Posts

Showing posts from March, 2014

dotfiles - Why does .lesshst keep showing up in my ~ -

dotfiles - Why does .lesshst keep showing up in my ~ - i never utilize less , , have used more . introduced to, why utilize more more instead of using less more. ( sorry, going sound bit of mess :) ) i tried less , couldn't quit out of it, until realized took vi/vim style command. @ least, believe happened. by in ~ there .lesshst file, rm time, prefer utilize more or nano simple stuff , can utilize textmate simple text editing, or sublime or whatever else in mood for. i noticed ".jbapps-myusername" in ~ well. showed 2 days ago, , don't recall installing strange. thought is? have never jailbroken phone, , don't install hacks on machine. things go gray area getting played in vm, not on core of machine working on main computer. $file .jbapps-haneda .jbapps-haneda: ascii text, no line terminators the contents of .jbapps-* file "483^@" no leading or trailing newlines, carriage returns etc. then there git issue. have .c

matlab - License error manager-4 -

matlab - License error manager-4 - how resolve error? whenever using 'syms' shows error:- "error using sym license checkout failed. license manager error -4 maximum number of users symbolic_toolbox reached. seek 1 time again later. see list of current users utilize lmstat utility or contact license administrator. troubleshoot issue visiting: http://www.mathworks.com/support/lme/r2013b/4 diagnostic information: feature: symbolic_toolbox license path: c:\users\hp\appdata\roaming\mathworks\matlab\r2013b_licenses;c:\matlab\licenses\license.dat;c:\matlab\licenses\network.lic licensing error: -4,132." solution? it means using concurrent (network) license of matlab, presumably on university campus, , license includes number of "seats" of matlab , associated toolboxes, allow n people on network using matlab concurrently, , m people (generally m<n ) using symbolic toolbox. when user number n+1 matlab, or m+1 symbolic toolbox, error messa

xsd - In XML Schema, why does an element group tag even exist? -

xsd - In XML Schema, why does an element group tag even exist? - from understanding, group used create named sequences (choice, sequence, all) can later referenced. however, why necessary when complextype can used accomplish same thing , is, in addition, much more powerful? isn't un-dry? not mention group tag acts both definition of type, , @ same time, can reference type, depending on whether utilize ref or name attribute. isn't terribly confusing , unnecessary? or missing important? named element , attribute groups ( xs:group , xs:attributegroup ) important. in effect, allow define sort of surrogate complextypes, without limitations of real complextypes. limitations of xs:complextype suppose define base of operations complextype this: <xs:complextype name="base"> (base element model) </xs:complextype> then, want reuse (base element model) across xml schema, can deriving other complextypes this: <xs:complextype n

oracle - Where those sqlplus columns are used? -

oracle - Where those sqlplus columns are used? - just type col in sqlplus returns list of columns, there columns ended _recyc, columns used ? googled not find documentation on them. column droptime_plus_show_recyc on heading 'drop time' format a19 column objtype_plus_show_recyc on heading 'object type' format a12 column objectname_plus_show_recyc on heading 'recyclebin name' format a30 column origname_plus_show_recyc on heading 'original name' format a16 they're used show recyclebin command. if run headings like: original name recyclebin name object type drop time ---------------- ------------------------------ ------------ ------------------- ... if clear columns , run 1 time again get: origname_plus_show_recyc objectname_plus_show_recyc objtype_plus_show_recyc droptime_plus_show_ -------------------------------- ------------------------------ ----------------------

Hibernate errors: "java.lang.Integer cannot be cast to java.lang.String" and so on -

Hibernate errors: "java.lang.Integer cannot be cast to java.lang.String" and so on - i have situation film can have lots of reviews, review ever related 1 movie. have had issue stated below, have tried many permutations, little confused, before mess code anymore thought best inquire here. q.how should set up? can hard set movie_id int, in review before save review? or need have moviedto film object 1 of objects in reviewdto class? , when create review object saved, phone call review.setmovie(somemovieobject)? so here going on in code errors: first complained not-null film reference not set (hibernate : not-null property references null or transient value), after not beingness able prepare it, suggested remove constraint, see if work. now complains "java.lang.integer cannot cast java.lang.string", confused there type mismatch? class<->hibernate or hibernate<->db? very confused, can please shed light...? in advance. package edu.un

java - Convert .PSD File To .JPEG/.PNG File Programmatically -

java - Convert .PSD File To .JPEG/.PNG File Programmatically - how convert .psd file image, .jpeg or .png or other image format, programmatically? i tried find java library imagemagick. if conversation not possible, find way read psd files straight on viewer . need more suitable suggestion thanks should this processbuilder pb = new processbuilder("converted", "-format ", "jpg ", psdafterconvpath, psdpath + "\\" + "*.psd"); pb.redirecterrorstream(true); seek { process p = pb.start(); } grab (ioexception ex) { logger.getlogger(definetask.class.getname()).log(level.severe, null, ex); } } java android psd

ios - when updating label text a few images reset to their storyboard init size -

ios - when updating label text a few images reset to their storyboard init size - i'm working on game score ( uilabel ) , few moving uiimage s. from day installed xcode 6, every time update score images in view go first frame (the frame storyboard). i tried update score this: label.text = @"4"; [label settext : @"4"]; but still happens i think if create score label programmatically might help, wanna know if of know bug , maybe have other solution? ios objective-c xcode ios8 xcode6

datatables - ajax based jquery data table sending columns as "columns"=>"[object Object]" -

datatables - ajax based jquery data table sending columns as "columns"=>"[object Object]" - jquery ajax info table sending parameters filters next array how alter send actual value , name of column? parameters: { "draw"=>"2", "columns"=>"[object object],[object object],[object object],[object object],[object object],[object object],[object object],[object object],[object object],[object object],[object object],[object object],[object object]", "order"=>"[object object]", "start"=>"0", "length"=>"10", "search"=>"[object object]" } the same issue me. figured out reason past setting of jquery jquery.ajaxsettings.traditional = true. remove setting works me jquery datatables

javascript - dropbox onchange with jquery-ui -

javascript - dropbox onchange with jquery-ui - i'm trying onselect , javascript function doesn't work. works when take away jquery-ui script, ugly forms. <select id="productkleur" style="width: 200px;" onchange="productkleurchange()" data-theme="c" data-native-menu="true"> <option value="1" id="1">zwart</option> <option value="2" id="2">rood</option> <option value="3" id="3">groen</option> <option value="4" id="4">paars</option> <option value="5" id="5">blauw</option> <option value="6" id="6">geel</option> </select> i tried this: $("#productkleur").combobox({ select: function (event, ui) { alert("the select event has fired!"); var productid = $("#productid

c# - WPF - TreeView adding Children to Children completly dynamically -

c# - WPF - TreeView adding Children to Children completly dynamically - i have build completly working logic in winforms insert info in treeview comes db, cant set datatable behind treeview , happy, because need build nodes , undernodes , undernodes, etc. working code in old winforms: private void waregroup() { dataset mydataset = new dataset(); datatable mydatatable = new datatable(); string sqlstatement = "select * apwgrupp order wg_wgschl asc"; string str_key = ""; string str_desc = ""; int int_node0 = 0; int int_node1= 0; int int_node2 = 0; int int_node3 = 0; int int_node4 = 0; mydataset = importdbf(sqlstatement); mydatatable = mydataset.tables["table"]; foreach (datarow row in mydatatable.rows) { str_desc = row.field<string>(1); str_key = row.field<string>(2); swit

java - deactivate a variable after use -

java - deactivate a variable after use - is there annotation can allow me tell java compiler variable not supposed used after annotation? autofill , re-create paste features of modern ides, easy introduce bugs mistyping variable names. such annotations help observe of bugs @ compile time (or @ typing time if 1 using smart ides netbeans/eclipse). example, have next string processing pipeline: string input = .... string pass1 = op1 (input); ... string pass2 = op2 (pass1); ... string pass3 = op3 (pass1); // typo: pass1 should pass2 ... homecoming pass3; if disable pass1 after line op2 called, typo in line op3 called detected pass1 out of scope result of hypothetical disable annotation. no, cannot deactivate variables in java. alternative, reuse variables, instead of creating new ones: string input = .... string currentpass = op1 (input); ... currentpass = op2 (currentpass); ... currentpass = op3 (currentpass); ... homecoming currentpass; in theory, suffi

Get refund status from amazon mws order -

Get refund status from amazon mws order - i using amazon mws api integrating orders amazon. after cancel order, refund applied on amazon seller central. how can know status of refund, in form of may study or something?. because after amazon refund, should update status on my(seller) side. maximum number of days within refund trigger ? plz help. i think looking "settlement reports" in reports api has next study types can use. - _get_flat_file_payment_settlement_data_ - _get_payment_settlement_data_ - _get_alt_flat_file_payment_settlement_data_ amazon-web-services amazon-mws

c# - ASP.NET MVC Sequence contains no matching element -

c# - ASP.NET MVC Sequence contains no matching element - i new asp.net mvc. have finished project unusual issue appeared in project. as seek run project error message. an exception of type 'system.invalidoperationexception' occurred in entityframework.dll not handled in user code additional information: sequence contains no matching element in 1 of controller using statement below groups display in dropdownlist. http://localhost....../clients (trying run page) , getting error on line containing code below. viewbag.groupdropdownvalues = new selectlist(db.groups.orderby(m => m.groupid), "groupid", "groupname"); or other controller: viewbag.categorydropdownvalues = new selectlist(db.category.orderby(m => m.categoryid), "categoryid", "categoryname"); this happening in controllers using syntax. i need display dropdownlists values database. working correctly till morning. don't have thought changed ,

themes - Overwrite CSS in an additional file? -

themes - Overwrite CSS in an additional file? - is there way overwrite css definitions in additional file (similar concept of kid themes of wordpress)? css has hierarchy overrides styles can overridden in style defined (inline style within element attribute vs embedded style on same page vs externally referenced style) overrides can occur through selection of element (id, attributes, classes, etc) order of definitions - if have external stylesheet needs overridden, utilize own stylesheet referenced after external stylesheet want override usage of !important in style definition see: http://www.alternategateways.com/tutorials/css/css-101/part-four-the-css-order-of-precedence css themes impresspages

Android testing clicking button/links/objects -

Android testing clicking button/links/objects - i made apps want test in android. apps game, website, , let's list view app. specifically, want create app lets me open of these (the easy part), problem is, how allow "new app" test previous app in way click specific links site/ views/ objects (for game app) want click. in essence it's human testing it, except human doesn't need click specific links, instead watch work human tester. android testing

svg - Position of a custom shape using dagre -

svg - Position of a custom shape using dagre - i'm trying create custom shape , set x , y axis on svg, far got done on top of element have transform attribute belongs grouping (g) references node, tried alter attribute setting custom transform without luck. my question is, how can alter x , y position whole node? render.shapes().task = function(parent, bbox, node) { var shapesvg = parent.insert('rect', ':first-child') .attr('x', node.x) .attr('y', node.y) .attr('width', bbox.width) .attr('height', bbox.height); parent.attr('transform', 'translate(' + node.x + ',' + node.y + ')'); node.intersect = function(point) { homecoming dagred3.intersect.rect(node, point); }; homecoming shapesvg; }; for generating node: g.setnode(string(element._id), { label:element.flowelement.meta.name, shape:element.type, x:meta.x, y:meta.y, wi

asp.net mvc - PerRequestLifetimeManager and Task.Factory.StartNew - Dependency Injection with Unity -

asp.net mvc - PerRequestLifetimeManager and Task.Factory.StartNew - Dependency Injection with Unity - how manage new tasks perrequestlifetimemanager? should create container within new task?(i wouldn't alter perrequestlifetimemanager perresolvelifetimemanager/hierarchicallifetimemanager) [httppost] public actionresult uploadfile(fileuploadviewmodel viewmodel) { var cts = new cancellationtokensource(); cancellationtoken cancellationtoken = cts.token; task.factory.startnew(() => { // _fileservice = dependencyresolver.current.getservice<ifileservice>(); _fileservice.processfile(viewmodel.filecontent); }, cancellationtoken); } you should read this article di in multi-threaded applications. although written different di library, you'll find of info applicable concept of di in general. quote few of import parts: dependency injection forces wire dependencies in single

Inner Join and Update with SQL Server & PHP -

Inner Join and Update with SQL Server & PHP - i trying update 2 tables (requisition & stock) , subtract 2 column both table using inner bring together on sql server. i've tried , doesn't work out. <?php $tsql = "update [mrs].[dbo].[requisition] inner bring together [mrs].[dbo].[stock] b on b.stockid = a.stockid set a.requeststatus = 'approved', a.approveddate = convert(varchar(10), getdate(),103), b.stockquantity = b.stockquantity - a.requestquantity requestid = '$_get[requestid]'"; $result = sqlsrv_query($conn, $tsql, array(), array ("scrollable" => sqlsrv_cursor_keyset)); header('location:approval.php'); ?> you can't update multiple tables within single update statement. way execute 2 separate update statements within single transaction begin tra

java - trying to create a class objext iside an other class -

java - trying to create a class objext iside an other class - i trying create object of class point class interestpoint , words want able utilize points values within interestpoint class without utilize of heredity public class interestpoint { private point p1; private string aeria; public interestpoint() { this.p1 = new point(); //p1.dysplay1(); } } edit no misunderstand when phone call method print point through class functions print me error : exception in thread "main" java.lang.unsupportedoperationexception: not supported yet. @ point.dysplay1(point.java:29) @ interestpoint.setall1(interestpoint.java:22) @ main.main(main.java:16) java result: 1 thats why posted question :d re: exception in thread "main" java.lang.unsupportedoperationexception: not supported yet. @ point.dysplay1(point.java:29) @ interestpoint.setall1(interestpoint.java:22) @ main.main(main.java:16

How to connect my android app to the remote web server -

How to connect my android app to the remote web server - i working on android app. right requesting webserver , getting info successfully. now thing when running server , mobile device on same network it's working fine. when webserver running on 1 network ex. wlan , android device network 3g enabled app not able create request. so how can create webserver request visible different networks. on android part making retrofit request server. restadapter restadapter = new restadapter.builder() .setendpoint("http://134.162.1.120:3000") // ip of scheme (just random ip illustration purpose) .setloglevel(restadapter.loglevel.full) .build(); i getting info when pc , android device on same network. when phone , pc on different network it's not getting connected the server on local pc.. sounds server in local lan can access mobile device if in same network via wlan. accessing server it's lan-ip. can't a

javascript - No 'Access-Control-Allow-Origin' header is present Error on a few clients -

javascript - No 'Access-Control-Allow-Origin' header is present Error on a few clients - i receive no 'access-control-allow-origin' header nowadays error from background-script of chrome-addon. : var trophynames; var file="http://www.example.com/js/trophy."+request.language+".json"; $.ajax({ url: file, datatype: 'json', async: false, success: function(data) { trophynames=data; } }); the funny thing is: this appears on (at least) one client, not on all. assume error gets or noone. clue why might client-specific? the not-working-client has same browser (chrome, of course) , same settings (synched local chrome browser) the .htaccess is: <filesmatch "\.(json)$"> <ifmodule mod_headers.c> header add together access-control-allow-origin "*" header add together access-control-allow-

vbscript - Passing an argument into a VBS script which passes into a batch file -

vbscript - Passing an argument into a VBS script which passes into a batch file - i have legacy application doesn't back upwards utilizing default applications defined in windows requires specify specific executable file format opened within application. since microsoft no longer includes modi office default have been looking @ using launching windows image viewer .tif, .tiff, & .bmp files since built windows; microsoft not have direct executable windows image viewer can called forcing me create script executes command calls windows image viewer execute. after research way have been able phone call application open specific file creating batch file such below: gifts.bat rundll32.exe c:\windows\system32\shimgvw.dll,imageview_fullscreen %~1 if execute above code such gifts.bat "c:\example directory\sample file.tif" command prompt or application launches , sample file.tif opens without problem; command prompt opens along file when launching applicat

Kafka Monitoring JMX Attributes Count or MeanRate? -

Kafka Monitoring JMX Attributes Count or MeanRate? - i have configured jmxtrans values "kafka.server":type="brokertopicmetrics",name="alltopicsmessagesinpersec" it has 3 attributes- count , oneminuterate, meanrate i confused identify, of these attributes gives "number of messages broker per sec" ? sample values got these attibutes @ instance are count =1955600, meanrate = 1036 , oneminuterate=2643 which of these attributes should refer to? that meanrate. oneminuterate - means average value of meanrate lastly 60 seconds jmx apache-kafka jmxtrans

python - Matching an optional '#' does not seem to be working properly -

python - Matching an optional '#' does not seem to be working properly - i'm attempting total words or hashtags string, seems though i'm applying 'optional character' ? flag wrong in regex. here code: print re.findall(r'(#)?\w*', text) print re.findall(r'[#]?\w*', text) thus 'this sentence talking this, #this, #that, #etc' should homecoming matches 'this' , '#this' yet seems returning list empty strings other random things. what wrong regex? edit: i'm attempting whole spam words, , seem have jumbled myself... s = 'spamword' print re.findall(r'(#)?'+s, text) i need match whole word, , not word parts... you can utilize word boundary in regex: s = 'spamword' re.findall(r'#?' + s + r'\b', text) python regex

Java array fills, and values print. But, memory always prints after -

Java array fills, and values print. But, memory always prints after - my project take in , read file load contents array, have user alter , find things it. problem though when go search array prints out contents, along stored in memory. can't figure out how stop because can't figure out is. prints though directory1@27391d. import java.io.file; import java.io.filenotfoundexception; import java.util.*; public class directory1{ private int size=0; private string[] dval;//sting array public directory1(string directoryfilename){ int size=0;//counter array size int ct=0;//counter dval = new string[size];//new string array file file= new file(directoryfilename); try{ scanner insert = new scanner(file); scanner populate= new scanner(file);//scans file //counts amount of lines array size while(populate.hasnextline()){ string i= populate.nextline(); size++; } dval= new str

dependency injection - Injecting Statefull Bean inside Stateless bean -

dependency injection - Injecting Statefull Bean inside Stateless bean - when injecting stateful session bean within stateless session bean using di , happens exactelly : did container inject new instance of statefull bean every stateless bean (wich exists in pool), or same instance shared between them? why indicated using jndi in case improve di? i didn't :) thank :) basically doesn't create sense inject stateful stateless, because stateful shared many clients, if happen same stateless instance, or 1 client can access different stateful instances, if access different stateless instances. using jndi or not, doesn't create difference in case. stateful cannot shared many clients , each statelss instance different client. if utilize jndi depending lookup can end new stateful instance every phone call stateless. any reason why inject stateful in stateless? dependency-injection ejb-3.0 jndi stateful-session-bean stateless-session

java - Loops, trouble understanding loops please help a beginner -

java - Loops, trouble understanding loops please help a beginner - int a= io.readint(); int b = io.readint(); int z = 0; int i; for(i =0; z<=b; i++) { z=z+a; } system.out.println(i); a.) actual output of code, given next input? input: reads in 20, b reads in 75. b). mathematical operation code resemble. c. implemented code correctly accomplish operation identified in (b)? if provide test cases show this. if not, prepare bug in code. `` ok professor went on answers , want know if of guys can explain happening in code. got a.) 4 don't understand how 4. , mathematical operation code resemble got += add-on , no close answer. need improve understanding on loops, help much appreciated. the output how many times loop continued until z > b. simple add-on z + each time through , should understand how it's executed java

Error in starting java application as windows services -

Error in starting java application as windows services - i have downloaded commom-daemon tool , used java application. have created bat file shown below set service_name=sample set pr_install=d:\commons-daemon-1.0.15-bin-windows-signed\prunsrv.exe rem service log configuration set pr_logprefix=%service_name% set pr_logpath=d:\logs set pr_stdoutput=d:\logs\stdout.txt set pr_stderror=d:\logs\stderr.txt set pr_loglevel=error rem path java installation set pr_jvm=c:\java\jre7\bin\client\jvm.dll set pr_classpath=d:\commons-daemon-1.0.15-bin-windows-signed\daemon.jar rem startup configuration set pr_startup=auto set pr_startmode=jvm set pr_startclass=com.someservice set pr_startmethod=start rem shutdown configuration set pr_stopmode=jvm set pr_stopclass=com.someservice set pr_stopmethod=stop rem jvm configuration set pr_jvmms=256 set pr_jvmmx=1024 set pr_jvmss=4000 set pr_jvmoptions=-duser.language=de;-duser.region=de in cmd , install service using command prunsrv.exe //is

r - Function for Logistic Regression Training Set -

r - Function for Logistic Regression Training Set - i trying create function test logistic regression model developed on training set. for example train <- filter(y, folds != i) test <- filter(y, folds == i) i want able utilize formula different info sets. example, if take y response variable such “ low ” in birthwt info set , x explanatory variables e.g. “age", “race” how implement these arguments glm.train formula without having type function separately different info sets ? glm.train <- glm(y ~x, family = binomial, info = train) you can utilize reformulate create formula based on strings: x <- c("age", "race") y <- "low" form <- reformulate(x, response = y) # low ~ age + race use formula glm : glm.train <- glm(form, family = binomial, info = train) r logistic-regression

ruby on rails 3.2 - Carrierwave converts but image_tag call is to old name -

ruby on rails 3.2 - Carrierwave converts but image_tag call is to old name - an uploader proper handling version :thumb process :resize_to_limit => [200, 200] process :convert => 'jpg' def filename super.chomp(file.extname(super)) + '.jpg' end end in store directory uploaded file , thumbnail there. , thumbnail converted jpg. however show view <%= image_tag @docimage.production_file_url(:thumb).to_s %> is rendering path original name <img alt="thumb_30x30_2mb" src="/uploads/docimage/yadayadayada/thumb_30x30_2mb.tif" /> i'm missing here handling new extension. i guess expecting existing method handle case. given brevity of solution, wildly mistaken. def edited_thumb start_path = self.production_file_url(:thumb) edited_thumb = start_path.sub(/[^.]+\z/,"jpg") end then, in view <%= image_tag @model.edited_thumb %> ruby-on-rails-3.2 carri

consistent hashing - Is there a way to generate hash integer within a predefined range for a string in PostgreSQL? -

consistent hashing - Is there a way to generate hash integer within a predefined range for a string in PostgreSQL? - for sharding need hash algorithm. need generate hash integer value string within 0-2^31 range. possible ? following reply give way generate integer md5 algorithm. hashing string numeric value in postgressql but there way generate value within range ? in function suggested in hashing string numeric value in postgressql, 32 bits range expressed width of bit(n) cast. it cannot passed parameter because type modifier must constant, fixed 31 bits, may adjust function this: create function hash_string_into_31_bits(text) returns int $$ select ('x'||substr(md5($1),1,8))::bit(31)::int; $$ language sql; then result 31 bits wide , positive, same thing. postgresql consistent-hashing

lambda - Passing a comparison function as a parameter into Entity Framework -

lambda - Passing a comparison function as a parameter into Entity Framework - i have couple of entity framework functions differ in operators, e.g. public int getcountequal(int i) { homecoming context.entity.where(e => e.value == i).count(); } public int getcountless(int i) { homecoming context.entity.where(e => e.value < i).count(); } public int getcountlessorequal(int i) { homecoming context.entity.where(e => e.value <= i).count(); } and on. obviously, dumbed downwards version of real program... i guess must possible somehow pass operator parameter / lambda look (since they're sort of canonical), whatever i've tried far along lines results in infamous "the linq look node type 'invoke' not supported in linq entities." error. any hints how pass comparing function parameter can translated sql? query needs run @ database level, can't load entities memory , run lambda there... public int getcount(expression

python - It's Dangerous not recognizing payload -

python - It's Dangerous not recognizing payload - i'm using heroku scheduler run script outside of app. script in same folder run.py , procfile. @manager.command def run_purge(): candidates = models.candidate.query.all() print "secret key --------->", os.environ["app_secret_key"] people_purged = [] candidate in candidates: if candidate.status != 0 , candidate.approved == true , over_30_days(candidate.last_status_change): payload = reactivate_account_link(candidate.email, 'reactivate_account') send_email("your business relationship innactive", "talenttracker", [candidate.email], payload) candidate.status = 0 db.session.commit() people_purged.append(candidate.email) else: pass homecoming send_email("purge completed", "talenttracker", email_to_admin, "purge completed --> {0}".fo

javascript - New array overwriting global array -

javascript - New array overwriting global array - i have global array like: var myarray = []; and has various elements in it. need create new array same contents , reverse this: newarray = myarray; newarray = newarray.reverse(); however when this, reverses both myarray , newarray. what doing wrong? thanks! it's because both arrays referenced same object. rid of have clone slice.. var myarray = [1,2]; var newarray = myarray.slice(0) newarray.reverse(); javascript

Android - ResourcesNotFoundException when trying to set Action Bar icon by resource id -

Android - ResourcesNotFoundException when trying to set Action Bar icon by resource id - i changing action bar icon circleimageview shows profile picture: circleimageview actionbaricon_profile = new circleimageview(this); actionbaricon_profile.setimagedrawable(getresources().getdrawable(r.drawable.my_picture)); actionbaricon_profile.setlayoutparams(new layoutparams(48, 48)); actionbaricon_profile.setid(r.id.actionbaricon_profile); getactionbar().seticon(r.id.actionbaricon_profile); the ids kept in ids.xml: <?xml version="1.0" encoding="utf-8"?> <resources> <item type="id" name="actionbaricon_profile"/> </resources> i resourcesnotfoundexception. help appreciated. seticon expecting receive id of resource. id actionbaricon_profile unique id you're creating has no resource associated it. that's why you're getting resourcesnotfoundexception . you can set drawable actionbar's seti

java - How to get two value after the decimal for the result of distance -

java - How to get two value after the decimal for the result of distance - to calculate distance between 2 places;with 2 lat , longi using link calculate distance in meters when know longitude , latitude in java i got result metre 2.4737676e-5,its float value too. i want take first 2 values after decimal.but using decimal format , string format couldn't expected result like(2.47)..its coming 0.00 only. > float meanwhiledist=distfrom(latti,longii,curlat,curlongi); > decimalformat df2 = new decimalformat( "#.00"); > double dd2dec = new double(df2.format(meanwhiledist)); or double dd = double.valueof(meanwhiledist); string angleformated = string.format("%.2f", dd); if print angleformated , dd2dec result coming 0.00 the value of 2.4737676e-5 seems less expect: float ff= 2.4737676e-5f; system.out.println("float value: "+ff);

.net - Microsoft fakes - shims without ShimsContext -

.net - Microsoft fakes - shims without ShimsContext - i'm trying hook methods of external .net programme , msft fakes framework seems create easy using shims. here's example: let's game uses library includes chat class addmessage(msg) method. want modify method in such way function of mine gets called argument. illustration modify msg , homecoming original function modified msg argument. next time gets printed chat, function executed , modified string displayed in chatbox. modifying il asm of dll itself, that's not sustainable larger modifications or if target updates. my problem since fakes made used in unit testing environment, shims work in shimscontext - prevent people overriding methods outside of testing cases, that's want do. is possible 'globally' overwrite methods shims or framework locked downwards in regard? if it's locked down, there frameworks might help me accomplish goal? .net instrumentation microsoft-fakes shim

java - Generating class for dynamic XML -

java - Generating class for dynamic XML - i have xml strucutre below <projectname> <packagename> <classname> <targetmethodname> <testmethod1> <parameter1>--</parameter1> <parameter2>--</parameter2> </testmethod1> <testmethod2> <parameter1>--</parameter1> <paramater2>--</parameter2> </testmethod2> <testmethodname> -------------- ------------ ---------------- </testmethodname> </targetmethodname> </classname> </packagename> </projectname> xml construction changes dynamically based on user input. question how can generate using jaxb. class construction xml. you have write

dimensional modeling - Data Warehouse - Dimension with free text fields -

dimensional modeling - Data Warehouse - Dimension with free text fields - i after advice on best way model info free text fields. next simplified have factincident table , dimension called dimpropertytype. there 3 fields define propertytype called type1, type2 , type3 , these each contain 1 of possible 20 values. wanted have dimpropertype next fields: propertytypekey type1 type2 type3 however looking @ info each set of property type options there alternative titled 'other' , additional set of fields called - type1othertext, type2othertext , type3othertext. have looked through info , 80% of each of fields have been set 'other' respective free text set. speaking business analysts searches utilize these fields constraints need in there somewhere. does have advice on best way of dealing situation? looking through info issue occurs in number of different dimensions going have deal number of times. thanks. data-warehouse dimensional-modeli

office365 - Using office 365 api from a service -

office365 - Using office 365 api from a service - will able utilize new rest file api service headlessly? for example, want able create service user gives consent once, , there-after service may perform file operations (against sharepoint online) without explicit consent months on end without intervention. such thing possible other oauth type rest apis (for instance 1 drive rest api allows it) storing refresh token , using new access token. 1) such thing possible these new apis. comment "jthake" in response "tdriver" here http://blogs.office.com/2014/05/12/net-and-javascript-libraries-for-office-365-apis/ . seems hint want isn't possible i'm not sure why not. the new o365 rest apis utilize common consent framework in order verify app has permission utilize apis. means user needs first register app in aad & consent app's info utilize in browser app has right permissions. 1 time app consented to, completing oauth flow headl

javascript - speed of setter functions not what expected -

javascript - speed of setter functions not what expected - i comparing performance of 2 different types of setters shown below: var q={}; var z={}; (function(){ var x=1; q.x=function(){ homecoming x; }; q.x.set=function(val){ x=val; }; })(); (function(){ var x=1; z.x=function(){ homecoming x; }; z.x_set=function(val){ x=val; }; })(); the difference lies in setter stored: q.x.set vs z.x_set . expected z variant run faster since requires 1 less table look-up. on contrary q variant consistently faster. ideas why? here jsperf: http://jsperf.com/hq7f3 your experiment has few results various browsers. lets @ results. so expect z faster q . when examine results see 2 different categories of result. results nearly identical, trending towards q beingness faster. or z faster. what tells me @ mercy of implementation details of various js engines. different js engines utilize ton of low level optimizations alter timing charac

Windows phone comnpatbility -

Windows phone comnpatbility - how can run windows phone 8 application in windows phone 7? have developed app in windows phone 8 when want run app in windows phone 7 not running. there way create app compatible if application written wp8 can't run on wp7. on other hand, if application written wp7 can run on wp8. if need run on wp7 must modify code there lot of improvements in wp8 maybe using in app won't available in new compilation wp7. more info available in https://msdn.microsoft.com/library/windows/apps/jj206947(v=vs.105).aspx windows-phone-8

java - Message failed to send -

java - Message failed to send - i using sinch parse, , on messagingactivity receiving next message: message failed send (in method onmessagefailed). trying understand why message failed register parse:, , sent together below activity believe triggering error: public class messagingactivity1 extends activity { private string recipientid; private edittext messagebodyfield; private string messagebody; private messageservice.messageserviceinterface messageservice; private messageadapter messageadapter; private listview messageslist; private string currentuserid; private serviceconnection serviceconnection = new myserviceconnection(); private messageclientlistener messageclientlistener = new mymessageclientlistener(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.messaging); parse.initialize(this, "code", "code");

Ember CLI: How to do Asynchronous Model Unit Testing with RESTAdapter -

Ember CLI: How to do Asynchronous Model Unit Testing with RESTAdapter - i want test models, , integration rest api, using ember testing framework ships ember cli, requests, using restadapter settings not beingness made in tests, within model tests. stands, phone call save() on model cause tests next not execute: here test made check interaction server (rest api): test "store can used send info server", -> store = @store() ember.run -> cpanel = store.createrecord "item" cpanel.save().then((response) => equal(response.status, 200) ) this blocks tests next one; furthermore, no requests made server, when monitoring network tab in chrome dev tools: a friend advised me utilize qunit async helper, when using that, find this.store() undefined (perhaps ember qunit adapter decided leave out back upwards async testing helpers?): asynctest "async creates business relationship on server&q

c# - Elegant retry on effectively arbitrary call -

c# - Elegant retry on effectively arbitrary call - i have phone call remote resource, on occasion wcf 1 have similar problem com phone call might useful. i want retry phone call if exceptions thrown , there dozen or calls want handle more elegantly. i thought of reflection vampire instinctively shy away it. this have void mycall(){ (int = 0; < 5; i++) { seek { homecoming this.innerproxy.loadmap2(mapname); } grab (servertoobusyexception e) { logger.debugformat("caught servertoobusyexception {0}th time retrying [{1}]", + 1, e.message); thread.sleep(50); } } // final phone call fail if servertoobusy thorwn here. homecoming this.innerproxy.loadmap2(mapname); } as have several calls seems ought able pass in method pointer , parameter array &

php - Search query containing a variable -

php - Search query containing a variable - hi working on php mysql project , need help. on 1 of fields utilize check box come in value. possible options 9001 14001 , 18001. if tick 14001 , 18001 result gets stored 14001,18001. when set search have had set if equals each possible combination. ..not bad in case 7. bit utilize in sql query if wanted if (field) contains? the next query give line field contains 14001. select * table field '%14001%' but might want reconsider way store info create faster. 1 way nicely described here: http://www.phpknowhow.com/mysql/many-to-many-relationships/ php mysql

Gettining java annotations using reflection -

Gettining java annotations using reflection - i'm trying spot, using reflection, 'init' method annotaded @override annotation (or whatever annotation), ok, heres example, much simplified, ofcourse base of operations class: public abstract class { public void init() { } } then here subclass: public class b extends { string bla; @override public void init() { } public void init(string bla) { this.bla=bla; } } so code run annotated method this: public static void main(string[] args) { classloader c = main.class.getclassloader(); seek { class<?> clazz = c.loadclass("correct.path.to.class.b"); (method method : clazz.getdeclaredmethods()) { if (method.getname().equals("init")) { system.out.println(method.getdeclaredannotations().length); } } } grab (classnotfoundexception e) { e.printstacktrace();

xcode6 - Documents directory path of simulator in Xcode 6 -

xcode6 - Documents directory path of simulator in Xcode 6 - any thought why apple changed documents directory path in xcode 6? read pinkstone's post curious know whether there explanation change. the simulator architecture rewritten on top of new framework called coresimulator.framework. part of that, have library of devices can create or delete testing rather having 1 path of info used devices. ios-simulator xcode6

How to use JavaScript, Ajax or jQuery to display array data in table -

How to use JavaScript, Ajax or jQuery to display array data in table - right getting info works fine want auto display in table. have button clicked , should display result table or should create table , display way fine. $result = array(); while ($row = mysql_fetch_assoc($res)) { $result[$i][0] = $row['fname']; $result[$i][1] = $row['lname']; $result[$i][2] = $row['membershipid']; } homecoming $result; any help great given info construction of [ { fname:"john", lname:"doe", membershipid: "1234" } ] this function should work n rows of data function createtable(dataarray){ var table = document.createelement('table'); var tablerows = dataarray.map(function(datarow){ var tablerow = document.createelement('tr'); (var value in datarow){ var cell = document.createelement('td'); cell.innertext = datarow[value]; tablerow

sql - Associate one column in table with two existing tables -

sql - Associate one column in table with two existing tables - my db has next tables: resource : resources can uploaded on site groups : groups on site users : users on site (not part of grouping if like) now, when 1 uploads resource currently, ownership of resource given it's uploader default. resource table has column ownerid foreign key association user table. but now, has changed such ownership of resource given either user or entire group. i'm trying decide migration scheme, move owner beingness user entity either user or group . intuition when uploads material, can take owner user or entire group . currently migration plans involves: add ownertype (user, group, global) , userowner , groupowner within material table (probably worse normalized table). ownertype global if owner --or-- group if owner group entity else user . then when i'm querying resource table, can check ownertype condionally select owner either user table or gr

c# - Order list by value with maximum sequence appearance -

c# - Order list by value with maximum sequence appearance - i have next list (simplified): name | brand shirt0 | adidas shirt1 | nike shirt2 | adidas shirt3 | adidas shirt4 | erima shirt5 | nike i want order brand, , display (a maximum of) 2 of brand in sequence. therefore not display 3 adidas products first, two! result: shirt0 | adidas shirt2 | adidas shirt1 | nike shirt5 | nike shirt4 | erima shirt3 | adidas so takes 2 products every brand, , starts on when no more available. any ideas how accomplish linq? i assume product class has next property: public string brand { get; } i utilize next approach: group products brand property wrap result in each grouping in anonymous class additional order property , assign 0 if index within grouping less 2 , 1 if else (will apply first , sec item) apply order based on order property of our anonymous class select product, rid of our anonymous wrapper class the query below: var result = list

Mac osx terminal proccess completed -

Mac osx terminal proccess completed - after open terminal (console) in osx: last login: tue oct 28 10:29:21 on ttys000 login(14773,0x7fff7572f300) malloc: * error object 0x7fd4bb715110: pointer beingness freed not allocated * set breakpoint in malloc_error_break debug [proccess completed] to honest, have no thought did or hot prepare it. after 2 hours or research decide inquire question.. osx

javascript - How to create a basic SOAP request page -

javascript - How to create a basic SOAP request page - i need create basic html page capture user information, first name, surname, value , email address , description of goods etc. needs sent example.com basic soap request (below) this simple signup form. user manually input info , on submit info should pass "http://www.example.com/". want know, how create html page job. <?xml version="1.0" encoding="utf-8"?> <s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <submitnewapplicationshort xmlns="http://www.example.com/"> <newapplicationdatashort> <usercredentials> <loginname>xxxxx_icet1</loginname> <password>xxxxxxx</password> </usercredentials> <proposalshort> <clientreference>