Posts

Showing posts from September, 2013

javascript - jQuery datepicker keeps returning mm/dd/yyyy -

i have jquery datepicker defined in code this: $fromdate = strtotime($vacancy[0]->vacancy_visibility_start_date); $fromdate = date('d/m/y',$fromdate); $calendarfromarray = array( 'name' => 'datepicker', 'id' => 'datepicker', 'value' => $fromdate ); my js looks this: $( "#datepickerfrom" ).datepicker({ dateformat: 'dd-mm-yy' }); $( "#datepickerto" ).datepicker({ dateformat: 'dd-mm-yy' }); even though datepicker appears , works date remains in mm/dd/yyyy format.

javascript - PropTypes of specific component? -

i've got simple react component: import {proptypes} 'react'; import column './column'; export default function columncontainer({children}) { return ( <div classname="cr-column-container">{children}</div> ); } let columntype = proptypes.instanceof(column); columncontainer.proptypes = { children: proptypes.oneoftype([ columntype, proptypes.arrayof(columntype), ]).isrequired, }; which use this: render() { return ( <columncontainer> <column> *snip* </column> </columncontainer> ); } but it's failing prop-type validation: warning: failed prop type: invalid prop `children` supplied `columncontainer`. in columncontainer (created examplecontainer) in examplecontainer why that? i've used column s inside of columncontainer . proptypes.instanceof(column) not work expect? how supposed specify co

database - Java: Reading data with type that isn't known in advance -

i'm working on project in have read bunch of features (properties) database (which in form of csv file). this how file looks (formatted bit easier readability): isfast; speed; isred; r; g; b t; 123.4; f; 0.0; 0.0; 1.0 f; 21.3; t; 1.0; 0.0; 0.0 ... as can see, t/f represent boolean values, while numbers floating point values. properties may later added or removed. in code need read these values each instance (row) , pass them other code processes data further. the way i'm dealing have following classes: public abstract class feature<t> { public final string name; public final t value; public feature(string name, t value) { this.name = name; this.value = value; } public abstract boolean test(t value); } public class boolfeature extends feature<boolean> { public boolfeature(string name, boolean value) { super(name, value); } @override public boolean test(boolean v

generics - <ObjectType> in Objective-C -

in nsarray.h saw interface this @interface nsarray<objecttype> what significance of <objecttype> ? that apple using lightweight generics. full @interface declaration in xcode 7.3.1 looks this: @interface nsarray<__covariant objecttype> : nsobject <nscopying, nsmutablecopying, nssecurecoding, nsfastenumeration> objecttype placeholder used represent generic argument pass compiler knows reference them. different using nsobject * because objecttype id , can refer non-objective-c pointer types such corefoundation objects. for example, if wanted create class mocks array specific class, @interface myarray<myclass *> . you declare array of strings nsarray<nsstring *> . see this article on objective-c generics more information.

Where is the core data located in ios(9.3)? -

i saw many answers, in case, don't have below folders mentioned others. library/application support/ iphone simulator library/ developer users/my name/ library who knows core data of iphone 6 simulator located? i found printing sqlite path. rmaddy!

sql server - Grant Create/Alter/Drop Function/Procedure, not Tables -

i'm looking create database role within database allows developer members of role ability create/alter/drop procedures , functions. not want them able create/alter/drop tables though, managed different team. i found grant create procedure/table/function , i'm not able allow them alter/drop procedures/functions well. i have tried: create role developer grant view definition on database::mydb developer grant alter on database::mydb developer -- above allows modification of procedures/functions, tables deny create table on database::mydb developer -- above denies create table, can still alter/drop tables, want prevent

html - Make list the width of an input tag without javascript -

consider following snippet of html: <input><ul> we have input tag, followed list. (the list have actual items, keep things compact left them out here.) now, possible control width of list using css, , likewise input tag. i want leave input tag @ default width, , make list width have matching width. of course use javascript's getcomputedstyle. in theory, cause problems if user disables javascript, in practice, i'm coding (very minimalistic) autocomplete widget (like on wikipedia, less fancy), won't work without javascript anyway. but still: possible? know nothing css, forgive me if supposed obvious. normally, you'd wrapper element set display:table or display:table-cell (it doesn't matter which, anonymous object created other one) along small specified width. used width of wrapper forced @ least wide input box , list fit inside that. (the demo css , html markup borrowed joseph marikle's answer) .wrapper { display

unity3d - How to fix low resolution lightmaps in Unity -

Image
i'm testing how baked lightmaps work models made in blender. after building lightmaps noticed pixelated in areas. trying figure out part of lightmap causing effect. seems it's indirect resolution, because when turned down low possible, pixelated parts disappear. the problem form saw in other projects indirect resolution lower baked resolution don't know why in project looks this. tried crank indirect resolution results weren't satisfying. these lightmaps might seem fine can see darker areas "splash" , doesn't match resolution of rest. there screenshots of how lighting works 2 different setups: this setup used lightmap in first screenshot: first screenshot: example of low res part in screen above: second screenshot (the change indirect resolution changed 20): try adjusting lighting-map settings of object in lighting window , advanced paramters .

Extract text around a list of words in python 3.x -

i extract few lines (perhaps 100 or characters) of text text files. have list of words extract around. have following code want except lines not long enough capture need. import os ngwrds=[long list of words] filename in os.listdir(os.getcwd()): open(filename, 'r') searchfile: line in searchfile: if any(x in line x in ngwrds): open("extract.txt", 'a') out: out.write("{} {} \n".format(filename, line)) any thoughts? thank you.

Android googlemap permission check, cannot resolve symbol -

i got sample code https://developers.google.com/maps/documentation/android-api/location?hl=en if (activitycompat.checkselfpermission(this, manifest.permission.access_fine_location) == packagemanager.permission_granted) { mmap.setmylocationenabled(true); } else { // show rationale , request permission. } i uses above codes, in android studio, access_fine_location described cannot resolve symbol access_fine_location red color font. put <uses-permission android:name="android.permission.access_fine_location"/> on androidmanifest what should solve this? you can import manifest manually. put import android.manifest; import part of activity.java

python - Sleepwatcher on OS X 10.11 not executing script on wake -

in installed sleepwatcher 2.2 on os x 10.11 , launching via launchd agent. it launches okay , shows in activity monitor. however, want fire off python script when computer wakes up. my installation commands follows. sudo mkdir -p /usr/local/sbin /usr/local/share/man/man8 sudo cp ~/desktop/sleepwatcher_2.2/sleepwatcher /usr/local/sbin sudo cp ~/desktop/sleepwatcher_2.2/sleepwatcher.8 /usr/local/share/man/man8 sudo cp ~/desktop/sleepwatcher_2.2/sleepwatcher/config/rc.sleep /etc sudo cp ~/desktop/sleepwatcher_2.2/sleepwatcher/config/rc.wakeup /etc sudo cp ~/desktop/sleepwatcher_2.2/sleepwatcher/config/de.bernhard-baehr.sleepwatcher-20compatibility-localuser.plist /library/launchagents chmod +x /etc/rc.sleep chmod +x /etc/rc.wakeup chmod +x /usr/local/bin/test.py my rc.wakeup file follows. #!/bin/sh /usr/local/bin/python3 /usr/local/bin/test.py when executing sleepwatcher @ terimnal window typing in following, seems work. /usr/local/sbin/sleepwatcher --verbose --wakeup

django - Djangocms_blog confusion about post creating -

i met lot of difficulties start djangocms-blog, follow indications online docs in excerpt below : start blog need use apphooks django cms add blog django cms page; step not required when using auto setup: 1- create new django cms page 2 - go advanced settings , select blog application selector , create application configuration; 3- customise application instance name; 4- publish page 5- restart project instance load blog urls. below after adding apphook page cannot change instance namspace field defined apphokconfig; if want change it, create new 1 correct namespace, go in cms page advanced settings , switch new application configuration add , edit blog creating them in admin or using toolbar, , use django cms frontend editor edit blog content: create new blog entry in django admin backend or toolbar click on “view on site” button view post detail page edit post via djangocms frontend adding / editing plugins publish blog post f

java - How to find out what makes gradle slow when not in offline mode -

my build runs 10 seconds when every project date. today every project takes on average 40 sec complete. when turn --offline mode on, runs fast again. there has slows down - related trying communicate external resources. there way figure out causes slow down? gradle version 2.14.1 update: here build scan: https://scans.gradle.com/s/mzqnuvgjtve76/tasks a way idea what's slow in build execute project build scan capability enabled. build scan give break down on time spent. if post link build scan can further analyze issue.

Reading in Complicated CSV to R -

Image
i trying read in following .csv file r. can see imagine below, row 2 has unique variable names, while row 3 has values above variables. rows 2/3 represent 1 observation. process continues, row 4 line of variable names , row 5 corresponds variable values. process continues each two-row pair (2/3, 4/5, 6/7....999/1000) represent 1 observation. there 1,000 observations total in data set. what having trouble reading r have more usable dataset. goal have standard set of variable names across top row, , each subsequent line representing 1 observation. any expert r coders have suggestions? thank you, here solution worked on simple test case made. you'd need import data data.frame, x = read.csv(file="your-file.csv") to test though, used test data.frame, x: x=structure(list(v1 = structure(c(2l, 1l, 4l, 3l), .label = c("1", "a", "ab", "h"), class = "factor"), v2 = structure(c(2l, 1l, 4l, 3l), .label = c(&q

Paths in python -

consider rectangular grid. i want short , elegant way of generating straight path [x0,y0] [x1,y1] , either x0=x1 or y0 = y1 . for example, on input [1,3], [3,3] output [[1,3],[2,3],[3,3] should generated. likewise if input [3,3], [1,3] . i have tried [[i,j] in range(self.origin[0],self.end[0]+1) j in range(self.origin[1], self.end[1]+1)] , works case input ordered. your question states solution x -> y should same solution y -> x , i.e. we're interested in defining points on path, not in ordering of points. if that's true, find out path has smaller x (or y ) , designate origin. origin = (3,3) dest = (1,3) origin, dest = sorted([origin, dest]) path = {(i,j) in range(origin[0], dest[0]+1) j in range(origin[1], dest[1]+1)} # note set comprehension, since doesn't make sense # use list of unique hashable items order irrelevant of course, solves obstructionless 2-d pathfinding. if know 1 direction changing, in direction. origin, dest = sorted

matlab - Comparing content of a cell array with a vector -

i have following 1-by-3 cell arrays: y = {[2 3 4 5 8],[1 2 5 7 8],[3 4 7 8]} and following 1-by-8 vector: x = [1 2 3 4 5 6 7 8] using form of logical index, compare vector each content of cell array. instance, comparing x y(1,1) give following: [0 1 1 1 1 0 0 1] likewise, comparing x y(1,2) give following: [1 1 0 0 1 0 1 1] and comparing x y(1,3) give following: [0 0 1 1 0 0 1 1] hence, should have following output: [0 1 1 1 1 0 0 1 1 1 0 0 1 0 1 1 0 0 1 1 0 0 1 1] grateful form of help. use cellfun apply ismember each cell's contents: result = cellfun(@(c) ismember(x, c), y, 'uniformoutput', false); % gives cell array result = vertcat(result{:}); % vertically concatenate cells' contents matrix

angularjs - Set Id Attribute of element to variable from directives controller -

update #2: using template: '<div id="{{vm.divid}}"></div>' works fine , variable input template , other times doesn't work , instead of using variable id set id="{{vm.divid}}" . still haven't figured out making work , not others original post i have simple directive needs element in template have id set dynamically. figured simple no matter variable doesn't interpolate. i have tried setting id this, template: '<div id="{{vm.divid}}"></div>' template: '<div ng-attr-id="{{vm.divid}}"></div> , number of variations of 2 none seem work. here directive: .directive('gmap', function() { return { restrict: 'e', scope: { 'options': '=' }, transclude: true, controlleras: 'vm', bindtocontroller: true, controller: function(mapservice) { console.log(this

local variables not used (pascal) -

it keeps saying i,cont , divisor not being used , cant figure out why, everthing assinged , used @ point. i can compile using command prompt doesnt display should result shows simbols, , if try compiler shows local variable not used message not error says: note local variable "i" not used here´s code program tarea1; var n,m,i,divisor,cont: integer; begin readln(n); readln(m); if (n<1) or (m<n) end. i:=n; m begin divisor:=2; while (sqrt(i) >= divisor) , (i mod divisor <> 0) divisor:=divisor + 1; if (divisor > sqrt(i)) writeln(i': es primo') else begin (i div 2) begin divisor:= 2; cont:= 0; write(i':'); repeat if mod divisor = 0 begin write(' divisor '); divisor:=succ(divisor); cont:=succ(cont); until cont = 6; writeln(); end; end; end; end; end. your program not long seem think. around line 14 code is: if (n<1) or (m<n) end. this "end.&

c# - How to set path for images to display it through name with different sequences for executable -

Image
i'm trying animate 4 images different sequences, i'm wondering how set path display images name , use path executable. question is, have save pictures folder, , how path display images different sequences through variable name excusable file make available other users , not way: bitmap img1, img2, img3, img4; img1 = new bitmap(@"d:\my_doc\folder\images\1.png", true); img2 = new bitmap(@"d:\my_doc\folder\images\2.png", true); img3 = new bitmap(@"d:\my_doc\folder\images\3.png", true); img4 = new bitmap(@"d:\my_doc\folder\images\4.png", true); picturebox1.image = img1; follow article add images project resources. after adding images can write codes this: system.drawing.bitmap img1, img2, img3, img4; img1 = yourprojectsbasenamespace.properties.resources.img1 img2 = yourprojectsbasenamespace.properties.resources.img2 img3 = yourprojectsbasenamespace.properties.resources.img3 img4 = yourprojec

regex - Regular expression selection of last two folder path names -

im working in perl having issues cutting out other folder names leave last 2 folder names. trainings , events general office\archive general office\office opperations\contacts general office\office opperations\office procedures\how tos public_html\accordion\.svn\tmp\text-base i remove folder path names folders end last 2 path names each: trainings , events general office\archive office opperations\contacts office procedures\how tos tmp\text-base office opperations\contacts ive read other stackoverflow showed last 2 folder names picked out, cannot reverse expression. (i link if can find it) i using sublime text 3 test expressions. thank you the pattern want is s/.+\/(.+\/.+)$/$1/g it'll grab last bit of folder name , replace whole string it.

Control Host playback from JUCE audio VST plugin -

i trying find way control playback position / tempo of vst host vst plugin build juce. i not sure if possible. i found setplayhead function on audioprocessor , , think might looking for. https://www.juce.com/doc/classaudioprocessor#a9015f8476c07b173e3c9919b3036339d but on doc of setplayhead reading this: tells processor use playhead object. so can tell me if supposed mean new audioplayhead set on audioprocessor used hosts playback (z.b. cubase), or mean audioprocessor of vst plugin use audioplayhead, , audioplayhead of host remains unaffected) thanks / input on this. a sequencer cannot controlled vst plugin in way. vst api doesn't allow this. method you've found part of juce api allows sequencer pass playhead structure to plugin. to fair, there no technical reason plugin couldn't this. host have supply unofficial custom opcode , associated cando feature. however, not part of vst standard, , work specific host. as far know, no major vst hos

ios - How to create light system font with special font attributes -

i need create uifont is: san francisco light weight using case insensitive font attribute (to display '/' glyph vertically aligned numbers) i using code go it: uifontdescriptor *fontdescriptor = [uifontdescriptor preferredfontdescriptorwithtextstyle:uifonttextstylebody]; nsarray *additionalfontsettings = @[@{uifontfeaturetypeidentifierkey: @(kcasesensitivelayouttype), uifontfeatureselectoridentifierkey: @(kcasesensitivelayoutonselector)}]; fontdescriptor = [fontdescriptor fontdescriptorbyaddingattributes:@{uifontdescriptorfeaturesettingsattribute: additionalfontsettings, uifontdescriptortraitsattribute: @{uifontweighttrait : @(uifontweightlight)}}]; return [uifont fontwithdescriptor:fontdescriptor size:50]; i right font right feature enabled, can't font weight adhered to. need light weight of system font. how achieve this? turns out matt right hint. had forgotten can derive uifontdescriptor existing uifont . therefore, creating descriptor works:

node.js - node: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory -

node node: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: no such file or directory echo $ld_library_path /usr/lib:/usr/local/lib find /usr/lib -name libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 i appear have libstdc++.so.6 installed , in ld_library_path node still can't seem see it. doing wrong? on server sudo not possible node install local in ~/.local/bin

php - Checking if there are duplicates in a tables -

Image
hello have been working on sql code found online said check if there duplicates online. what want checks whether if value has duplicate in table inserting need return booleon in php having problem in mysql code. have code have found online: select schedday,schedtime count(schedday, schedtime) count scstock group schedday, schedtime having count(schedday, schedtime) > 1 but having error then tried modify wanted accomplish select schedday,schedtime count(schedday, schedtime) count scstock schedday = 'm/t' , schedtime = '7:00-9:00/7:00-9:00' having count > 1 but appears can me? try below query result select schedday,schedtime, count(*) count scstock group schedday, schedtime having count > 1

boolean - How to simplify this propositional logic expression (DNF)? -

i simplified original problem point ((p∧¬r)∨(¬q∨r))∧((q∧¬r)∨(¬p∨r)) , , got stuck here. next step? help!! i solving you. hint-1: ((p∧q)∨r) = (pvr) ∧ (qvr) hint-2: p ∧ true = p hint-3: p v true = true answer it true in end. check once. next step be = [(p v (~q v r)) ^ ( ~r v (~q v r))] ^[(q v (~p v r)) ^ ( ~r v (~p v r))] = (p v ~q v r) ^ ( ~p v q v r) = r v ( (p v ~q) ^ ( q v ~p)) = r v (( q -> p ) ^ ( p -> q)) = r v (p <-> q) whenever r true true. else p q p<->q ------------------ f f t f t f t f f t t t so conforms truth table. shown above trincot .

gnu - How to remove a word from Aspell's British dictionary -

when check texts aspell (with british dictionary), word " froward " accepted (because real english word ). never use it, in texts " froward " misspelling of " forward ". therefore want aspell reject " froward ". how can remove word standard dictionary? there way create "blacklist" of words? there no way mark in .aspell.en.pws , beacuse personal dict contains "whitelist".

matlab - Smooth and fit edge of binary images -

Image
i working on research swimming of fishes using analysis of videos, need images (obtained video frames) emphasis in tail. the images in high-resolution , software customize works binary images, because easy use maths operations on this. for obten binary images use 2 methods: 1)convert image gray, invert colors,later bw , binary treshold give me images this, nothing of noise. images loss bit of area , doesn't tail(now need more acurracy determinate amplitude of tail moves) image 1 2)i use code, cut border increase threshold, give me image of edge, dont know joint these point , smooth image, or fitting binary images, app fitting of matlab 2012rb doesn't give me graph , don't have access toolboxs of matlab. s4 = imread('arecorte.bmp'); a=[90 90 1110 550] s5=imcrop(s4,a) e = edge(s5,'canny',0.59); image2 my question how can fit binary image or joint points , smooth without disturb tail? or how can use edge of image 2 increase acurracy of i

ggplot2 - Overlaying two/more graphs using R -

Image
i have been referring stackoverflow posts , came query on gglot2 features. the data set used code follows. timestamp data_1 data_2 data_3 15:11:37.474 99.791028 0.312498 99.47853 15:16:22.373 99.791028 0.729162 99.061866 15:21:37.424 99.791028 0.104166 99.686862 15:31:52.475 88.02027 90.520254 15:42:07.157 99.99936 0.208332 99.791028 15:43:22.279 99.99936 0.52083 99.47853 15:45:37.673 99.686862 0 99.686862 15:52:52.872 99.686862 0.729162 98.9577 p1<- ggplot(df, aes(timestamp, data_1,group=1)) + geom_point() + geom_point(data = df[df$data_1 > 80,], pch = 21, fill = na, size = 4, colour = "red", stroke = 1) + geom_line() p2<-ggplot(df, aes(timestamp, data_3,group=1)) + geom_point() + geom_point(data = df[df$data_3 > 70,], pch = 21, fill = na, size = 4, colour = "blue", stroke = 1) + geom_line() i trying overlay p1 , p2 same x , y

arrays - How to get a value from nested / staggered Excel object - data from json -

i have tried many json addins excel having no luck parsing json data below. have managed use code below sub jsondecode() dim jsondecode variant jsontext = worksheets("sheet3").range("a1").value set sc = createobject("scriptcontrol"): sc.language = "jscript" set jsondecode = sc.eval("(" + jsontext + ")") end sub to create staggered object cannot access values in image below. have tried following msgbox(jsondecode.location.id) msgbox(tostring(jsondecode.location.id)) msgbox(jsondecode(location(id))) any appreciated code values marked , b in image below :) forgive me if terminology bit skewif cheers!! image of array tree in excel locals window json text is {"location":{"id":2456,"name":"tuggerah","region":"central coast","state":"nsw","postcode":"2259","timezone":"australia/sydney&qu

angular - How to apply form validation without <form> tag in Angular2 -

i wondering if there way validate form in angular 2 without using form tag? example below want make required field <div class="form-group"> <label for="name">name</label> <input type="text" class="form-control" id="name"> </div> <button type="button" class="btn btn-default" (click)="save()">save</button> form controls can standalone (without parent form), whether using declarative form controls or reactive form controls. for declarative (using ngmodel ) can like <input #model="ngmodel" [(ngmodel)]="value" type="text" required/> <div *ngif="model.invalid" style="color: red">required</div> for reactive forms can like <input [formcontrol]="control" [(ngmodel)]="value" type="text"/> <div *ngif="control.invalid" style="

php - Auto increment employee ID -

Image
i want add employee , after that, employee id increment. textbox must disabled also here's code. want auto increment employee id when add new employee. hope me. thank in advance. :) <center> <form class="contact_form" action="#" method="post"> <h2>register new employee</h2> <br/> <table> <tr> <td><label for="emp">emp id:</label></td> <td><input type="text" name="emp" placeholder="emp id" required /></td> </tr> <tr> <td><label for="name">name:</label></td> <td><input type="text" name="fname" placeholder="first name" required /> <input type="text" name="lname" placehol

sql - data not present in 1 table but present in another -

select cast(tmi.mi varchar) tmi left outer join tcard on cast(tcard.cardnumber varchar) = cast(tmi.mi varchar) inner join tmims on cast(tmims.tmi_id varchar) = cast(tmi.id varchar) tmimsstatus_id = 0 , tmsrevision_id = 35 , tcard.cardnumber null , tmi.mi not null hi all, above sql using. (the cast because getting conversion issues before not sure if i'm using them right) i trying list of entries in tmi.ti tcard.cardnumber empty. can going wrong. before join 'tmims' table seems run give incorrect data. any great.

operator overloading - C++ error: passing xxx as 'this' argument of xxx discards qualifiers -

this question has answer here: discards qualifiers error 4 answers this code i've written access matrix in class , compare 2 objects of same class using less operator , equal operator. compiler throws errors. #include <bits/stdc++.h> using namespace std; class node { private: int a[5][5]; public: int& operator()(int i, int j) { return a[i][j]; } friend bool operator==(const node& one, const node& two); friend bool operator<(const node& one, const node& two); }; bool operator==(const node& one, const node& two) { (int = 1; < 5; i++) { (int j = 1; j < 5; j++) { if (one(i, j) != two(i, j)) { return false; } } } return true; } bool operator<(const node& one, const node& two) { (int = 1; < 5; i++) { (int j = 1; j < 5; j++) { if (one(i, j) >

session - getting/setting browser_id with Products.BeakerSessionDataManager -

i'm having problem associating browser_id session when using products.beakersessiondatamanager. i'm working on plone 5. as far understand zope sessions, .getsessiondata() called on session data manager, session data container created if did not exist. furthermore, data contain token , same browser_id associated browser making request. , finally, cookie set on response name _zopeid (and value same token ). thus, when use default session data manager come zope, this: ipdb> context.session_data_manager.getsessiondata() id: 14737473151418102847, token: 38878600a7nh90de9ao, content keys: [] however, when use products.beakersessiondatamanager, same call gives me this: ipdb> context.session_data_manager.getsessiondata() {'_accessed_time': 1473745441.437582, '_creation_time': 1473745441.437582} moreover, no cookie set . perusing old zope docs , found reference getcontainerkey() , thought might me browser_id. however, returned value diffe

php - Find exact same string in multiple strings -

the following example. i have array : array ( [0] => vlakke lasflenzen pn6 [1] => vlakke lasflenzen pn10 [2] => vlakke lasflenzen pn16 [3] => vlakke lasflenzen pn25-40 ) i not know part of strings same. , dont know if pattern stay same. cannot explode() on spaces or something. what want try extract part of srting same between 4 of them split between spaces. so example need extract 'vlakke lasflenzen' 4 strings based on compasison of them. can me? the problem you're talking called the longest common substring problem . i found an implementation finding longest common substring in array of strings. mentioned in original post, usage: <?php $array = array( 'ptt757lp4', 'ptt757a', 'pct757b', 'pct757lp4ev' ); echo longest_common_substring($array); // => t757 ?> the relevant code: function longest_common_substring($words) { $words = array_map('strtolower', a

sql - Subquery returned more than 1 value. (Insert within a while loop) -

declare @int int declare @saveamount int declare @savedate datetime set @int=1 set @saveamount=400 set @savedate= '20160101 13:00:00.00' while @int<=357 begin insert watersave (reservoirid, amount, savedate) values (1,@saveamount,@savedate) set @int=@int+1 set @saveamount=@saveamount+(select round((6 - 12 * rand()), 0)) set @savedate=@savedate+1 end trying insert test purposes stacked subquery returned more 1 value error on line 9. any idea? regards since there not appear sub-queries in sql, check see if there triggers on [watersave] table. reference: sql server subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >=

custom geom text colors in ggplot2 with R -

Image
i want visualize tennis data using ggplot. far able visualize data based on winner/loser data. 2015 flavia pennetta 81 2014 serena williams 65 2013 serena williams 109 2012 serena williams 94 2011 samantha stosur 61 2010 kim clijsters 58 2009 kim clijsters 82 2008 serena williams 89 2007 justine henin 70 2006 maria sharapova 66 2015 roberta vinci 47 2014 caroline wozniacki 49 2013 victoria azarenka 91 2012 victoria azarenka 87 2011 serena williams 41 2010 vera zvonareva 31 2009 caroline wozniacki 66 2008 jelena jankovic 79 2007 svetlana kuznetsova 54 2006 justine henin 58 here code: ggplot(data=f_data, aes(x=year, y=winner_totalpointwon, fill=output)) + geom_bar(stat="identity", position=position_dodge())+geom_text(aes(label=winner), position = position_dodge(0.9),vjust=0,angle=90) how can change text color of names grouped player names each player can represented distinct color?

winforms - Dynamic Filling of TextBox AutoComplete not working is it possible in c#? -

i did put code in “textchanged”-event, think it's 'too late' there: private void texttiteulttest_textchanged(object sender, eventargs e) { textbox tb = (textbox)sender; datalayer dbclass = new datalayer(); try { string sql = ; string strvar = texttiteulttest.text + "%"; //get sqldatareader dataclass sqldatareader sqldr = dbclass.returndatareader(sql, , strvar); autocompletestringcollection autocol = new autocompletestringcollection(); //fill stringcollection while (sqldr.read()) { autocol.add(sqldr["tite_titles"].tostring()); } //fill autocomplete textbox lock (tb.autocompletecustomsource.syncroot) { tb.autocompletecustomsource = autocol; } } catch (exception exc) { console.writeline(exc.data.tostring() + exc.message.tostri

Can i upload data from multiple datasources to azure DW at same time -

can retrieve data multiple data sources azure sql datawarehouse @ same time using single pipeline? sql dw can load multiple tables concurrently using external (aka polybase) tables, bcp, or insert statements. hirokibutterfield asks, referring specific loading tool azure data factory?

ios - Add "shadow" to view -

Image
i have cells 2 "rectangles". want is, add shadow right rectangle. better explained on screenshot: from left first part of cell (first rectangle) , on right in second part. want add shadow on screenshot. tried: -(void)addinnershadow{ self.bgdetailsview.layer.shadowcolor = [uicolor colorwithhexstring:@"#a4c2e0"].cgcolor; self.bgdetailsview.layer.shadowoffset = (cgsize){shadow_side_height,0}; // self.vselectionback.layer.shadowradius = 1.4; self.bgdetailsview.layer.shadowradius = shadow_side_height; self.bgdetailsview.layer.shadowopacity = .5; } where bgdetailsview second (right) view, has no effect. ok, understand want add shadow right view , shadow casts on left view. to so: you can set self.bgdetailsview.clipstobounds = no , make shadow visible make shadow visible on , below right view. you can put right view in container. set clipstobounds = no in right view , make container view bit bigger left. you can make

If statement to hide/show rows in Excel VBA -

i have sequence of code if c37 blank, want 2 series of rows hidden. code have works this. however, if d37 not blank same series of rows unhidden. 'show/hide filter index columns if worksheets("req sheet").range("c37").value = "" worksheets("formulation").rows("54:57").entirerow.hidden = true worksheets("formulation").rows("125:128").entirerow.hidden = true else rows("54:57").entirerow.hidden = false rows("125:128").entirerow.hidden = false end if if worksheets("req sheet").range("c38").value = "" worksheets("formulation").rows("54:57").entirerow.hidden = true worksheets("formulation").rows("125:128").entirerow.hidden = true else rows("54:57").entirerow.hidden = false rows("125:128").entirerow.hidden = false end if i know have syntax of code wrong, problem gettin

visual studio - Why outputting 'error: ' in Post-Build Event breaks my build in VS2012? -

adding cmd.exe /c "echo error : unexplainable" causes this: 1>------ build started: project: xxx, configuration: debug win32 ------ 1>exec : error : unexplainable 1>c:\program files (x86)\msbuild\microsoft.cpp\v4.0\v110\microsoft.cppcommon.targets(134,5): error msb3073: command "cmd.exe /c "echo error : unexplainable" 1>c:\program files (x86)\msbuild\microsoft.cpp\v4.0\v110\microsoft.cppcommon.targets(134,5): error msb3073: :vcend" exited code -1. ========== build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ========== it happens when 'error' string followed ':' character. it bug in msbuild: https://github.com/microsoft/msbuild/issues/766 the 'exec' task used 'postbuildevent' target should have 'ignorestandarderrorwarningformat' set true default doesn't, fails when finding 'error:' in output. an unreliable way fix modify 'postbuildevent' target in c:\program

redirect on Jquery Ajax success not working -

jquery code: $.ajax({ type: "post", async: false, cache: false, url: "manageusers/validatereportusers.aspx/allocatesessionredirect", data: '{id:"'+flag+'"}', contenttype: "application/json; charset=utf-8", datatype: "json", success: function (response) { if (response.d == true) { alert("you redirected."); window.location.href = "/downloadreport.aspx"; } } }); web method code : public static bool allocatesessionredirect (int id) { // set of codes here return true; } the browser displays alert message "you redirected." not execute window.l

ruby - Read SCSS variable in rails helper -

to target art direction problem (see here https://developer.mozilla.org/en-us/docs/learn/html/multimedia_and_embedding/responsive_images ) need make use of <picture> element in markup. have images resized paperclip 4 different styles: lg, md, sm, xs. i'm using bootstrap (scss) , have defined breakpoints through variables: $screen-xs: 425px; $screen-sm: 768px; $screen-md: 1000px; $screen-lg: 1200px; to use <picture> element, have refer breakpoints in erb markup: <picture> <source media="(max-width: 425px)" srcset="<%= image.attachment(:xs) %>"> <source media="(max-width: 768px)" srcset="<%= image.attachment(:sm) %>"> <source media="(max-width: 1000px)" srcset="<%= image.attachment(:md) %>"> <source media="(max-width: 1200px)" srcset="<%= image.attachment(:lg) %>"> <img src="<%= image.attachment(:md) %>

postgresql - Why one Clojure JDBC serializable transaction "sees" (?) changes made by another transaction? -

i have simple table: create table tx_test ( integer, constraint i_unique unique (i) ); also have function performs insert table in transactional manner ( jdbc-insert-i-tx ). timeout-before , timeout-after , label parameters there reproduce issue , simplify debugging. (defn jdbc-insert-i [con i] (jdbc/db-do-prepared-return-keys con ;; db-do-prepared-return-keys can updates within tx, ;; disable behaviour sice handling txs ourselves false (format "insert tx_test values(%s)" i) [])) (defn jdbc-insert-i-tx [db-spec timeout-before timeout-after label i] (jdbc/with-db-transaction [t-con db-spec :isolation :serializable] (and timeout-before (do (println (format "--> %s: waiting before: %s" label timeout-before)) (do-timeout timeout-before))) (let [result (do (println (format "--> %s: doing update" label)) (jdbc-insert-i t-con i))] (and

ios - Bootstrap wells issue on safari browser -

<div class="well"> <div class="row"> <div class="col-lg-12"> <div class="btn-col" button data-toggle="collapse" data-target="#helplinks"><p id="scrollertext">what trust deed? &#8595</p></button></div> <div id="helplinks" class="collapse"> <p id="scrollerinfo"> trust deed formal agreement made between person in debt , creditors. agreement allows debtor make regular monthly payments towards clearing debt. further interest , charges on outstanding debt stopped. @ end of arrangement, unpaid debt written off.</p> </div> </div> </div> </div> just starting out on web design , coding.. have made quite basic website bootstrap wells, cascade give further information. on windows , android platforms, website works great.

eclipse - Running e4 RCP application on GTK2 -

this question continuation of attempts make e4 rcp application run on recent linux distros. i starting rcp application following option: --launcher.gtk_version 2 the first launch fails , took me while figure out reason - missing xmi file: .metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi how make workbench load without file first time? there absolutely no traces on , why fails load. the workbench.xmi produced when application gets closed first time. , don't chance of first time. manually produce file running application without --launcher.gtk_version 2 switch. having file in place makes application run fine gtk2. , trying achieve. any on how overcome chicken-or-egg problem appreciated. i have found problem, internal issue in app doing illegal things in workbenchwindowadvisor.prewindowopen() . once moved 'criminal' code workbenchwindowadvisor.postwindowopen() , problem gone. still have no idea why workbench.xmi file had such side effe

Passing parameter to the drill thru report in cognos -

how pass calculated member/measure drill-thru target report in order avoid using calculated members--because googling people saying not pass them via drill-thru--i went fm model , created 3 new measures (high risk, low risk , medium risk). these show in drill-thru definitions parameter list . . . problem how can check see of 3 measures has been selected user? remember, have line chart 3 lines, 1 each measure above (high, medium or low risk) time frame. user select data point, high risk march or medium risk semester 2, example. need pass value datapoint target (2nd) report. how can check of 3 measure values passed through?!?

Print an array value when its key matches with a variable (PHP) -

i have "album.php" page 4 albums; when click on 1 of them links "gallery.php" showing photos of specific album. put specific title in "gallery.php" depending on album clicked user , in nice , clean way. gallery.php: $query_url = $_server['query_string']; $pageid = substr($query_url, 6); $album_title = array("album1" => "title1", "album2" => "title2", "album3" => "title3"); while($album_title[key] = $pageid) { echo '<div id="album_title"> <h2 class="body_text">'.$album_title[value].'</h2> </div>'; } i thought instead of less dynamic: if($pageid = "album1") {echo "title1";} if($pageid = "album2") {echo "title2";} etc. my problem don't know how "say": when(array[key] = $pageid) {