Posts

Showing posts from August, 2011

C#: bizzare multiple event firing for listview on SelectedIndexChanged -

if put listview component windows form , add bellow code it's selectedindexchanged event: messagebox.show("fired!"); foreach (int selectedindex in listview1.selectedindices) { listview1.items[selectedindex].selected = false; listview1.items[selectedindex].focused = false; } the message box shown 4 times! why that? note : use loop clear selected items in listview you should not change selection in selectedindexchanged event. more generally, you should not change property inside of notification property has been changed . if need change property in response notification, handle corresponding *changing event. rather being notification has changed (which comes after fact), notification change (which comes before fact). in selectedindexchanging event, have couple of different options alter course of events: you can set e.cancel property true , says. cancel event , prevent selected index changing. you can use e.newselectedindex property al

sql server 2005 - SSRS - Linking/Lookup Parameter Labels to return different values? -

i'm relatively new reporting stuff, i'm not sure if make sense, here goes... there 2 parameters below (@comboll & @combomob), both parameters have same labels different values per label. i @comobomob parameter stay hidden end user, selection of @comboll determine value used @combomob parameter. https://www.dropbox.com/s/kcpt7rddqtx990h/screen.jpg as both have same labels in way possible? if selects pack 1, use value 1000 @comboll value 250 @combomob, instance. or alternatively, there less complicated way of doing i've missed? thanks! okay tested in 2008 r2 , 2012, not work 2005 here goes. yes can in 2008 , sure. set first parameter. set dataset values of first parameter data second. select thing table value = @comboll now when set second parameter, make hidden. set 'available values' 'get values query' choose dataset similar above. set 'default values' aslo 'get values query' well. ensure datasource

linux - Unable to find where my java installation is -

i have java installed. however, java_home empty , can't find out should point to: $ ls /usr/lib/jvm/default-java ls: cannot access '/usr/lib/jvm/default-java': no such file or directory $ ls /usr/bin/java /usr/bin/java try which java | xargs -l1 ls -al it show java stored on hard drive must symbolic link an example of output: /usr/bin/java -> /foo/bar/java in case java in directory bar

uilabel - iOS RTL - improperly displaying English inside RTL string -

Image
ios application, we're display news, coming server. uilabel used everything perfect when sentence in single language no regard layout (we're switching layout rtl ltr different languages, including arabic, hebrew) when inside ltr language have rtl words, they break sentence structure (see picture, btn must in beginning of line, jumped end) idea how solve this? in advance :) "arabic text \u200e english text \u200f arabic text \u200e english text" solved issue

JavaScript - Turning an array into a list -

i want able turn array, consists of names entered user, unordered list list presents names on first list item. how separate names onto different list items? this have: function createlist(){ var list = document.getelementbyid("list"); var li = document.createelement("li"); var input = document.getelementbyid("q8").value; var strcomma = input.split(","); console.log(strcomma); var = 0; (i; < strcomma.length; i++){ var el = document.createtextnode(strcomma[i]); li.appendchild(el); list.appendchild(li); } } that should trick function createlist(){ var list = document.getelementbyid("list"); //var li = document.createelement("li"); var input = document.getelementbyid("q8").value; var strcomma = input.split(","); console.log(strcomma); var = 0; (i; < strcomma.length; i++){ var el = document.create

javascript - jQuery multiple parallax buttons -

i've got bunch of divs on single page of same type used buttons. have same class box , each it's own unique content. i'm trying them move away mouse ever create slight parallax effect. i'm having trouble making them move independently each other. currently, i've tried: $(function() { $('.box').each(function() { var location = $(this).offset(); var locationx = location.left; var locationy = location.top; $('html').on("mousemove", function(event) { var offsetx = (locationx - event.pagex) / 100; var offsety = (locationy - event.pagey) / 100; $('.box').css('transform', 'translate3d(' + offsetx + 'px, ' + offsety + 'px, 0)'); }); }); }); so basically, grab location of each box element it's x , y position. event supposed cursor's position math generate parallax effect based on initial position of box.

python - Time out on lost connection in Paramiko -

i need handle connectivity problems correctly while executing long-running commands on ssh paramiko. the exec_command has timeout argument throws exception if there no response. raises when connection lost when command execute works longer timeout seconds. so tried use set_keepalive not work either. paramiko not guarantee keepalive packet sent , seems not check keepalive response server. put: iptables -a input -s ... -j drop on target server in middle of command executes , watched paramiko's debug logs - keeps sending keepalive packet , not pay attention @ absence of server response. seems there nothing similar openssh serveralivecountmax param kill ssh if there no response client ssh server. as see there no way distinguish long running command , network failure. can put timeout on exec_command call , believe if exception raised it's not slow command connection loss. is there solid way solve problem? both cases network failures, 1 didn't wor

xquery - Compare two elements of the same document in Mark Logic -

i have marklogic 8 database in there documents have 2 date time fields: created-on active-since i trying write xquery search documents value of active-since is less than value of created-on currently using following flwor exression: $entity in fn:collection("entities") let $id := fn:data($entity//id) let $created-on := fn:data($entity//created-on) let $active-since := fn:data($entity//active-since) $active-since < $created-on return ( $id, $created-on, $active-since ) the above query takes long execute , increase in number of documents execution time of query increase. also, have element-range-index both above mentioned datetime fields not getting used here. cts-element-query function compares 1 element set of atomic values. in case trying compare 2 elements of same document. i think there should better , optimized solution problem. please let me know in case there search function

javascript - Gulp - Excluding Paths dont work for me -

i saw lot of google entries question "how exclude in gulp paths" none of work me. the thing works this: gulp.task('sassplatform', function () { return gulp.src([ './src/sass/platforms/**', // todo find way make shorter '!./src/sass/platforms/globals/*.scss', '!./src/sass/platforms/globals/' ]) .pipe(sass({outputstyle: 'compressed'}).on('error', sass.logerror)) .pipe(gulp.dest('./dist/css/platforms')); }); the point got folder structure: scss |_platforms |_globals |_content.scss |_footer.scss |_globals.scss |_header.scss |_superfolder1 |_main.scss |_superfolder2 |_main.scss |_superfolder3 |_main.scss |_and alot of superfolders more... i want keep folder structure , take fields in superfolders. not global folder. with code works correctly. want understand why doesn't work with: '

asp.net - web.config Configuration for Folder Containing Mixed WCF and Domain Services -

i'm trying lock down security on folder contains mix of wcf , wcf-ria domain services authenticated users, except domain services. folder name "services" , contains following: /services/service1.svc /services/service2.svc /services/service3.svc /services/authenticationservice.vb instead of specifying each service separately, i'd deny access anonymous user folder, , allow anonymous access 1 service. since authenticationservice.vb doesn't exist after compiling, i'm not sure use location path. this how current web.config looks: <location path="services"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> <location path="services/authenticationservice.vb"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web>

javascript - Add CSS class to change style of HTML element -

@charset "utf-8"; html, body { margin: 0px; font-family: helvetica, sans-serif; min-height: 100%; height: 100%; } .center-container { display: flex; align-items: center; justify-content: center; height: 100%; /*height: 500px;*/ } .main-container { /*height: 100%;*/ } .darktitle { color: #000000; background: grey; font-size: 25px; } .titlebar { text-align: center; color: #ff0000; background: blue; font-size: 40px; } button { padding: 00px; font-weight: bold; font-size:1em; font color: #000000; height: 40px; width: 200px; } <!doctype html> <html lang="de"> <head> <link href="styles/styles.css" rel="stylesheet"/> <meta charset="utf-8"> </head> <body> <div class="main-container"> <h1 id="titlebar" class="titlebar"> titlebar</h1> &l

c# - Dynamically generate code for DllImport depending on application version -

i write .net-extension can loaded different versions of unmanaged application. below imported some_func_v01 , some_func_v02 , , some_func_v03 functions: [dllimport("some_library_v1.0.dll", callingconvention = callingconvention.cdecl, charset = charset.unicode, entrypoint = "func_name")] extern static private void some_func_v01(string msg); [dllimport("some_library_v2.0.dll", callingconvention = callingconvention.cdecl, charset = charset.unicode, entrypoint = "func_name")] extern static private void some_func_v02(string msg); [dllimport("some_library_v3.0.dll", callingconvention = callingconvention.cdecl, charset = charset.unicode, entrypoint = "func_name")] extern static private void some_func_v03(string msg); ... public void some_func(string msg) { switch (application.version.major) { case 1: some_func_v01(msg); break; case 2: some_func_v02(msg); break; case 3: some_func_v03(msg);

android - application crashes during http connection -

application crashes when try create http connection when phone connected limited wifi connection, can tell me how check internet working or not in wifi. sorry poor english. fatal exception: main process: com.bytemachine.aditya.vehicletracker, pid: 3626 java.lang.nullpointerexception: attempt invoke interface method 'org.apache.http.httpentity org.apache.http.httpresponse.getentity()' on null object reference @ com.bytemachine.aditya.vehicletracker.searchscreen$setconnectionforvehiclesearch.onpostexecute(searchscreen.java:561) @ com.bytemachine.aditya.vehicletracker.searchscreen$setconnectionforvehiclesearch.onpostexecute(searchscreen.java:504) @ android.os.asynctask.finish(asynctask.java:636) @ android.os.asynctask.access$500(asynctask.java:177) @ android.os.asynctask$internalhandler.handlemessage(asynctask.java:653) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(loop

'knife: command not found' after chef-server installation -

im learning chef. have setup couple of centos 6.4 vms. on 1 of vms(say chef-server), installed chef-server-core-12.6.0-1.el5.x86_64.rpm, server front-end, reconfigured chef-server-ctl , chef-manage-ctl , setup user & org. downloaded starter kit front end , extracted chef-repo folder on chef-server vm. here problem. based on tutorial i'm following, should able run knife ssl fetch chef-repo folder. but, facing knife: command not found error. tried googling find exact reason. missing!! please me. thanks in advance. the chef repo , starter kit, chefdk not belong server, workstation , aka. laptop. knife included , chefdk , used communicate chef server. edit: actually, think chef components section of official documentation provides overview. not sure, tutorial following - official 1 on learn.chef.io . provide clear guidance?

c++ - Class variables and a function from header are ignored by some functions while compiling -

i have write class, errors don't make sense me. link codes , error message i'm getting. i have declared private variables , functions in header file, variable can't seen functions , 1 of functions can't seen in .cpp. precisely: int sizecounter can't seen void transportvalues() , void putvalue() , can seen void size() , void isempty() , void enqueue() . void swapvalues() gives "identifier not found" error though declared in header. what i've tried , didn't work: moving sizecounter or swapvalues private public. moving functions can's see sizecounter or swapvalues private public. asking experienced people help. what i've tried , did work: creating function prototype swapvalues in .cpp. moving swapvalues above putvalue in .cpp(this worked if removed declaration header). what haven't tried: asking compile code show if error caused compiler. i'm using visual studio 2008, btw. os: win 7(x64). if find othe

Want to write an order script with linux (bash) -

i have write bash shell script take in 3 integer arguments , print them out smallest largest. new linux unsure errors experiencing program. have far, whatever change never seems work. #!/bin/bash read x y z if [ $x -lt $y && $x -lt $z ] ; if [ $y -gt $z ]; echo "$x $z $y" else echo "$x $y $z" if [ $y -lt $x && $y -lt $z ] ; if [ $x -gt $z ]; echo "$y $z $z" else echo "$y $x $z" if [ $z -lt $x && $z -lt $y ] ; if [ $z -gt $y ]; echo "$z $y $x" else echo "$z $x $y" fi any appreciated. thank time. it's 1 line bash code script: #!/bin/bash echo $* | tr ' ' '\n' | sort -n | tr '\n' ' '

model - Rails - Database Translation static values -

i have model called house. in model have amenities such wi-fi, tv, air conditioning etc. these in english , checkbox. user clicks them , show them on home#show page disabled class as; <%= @home.amenities.each |amenity| %> .... the thing users can select language locale variable web site turns in french instance. static texts, flash , error messages able translate , works fine. but not know how should translate these model based values. website looks frenglish right now. for internationalisation/translations of database data in rails, i'd highly recommend using globalize gem .

android - How to extract String resource in my code? -

when add string parameter this, ok: mpages[0] = new page( r.drawable.page0, "on return trip studying saturn's rings, hear distress signal seems coming" + " surface of mars. it's strange because there hasn't been colony there in years. " + "even stranger, it's calling name: \"help me, %1$s, you're hope.\"", new choice("stop , investigate", 1), new choice("continue home earth", 2)); however, when try extract string resource this, there error mpages[0] = new page( r.drawable.page0, .getstring(r.string.story_page0), new choice("stop , investigate", 1), new choice("continue home earth", 2)); so should do? try use : mpages[0] = new page( r.drawable.page0, string.valueof(r.st

java - Resolution scaing for online snake game -

im trying add multiplayer snake game 2 players can compete apples. current dilema is: how deal session 2 players playing on masively different resolutions? thing snake game not using grid. want make sure regardless of resolution time takes remote player reach apple same time takes 1 im seeing on screen! i hope guys understand me, if not please feel free ask me questions. here picture of game: http://postimg.org/image/js8bs4w0b/ you need implement measurement system, , base speed snake travels on system, instance, imagine rectangle 30x40 blocks, snake travels @ 1 block every few seconds, no matter size of block in real life, snake's speed adjust blocks positions on game screen.

c# - Combo box DisplayMember of a value -

i'm pretty new wpf , searched several sites , pages, didn't found problem: i fill combobox values , different displaymembers c#: comboraum.datacontext = dtload.defaultview; comboraum.displaymemberpath = dtload.columns["name"].tostring(); comboraum.selectedvaluepath = dtload.columns["id_room"].tostring(); xaml: <combobox name="comboraum" margin="5" height="26" itemssource="{binding}"/> now read id_room table sqldatareader. reader works fine, other things displayed right. sqlreaderdetails["id_room"].tostring(); how combobox set item same value selected item? jumps first entry. solved it! added selectedvaluepath="content" to xaml combobox properties. can set selecteditem selectedvalue = id @ runtime.

Can Flot plot a vector field? -

i have js explores properties of planar model , mechanism causes phase transition in lattice of spins. 1 indicator of phase transition way spins oriented in lattice, , plot vector field . can flot that? yes, can 1 small change flot library. in drawseriespoints(series) function (line 1986 in version 0.7) change line symbol(ctx, x, y, radius, shadow); to this symbol(ctx, x, y, radius, shadow, series, math.floor(i / ps)); this done can access datapoint when drawing it. format data points in form [x coordinate, y coordinate, vector angle, vector length] , use custom symbol function this: function vector(ctx, x, y, radius, shadow, series, index) { var vectorangle = series.data[index][2]; // in radians var vectorlength = series.data[index][3]; // in pixels var bottom = [math.round(x + vectorlength * math.sin(vectorangle)), math.round(y - vectorlength * math.cos(vectorangle))]; var top = [math.round(x - vectorlength * math.sin(vectorangle)), math.round(y +

javascript - Why the gridApi.on.edit.beginCellEdit in angular-ui-grid cannot update the new drop-down options immeidiately? -

i have same problem 1 why ui grid value drop-down box assigned in event fires before begincelledit in angular , have little bit difference. after updated editdropdownoptionarray still keep old value, it's have new value in next click. hope can me one. thank you. here code snippet: the html of dropdown: <div> <form name="inputform"> <select ng-class="'colt' + col.uid" ui-grid-edit-dropdown ng-model="model_col_field" ng-options="field custom_filters field in editdropdownoptionsarray"></select> </form> </div> the controller code: $scope.menucolumns = [ { displayname: 'menu', field: 'name', enablecelledit: false }, { displayname: 'access level', field: 'accesslevelname', editablecelltemplat

javascript - Return variable in an onclick function -

i have javascript code returns variable called foo i need pass variable text onclick function function getqueryvariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if(pair[0] == variable){return pair[1];} } return(false); } var foo = getqueryvariable("dv1"); <ul class="answer-list"> <li><a class="btn rollover" onclick="nextquestion(6, 'http://www.example.net/iclk/redirect.php?apxcode=042004&id=et9hmn9xd3xmgt8nkuj0krjmiwuxetj0kn2-0n&dv1=foohere');"><span>yes</span></a></li> <li><a class="btn rollover" onclick="nextquestion(6, 'http://www.example.net/iclk/redirect.php?apxcode=042004&id=et9hmn9xd3xmgt8nkuj0krjmiwuxetj0kn2-0n&dv1=foo

spring - HandlerInterceptorAdapter.postHandle doesn't get called -

i populate pages variables, wont work: public class pagepopulationinterceptor extends handlerinterceptoradapter { public void posthandle(modelmap map) { map.addattribute("hello", "world"); } } @configuration @enablewebmvc public class webmvcconfig extends webmvcconfigureradapter { public @override void addinterceptors(interceptorregistry registry) { registry.addinterceptor(new pagepopulationinterceptor()); } } when putting ${hello} on page it's empty. note posthandle() method has incorrect signature, therefore doesn't override actual method of handlerinterceptoradapter . correct 1 is: public void posthandle( httpservletrequest request, httpservletresponse response, object handler, modelandview modelandview) { ... } you can prevent kind of problems annotating methods intended override superclass methods @override : @override public void posthandle(modelmap map) { ... } in case compiler give

python - peewee with bulk insert is very slow into sqlite db -

i'm trying large scale bulk insert sqlite database peewee. i'm using atomic performance still terrible. i'm inserting rows in blocks of ~ 2500 rows, , due sql_max_variable_number i'm inserting 200 of them @ time. here code: with helper.db.atomic(): in range(0,len(expression_samples),step): gtd.geneexpressionread.insert_many(expression_samples[i:i+step]).execute() and list expression_samples list of dictionaries appropriate fields geneexpressionread model. i've timed loop, , takes anywhere 2-8 seconds execute. have millions of rows insert, , way have code written take 2 days complete. per this post , there several pragmas have set in order improve performance. didn't change me performance wise. lastly, per this test on peewee github page should possible insert many rows fast (~50,000 in 0.3364 seconds) seems author used raw sql code performance. has been able such high performance insert using peewee methods? edit: did not realize test on

linux - Read file contents to variable in grub.cfg file -

q1. wanted know how read contents of file variable @ boot time in grub.cfg? q2. extended read .ini type file can read values various name entries? [section] nothisone=whatever thisone=this want get tia!! in order asking for, need write own grub module. however, should able achieve you're after either using configfile command, or clever application of environment block feature.

amazon web services - S3 TVM Issue – getting access denied -

i'm trying let ios app upload s3 using credentials gets modified anonymous token vending machine. the policy statement token vending machine returns is: {"statement": [ {"effect":"allow", "action":"s3:*", "resource":"arn:aws:s3:::my-bucket-test", "condition": { "stringlike": { "s3:prefix": "66-*" } } }, {"effect":"deny","action":"sdb:*","resource":["arn:aws:sdb:us-east-1:myaccountidhere:domain/__users_domain__","arn:aws:sdb:us-east-1:myaccountidhere:domain/tokenvendingmachine_devices"]}, {"effect":"deny","action":"iam:*","resource":"*"} ] } the object i'm trying put has same bucket name , key 66-3315f11e-84fa-417f-9c32

c++11 - Clang on WIndows finds VC headers instead of GCC -

when had clang 3.7 installed find stl headers gcc installation long both 2 directories in path. now have installed clang 3.8 compiler keeps finding visual studio headers despite fact isn't in path my path follows: path=whatever;g:\compilers\llvm\bin;g:\compilers\mingw64-64bit\bin edit 1 i've know idea correct include paths, tried compilation in codelite found these: "-ig:\\compilers\\mingw64-64bit\\x86_64-w64-mingw32\\include\\c++" "-ig:\\compilers\\mingw64-64bit\\x86_64-w64-mingw32\\include\\c++\\x86_64-w64-mingw32" "-ig:\\compilers\\mingw64-64bit\\lib\\gcc\\x86_64-w64-mingw32\\5.1.0\\include" "-ig:\\compilers\\mingw64-64bit\\lib\\gcc\\x86_64-w64-mingw32\\5.1.0\\include-fixed" "-ig:\\compilers\\mingw64-64bit\\x86_64-w64-mingw32\\include" "-ig:\\compilers\\mingw64-64bit\\x86_64-w64-mingw32\\include\\c++\\backward" i'm using dialect flag --std=c++11 however simple program using c++ library g

linux command to connect to another server using hostname and port number -

what linux command connect server using host name , port number? how connect server using host name , port number check if existing process running? way see working log in server , run ps command. there way without logging in directly other server , connect host name , port number , check running process? if want try arbitrary connection given host/port combination, try 1 nmap , telnet or nc (netcat). note can't determine whether or not process running remotely - might running on port, ignore sees on port. sure, need run ps or netstat or etc. via ssh or etc. if want use ssh e.g. script or, more generally, without typing in login information, want use public key authentication. ubuntu has documentation on how set up, , it's applicable other distrobutions well: https://help.ubuntu.com/community/ssh/openssh/keys . if have no access server you're trying list processes on @ all, i'm afraid there isn't way list running processes remotely (beside

javascript - jQuery $.post-function | data-processing function does not work -

i new in web development, having years of experience in traditional development, e.g. using java, c , abap, under belt. i trying create pretty simple login-functionality, struggling jquery's $.post() -functionality. in below seen code, alert("test") -function in data-processing part of $.post() doesn´t seem executed, after submit form form_login . guess problem how connected javascript-function login_attempt() submitting of form form_login . <!doctype html> <html> <head> <title>login</title> <script src="jquery-2.2.4.min.js"></script> <script> function login_attempt(){ $.post("login.php", $("#form_login").serialize(), function(data){alert("test");},html); } </script> </head> <body> <h1>login-form</h1> <form id="form_login" method="post" onsubmit="return login_attempt()"> &

java - What replaces chunk in iText 7? -

attempting use itext 7 in java. want have part of paragraph bold. apparently in earlier releases done formatting "chunks" separately adding them paragraph. apparently "chunks" don't exist in itext 7. procedure itext 7? text in com.itextpdf.layout.element meant alternative chunk . to make part of paragraph bold, need bold font specified piece of text. paragraph p = new paragraph(); p.add(new text("this in bold").setfont(boldfont)); alternatively, can rely on itext simulate bold regular font, not preferred way. p.add(new text("bold simulated regular font").setbold()); please check out jumpstart tutorial written bruno lowagie.

java - Can Dijkstra's algorithm be used to find the quickest way to return to the route node? -

i have directed graph nodes abcdefgh. i have dijkstra working can find quickest route a-f (for example). if wanted find quickest path a-a, dijkstra's appropriate algorithm use? usually if want same node have started concept of ts(travelling salesman) come in play given traversing through node(abcdefgha). can check ts below http://mathworld.wolfram.com/travelingsalesmanproblem.html

javascript regex for MM/YYYY and YYYY -

i have 2 places need regex in javascript 1 validate mm/yyyy have: var regex = new regexp(/^(0?[1-9]|1[0-2])\/(\d{4})$/); the other validate yyyy i need both validate year between 1900 , current year this work next millennium: var y = (new date().getyear()-100).tostring(); // "13" var strreg = '^((0?[1-9]|1[0-2])\\/)?(19\\d{2}|2' + (y.length-2?'':'0'); for(var i=0;i<y.length;i++) { strreg+='[0-'+y[i]+']'; } strreg+=')$'; // "^((0?[1-9]|1[0-2])\/)?(19\d{2}|20[0-1][0-3])$" console.log(new regexp(strreg).test('2013')); // true console.log(new regexp(strreg).test('2016')); // false console.log(new regexp(strreg).test('01/2013')); // true console.log(new regexp(strreg).test('13/2013')); // false and if want use valid dates century , last century (versus 1900s til now), can replace 19 in regex code... '...?(' + (y.length-2?parseint(y[0])+19:'19')

python - Converting range of numbers with respective ASCII codes -

how convert set of values characters every number in range should converted , returned without using control statements , loops eg: range(97,100) should converted {'a','b','c'} try this: >>> map(chr, range(97,100)) ['a', 'b', 'c'] use of char: >>> chr(97) 'a' using list comprehension: >>> [chr(x) x in range(97,100)] ['a', 'b', 'c'] to in unicode use unichr : >>> [unichr(x) x in range(97,100)] [u'a', u'b', u'c']

laravel - Associate CartoDB with local data -

i'm quite new software such cartodb, i've create map , add data set. goal create map administrative areas each country (using http://www.gadm.org/version2 ). each of areas reservable user here's issue : can store users own areas ? want integrate map laravel back-end. you can access cartodb data backend using sql api perform select , update , insert 's. render data on cartodb need stored on cartodb table need implement kind of synchronization between data repositories.

html - Align divs under each other -

basically want align .answer div under each other. the text this: firstname:       oliver lastname:         malan gender:        male and want this: firstname:    oliver lastname:     malan gender:         male code: .profile-data { padding-left: 170px; padding-top: 50px; } h3.header-h3 { font-size: 26px; } .data { font-size: 20px; margin-bottom: 15px; border-bottom: 1px solid #666; padding: 7px; width: 60%; } .answer { margin-left: 100px; position: relative; display: inline-block; } <div class="profil-data"> <h3 class="header-h3">personal info</h3> <div class="data"> name: <div class="answer"><b>oliver</b> </div> </div> <div class="data"> lastname: <div class="answer"><b>malan</b> </div> </div> <div class="da

javascript - chrome extension right context menus -

below code google chrome extension. beginner it. trying append result div of pop html. nothing appended. , if click context menu multiple times, right context menu created multiple times. when open extension pop console, pop appear, otherwise, won's. confused. can me out? chrome.contextmenus.create({ "title": "my extension", "contexts": [ "page" ,"selection"], }) function parser(article, key, threadshold){ console.log(article); var ret = "<div>" + key + ": "; var res = json.parse(article)["results"]; var keywords = res[key]["results"][0]; console.log(keywords); var sortable = []; (var keyword in keywords){ sortable.push([keyword, keywords[keyword]]) } sortable.sort(function(a,b) {return b[1] - a[1]}) (var item in sortable){ console.log(sortable[item][1]); $(&

css - How do I trigger this page transition using jquery? -

http://www.biola.me/ i'd similar transition effect when clicked in "about" link. i've seen code , uses css transition , transform. how trigger jquery? thanks in advance here way it: css: html, body { height: 100%; } .nav > li { list-style: none; cursor: pointer; } .nav > li > { font-size: 24px; } .container { overflow-x: hidden; -webkit-transition: -webkit-transform 0.5s; transition: transform 0.5s; } .container.overlay-open { -webkit-transform: translatex(100%); transform: translatex(100%); } .overlay { position: fixed; width: 100%; height: 100%; top: 0; left: 0; background: rgba(153,204,51,0.9); overflow-y: scroll; } .overlay .close { position: absolute; top: 15px; right: 15px; color: #ffffff; font-size: 21px; cursor: pointer; } .overlay-contentpush { visibility: hidden; -webkit-backface-visibility: hidden; backface-visibilit

How String class is thread safe in java? -

public class threadstring extends thread { string str = "abc"; public void run() { str = "abc"; } } if threads accessing above run method, reference "abc" pointing "abc" how works internally? string s in java immutable. aren't modifying string , you're pointing value. point of view, it's thread safe - str either "abc" or "abc" , can't invalid or illegal.

tfsbuild - TFS 2015 Build number in YY_week number_ day number format -

Image
i started creating tfs 2015 build ( vnext) definition file. build number format have $(builddefinitionname)_$(year:yyyy).$(month).$(dayofmonth)_$(rev:r) it gives buildname_2016.05.28_1 but, wanted $(builddefinitionname) $(year:yy). week number.day number $(rev:r) in real example : buildname_16.21.6_1 anyway can achieve week number , day number? can use same format releases , version number. unfortunately, there no $(week) variables $(month) use directly, have add custom variables achieve weekly yourself. you may have manually edit value of week or write ps script achieve this. more details how manage version numbers, please refer blog .

bash - comparing two files by lines and removing duplicates from first file -

problem: need compare 2 files, removing duplicate first file then appending lines of file1 file2 illustration example suppose, 2 files test1 , test2. $ cat test2 www.xyz.com/abc-2 www.xyz.com/abc-3 www.xyz.com/abc-4 www.xyz.com/abc-5 www.xyz.com/abc-6 and test1 is $ cat test1 www.xyz.com/abc-1 www.xyz.com/abc-2 www.xyz.com/abc-3 www.xyz.com/abc-4 www.xyz.com/abc-5 comparing test1 test2 , removing duplicates test 1 result required: $ cat test1 www.xyz.com/abc-1 and adding test1 data in test2 $ cat test2 www.xyz.com/abc-2 www.xyz.com/abc-3 www.xyz.com/abc-4 www.xyz.com/abc-5 www.xyz.com/abc-6 www.xyz.com/abc-1 solutions tried: join -v1 -v2 <(sort test1) <(sort test2) which resulted (that wrong output) $ join -v1 -v2 <(sort test1) <(sort test2) www.xyz.com/abc-1 www.xyz.com/abc-6 another solution tried : fgrep -vf test1 test2 which resulted nothing. with awk: % awk 'nr == fnr{ a[$0] = 1;next } !a[$0]' test2 test

Displaying time in Python using "Strptime()" -

i'm trying make basic program shows how many days left until next birthday, when run in terminal, says input value should returning string not integer? when using input function in python, doesnt automatically return string value? import datetime currentdate = datetime.date.today() userinput = input("please enter birthday(mm.dd.yy)") birthday = datetime.datetime.strptime(userinput, "%m/%d/%y") print(birthday) use %y (small letter) catch 2 digit years you should advice user expected format - expect "mm/dd/yy", tell user type "mm.dd.yy" to calculate difference use (for python3, python2 use raw_input jahangir mentioned): import datetime today = datetime.date.today() userinput = input("please enter birthday(mm/dd):") birthday = datetime.datetime.strptime(userinput, "%m/%d") birthday = datetime.date(year=today.year, month=birthday.month, day=birthday.day) if (birthday-today).days<

php - Godaddy Hosting HTTP GET Request Lengh Issue -

i facing difficulty receiving full length of request in php file. have written sample this. wrote test.php file below content, <?php $data = $_get['data'] ; echo($data); ?> now have checked browser following url, http://myserver.com/test.php?data=dddddddddddddddddddd i have tested increasing number of d letters increased see how data can passed maximum. what found 478 characters received , shown in echo statement. when put more letter 'd' s in parameter won't show. what gathered maximum of 512 characters can received. if total length more that won't pass parameter. (will result empty data). changed browser effect same. but same thing work localhost (wamp server) firefox, chrome etc , can send / receive largeer request data. understand not browser issue server has limit. (my requests 1000 characters long in average , did not work in godaddy server). i using godaddy shared hosting server. guess can solved if can increase request length allo

biztalk - Unable to add behaviorExtension in machine.config via c# -

my biztalk application requires me add custom behaviorextension machine.config file. install application via msi, via biztalk deployment framework (btdf), done programmatically well. now cannot seem find way either list installed behaviors not edit them. i have following code, after i'm stuck. // machine.config file. configuration machineconfig = configurationmanager.openmachineconfiguration(); // machine.config file path. configurationfilemap configfile = new configurationfilemap(machineconfig.filepath); // map application configuration file machine // configuration file. configuration config = configurationmanager.openmappedmachineconfiguration(configfile); configurationsectiongroup svcmodel = config.sectiongroups.get("system.servicemodel"); configurationsection extensions = svcmodel.sections.get("extensions"); can give me pointers on how approach this? you there. e

How to compile a Release configuration for Ubuntu console app .NET Core RC2 -

for example, hwapp sample builds debug not release: $ dotnet new … $ dotnet restore … $ dotnet build … $ dotnet ./bin/debug/netcoreapp1.0/hwapp.dll hello world! what have add project.json optimized build? { "version": "1.0.0-*", "buildoptions": { "emitentrypoint": true }, "dependencies": { "microsoft.netcore.app": { "type": "platform", "version": "1.0.0-rc2-3002702" } }, "frameworks": { "netcoreapp1.0": { "imports": "dnxcore50" } } } my original question may have conflated 2 difference issues - how build release instead of debug? how build .net native? i've stumbled on an answer first question : $ dotnet build -c release that seems provide obvious performance improvement. according this native compilation has been removed latest version of dotnet tools.

java - JDBC: How to store and retrieve hashed passwords -

i'm trying make simple secure login system. i've read hashing , salting passwords gives sufficient security if you're using algorithm hashing , creating unique salt each hash. found code-snippet on owasp website hashing method: public static byte[] hashpassword(final char[] password, final byte[] salt, final int iterations, final int keylength) { try { secretkeyfactory skf = secretkeyfactory.getinstance("pbkdf2withhmacsha512"); pbekeyspec spec = new pbekeyspec(password, salt, iterations, keylength); secretkey key = skf.generatesecret(spec); byte[] res = key.getencoded(); return res; } catch (nosuchalgorithmexception | invalidkeyspecexception e) { throw new runtimeexception(e); } } and i'm using securerandom generate salt public static byte[] generatesalt(int length) { securerandom random = new securerandom(); byte[] salt = new byte[length]; random.nextbytes(salt);

javascript counting vowels, consonants and show the occurrance -

i'm having trouble figure out how count vowels, consonants , declare how vowels appears separately, user input. user put text ex: “mischief managed!” , result must be: a: 2 e: 2 i: 2 o: 0 u: 0 non-vowels: 11 var userdata = prompt ("enter text here"); var = 0; var e = 0; var = 0; var o = 0; var u = 0; var consonants = 0; var count; (count = 0; count <= userdata.legth; count++){ if((userdata.charat(count).match(/[aeiou]/))){ a++; e++; i++; o++; u++; }else if((userdata.charat(count).match(/[bcdfghjklmnpqrstvwxyzbcdfghjklmnpqrstvwxyz]/))){ consonants++; } } console.log ("a: " + a); console.log ("e: " + e); console.log ("i: " + i); console.log ("o: " + o); console.log ("u: " + u); console.log ("consonants: " + consonants); but it's not working. searched in many other forums but, didn't find this. firstly, let's point out things for (c

How do I load CSV file into Amazon Redshift from OS Windows using Python? -

i need load csv files desktop (windows) redshift tables. can demonstrate implementing process in python? i assuming script accept csv file name , connection details. the result of execution of script csv data appended redshift table. start uploading file s3 effective way load data redshift copy s3. you can use aws sdk s3: https://boto3.readthedocs.io/en/latest/reference/services/s3.html#s3.object.put the next step run copy command. done through sql connection. here have few options, using standard jdbc/odbc connection redshift/postgresql (pyodbc - https://github.com/mkleehammer/pyodbc , example), or dedicated library such copy ( http://initd.org/psycopg/ , example). copy command point s3 object uploaded in step 1.

multithreading - Serialization of chess game logic not succesful after clicking on "save game" button in Java GUI -

i writing quite simple chess game separate gui , logic.the "save game" button starts save filedialog , there user chosen directory , file name passed savegame method in game logic class. there create file fileoutputstream , try write file objectoutputstream. ioexception raised , dont know why. here snippet of how game class looks, logic part of chess game program. public class game implements runnable, serializable { private final board board; private final transient moveevaluate moveevaluator; private final logger log = logger.getlogger("game"); private transient boardgui gamegui; private boolean whiteonmove; private boolean gameover = false; private boolean customboardsetup = true; private boolean setupisdone = false; public game() { log.log(level.severe, "game created"); this.board = new board(); this.whiteonmove = true; this.moveevaluator = new moveevaluate(this); } this save game method whis inside game class. method ca

mysqli - Website Version PHP -

i trying create version file alert end user if there update. in theory , practical application: when admin logs in , goes management interface, script reads remote file , compares remote version local version, if same, report status, if remote greater, alert. the local version pulled mysql table mysqli , confirmed work, remote file read, confirmed work how ever running issue. local version 1.3, remote version 1.3 yet reports: version - 1.3 out of date, new version 1.3 available download when should say version date! the code using below require_once('includes/settings.php'); function check_version() { global $connection; $query = "select * version"; $result = mysqli_query($connection, $query); // if query fails, die , report if(!$result = $connection->query($query)){ die('there error running query [' . $connection->error . ']'); } else { $row = mysqli_fetch_assoc($re

angularjs - Need to Loop thru a firebaseArray and returning 1 object -

i trying access data returned in firebase array , return 1 of these objects - firebase array returning 3 objects , want able loop through these 3 objects , compare data. not sure do: its function getnewsdetail problem. angular.module('news.services', ['ionic', 'firebase' ]) .factory('newsitems', ['$firebasearray', function($firebasearray){ var newsref = new firebase ('https://xxxx.firebaseio.com/newsitems'); var thenewsitems = [$firebasearray(newsref)]; //alert($firebasearray(newsref).length) return{ getnewsitems: function(){ return $firebasearray(newsref); }, getnewsdetail: function(newsid){ for(var = 0; < thenewsitems.length; i++){ if(thenewsitems[i].id == parseint(newsid)){ return thenewsitems[i]; } } return null; } }; }]); including firebase layout: newsitems -kiip4vmlntvaklobaxa

linker - ar on MSYS2 shell receives truncated paths when called from Makefile? -

i'm using git-bash.exe portablegit install, environment variables different mingw. have: workgroup+user@ad-x mingw32 /z/user/downloads $ ar //workgroup.ex.com/users/user/downloads/mingw-w64/i686-4.9.3-posix-dwarf-rt_v4-rev1/mingw32/bin/ar workgroup+user@ad-x mingw32 /z/user/downloads $ gcc --version | head -1 gnu ar (gnu binutils) 2.25 now there's library i'm building, , @ end, link step fails @ call of ar command, looks this: ar -cr "z:/user/downloads/myprojectnameabcde/somelibraryabc/libs/somelibrarydefghi/lib/mingw/libsomelibraryabcdebug.a" \ z:/user/downloads/myprojectnameabcde/somelibraryabc/libs/somelibrarydefghi/lib/mingw/obj/debug/libs/somelibrarydefghi/test/someobject.o \ [...] ... , there's bunch of objects listed in - command line 10000 characters in length, still below getconf arg_max of 32000 in msys2 shell of portablegit ( git-bash.exe ). however, failure no such file or directory : \\workgroup.ex.com\users\user\downloads\mingw-w

c++ - Cythonic way to wrap boost::geometry::Point accessors -

what correct cythonic way wrap following member functions of boost::geometry::point ? code snippet comes here . /// @brief coordinate /// @tparam k coordinate /// @return coordinate template <std::size_t k> inline coordinatetype const& get() const { #if defined(boost_geometry_enable_access_debugging) boost_geometry_assert(m_created == 1); boost_geometry_assert(m_values_initialized[k] == 1); #endif boost_static_assert(k < dimensioncount); return m_values[k]; } /// @brief set coordinate /// @tparam k coordinate set /// @param value value set template <std::size_t k> inline void set(coordinatetype const& value) { #if defined(boost_geometry_enable_access_debugging) boost_geometry_assert(m_created == 1); m_values_initialized[k] = 1; #endif boost_static_assert(k < dimensioncount); m_values[k] = value; } i first attempted using: cdef exte

php - Returning multiple search queries with a single search bar? -

i attempting search using form action. i'd 10 search fields ticket id's return each ticket id in search bar. form: <form action="http://-withheld-/adminhelper/-withheld-/ticket.php" method="get"> <input type="text" name="id1" placeholder="search ticketid" required="required"> <br> <input type="text" name="id2" placeholder="search ticketid" required="required"> <button type="submit">search</button> php: <?php if(isset($_get['id'])){ $id = $_get['id']; $url = 'http://-withheld-.com/api/v1/tickets/'.$id.'?api_key=withheld'; // initiate curl $ch = curl_init(); // disable ssl verification curl_setopt($ch, curlopt_ssl_verifypeer, false); // return response, if false print response curl_setopt($ch, curlopt_returnt