Posts

Showing posts from August, 2015

javascript - How to use ng-options in angularjs -

Image
the select element not bound expected. html: <select ng-model="selectedpage" ng-change="showpageresult();" ng-options="o o in pagenumbers"> </select> ctrl.js: function bindpagenumbers() { $scope.pagenumbers = []; (var = 1; <= 2) ; i++) { $scope.pagenumbers.push(i); } } output: <option value="0"label="1">1</option> <option value="1" label="2">2</option> if put $scope.pagenumbers.push(i.tostring()); , output <option value="?"label=""></option> <option value="0" label="1">1</option> <option value="1" label="2">2</option> expected: <option value="1">1</option> <option value="2">2</option> what should done desired o/p : http://jsfiddle.net/s222904f/ check i...

ios - Can't add missing constraints Xcode 6 -

Image
i have finished app releasing on iphone, no ipads. there different sized iphones had fix few layout issues in project. apparently nice way approach select views , 'add missing constraints'. when doing following error message: i have tried clearing constraints, no look. when click 'reveal diagnostics in finder' directed zip file named 'ib-layout-diagnostics_2015-07-08_13-57-41_336000' containing log files , can't decrypt it. has fact have app completed, , accessing of views programatically in swift? in development info have device set iphone, device orientation portrait, , have 'use auto layout' , 'size classes' checked. any ideas why i'm getting error? in advance. this answer may not specific enough. if else having same problem solution found: copy views inside table view cell, other temporary view controller delete views table view cell select views in controller , add missing constraints (works now!) a...

Memory Leaks while Navigating between pages in windows store app -

i have created windows store application more 200 pages. problem here moving 1 page other, each page leaving small memory footprint in spite of releasing references. have checked major tools , profilers , made sure there no references holding them. due this, memory increasing 500-600 odd mb , application crashing. as illustration, have created sample project 2 pages i.e. page1 , page2. page1 heavy lot of controls (including 1 button redirects page2) page2 blank page. in app.xaml.cs, if set first page page2, application launches , can see page2. not in taskmanager, see memory 17 mb. now, have changed app.xaml.cs make start page page1. when launched app , when see taskmanager, see memory 50.4 mb fine until considering controls , images on page. when click button leads me page2, see memory in taskmanager 50.7 mb (an increase of 300 kb). i want rid of page1, facing problems. please note have taken care of basic memory related stuff like released references objects in page1 ma...

java - Partner not reached error in JCO.destination -

i'm having problem establishing connection sap in java program. i'm following examples come in jco download error: com.sap.conn.jco.jcoexception: (102) rfc_error_communication: connect sap gateway failed connection parameters: type=a dest=abap_as_without_pool ashost=xx.xx.x.xx sysnr=00 pcs=1 location cpic (tcp/ip) on local host unicode error partner 'xx.xx.x.xx:3300' not reached time wed jul 08 08:18:28 2015 release 711 component ni (network interface) version 39 rc -10 module nixxi.cpp line 3147 detail nipconnect2: xx.xx.x.xx:3300 system call connect errno 10060 errno text wsaetimedout: connection timed out counter 2 i don't know can be, i'm writing down correct connection properties (ashost,user,passwd,sysnr,etc). has else has had problem this? this connection code: properties connectproperties = new properties(); ...

ruby on rails - NoMethodError in PaymentsController#summary, undefined method `empty?' for nil:NilClass -

am getting following error: nomethoderror in paymentscontroller#summary undefined method `empty?' nil:nilclass extracted source (around line #134): 132 format.pdf 133 pdf = summarypdf.new(@klasses) 134 send_data pdf.render, filename: "payments summary_#{academicterm.current.details}.pdf", type: "application/pdf" 135 end 136 end 137end summarypdf class responsible printing income summary of payments in school. defined under payments controller as def summary @klasses = klass.all respond_to |format| format.html {render "summary"} format.pdf pdf = summarypdf.new(@klasses) send_data pdf.render, filename: "payments summary_#{academicterm.current.details}.pdf", type: "application/pdf" end end end routes.rb resources :payments 'search_form', :on=>:collection 'klass_menu',:on =>:collection 'byklass',:on =>:collection 'enrolment...

Hadoop 2 (YARN). getting java.io.IOException: wrong key class. Exception -

i'm trying run hadoop 2 mapreduce process output_format_class sequencefileoutputformat , input_format_class sequencefileinputformat . i chose mapper emits key , value both byteswritable. reducer emits key intwritable , value byteswritable. every time i'm getting following error: error: java.io.ioexception: wrong key class: org.apache.hadoop.io.byteswritable not class org.apache.hadoop.io.intwritable @ org.apache.hadoop.io.sequencefile$writer.append(sequencefile.java:1306) @ org.apache.hadoop.mapreduce.lib.output.sequencefileoutputformat$1.write(sequencefileoutputformat.java:83) @ org.apache.hadoop.mapred.reducetask$newtrackingrecordwriter.write(reducetask.java:558) @ org.apache.hadoop.mapreduce.task.taskinputoutputcontextimpl.write(taskinputoutputcontextimpl.java:89) @ org.apache.hadoop.mapreduce.lib.reduce.wrappedreducer$context.write(wrappedreducer.java:105) @ org.apache.hadoop.mapreduce.reducer.reduce(reducer.java:1...

ios - SDWebImage Complete closure is called 4 times per image -

i use sdwebimage progress . i use following code in `init()`` constructor: if let url: nsurl = nsurl(string: previewcard.getimageurls().getwithint(0) as! string) { self.imageview?.setimagewithurl(url, placeholderimage: mgimage.imagewithcolor(uicolor.clearcolor()), options: sdwebimageoptions.refreshcached, completed: { (image:uiimage!, error:nserror!, type:sdimagecachetype, loadurl:nsurl!) -> void in println("-------------- done") }, usingactivityindicatorstyle: uiactivityindicatorviewstyle.gray) } the console output is: println("-------------- done") println("-------------- done") println("-------------- done") println("-------------- done") why complete closure called 4 times? how can prevent called 4 times? edit: verified init() method called once. wherever call setimagewithurl method complete closure called @ least twice. it's because you're specifying "refreshcached". c...

windows installer - How to define a CustomAction with a long command line in WIX? -

i have define custom action in wxs file: <customaction execommand="long command line" filekey="xyz.exe" id="foo"/> and receive warning: warning lght1076 : ice03: string overflow (greater length permitted in column); table: customaction, column: target, key(s): what right solution define action long command line? after many time have find solution. split command line multiple properties. <customaction id="action.prop0" property="prop0" value="first part [installdir]"/> <customaction id="action.prop" property="prop" value="[prop0] second part"/> <customaction execommand="[prop]" filekey="service.exe" id="myaction"/> <installexecutesequence> <custom action="action.prop0" after="installfiles"/> <custom action="action.prop" after="action.prop0"/> <cus...

Create group using Office365 unified API returns 201 but doesn't work -

i using office365 unified apis preview deal office 365 groups, getting user groups endpoints works fine , returns user groups. when call create group endpoint, retruns 201.created group doesn't exist in office portal nor groups api call. here endpoint url: https://graph.microsoft.com/beta/ {my_tenant_name}/groups i landed working solution. if trying create group, need add directory permission (unfortunately need admin consent): read , write directory data these weird behaviors office365 unified apis, should excuse apis can see "beta" inside endpoint url.

ios - Parse Json from Facebook -

i have been trying integrate facebook sdk login user's data. i'm using method after authentication user's details. if ([fbsdkaccesstoken currentaccesstoken]) { [[[fbsdkgraphrequest alloc] initwithgraphpath:@"me" parameters:nil] startwithcompletionhandler:^(fbsdkgraphrequestconnection *connection, id result, nserror *error) { if (!error) { nslog(@"fetched user:%@", result); } }]; } and data i'm getting : 2015-07-08 14:02:40.502 auth-app[whatever] fetched user:{ "first_name" = lol; gender = male; id = 12345; "last_name" = ak; link = "https://www.facebook.com/...../...."; locale = "en_us"; name = "lol ak"; timezone = 4; "updated_time" = "2015-07-08t10:22:32+0000"; verified = 1; } i need read array , display in text fields. tried using results[0] first element in array didn't work. ...

c - Is there a way to dump the complete stack trace after normal execution of the binary? -

i want complete stack trace, list of functions traversed in normal execution of binary. afaik, gdb provides trace when hits break point or in case of crash. that called the call graph . that require either: instrumentation, i.e. adding code each function record when entering/leaving it profiling, i.e. sampling program's state , recording functions detected emulation, i.e. running program on fake/virtual cpu , recording when jumps occur of above, first 1 provide 100% accuracy, , of course in general hard since use libraries , wouldn't instrumented if got own code be. the reason hard stack frame "history" isn't recorded; once program has stopped running there no current stack frame inspect, unlike when breaking in debugger. see this question .

.net - C# Update List by adding new items, updating existing items and deleting uncommon items in least iteration -

i need update existing list data of new list. shown below: i have list binded ui element. need update items data of list items of list b without assigning list list b. shown below: list a: { {id: 1, value: aaa}, {id: 2, value: ddd}, {id: 3, value: ccc}, {id: 4, value: bbb} } list b: { {id: 1, value: zzz}, {id: 5, value: xxx}, {id: 3, value: yyy}, {id: 4, value: bbb} } after updation should have value in list below: list a: { {id: 1, value: zzz}, {id: 5, value: xxx}, {id: 3, value: yyy}, {id: 4, value: bbb} } what best way achieve this? this should it: a.removeall(aitem => b.all(bitem => aitem.id != bitem.id)); a.foreach((aitem) => { aitem.value = b.first(bitem => aitem.id == bitem.id).value; }); a.addrange(b.where(bitem => a.all(aitem => aitem.id != bitem.id))); row #1 deletes uncommon items. row #2 updates common items between thetwo lists. , row #3 adds b-unique items.

javascript - Object index reference -

i've created object var slider = { this.config = { color : "white", width: 200, maxwidth : //here want insert value of "slider.config.width" * 1.5 } } and want set value of "maxwidth" "width * 1.5". how can it? i had difficulties make work object on jsfiddle, made similar : http://jsfiddle.net/06c07qgj/19/ var slider = { color : "white", width: 200, maxwidth : function(e){ this.maxwidth = this.width*1.5;} }; slider.maxwidth(); alert(slider.maxwidth); are sure object doesnt : var slider = { config : { color : "white", width: 200, maxwidth : //here want insert value of "slider.config.width" * 1.5 } }

c# - System.Net.Http.HttpClient vs Windows.Web.Http.HttpClient - What are the main differences? -

when developing .net 4.5 desktop apps windows have been used use system.net.http.httpclient communication backend web api. developing windows store app , has noticed existence of windows.web.http.httpclient . have looked information on main differences between 2 clients without luck. from msdn know should start using windows.web.http.httpclient in windows store app since system.net.http.httpclient might removed api: note system.net.http , system.net.http.headers namespace might not available in future versions of windows use windows store apps. starting windows 8.1 , windows server 2012 r2, use windows.web.http.httpclient in windows.web.http namespace , related windows.web.http.headers , windows.web.http.filters namespaces instead windows runtime apps. but apart information, have hard time figuring out main differences , main benefit of using windows.web.http.httpclient ? add don't got in system.net.http.httpclient ? answers backed official documentation apprec...

python - sklearn: how to get coefficients of polynomial features -

i know possible obtain polynomial features numbers using: polynomial_features.transform(x) . according manual , degree of 2 features are: [1, a, b, a^2, ab, b^2] . how obtain description of features higher orders ? .get_params() not show list of features. by way, there more appropriate function now: polynomialfeatures.get_feature_names . from sklearn.preprocessing import polynomialfeatures import pandas pd import numpy np data = pd.dataframe.from_dict({ 'x': np.random.randint(low=1, high=10, size=5), 'y': np.random.randint(low=-1, high=1, size=5), }) p = polynomialfeatures(degree=2).fit(data) print p.get_feature_names(data.columns) this output follows: ['1', 'x', 'y', 'x^2', 'x y', 'y^2'] n.b. reason gotta fit polynomialfeatures object before able use get_feature_names(). if pandas-lover (as am), can form dataframe new features this: features = dataframe(p.transform(data), columns=p.get_...

Outlook opens ICS file with the timezone dropdown -

i have been trying ics file floating timezone setup. research suggests floating timezones not recommended, client has asked user downloading ics file in uk , 1 in both see same time. the code have follows (minus message body); begin:vcalendar prodid:-//microsoft corporation//outlook 14.0 mimedir//en version:2.0 method:publish x-ms-olk-forceinspectoropen:true begin:vtimezone tzid:gmt standard time begin:standard dtstart:16011028t020000 rrule:freq=yearly;byday=-1su;bymonth=10 tzoffsetfrom:+0000 tzoffsetto:-0000 end:standard begin:daylight dtstart:16010325t010000 rrule:freq=yearly;byday=-1su;bymonth=3 tzoffsetfrom:-0000 tzoffsetto:+0000 end:daylight end:vtimezone begin:vevent class:public created:20150609t083427z description:testing tuesday 09/06/2015 – 11.00-11.30\n dtend;tzid="gmt standard time":20150609t113000 dtstamp:20150609t083427z dtstart;tzid="gmt standard time":20150609t110000 last-modified:20150609t083427z location:la priority:5 sequence:0 summary;l...

java - Submit button with file download in wicket -

i want download csv file after clicking on button without using downloadlink. downloadlink can this: downloadlink link = new downloadlink(wicketid, new abstractreadonlymodel<file>() { private static final long serialversionuid = 1l; @override public file getobject() { file tempfile; try { tempfile = file.createtempfile("test", ".csv"); inputstream data = new bytearrayinputstream("some data elli".getbytes()); files.writeto(tempfile, data); } catch (ioexception e) { throw new runtimeexception(e); } return tempfile; } } ).setcacheduration(duration.none).setdeleteafterdownload(true); return link; } how can in onsubmit method of normal wicket button? i'm using wicket 6. already answered @ wicket jquery ui issue tracker: https://github.com/sebfz1/wicket-jquery-ui/issue...

Specflow running with MSTest -

i using vs2013. trying run *.dll mstest, fails without execution. if execute same test case manually, pass. below command line execution lines: c:>"c:\program files (x86)\microsoft visual studio 12.0\common7\ide\mstest" /testcontainer:"e:\e_drive\tfs_work\platformsoftware\embedded\automatedre gressiontests\main\bin\debug\ydoa.dll" /category:"trlys1d" microsoft (r) test execution command line tool version 12.0.21005.1 copyright (c) microsoft corporation. rights reserved. loading e:\e_drive\tfs_work\platformsoftware\embedded\automatedregressiontests\main\bin\debug\ydoa.dll... starting execution... results top level tests ------- --------------- failed ydoa.inputoutputfeature.relayandrelayfdbkasusednormalandfalseandtrue_01 failed ydoa.inputoutputfeature.relayasunusednormalandallrelaystrue 0/2 test(s) passed, 2 failed summary test run failed. failed 2 total 2 results fi...

java - Is there any alternative to XSLT -

in application, converting xml java object using 2 steps. in 1st step doing xml xml transformation using xslt. in second step, binding xml java object using jibx api. step1: documentbuilder builder = domfactory.newdocumentbuilder(); document doc = builder.parse(inboundmessagedata.getdatastream()); inputstream instream = xslttransformationutil.transform(doc, xsltfilename); step2: runtimedocument document = xmlbindingservice.unmarshall(instream, runtimedocument.class); is possible that, these 2 steps can achieved in single step or have api can use this. in advance. if java (domain) model not align input document, highly recommend use xslt done you. however, possible in 1 step , more efficient using standard java. see jaxbresult javadoc . example code (using java se 6+): /** * read file `./29238845.xml`, transform our internal canonical productxml , * bind to java `product` domain instance. */ @test public void testunmarshal() throws transformerexception, jaxbexce...

android - a url's response may be replaced by another url -

i have 2 different domain urls named a.com , b.com. code send request: asynchttpclient same one. asynchttpclient.post(context, "a.com", aparams, aresponsehandler); asynchttpclient.post(context, "b.com", bparams, brsponsehandler); there chance happen: "b.com" response in aresponsehandler, although doesn't happen frequently. why mistake response ? whehter perform either of them solely, it's ok. i find guy has same question. the issue linked on github seems closed. original poster wrote following: in local tests , no way reproduce problem , happened..... it seems unlikely occur, , issue cannot reproduced. personally, wouldn't worry happening in application. write conditional statement check , throw exception if wrong responsehandler triggered.

android - How to get device model as appears in 'Google Play Developer Console'? -

Image
i developer , trying block specific model of samsung galaxy note4 in google play developer console, problem can't find correlation between device model write in console. for example, want know sm-n910c translates below list took console: any ideas how that? manually or programmatically... don't think it's part of http://developer.android.com/reference/android/os/build.html

Store some data in client side which can be accessed across angularjs app -

hi new angularjs. @ start of app need hit api , store data in client side should accessible across controllers , in config. can please suggest whats best approach. here have tried: service : issue every time call , call api. i want call once , store it. fine calling on page refresh. value : cannot accessed in config. thanks. you can store data in angular js localstorage . ypu can add data in localstorage , them anywhere in app , if want ,you can remove localstorage also. example localstorage.setitem('test', data.item); localstorage.getitem('test') localstorage.removeitem('test');

python - Insert data from files into SQLite database -

i have sqlite database on form: table1 column1 | column 2 | column 3 | column 4 i want populate database data stored in hundred .out files in form, every file has millions of rows: value1;value2;value3;value4; 2value1;2value2;2value3;2value4; ... etc is there fast way populate database these data? 1 way read in data line line in python , insert, there should faster way input whole file? bash, sqlite, python preferrably sqlite has .import command. .import file table import data file table you can use (shell). for f in *.out sqlite3 -separator ';' my.db ".import $f table1" done

mysql - Create a table pivot-like output with SQL/Access -

i have table made of 2 columns: tested_object | result | ok | not ok | not ok b | ok and need have output following: tested_object | sum | ok | not_ok | 3 |1 | 2 b | 1 |1 | 0 (or empty) i tried using: select t1.tested_object, count(t1.result) sum, count(t2.result) ok, count(t3.result) not_ok (t1 left join (t1 t2) on t1.tested_object=t2.tested_object) left join (t1 t3) t1.tested_object=t3.tested_object group t1.tested_object now if put: where (t2.result="ok" , t3.result="not_ok") or where (t2.result="ok" or t3.result="not_ok") or t1 left join (t1 t2 t2.result="ok") on t1.tested_object=t2.tested_object i same count number each column or error. i managed different columns numbers saving oks in table , not oks in table manually.. need query calculation automatically input output table. if not clear, i...

amazon ec2 - How to create EC2 instance through boto python code -

requests = [conn.request_spot_instances(price=0.0034, image_id='ami-6989a659', count=1,type='one-time', instance_type='m1.micro')] i used following code..but not working.. use following code create instance python command line. import boto.ec2 conn = boto.ec2.connect_to_region("us-west-2", aws_access_key_id='<aws access key>', aws_secret_access_key='<aws secret key>') conn = boto.ec2.connect_to_region("us-west-2") conn.run_instances('<ami-image-id>',key_name='mykey', instance_type='t2.micro', security_groups=['your-security-group-here'])

cluster computing - Data not clustering but overlapping in histogram in gnuplot -

i have kind of data: ![#size conc cumconc midpoint diameter conc cumconc midpoint diameter conc cumconc 0.337 1788.647911 2679394.57 0.337 1583.950394 1085006.02 0.337 846.9754269 1333139.322 0.419 671.5617583 1005999.514 0.419 604.4813591 414069.731 0.419 353.3910197 556237.465 0.522 227.8372837 341300.251 0.522 192.4245766 131810.835 0.522 198.8547746 312997.4152 0.65 71.93152603 107753.426 0.65 58.52586701 40090.2189 0.65 71.10833659 111924.5218 0.809 39.83629606 59674.7715 0.809 28.31269255 19394.1944 0.809 49.12599943 77324.3231 0.997 26.33886829 39455.6247 0.997 17.56852188 12034.43749 0.997 40.27617821 63394.7045 1.244 10.69495002 16021.03513 1.244 7.027818774 4814.05586 1.244 15.75314508 24795.45036 1.562 8.939251215 13390.99832 1.562 5.863628745 4016.58569 1.562 12.25755549 19293.39234 1.944 9.94324986 14894.98829 1.944 6.499851182 4452.39806 1.944 12.77541752 20108.50717 2.421 6.101436...

How to parse CSV file in PHP and store fields in a database? -

i need parsing following csv file in php, can insert contents database. i know use file_get_contents() after feel bit lost. what i'd store. collection1 - events.text & date collection2 - position & name.text & total i'm not sure how best structure data insert database table. "**collection1**" "events.href","**events.text**","**date**","index","url" "tur.com/events/classic.html","john deere classic","thursday jul 9 - sunday jul 12, 2015","1","tur.com/r.html" "collection2" "**position**","name.href","**name.text**","**total**","index","url" "--","javascript:void(0);","scott","--","2","tur.com/r.html" "--","javascript:void(0);","billy","--","3","tur.com/r.ht...

asp.net - Pass selected gridview value to detailsview template field in edit Mode -

detailsview1 shows master detail selected record of gridview1 . in edit mode, have included functionality search, on user click, gridview2 visibility enabled. i have data selected row value (eg "accountnumber") gridview2 loaded textbox control in detailsview1 when want update "accountnumber". how can achieve using vb.net? i put few ideas come this, worked well. dim textbox textbox = trycast(detailsview1.findcontrol("textbox1"), textbox) textbox.text = gridview2.selectedrow.cells(0).text

rest - Type boolean, and MIME media type application/octet-stream was not found Java (Jersey) -

i using jersey version 1.12 , facing error is a message body writer java class java.lang.boolean, , java type boolean, , mime media type application/octet-stream not found @ com.sun.jersey.spi.container.containerresponse.write(containerresponse.java:285) @ com.sun.jersey.server.impl.application.webapplicationimpl._handlerequest(webapplicationimpl.java:1451) @ com.sun.jersey.server.impl.application.webapplicationimpl.handlerequest(webapplicationimpl.java:1363) @ com.sun.jersey.server.impl.application.webapplicationimpl.handlerequest(webapplicationimpl.java:1353) @ com.sun.jersey.spi.container.servlet.webcomponent.service(webcomponent.java:414) @ com.sun.jersey.spi.container.servlet.servletcontainer.service(servletcontainer.java:537) @ com.sun.jersey.spi.container.servlet.servletcontainer.service(servletcontainer.java:708) @ javax.servlet.http.httpservlet.service(httpservlet.java:728) @ org.apache.catalina.core.applicationfilterchain.internaldof...

AngularJS: Nested Directives - Data binding ishu -

i have nested directives. i send data first 1 the second. the problem lose the binding main scope. this code: plunker (clicking button changes value in main scope not in directive) angular.module('app', []) .controller('mainctrl', function($scope) { $scope.change = function(){ var id = math.floor((math.random() * 4) + 0); var val = math.floor((math.random() * 100) + 1); $scope.data.items[id].id = val; } $scope.data = { items: [{ id: 1, name: "first" }, { id: 2, name: "second" }, { id: 3, name: "third" }, { id: 4, name: "forth" }] } }) .directive('firstdirective', function($compile) { return { replace: true, restrict: 'a', scope: { data: '=' }, link: function(scope, element, attrs) { var template = ''; angular.f...

Control + V not working using selenium c# -

i trying copy , paste object, keyboard action using selenium c#, works ctrl+c not ctrl + v. sample script below: action copyaction = getactions(); action pasteaction = getactions(); copyaction.sendkeys(keys.control + "c").build().perform(); click folder paste above copied object thread.sleep(1000); pasteaction.sendkeys(keys.control + "v").build().perform(); thanks in advance. this code works me! allows me use sendkeys clipboard.settext(target); pageobjects.sendkeys(openqa.selenium.keys.control + "v");

c# - Is it possible to use Lync Server 2013 as a UCMA application server also? -

i'm new ucma , i'm trying set environment build ucma applications. i have 2 windows 2008 servers, 1 active directory dc , other lync 2013 server, can use either of these machines run/develop ucma applications installing vs , ucma 4.0 sdk ? or need separate windows 2008 server ? you can use lync server app server, can't find proof i'm pretty sure microsoft advise against , although suspect fine in lab environment come across undocumented issues.

css - Stop header/nav bar from scrolling -

ok have header/nav bar scrolls up/down each page. how fix top of page no longer scrolls , content scrolls behind it? checked out many examples old , dont seem work. want entire header incl. nav bar remain in fixed position! appreciate help. damien <header> <div class="nav-responsive"><div>menu</div> <select onchange="location=this.value"> <option></option> <option value="index.html">home</option> <option value="about.html">about</option> <option value="services.html">services</option> <option value="products.html">products</option> <option value="contacts.html">contacts</option> </select> </div> <div> <div> <h1><a href="index.html...

c# - Why does the resource file format change after syncing from Perforce? -

i have active template library project used starting point writing dynamic link library (dll). has resource header: resource.h (this standard header file defines resource ids.) it looks this: //{{no_dependencies}} // microsoft visual c++ generated include file. // used myproject.rc // #define ids_projname 100 #define idr_myproject 101 #define idb_myprojectfilt 106 #define idr_myprojectfilt 107 // next default values new objects // #ifdef apstudio_invoked #ifndef apstudio_readonly_symbols #define _aps_next_resource_value 201 #define _aps_next_command_value 32768 #define _aps_next_control_value 201 #define _aps_next_symed_value 108 #endif #endif now, after sync file depot using perforce (p4 client , not command-line), resource file changes this: //{{no_dependencies}} ਍⼀⼀ 䴀椀挀爀漀猀漀昀琀 嘀椀猀甀愀氀 䌀⬀⬀ 最攀渀攀爀愀琀攀搀 椀渀挀氀甀搀攀 昀椀氀 攀⸀ഀഀ // used myproject.rc ਍⼀⼀ഀഀ #define ids_projname ...

javascript - Adding skype button with variable user -

i have site creates profile page on fly. want add skype button page each of profiles - each profile having different id. i have found code: <script type="text/javascript" src="http://www.skypeassets.com/i/scom/js/skype-uri.js"></script> <div id="skypebutton_call_skypeid_1"> <script type="text/javascript"> skype.ui({ "name": "call", "element": "skypebutton_call_skypeid_1", "participants": ["skypeid"], "imagesize": 32 }); </script> this pasted php file @ moment. i need change skypeid on fly - can html bits easy enough since have php variable skypeid . how pass variable javascript? <script type="text/javascript" src="http://www.skypeassets.com/i/scom/js/skype-uri.js"></script> <div id="skypebutton_call_skypeid_1"> <script type="tex...

javascript - d3js diagonal paths in tree layout don't look right -

Image
i trying copy example d3js tree layout , style little more, understand details. also, applied class-oriented approach, required client project. i not quite sure went wrong when copying it, when got display something, paths node node rather strange. so, question now: why? code should same site's above, , when looking @ curve in inspector, d attribute of path looks same in example. <path d="m428.57142857142856,180c428.57142857142856,270 285.7142857142857,270 285.7142857142857,360" class="link"> </path> i create diagonal in constructor of object. var treegenerator = function(nodes,links){ this.nodes = nodes; this.links = links; this.svg = d3.select("svg"); this.svg.attr("width",width); this.svg.attr("height",height); this.system = d3.svg.diagonal(); } and use in method later on. treegenerator.prototype.generatetree = function () { var nodes = this.nodes; var links = this.links; //f...

python - Plotting histogram of brownian motion? -

Image
my task plot histogram of simulation of brownian motion. thankfully, i've made program simulates brownian motion, , plots on scatter plot function of time , distance. output looks like: however, need convert histogram, 5 different locations (e.g: histogram @ t=0,1,2,3,4). currently packages have numpy, mattplotlib, , scipy. have seen examples of how plot normal distribution, how plot distribution data have gathered? here code have far: http://pastebin.com/aepqdqd2 (since couldn't post 2 links, had paste both files together, first 1 one computation brownian motion , second 1 outputs graph on imgur link) this not homework, given credit problem, , instructor explicitly said allowed use whatever information can. thanks. use pylab.hist this, after calculating index of time point you're interested in, it : # -*- coding: utf-8 -*- import numpy pylab import plot, xlabel, ylabel, title, grid, show, hist, legend brownian import brownian #this code perfo...

c# - Deep cloning objects -

i want like: myobject myobj = getmyobj(); // create , fill new object myobject newobj = myobj.clone(); and make changes new object not reflected in original object. i don't need functionality, when it's been necessary, i've resorted creating new object , copying each property individually, leaves me feeling there better or more elegant way of handling situation. how can clone or deep copy object cloned object can modified without changes being reflected in original object? whilst standard practice implement icloneable interface (described here , won't regurgitate), here's nice deep clone object copier found on the code project while ago , incorporated in our stuff. as mentioned elsewhere, require objects serializable. using system; using system.io; using system.runtime.serialization; using system.runtime.serialization.formatters.binary; /// <summary> /// reference article http://www.codeproject.com/kb/tips/serializedobjectcloner.asp...

Google Charts - Category Filter Callback? -

is possible call function whenever option in category filter selected? the answer here i'm looking for, since i'm using google's api i'd assume can't access element's html , attach onchange() event. callback google docs mention setonloadcallback(), it's entire dashboard. any appreciated. thanks! this should possible statechange listener: function statechangehandler() { console.log("hello"); }; google.visualization.events.addlistener(**name-of-your-filter**, 'statechange', statechangehandler);

How to filter or drop a value based on the previous one using Deedle in C#? -

i dealing data sensors. these sensors have blackouts , brownouts, in consequence can have following kind of time series in frame, let's call "mydata": [7.438984; 0,000002; 7.512345; 0.000000; 7.634912; 0.005123; 7.845627...] because need 3 decimals precision, rounded data frame: var myroundeddata = mydata.columnapply((series<datetime, double> numbers) => numbers.select(kvp => math.round(kvp.value, 3))); i columns frame , filtered zeros "0.000": var myfilteredtimeseries = kvp in mytimeseries kvp.value != 0.000 select kvp; so, time series partially filtered: [7.439; 7.512; 7.635; 0.006; 7.846...] however, value "0.006" not valid! how implement elegant filtering syntax based on previous value, "percent limit" in rate of change: if (0.006 / 7.635) * 100 < 0.1 ---> drop / delete(0.006) if want @ previous/next value, can shift series 1 , zip original. give series of pairs (a value previous/next valu...

git - Removing files from repository while merging makes them disappear -

Image
here test repo demonstrating problem: https://bitbucket.org/vektor330/bugtest the sequence of events this: add initial commit. person adds conflict , source develop . person b adds conflict master . person b merges develop master , resolving conflict on conflict using "mine" strategy, , removing source repository. empty commit, can commited , pushed remote. the result is: source has disappeared repository. appeared in 7dfa23e, there log of appearing in repo, , quietly disappeared in 5080a24, without single trace. i expect commit 5080a24 show " source removed", wrong git or expectation? why wouldn't show "content of merge commit". you can visualize content of merge commit selecting merge commit , each of 2 parents in turn. when select (in sourcetree) 1 develop branch (in addition of merge commit), see files_to_lose/source have been removed: why commit not show missing file? because in case of merge co...

c# - how send-register works on mvvm light? -

i know how use/code sending , registering objects in mvvm light. not want ask curious happening behind scenes? searching on , couldnt find deep explanation. address pointing in memory. objects addressed somehow type or? mean how 1 class sends , others finds indicating type. can shed lights here please or link reference can read it? i think below links understand how register/subscription works in mvvm light. https://msdn.microsoft.com/en-us/library/ff921122.aspx http://brentedwards.net/2010/04/13/roll-your-own-simple-message-bus-event-aggregator/ i guess mvvm light using similar implementation. can see mvvm light messenger code here hope helps

c# - Make a Dropdownmenu with CSS -

Image
i make dropdownmenu, not easy, because working panels. menu. i've got nav= menu , got panel menu , 1 submenu. submenupanel not displayed default. wan't block comes down, when hover on pnlmenu. <div id="wrapper_menu"> <div id="menuicon"> <div class="menubar" id="menubar-top"></div> <div class="menubar" id="menubar-mid"></div> <div class="menubar" id="menubar-bottom"></div> </div> <nav id="menu"> <asp:panel id="pnlmenu" runat="server"></asp:panel> <asp:panel id="pnlsubmenu" runat="server"> <asp:contentplaceholder id="contentplaceholder1" runat="server"> </asp:contentplaceholder> </asp:panel> </n...

python - Remove a column of text -

i'm new python, have scripting experience in other languages. i'm trying write script reads text file data formatted this: 1 52345 2 53 3 -654 4 2342 and print out this: 52345, 53, -654, 2342, so want remove first column , whitespace , add comma @ end. this have far, seems i'm trying use string methods on file object. def remove_first_column(text): splitstring = text.split(' ') splitstring.pop(0) finalstring = " ".join( [item.strip() item in splitstring]) return finalstring def main(): print "type filename:" file_again = raw_input("> ") txt = open(file_again) line in txt.split("\n"): print(remove_first_column(line)) #py2.5 print remove_first_column(line) if __name__ == '__main__': main() i exception saying "attributeerror: 'file' object has no attribute 'split' yes, when open file using open func...

c# - How do I get the account name from UserPrincipal? -

i using active directory login in 1 of winforms applications. userprincipal object i'm not sure how proper accountname object? can see there samaccountname same account name states old versions of windows. how proper account name no mather old or new windows systems? this code use object if (adusername.length > 0) context = new principalcontext(contexttype.domain, adserver, null, adusername, aduserpassword); else context = new principalcontext(contexttype.domain, adserver); userprincipal.findbyidentity(context, account) samaccountname is "account name" used in windows before active directory introduced. it's "legacy" in has been supplemented additional info - "distinguished name" in ldap context etc. - is windows account name ("short name") - , it's still mandatory field new user being created - use it! see user naming attributes more details on name used in ad context.

Cassandra is not consistent despite QUORUM consistency level with replication factor 3 -

i have problem cassandras consistency. have 3 cassandra nodes (version 2.0.14.352) in cluster , reading , writting consistency level quorum , replicationfactor 3 . if understand this right in case cassandra should consistent, because 2+2>3. wrote test in java, insert data fast cassandra using datastax-driver: final instant t1 = instant.parse("2000-01-01t00:00:00.000z"); final instant t2 = instant.parse("2000-02-01t00:00:00.000z"); (int = 0; < 100; i++) { dataprovider.setvalue(t1, new double(1)); //if next line removed, test pass dataprovider.setvalue(t2, new double(3)); dataprovider.savetodb(); dataprovider.clear(); assertequals("i=" + i, new double(3), dataprovider.getvalue(t2)); assertequals("i=" + i, new double(1), dataprovider.getvalue(t1)); dataprovider.setvalue(t1, new double(2)); dataprovider.savetodb(); dataprovider.clear(); assertequals("i=" + i, new double(2), datap...

avaudiorecorder - iOS: Record audio below some certain frequency -

i working on app in have perform recording iphone's microphone, requirement record voice below frequency. other voice more frequency should not record. i know has many post on this, couldn't find helpful. i find frequency using code:- http://www.ehow.com/how_12224909_detect-blow-mic-xcode.html but getting trouble avoid frequency being recorded. can suggest me how or if lib/open source available. on appreciated. thanks in advance. first check if microphone of device can detect frequencies in band width. second ios comes amazing framework called accelerate here can find vdsp library (digital signal processing) functionalities: vector , matrix arithmetic fourier transforms convolution, correlation, , window generation accelerate efficient set of functionalities, powerful , performant. problem seems matter of filtering (mostly). here sample apple, using fourier transform .

sql - How to transform a MySQL table into another that has key value pairs? -

i have accomplish requirement in mysql, need convert regular table 1 key value pairs, unable find answers (i'm relatively new sql). i've been able find answers approach that's opposite of requirement though - here's sample . as part of database migration activity in project, source table looks this: mysql> select * employee; +------+-------+--------+ | id | fname | lname | +------+-------+--------+ | 1 | lex | luthor | | 2 | clark | kent | | 3 | lois | lane | +------+-------+--------+ 3 rows in set (0.00 sec) now, has converted table looks below: +----------------+-----------------+ | attribute_name | attribute_value | +----------------+-----------------+ | id | 1 | | fname | lex | | lname | luthor | | id | 2 | | fname | clarke | | lname | kent | | id | 3 | | fname | lois ...

json - executing for loop in javascript unsuccessful -

i have loop within javascript code , can't seem figure out why not executing. have console.log statements trying see whether variables capturing need them to. however, when run code, not see output console.log commands. there missing here? please see javascript code below: var strarry = []; for(var i=0; i<obj[0].srclanguagesentence.text; i++) { // create variables representing substrings of source language sentence var s1 = text.substring((obj[i].srclanguagesentence.roles[i].beginoffset - obj[i].srclanguagesentence.roles[i].beginoffset),(obj[i].srclanguagesentence.roles[i].beginoffset - 1)); var s2 = text.substring(obj[i].srclanguagesentence.roles[i].beginoffset,obj[i].srclanguagesentence.roles[i].endoffset); var s3 = text.substring(obj[i].srclanguagesentence.roles[i].endoffset,obj[i].srclanguagesentence.text.length); strarry.push(s1) strarry.push(s2) if(i == obj[0].srclanguagesentence.roles.length) { strarry.push(s3); } ...

ruby on rails - How to make page error404? -

please advice. userscontroller: class userscontroller < applicationcontroller before_action :set_user, only: [:show] ........ ......... def show ...... end private def set_user @user = user.find_by_id(params[:id]) render_404 unless @user end end applicattioncontroller: class applicationcontroller < actioncontroller::base before_action :set_locale protect_from_forgery with: :exception private def render_404 render file: "public/404.html", status: 404 end end at http://localhost:3000/users/24/ see page user. at http://localhost:3000/users/24242424/ see page error404. at http://localhost:3000/qwertyghjfd see error message: routing error no route matches [get] i need @ http://localhost:3000/qwertyghjfd saw page error404 in applicationcontroller call render_404 when there routing error rescue_from actioncontroller::routingerror, :with => : render_404

css - Change individual column widths when using DataTables jQuery plugin -

i using datatables here . have made table database. want change width of each column in terms of percentage. relative code or example can me? <table id="example" cellspacing="0" width="100%"> <thead> <tr> <th width="60%">name</th> <th width="40%">position</th> </tr> </thead> <tbody> <tr> <td width="60%">abc</td> <td width="40%">def</td> </tr> <tr> <td width="60%">xyz</td> <td width="40%">zyx</td> </tr> </tbody> </table> according documentation can following: $('#example').datatable( { "columns": [ { "width": "60%" }, { "width": "40%" }, ...

magnific popup autoplay slideshow -

i using magnific popup popup image slideshow. below have done. $('.parent-container').magnificpopup({ type:'image', delegate: 'a', gallery: { // options gallery enabled: true }, image: { // options image content type titlesrc: 'title' } }); and html markup <div class="parent-container"> <ul class="row carousel-inner" style="margin:0; padding:0; background:red;"> <li class="active item gallery-photo" style="margin:0; padding:0; background:red;"> <a href="images/gallery-1.jpg" title="image title here"><img class="img-responsive" src="images/gallery-1.jpg"></a> </li> <li class="item"> <a href="images/gallery-2.jpg" title="image title here"><img class="img-responsive" src="images/gallery-2.jpg"></a...

ios - searchDisplayController dim view stays after first search -

i using searchdisplaycontroller search functionality. on click of search button, folowing thing: [mysearchbar becomefirstresponder]; first time, works fine. following in searchdisplaycontrollerdidendsearch (which called on cancel button event) - (void)searchdisplaycontrollerdidendsearch:(uisearchdisplaycontroller *)controller { [mysearchbar resignfirstresponder]; } now, on cancel button press, search bar hides also. till moment works fine. when second time press search icon, search bar opens , even-though type text , search results, dim view stays there. i don’t know problem. tried lot not found issue. please me. stuck @ point. thanks in advance !!! i solved !!! actually making tiny mistake in order hide/show tableview of search display controller following: -(ibaction)searchbutton_action:(id)sender { // // self.searchdisplaycontroller.searchresultstableview.hidden = false; // // } we should not on our own programatically beca...