Posts

Showing posts from September, 2011

eclipse - Getting started with a cross platform C++ project -

eclipse - Getting started with a cross platform C++ project - i starting c++ project compile as in eclipse (linux) , vs2010 same repository , utilize help getting started. while many of aspects can individually google'd, hoping advice on how approach problem on whole. for example, maintain library sources, how construction create file, , how integrate googletest (finding novice tutorial on googletest lone hard). link tutorial addresses these aspects great, or series of tutorials help. my background in c# , i'm trying maintain "cleanness" , organization of vs projects. i have done cross platform projects used "native" build systems on both platforms (vsproj files on windows , makefiles on linux), pain maintain both project files. so, yes, agree other suggestions should seek start solid cross platform build utility. cmake or perchance boost build seem decent options - there many others. when comes 3rd party libraries, you'll wan...

xaml - How to access Generated WPF controls after Data Binding -

xaml - How to access Generated WPF controls after Data Binding - please consider next xaml code: <listbox name="listbox1" itemssource="{binding}" > <listbox.itemtemplate> <datatemplate> <border name="border1"> <textblock text="{binding}" /> </border> </datatemplate> </listbox.itemtemplate> </listbox> and assign simple array it: listbox1.datacontext = new[] { "a", "b", "c" }; now question how can access generated objects border (or textblock instances)? it not possible "border1". not exist. listbox1.itemcontainergenerator.containerfromindex(0) returns listboxitem content of listboxitem of type string. findname("border1") returns null update: expect find 3 instances of border (and 3 textblocks, 1 in each border). once listboxitem, need walk visual tree...

java - How to create a generic JavaFX XYChart with Number or String Axes? -

java - How to create a generic JavaFX XYChart with Number or String Axes? - now work javafx charts, need create generic class each chart type. example, need create scatterchart can create class scatterchart x = number , y= number axes, x = string , y = number axes, x = number , y = string axes or x = string , y = string, see mandatory define type of chart before work it, , not possible alter types of axes @ same chart. i tried create this, methods manipulate info not work: public class jfxpanelscatterchartns extends jfxpanel.... ..... private scatterchart chart; ....... public jfxpanelscatterchartns(string[] xaxiscategories, string[] yaxiscategories ){ if(xaxiscategories != null && yaxiscategories != null){ xaxiscategory = new categoryaxis(fxcollections.observablelist(arrays.aslist(xaxiscategories))); yaxiscategory = new categoryaxis(fxcollections.observablelist(arrays.aslist(yaxiscategories))); chart = new scatte...

batch file - ( goto was unexpected this time error -

batch file - ( goto was unexpected this time error - my code below throwing error.please help.i new batch file scripts.it showing syntax error , (goto unexpected time error. motive create batch file take parameter user.based on parameter, perform tasks. if input sql, execute sql script.if input foldercreation, create new folder. @echo off cls set /p filetype=type of file : if "%filetype%==sql" (goto sql) if "%filetype%==txt" (goto text) if "%filetype%==bat" (goto bat) if "%filetype%==foldercreation" (goto foldercreation) if "%filetype%==ftp" (goto ftp) :sql set /p sname=server name : set /p dbname=database name : if exist _deploy.txt del _deploy.txt @echo on sqlcmd -s %sname% -e -d %dbname% -i -i "d:\script\execute_script.sql" >>_deploy.txt 2>&1 @notepad _deploy.txt exit /b :text if exist _deploy.txt @echo on move /-y "d:\artifacts\art1\test1.txt" "d:\artifacts\art2\">>_deplo...

SAS stored processes in HTML -

SAS stored processes in HTML - how html able understand output , run sas stored processes ? i understand if have "sas integration technologies" there module within software uses java instruct html talk stored process server, true ? apparently code work , run stored process requested user. <!-- welcome page mywebapp --> <html> <head><title>welcome mywebapp </title></head> <body><h1>welcome mywebapp</h1> <form action="/sasstoredprocess/do"> please come in first name: <input type="text" name="fname"><br> <input type="hidden" name="_program" value="/webapps/mywebapp/ask color"> <input type="submit" value="run program"> </form> </body></html> you need have metadataserver , stored process webapplication. if these nowadays in environmen...

scroll - Keep the JavaScript loading even on scrolling -

scroll - Keep the JavaScript loading even on scrolling - i building chrome extension loads javascript place image in front end of tweets urls. code below achieves desirable, on scrolling page urls arent marked. any thought on this? linkslist=document.body.getelementsbyclassname("js-display-url"); var i=0; (var index=0;index<linkslist.length;index++) { console.log(linkslist[index]); arrayoflinks[i]=linkslist[index].getattribute("data-expanded-url") ; linkslist[i].innerhtml=linkslist[i].innerhtml+"<img src='"+chrome.extension.geturl("green.png")+"' alt='green'/>"; i++; } javascript scroll

javascript - Supressing or resolving compiler errors in goog.base -

javascript - Supressing or resolving compiler errors in goog.base - i utilize closure compiler on sources , decided enable strict mode via --jscomp_warning=reportunknowntypes . alas, triggered lot of warnings within goog.base itself! i've fixed problems in own code , i'm looking way silence/remove errors in closure library code. i tried prepare errors in base.js realized it's infeasible. there approximately 108 errors in file , in cases real errors becasue of goog.base doesn't care much types: it's mutual practice there define type {?} or {*} . i tried utilize --warnings_whitelist_file quiet warnings don't care didn't work either. error: ..\js\google\base.js:204: warning - not determine type of look cur[part] = opt_object; ^ i tried different forms in whitelist file none has worked: ..\\js\\google\\base.js:204 not determine type of look ..\\js\\google\\base.js:204 warning - not determine type of look ..\js\google\ba...

javascript - Move a list item from left to right or right to left updating data-attribute -

javascript - Move a list item from left to right or right to left updating data-attribute - this in reference of question "reorder list elements - jquery?" asked here now want move little further. wanting do, wanting build comparing product items ecommerce. so, here find reordering list item. want add together 2 button in each list item named "left" , "right", though here have shown 1 i.e "right". on clicking the "right" button "data-sortby" value update +1 , list move right i.e. in next position , next positioned list item reorder it's previous position. in short side side motion of li items. so html below:[just added buttons] <ul id="ulname"> <li data-sortby="1">three <a href="javascript:;" class="rgth" >right</a></li> <li data-sortby="2">one<a href="javascript:;" class="rgth" >right</a> ...

android - gradle buid failed with Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead -

android - gradle buid failed with Cannot cast object 'null' with class 'null' to class 'int'. Try 'java.lang.Integer' instead - i utilize gradle -s build trace eroor , below trace log caused by: org.codehaus.groovy.runtime.typehandling.groovycastexception: cannot cast object 'null' class 'null' class 'int'. seek 'java.lang.integer' instead @ com.android.build.gradle.internal.dependency.dependencychecker.getapilevelfrommavenartifact(dependencychecker.groovy:99) @ com.android.build.gradle.internal.dependency.dependencychecker.excluded(dependencychecker.groovy:38) @ com.android.build.gradle.internal.dependency.dependencychecker$excluded.call(unknown source) @ com.android.build.gradle.baseplugin.adddependency(baseplugin.groovy:3399) @ com.android.build.gradle.baseplugin$_adddependency_closure191.docall(baseplugin.groovy:3417) @ com.android.build.gradle.baseplugin.adddependency(baseplugin.groovy:3415) @ com.android.bu...

css - How can I use Sass to style the top bar dropdown menu divider? -

css - How can I use Sass to style the top bar dropdown menu divider? - how can utilize sass style topbar dropdown menu divider (shown black line in image below)? this portion in _setting.scss seems apply vertical menu dividers: // divider styles $topbar-divider-border-bottom: solid 1px scale-color($topbar-bg-color, lightness: 13%); $topbar-divider-border-top: solid 1px scale-color($topbar-bg-color, lightness: -50%); the code below sass variables beingness used style of divider. // divider styles $topbar-divider-border-bottom: solid 1px scale-color($topbar-bg-color, lightness: 13%); $topbar-divider-border-top: solid 1px scale-color($topbar-bg-color, lightness: -50%); you'll need find actual class '.divider' beingness defined , update styles there. css sass zurb-foundation

sql - Create a view to merge all data from 2 tables -

sql - Create a view to merge all data from 2 tables - tables , b have n columns same name (common columns), each table has own special columns - table has x additional columns , table b has y additional columns. column1* - db-wide unique id, rows in tables , b cannot merged. need create viewab include info in tables , b. we tried union (but puts info different columns single column if not name columns), total outer bring together did not help because in view see mutual columns appear twice (i.e. column1 , column1_1 etc). ideal solution create query in not need name mutual columns (there lot), fine if have them named. see image how see our info (http://imgur.com/u2zt98g). please, find below scripts set tables , b. --tablea create table tablea ( common1 varchar2(50), common2 varchar2(50), common3 varchar2(50), a1 varchar2(50), a2 varchar2(50), a3 varchar2(50), constraint common1_pk primary key (common1) ); insert tablea (common1, common2, common3...

.net - Hash code in Dictionary -

.net - Hash code in Dictionary<TKey, TValue> - i playing around dictionary , stumbled across below scenario public class myobject { public string { get; set; } public string j { get; set; } public string k { get; set; } public override int gethashcode() { int hashcode = (i+j+k).gethashcode(); debugger.log(9, "info", hashcode.tostring() + system.environment.newline); homecoming hashcode; } } class programme { static void main(string[] args) { myobject obj1 = new myobject() { = "hello", j = "world" }; myobject obj2 = new myobject() { = "hello", j = "world" }; dictionary<myobject, string> collection = new dictionary<myobject, string>(); collection.add(obj1, "1"); var result = collection[obj2]; // keynotfound exception here. } } i have myobject class acts key dictionary , override gethashcode method ...

java - Optimistic locking on merge operation using JPA -

java - Optimistic locking on merge operation using JPA - i have production code running past 2 years. have noticed there concurrency issue in update operation. using jpa orm. in update request using this.entitymanager.merge(entity); now want utilize optimistic lock avoid concurrency. have done searching in google. think next take care this.entitymanager.lock(entity, lockmodetype.optimistic); here uncertainty need @version in table. guess client won't agree in adding column now. can tell me there improve way handle scenario. well, in jpa, no. jpa uses version column maintain it's consistency , there doesn't appear way around that. in hibernate there semantics around this: optimistic-lock = ‘all’ when set optimistic-lock attribute on element in hibernate mapping file value ‘all’, telling hibernate check no column in associated row has changed since persistent object retrieved , before updating row in database. read more: http://www.i...

entity framework 6 - How to use EF Migrations with Amazon RDS? -

entity framework 6 - How to use EF Migrations with Amazon RDS? - i'm trying understand if ef automatic migrations possible when using rds sql server. have line of code in query object database.setinitializer(new dropcreatedatabasealways<userdbcontext>()); except fail on rds database in use. or should stick manual updates? entity-framework-6 amazon-rds

Wix Installer Registry Key Always Returns 1 -

Wix Installer Registry Key Always Returns 1 - good afternoon, trying check specific registry key. if key exists, want display message application needs removed prior continuing installation. if key doesn't exist, installation should continue. know upgrade elements , such, in case not applicable due company's construction . have: <product id="b93715aa-ab42-426d-b47e-5f0370bba259" name="myapp" language="1033" version="20.2.0.0" manufacturer="mycompany" upgradecode="c2d873b4-6160-4d6a-91b7-9cb7193bbddf" > <package installerversion="500" compressed="yes" installscope="permachine" /> <majorupgrade downgradeerrormessage="a newer version of [productname] installed." /> <mediatemplate embedcab="yes" /> <property id="arpsystemcomponent" value="1" /> <property id="testproperty" secure="yes...

PowerShell - Connecting to Azure Active Directory using Microsoft Account -

PowerShell - Connecting to Azure Active Directory using Microsoft Account - i have azure subscription subscription administrator business relationship microsoft account. added microsoft business relationship co-administrator. i'm told when add together co-administrator, gets added subscription's default advertisement guest user. want accomplish alter user type guest member . this, advised utilize azure advertisement powershell , struggling. i've installed related ps modules (based on link: https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx). so here's doing: first, command issuing: $msolcred = get-credential i prompted entering credentials provide , run next command: connect-msolservice -credential $msolcred when this, next error: connect-msolservice : user name or password incorrect. verify user name, , type password again. @ line:1 char:1 + connect-msolservice -credential $cred -verbose + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...

jsf - Primefaces Push not work after deploy but work after restart glassfish 4.1 -

jsf - Primefaces Push not work after deploy but work after restart glassfish 4.1 - i have jsf project uses primefaces push. when bundle war file , deploy glassfish 4.1, force desn't work, <p:socket onmessage="handlemessage" channel="/mychannel" /> there chart page , when other event occurs, below code runs. eventbus eventbus = eventbusfactory.getdefault().eventbus(); eventbus.publish("/mychannel", map); the expected updating chart info map's data. above code runs expected if restart server after deployment. if redeploy or (undeploy , deploy) project. chart not updated eventbus anymore. comet back upwards , websocket back upwards enabled on glassfish. any idea? jsf primefaces glassfish push primefaces-push

algorithm - Optimize (parallelize) execution of my "virtual machine" model -

algorithm - Optimize (parallelize) execution of my "virtual machine" model - suppose have simple "virtual machine" model keeps queue of instructions in 1 of next formats: unary_opcode, in_address, out_address binary_opcode, in1_address, in2_address, out_address where addresses integers array of memory units. is there well-known algorithm analyzes sequence of instructions , tries parallelize them much possible without: producing different result sequential execution. data race. if instruction before instruction b in list, , ((b reads 1 of a's writes) or (b , have same write address) or (b writes 1 of a's reads)), add together directed border b a. note graph dag, since instructions in specific order. now calculate "layer" of instruction as: instructions no outgoing edges layer 1. instructions outgoing edges layer n , below layer n+1. obviously, if instruction has outgoing border instruction layer isn't known yet, do...

ACF plugin - Wordpress: Not saving sets of sub fields in a repeater when I have several sets (about >150) -

ACF plugin - Wordpress: Not saving sets of sub fields in a repeater when I have several sets (about >150) - i have wordpress site , i'm using acf plugin. in 1 of posts have repeater field lot of sets of sub fields. have problem when have lot of these sets (about 150) in post , seek update post adding more sets. times post remains equals, without new sets. , times sets (not new ones) removed post , new sets not saved. i've made changes on server through php.ini, problem still remains: max_input_vars = 3000 max_input_nesting_level = 128 max_input_time = 300 max_execution_time = 150 post_max_size = 32m any thought on how prepare it? thanks. i fixed it. i had php.ini in root folder. moved wp-admin folder , works. if php.ini in root folder, changes in php.ini aren't applied wordpress back-end. wordpress acf

How to add a profile and Sending and receiving messages to an android app -

How to add a profile and Sending and receiving messages to an android app - hello , have awesome week. first of, built android app 3 months ago after next android tutorial because have no experience in programming. however, question possible me create update on app? example, user can add together , un-add friends, can send , view video or image. how can create user profile in order create user able update info , alter profile pic. want know how start conversation user because when click on friend on friends list nil happening, want start conversation if did so. clarify, want user able start conversation fellow member on friends list. second, want user have profile within ability add together personal images if he/she wants. see pic below. enter link description here enter link description here android

apache - Laravel 5 not seeing Contact page -

apache - Laravel 5 not seeing Contact page - im new laravel. i have set httpd-vhosts.conf <virtualhost *:80> documentroot "e:\laravel\learning-laravel-5\public" servername laravel5 <directory "e:\laravel\learning-laravel-5\public"> allowoverride require granted </directory> </virtualhost> and hosts file 127.0.0.1 laravel5 ::1 laravel5 okay, in browser when come in laravel5 in adress bar, laravel 5 welocome screen. i set root contact in routes.php route::get('contact', 'welcomecontroller@contact'); and in welcomecontroller.php controller file have created method route this. public function contact() { homecoming 'hello mo'; } entering http://laravel5/ gives me laravel5 welcome screen but. on entering next in browser address http://laravel5/contact i presented screen has got how virtualhost set up? make s...

python - Open text file and search on OS X -

python - Open text file and search on OS X - i open text file , search string , highlight it. i use: command ="open "+'"'+ file +'"' os.system(command) but want like: command ="open "+'"'+ file +'"' + "then"+ "ctrl-f(string)" obviously doesn't work, there way this? want text in string highlighted normal ctrl+f. you're on right track open ; utilize ⌘+f (i'm assuming you're on os x tags), can utilize applescript tell the system events application perform keystroke: os.system("open " + filename) # may need add together sleep() here if application not open , hence needs time load os.system("""osascript -e 'tell application "system events" keystroke "f" using {command down}'""") os.system("""osascript -e 'tell application "system events" keystroke \"...

php - Disable autoloader from trying to load JsonSerializable -

php - Disable autoloader from trying to load JsonSerializable - i have next setup in library within codeigniter: class datamodelautoloader { public function __construct() { spl_autoload_register(array($this, 'loader')); log_message('debug', 'qr-invited autoloader initialized'); } public function loader($classname) { log_message("debug", "accessing loader class: " . $classname); if (substr($classname, 0, 9) == 'datamodel') { $fullyqualifiedpath = apppath.str_replace('\\', directory_separator, $classname).'.php'; log_message('debug', 'fully qualified path is: ' . $fullyqualifiedpath); require apppath.str_replace('\\', directory_separator, $classname).'.php'; } } } now, 1 of info models, invite , in datamodel/invite.php getting loaded, it's defined as: class invite impl...

javascript - indexOf() == -1 doesn't seem to work when pushing to an array -

javascript - indexOf() == -1 doesn't seem to work when pushing to an array - i have array filtered/searched when type input box. when nail homecoming input text appended array. great , works. what not working $scope.list.indexof() == -1 supposed stop me entering duplicates. not work. where going wrong? html <!doctype html> <html ng-app="bgapp"> <head> <title>list & tag</title> <!-- latest compiled , minified css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <!-- local css --> <link rel="stylesheet" type="text/css" href="./static/css/dev-style.css" /> </head> <body> <div ng-controller="listcontroller"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 div-title"> <div class="col-xs-6 col-...

php - Can't get the javascript to emulate a post -

php - Can't get the javascript to emulate a post - i have next javascript function submitform(formid) { document.forms[formid].submit(); } function submitform_with_value(eleid,ipvalue,formid) { var ele = document.getelementbyid(eleid); ele.value = ipvalue; submitform(formid); } and phone call onchange event so submitform_with_value("upload","upload","frmupphoto") the input's id ' upload ' form id ' frmupphoto ', , expecting value upload in post. works execpt $_post in php null. $_files has file details. what have in post ? couple of things here: your $_files variable beingness populated because have form "enctype" attribute set "multipart/form-data" - used file uploads. the $_post variable gets populated input field's "name" attribute, not "id". javascript php post submit

Swift: what's the difference between Array() and [OtherModule.MyType]() -

Swift: what's the difference between Array<OtherModule.MyType>() and [OtherModule.MyType]() - i'm using type different module, let's phone call othermodule.mytype, this code: var = [othermodule.mytype]() will produce error invalid utilize of '()' phone call value of non-function type '[mytype.type]' this code won't: var ax = [othermodule.mytype] but believe ax not array more, since code ax.append(othermodule.mytype()) will cause error cannot invoke 'append' argument list of '(mytype)' so wonder ax is? besides, code works fine: var ay = array<othermodule.mytype>() ay.append(othermodule.mytype()) update: i'm using swift 1.2 xcode 6.3 for reason best known swift team (modules scantly documented), module.thing behaves differently thing . while int type name: let i: int = 1 // fine // not fine, "expected fellow member name or constructor phone call after type nam...

c# - Getting the link for a virtual directory -

c# - Getting the link for a virtual directory - i have written server in c# js client. solution consists restapi bl , dal. the bl creates links images stored on virtual directory, on server. js , server code, stored in same directory. when build string of link utilize line of code: string keyimagename = settings.default.serverurl + settings.default.keyimagesfolder + relatedfinding.keyimagepath;` where keyimagefolder virtual directory. it works fine, problem website has multiple amazon instances, 1 each geographical zone , every time deploy, need alter ip in settings.it's annoying. is there way virtual directory's url, each machine? if js installed on same machine server, need total path? many thanks first, you'll need physical path file or directory want generate url for. can done within page object using request.applicationpath. next, path can converted url path using server.mappath function. take business relationship if there mo...

information retrieval - How to apply topic modeling? -

information retrieval - How to apply topic modeling? - i have 10000 tweets 5 topics. assume know ground truth (the actual topic of each tweet) , grouping tweets 5 documents each document contain tweets particular topic. apply lda on 5 documents number of topics set 5. in case topic words. now if don't know ground truth of tweets, how create input documents in way lda still give me topic words describing 5 topics. what if create input documents randomly selecting sample of tweets? if ends similar topic mixtures input documents? should lda still find topic words in case of 1st paragraph? if understand correctly, problem topic modeling on short texts (tweets). 1 approach combine tweets long pseudo-documents before training lda. 1 assume there 1 topic per document/tweet. in case don't know ground truth labels of tweets, might want seek one-topic-per-document topic model (i.e. mixture-of-unigrams). model details described in: jianhua yin , jianyong wang. 2014....

C# - Outlook - get access to a new calendar -

C# - Outlook - get access to a new calendar - i trying read calendars have in outlook c#, have problem getting access ones create within outlook (right click -> new calendar). i'm trying them by: outlook.application app = new outlook.application(); outlook.namespace ns = app.getnamespace("mapi"); outlook.mapifolder folderss = ns.getdefaultfolder(outlook.oldefaultfolders.olfoldercalendar); or by: application.session.stores but none of them holds new calendar. do have thought how reach them? calendars folders defaultitemtype olitemtype.olappointmentitem . can created in of outlook stores on level of folder hierarchy. assuming calendar created in root folder of 1 of stores , next c# code find it: void findmycalendar(string name) { string path = null; outlook.application app = new outlook.application(); outlook.namespace ns = app.getnamespace("mapi"); // there may more 1 store ...

c# - How to store the results in a database to see history results -

c# - How to store the results in a database to see history results - i making game people hear determine whether black or white. want store how many times got right , how many times got wrong in database can see old results. what kind of database (like sqlite) should use? how should save info , display later? you can utilize binaryserializtion, xmlserialization,...... so first create class: [serializable] public class result { public int timesright {get;set;} public int timeswrong {get;set;} } now in game: result result = new result(); result.timesright = x; //value of times right result.timeswrong = y; //value of times wrong now take way want save it, here references binary , xml serialization: binary serialization xml serialization c# database

loops - Insert a variable number of rows -

loops - Insert a variable number of rows - currently, macro running insert constant number of rows: %macro add_period; %do p = 1 %to 39; would able modify macro or create new macro run this, not 39 times, replace number of loops variable have table? thank you! use call symput turn variable(my_var) macro variable(loop_var) data _null_; set your_table; phone call symput("loop_var", my_var); run; and utilize & resolve macro variable code %macro add_period; %do p = 1 %to &loop_var; you pass macro variable parameters macro. %macro add_period(loop_var); loops macros sas datastep

bdd - Specflow Options in context menu is greyed out in Visual studio -

bdd - Specflow Options in context menu is greyed out in Visual studio - i using specflow write test in bdd style format. unfortunately today morning in visual studio, not able see options create step files. f12 not working. statements not have step file definition in violet previously. today in black though there no step file definition. please see attachment please help me missing thanks sounds me have not got specflow visual studio extension installed. are on same machine? have disabled extensions? visual-studio-2012 bdd specflow specrun

ant - Error when trying to run Cocos2d-JS project on Android -

ant - Error when trying to run Cocos2d-JS project on Android - the error in part: running: '"c:\apache-ant-1.9.4\bin\ant" clean debug -f c:\users\robert\desktop\n ormero\games\aztec\frameworks\runtime-src\proj.android\build.xml -dsdk.dir="c:\a ndroid-sdk"' filename, directory name, or volume label syntax incorrect. error running command, homecoming code: 1 i'm running: cocos run -p android on windows 7 64bit. have googled i'm stumped. i'm not genius in java nor android, hence utilize cocos js. edit: pointed out me dot (.) in proj.android might causing issue. way can prepare easily? edit2: happens during compile, weird thing is, can execute command says errors on, , goes build succesful. your python version not suitable. reinstall python 2.7.5 , work =) android ant cocos2d-js

android - Background images zoom in and out -

android - Background images zoom in and out - i working on mapping android application. map utilize in application image, how can create interactive? want map interactive, can plot location image. possible create ? using android studio. android

c# - Programming for Linux environment using visual studio and MONO -

c# - Programming for Linux environment using visual studio and MONO - before writing have gone through many articles, dint find steps follow. found plugin 'monohelper'. requirement build application using visual studio linux environment console application, on using webclient connecting net . not familiar linux environment. can share steps need follo process ahead visual studio , c# . it much easier mono , monodevelop installed on typical linux disto using xamarin's feed, http://www.mono-project.com/download/#download-lin and 1 time that's done, can follow steps such as http://anh.cs.luc.edu/170/notes/csharphtml/lab-monodevelop.html forget visual studio temporarily, won't quite want @ beginner level without learning much of linux , mono. after playing mono few weeks , noticing differences, can see visual studio can help. c# linux visual-studio-2013 mono

java - Strange char after reading from txt file -

java - Strange char after reading from txt file - i have txt file 3 rows of integers, after adding them list i'm finding unusual char @ origin of first index. used inputstream, bufferedreader , stringbuilder read file. tried debug using println() statements @ several places still can't figure out char came from. file selectedfile = filechooser.getselectedfile(); inputstream = new fileinputstream(selectedfile); bufferedreader reader = new bufferedreader(new inputstreamreader(inputstream)); stringbuilder out = new stringbuilder(); string line; while ((line = reader.readline()) != null) { out.append(line); items.add(line); } when seek re-create output printing out list items post somehow char i'm talking not show, i'll post screenshot instead: http://imgur.com/gjaf3no http://imgur.com/jha...

javascript - JS - How to get the correct val of a map? -

javascript - JS - How to get the correct val of a map? - on load create map, key anker-element , value offset of anker. unfortunately cannot read out val correctly, returns value of lastly key. wrong? js fiddle html <a>anker</a><a>anker</a><a>anker</a> js var ankers = {}; $('a').each(function(){ var pos = $(this).offset().left; ankers[$(this)] = pos; }); $('a').click( function(e) { e.preventdefault(); alert(ankers[$(this)]); }); javascript objects, you're using map here back upwards string keys (like objects in other languages). if want actual map should utilize map object instead if you'd utilize object key - work in new browsers, can (polyfill though): var ankers = new map(); $('a').each(function(){ var pos = $(this).offset().left; ankers.set($(this), pos); }); $('a').click( function(e) { e.preventdefault(); alert(ankers.get($(this)); }); f...

c# - Trying to find object roots using CLR MD -

c# - Trying to find object roots using CLR MD - here class namespace mynamespace { public class myclass { private byte[] imagebytes = null; public myclass() { } public void loadimage(string filepath) { image img = image.fromfile(filepath); using (memorystream mstream = new memorystream()) { img.save(mstream, img.rawformat); imagebytes = mstream.toarray(); } } public void removeimage() { imagebytes = null; } } } and how used static void main(string[] args) { myclass mc = new myclass(); mc.loadimage(@"c:\images\myimage.jpg"); console.writeline("take process dump now..."); console.read(); mc.removeimage(); } i run programme , take process snapshot. no surprise, here found references of myclass. 0:000> !dumpheap -type myclass ...

shell - sed positional replacement with regular expression -

shell - sed positional replacement with regular expression - i have string select dateadd(dd,-90, max(col_name)) table_123_name and want output select max(col_name) -90 table_123_name i have tried cat test.txt|sed "s/dateadd(dd,//i g"|sed 's/\(\[select\]\)\([ \s\t]*\)\([0-9-]*\)\(\[,\]\)\([ \s\t]*\)\([a-za-z0-9(_]*[)]*\)/select \6)\3/i g' but regular look replace not working you this, $ echo 'select dateadd(dd,-90, max(col_name)) table_123_name' | sed 's/dateadd(dd,\([^,]*\), *\([^) ]*)\)) *\(.*\)/\2 \1 \l\3/gi' select max(col_name) -90 table_123_name i modifier @ lastly helps case-insensitive match , \l\3 turns chars nowadays within 3rd capturing grouping lowercase. shell sed

Track Source and match earnings in adsense -

Track Source and match earnings in adsense - we have been buying ads different sources, , want see how much create money spent using google adsene, there way trap source , generate report. there limitation of custom channel 200, not fly :( adsense-api

iphone - how to make a phonegap app load a url in page without opening it with safari -

iphone - how to make a phonegap app load a url in page without opening it with safari - how possible using html/js create iphone native app build phonegap or other html based app makers load url in navigation controller without leaving app. (sort of fb iphone app) you can utilize plugin in xcode project. 1 created guys on phonegap team address situation desribe. chec out code in http://github.com/purplecabbage/phonegap-plugins/tree/master/childbrowser. allows 'spawn' new controller (from basic phonegap native app) pops , has browser in controller. button allows user 'close' view , homecoming native app. iphone

Eval inline ruby inside a markdown document -

Eval inline ruby inside a markdown document - i need phone call helpers markdown view. somehow practice , supported on popular ruby-based markdown parsers? no, isn't. markdown standardized, text-focused, cross-language format , of markdown parsers offers back upwards standard syntax. however, platforms need advanced features, such wiki , github, adds custom features. mutual features, tags generate page toc based on document structure. afaik, not bluecloth nor rdiscount offers built-in back upwards extensions. have code them before passing markdown text processor. ruby markdown inline-code

swing - JFrame not showing JPanel and other widgets in Java -

swing - JFrame not showing JPanel and other widgets in Java - so here's code, i'm still newbie in gui java (just started week). understand, create jframe, add together jpanels to, on panels can add together widgets jradiobutton etc. import java.awt.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.*; public class binary extends jframe{ private jlabel header; private jtextfield userinput1; private jbutton doit; private jbutton clear; private jradiobutton binary, decimal; private jlabel number2; private jframe frame1; private jpanel panel1; private jpanel panel2; public binary(){ super("number converter"); frame1 = new jframe("binary decimal converter"); frame1.setlayout(new flowlayout()); frame1.setdefaultcloseoperation(jframe.exit_on_close); frame1.setsize(250,500); frame1.setvisible(true); panel1 = new jpanel(); panel1.setsize(250, 450); frame1.add(panel1); h...

java - findFirstVisibleItemPositions doesn't work for recycleview android -

java - findFirstVisibleItemPositions doesn't work for recycleview android - i have code: mrecycleview.setonscrolllistener(new recyclerview.onscrolllistener() { @override public void onscrolled(recyclerview recyclerview, int dx, int dy) { super.onscrolled(recyclerview, dx, dy); int[] firstvisibleitempositions = new int[getresources().getinteger(r.integer.news_numbers_column)]; int pastvisiblesitems = ((staggeredgridlayoutmanager)getlayoutmanager()).findfirstvisibleitempositions(firstvisibleitempositions)[0]; } }); when scroll recycleview error: java.lang.nullpointerexception: effort invoke virtual method 'int android.support.v7.widget.orientationhelper.getstartafterpadding()' on null object reference @ android.support.v7.widget.staggeredgridlayoutmanager$span.findonevisiblechild(staggeredgridlayoutmanager.java:2177) @ android.support.v7.widget.staggeredgridlayoutmanager$span.findfirstvisibleitemposition(staggeredgridlayoutm...

c# - Deserialize array of json objects with json object inside -

c# - Deserialize array of json objects with json object inside - how can deserialize array of json objects in c#? here's json: [{"id":"255521115", "user":"username","userinfo":{"id":"158","online":"false"}}] i have code username: [jsonproperty("user")] public string username { get; set; } how can values of userinfo? want online value within userinfo object. there 1 cool feature in vs2013. if re-create json clipboard , in visual studio click edit -> paste special -> paste json classes generate class construction you. need rename properties if want to. in case modified version of classes be: public class obj { public string id { get; set; } [jsonproperty("user")] public string username { get; set; } public userinfo userinfo { get; set; } } public class userinfo { public string id { get; set; } public string onl...

javascript - Alternatives to document.createElement to fire pixels (request image) because of inconsistent results -

javascript - Alternatives to document.createElement to fire pixels (request image) because of inconsistent results - i have js script on server fire tracking pixel , serve appropriate file. the 3rd party loads script source, , calls "getfile( { ... } ) function on click of site. in js utilize this, not getting consistent results safari mac, pc, , ie (various). seems not loading properly. function getfile(options){ if ( (!options.email) || (!options.ref3) || (!options.ref4)){ homecoming false; } downloadapp(); var url="http://www.example.com/mysrc?image=1"; (var f in options) { url=url+"&"+f+"="+encodeuricomponent(options[f]); }; var oimg=document.createelement("img"); oimg.setattribute('src', url); oimg.setattribute('alt', 'na'); oimg.setattribute('height', '1px'); oimg.setattribute('width', '1px'); doc...

Match and find the earliest value in R -

Match and find the earliest value in R - i have 2 tables, 1 sales history, other key clients. the sales history table looks this(contains 500,000 rows): client no. transaction date sales amount abc 1/12/2014 100 def 2/28/2014 200 hij 3/01/2014 300 abc 2/18/2014 400 abc 5/26/2014 500 xyz 7/15/2014 600 def 8/23/2014 700 hij 9/19/2014 800 and key clients table looks this: client no. abc def xyz now want r that, based on key clients table, need create new table matching earliest sales amount sales history table. desired results looks this: client no. earliest sales amount abc 100 def 200 xyz 600 i recommend using data.table s binary join, utilize...

javascript - How to get random light color -

javascript - How to get random light color - this question has reply here: random color generator in javascript 33 answers i want randomly generate color hex code javascript. color needs lite plenty place black font on it. what best way ensure lite color beingness generated? help limit letters in next function? function getrandomcolor() { var letters = '0123456789abcdef'.split(''), color = '#'; for(var = 0; < 6; i++ ) { color += letters[math.floor(math.random() * 16)]; } homecoming color; } this stack answer seems work you. 1 such reply uses: var randomcolor = (function lol(m, s, c) { homecoming s[m.floor(m.random() * s.length)] + (c && lol(m, s, c - 1)); })(math, '3456789abcdef', 4); js fiddle reply above. edit: alter line alter how light/dark you...

jestjs - Jest testing of react-router -

jestjs - Jest testing of react-router - i trying write simple jest test react-router route module. the component has button , when clicking on it, there programatic navigation route using 'transitionto' method. i maintain getting next error, after adding stubroutercontext utils (as explained here), , wrapping userdetails component in stubroutercontext: typeerror: property 'transitionto' of object #<object> not function i using react 12.2, react-router 12.4, , jest 2.2 my dummy component: var navigation, react, router; react = require('react/addons'); router = require('react-router'); navigation = require('react-router').navigation; module.exports = react.createclass({ mixins: [navigation], onbuttonclick: function() { this.transitionto('next-page'); }, render: function() { homecoming (<button onclick={@onbuttonclick}>go next page</button>) } }); my test file: jest.dontmock...

Smack 4.1 connection to gtalk -

Smack 4.1 connection to gtalk - i updated smack 4.1, cannot connect gtalk. code using: xmpptcpconnectionconfiguration.builder configbuilder = xmpptcpconnectionconfiguration.builder(); configbuilder.sethost("talk.google.com"); configbuilder.setport(5222); configbuilder.setservicename("gmail.com"); configbuilder.setsecuritymode(securitymode.required); configbuilder.setdebuggerenabled(true); configbuilder.setsendpresence(true); configbuilder.setusernameandpassword(pref.getstring(constants.key_user, ""), pref.getstring(constants.key_token, "")); saslauthentication.blacklistsaslmechanism(saslmechanism.plain); abstractxmppconnection connection = new xmpptcpconnection(configbuilder.build()); seek { connection.connect(); connection.login();//.login(pref.getstring(constants.key_user, ""), pref.getstring(constants.key_token, "")); } catch(exception e)...

What is the point of defining new class as a struct in Python C API -

What is the point of defining new class as a struct in Python C API - the docs python c api describes pattern of defining new type: typedef struct { pyobject_head pyobject *first; /* first name */ pyobject *last; /* lastly name */ int number; } noddy; ... then methods such init added. my question - point define custom fields in struct, why not define them in init , in python, using pyobject_setattr function calls on self ? struct fellow member access far more efficient dict lookups. struct fellow member access far more convenient in c. it's much easier thing->foo pyobject_getattrstring(thing, "foo") . using struct members allows store info isn't of python type. allows things can't implemented in terms of python types, or much less efficient in terms of python types. using struct members prevents every object needing own dict. of import result of dict doesn't have have infinite descending chain of dicts, improves...

android - insertWithOnConflict making Columns null -

android - insertWithOnConflict making Columns null - i have next code update or insert database, q_id primary key public long updateresponse(int response, int q_id) { sqlitedatabase db = helper.getwritabledatabase(); contentvalues contentvalues = new contentvalues(); long id = 0; contentvalues.put(vivzhelper.q_id, q_id); contentvalues.put(vivzhelper.question_response, response); id = db.insertwithonconflict(vivzhelper.table_question_text, null, contentvalues, sqlitedatabase.conflict_replace); if(id==-1) log.d("failed", "failed"+response); else log.d("success","success"+response); homecoming id; } above code updating/inserting question_response making other column in row null in table.. help above code updating/inserting question_response making other column in row null in table that's "replace" conflict resoluti...

gpgpu - metal compute function limitations -

gpgpu - metal compute function limitations - i experienced mtlbuffer s computionally intensive shader functions tend stop calculating before threadgroups done. when utilize mtlcomputepipelinestate , mtlcomputecommandencoder blur image big blur radii resulting image half way processed , 1 can see half finished threadgroups . did not narrow downwards exact amount of blur radius, 16 pixels works fine, 32 much , not half groups computed. so there limitations on how long shader function phone call should take finish or that? finished of documentation how utilize metal framework , cannot recall stumbling upon such statements. edit since in case problem not simple timeout internal error i'm going add together code. the expensive part of block-matching algorithm finds matching blocks in 2 images (i.e consecutive frames in movie) //exhaustive search block-matching algorithm kernel void naivemotion( texture2d<float,access::read> inputimage1 [[ texture(0)...