Posts

Showing posts from June, 2010

How to enable AutoStart option for my App in Xiaomi phone Security App programmatically in android -

my app working remarks in mobile except mi. because mi restricting app background service run. after enabling app in autostart in security, working perfectly. can enable autostart option app in mi security app through programmatically. please let me know valuable suggestions. and doubt how whatsapp , facebook , many more apps default enabling autostart option in security app in xiaomi? thanks in advance. try this...it's working me. open screen enable autostart. string manufacturer = "xiaomi"; if(manufacturer.equalsignorecase(android.os.build.manufacturer)) { //this open auto start screen user can enable permission app intent intent = new intent(); intent.setcomponent(new componentname("com.miui.securitycenter", "com.miui.permcenter.autostart.autostartmanagementactivity")); startactivity(intent); }

Angular 2 RC6 Forms control validation message -

<form [formgroup]="registerform" (submit)="onsubmit()"> <label>firstname:</label> <input type="text" formcontrolname="firstname"> <p *ngif="registerform.controls.firstname.errors">this field required!</p> ... is there way make registerform.controls.firstname.errors little bit shorter? one way define shorter names abstractcontrol properties in form component. in respective component class, add: firstname: abstractcontrol; and in constructor: this.firstname = this.registerform.controls['firstname']; now, can access field properties this: <p *ngif="firstname.errors">this field required!</p> source

PHP evaluating the content of an array -

i trying evaluate content of array. array contain water temperatures submitted user. the user submits 2 temperaures, 1 hot water , 1 cold water. what need evaluate both array items find if within limits, limits "hot water: between 50 , 66", "cold water less 21". if either hot or cold fail check flag status "1" or if both pass check flag status "0". below code working with: $row_watertemp['hotmin'] = "50"; $row_watertemp['hotmax'] = "66"; $seqwaterarray new(array); $seqwaterarray = array("58", "21"); foreach($seqwaterarray $key => $val) { $fields[] = "$field = '$val'"; if($key == 0) { if($val < $row_watertemp['hotmin'] || $val > $row_watertemp['hotmax']) { $status = 1; $waterhot = $val; } else { $status = 0; $waterhot = $val; } } if($key == 1

excel - List top n items in column, which have highest sum in second column -

Image
so have spreadsheat this, each row contract company: company | revenue ------- | ------- facebook| 1000000 google | 1000000 facebook| 100000 john doe| 123 john doe| 100 john doe| 8 john doe| 50 foo inc.| 100 now want list top n companies revenue. lets n=2 should this: company | revenue sum -------- | ----------- facebook | 1100000 google | 1000000 remainder| 381 i'm looking excel formula this, cannot use vba. tried array formulas sumif , match , don't seem right. you can purely formulas (no pivot table or vba) . data in column a , b , in e2 enter: =large(b:b,row()-1) and copy down. sorts contents of column b . need find rows in values reside. in f2 enter: =match(e2,b:b,0) and in f3 enter: =if(countif($e$1:$e3,e3)>1,match(e3,indirect("$b" & f2+1 & ":b9999" ),0)+f2,match(e3,b:b,0)) and copy down. formula gets rows , handles duplicates in column b . finally in d2 enter: =index(a:a,f2) and copy do

How to filter array in subdocument with MongoDB -

this question has answer here: retrieve queried element in object array in mongodb collection 10 answers i have array in subdocument this { "_id" : objectid("512e28984815cbfcb21646a7"), "list" : [ { "a" : 1 }, { "a" : 2 }, { "a" : 3 }, { "a" : 4 }, { "a" : 5 } ] } can filter subdocument > 3 my expect result below { "_id" : objectid("512e28984815cbfcb21646a7"), "list" : [ { "a" : 4 }, { "a" : 5 } ] } i try use $elemmatch returns first matching element in array my query: db.test.find( { _id" : objectid(

regex - Regular Expression to get a string between backtick `` in Console application (C#) -

i trying parse sql using regular expression in order return aliases (a string after keyword as between backtick ``). instance input var test = "select t.`productid` `productid`, t.`attributeid` `attributeid`, t.`string_value` `string_value`, t.`numeric_value` `numeric_value`, t.`metadata` `metadata`, t.`datatype` `datatype`, t.`createdtime` `createdtime`, t.`createdby` `createdby`, t.`modifiedtime` `modifiedtime`, t.`modifiedby` dfsfile.tmp1.my_json t"; the expected return is "productid", "attributeid", "string_value", "numeric_value", "metadata", "datatype", "createdtime", "createdby", "modifiedtime" something ( regular expression , linq ): string test = "select t.`productid` `productid`, t.`attributeid` ..."; // if want preserve `` pattern @"\bas\s*(`[^`]*?`)" string pattern = @"\bas\s*`([^`]*?)`"; var result = regex

regex - ExpressionEngine 3 - Template Routing issue -

i have template route following: `/{static_country:regex[(zh|cn|usa)]}/{alpha_dash}` which matches uri website.com/usa/about-us fine , points template i've called static - works fine. however, when navigate website.com/usa/sdfsdfsdfsd fake route , isn't route matching entry in channel, still points first entry in static channel instead of throwing 404 . i know can limit using regex like: `/{static_country:regex[(zh|cn|usa)]}/{static_page:regex[(about-us)]}` but isn't dynamic if client adds own pages we'd have update regex each time. is there way around @ all?

html - Textarea doesn't fill parent div's height -

i'm trying make 2 columns (one photo , selection, , other textarea). need textarea same height column photo, button , selection. i painted right div black , of "flex" has same size left one. setting height=100% !improtant; textarea doesn't help. also, setting height=500px !important works , make 500px, size changing. 100% don't give me proper result. .modalimg { width:100%; max-height:100px; margin-bottom:5px; } .modalimg + button { margin-bottom:5px; } .row-eq-height { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } <div class="form-group row-eq-height"> <div class="col-sm-2 col-sm-offset-1"> <img src="https://pp.vk.me/c637522/v637522431/7314/of3uboieb8o.jpg" class="modalimg col-sm-12 img-rounded"> <button class="btn col-sm-12 btn-primary">upload</button> <select class="for

How to set chmod for a folder and all of its subfolders and files in PHP? -

this question has answer here: recursively chmod/chown/chgrp files , folder within directory 3 answers i think question explains everything. want use php's chmod() function set 777 permission on folder, subfolders , files. any appreciated. thx. chmod("folder",0770); function in php allow change permission of file , recursive change use exec exec ("find /path/to/folder -type d -exec chmod 0770 {} +");//for sub directory exec ("find /path/to/folder -type f -exec chmod 0644 {} +");//for files inside directory make sure webserver have write access folder. check these more detail http://php.net/manual/en/function.chmod.php http://www.w3schools.com/php/func_filesystem_chmod.asp

how to execute Js Script in Selenium Webdriver C# -

this line code returns number of elements. document.getelementsbyclassname("entry entrywriteable"); -> returns 70 elements i want implement loop that, below line of code execute element. document.getelementsbyclassname("entry entrywriteable")[i].value; can 1 me how impliment in c# selenium ? in order execute js in selenium on c# should use next code: ((ijavascriptexecutor) driver).executescript("your code")); so can execute js code want. the executescript returns object can typify it.

linux - how to sync a "shadow" git repository with a main repository "secretly" -

i have client work via git repository. not want him know partly using developer. have therefore created "shadow" repository, developer using. how sync "shadow" repository main repository main repository not know happening? i cannot merge git command, since reveal have done. i copy , paste files, visible in git have deleted files , replaced new files same name. not good. my client using bitbucket. give other developer bitbucket login, want avoid that. what work, can open file in main repository, delete content , paste in updated code. commit , if had done work directly in main repository. time-consuming (and time not have of). is there different way "secretly" copy content of files shadow repository main repository? there linux/osx-command use replaces content of file without deleting , recreating file (which use recursively)? there git-command make possible without leaving trail of evidence of have done? you can have same set of loc

c++ - Generate random Pastel colour -

i trying generate random pastel colour. is correct pastel colour has low value/intensity value (hs v )? therefore should generate random pastel colours: vec3b randpastel = vec3b(rng.uniform(0, 180), rng.uniform(0, 255), rng.uniform(0, 50)) my current function fails. ever creates black bgr colours reason: vec3b randpastelbgr() { mat hsv(1, 1, cv_8uc3); cvtcolor(hsv, hsv, cv_bgr2hsv); hsv.at<vec3b>(0, 0) = vec3b(rng.uniform(0, 180), rng.uniform(0, 255), rng.uniform(0, 50)); cvtcolor(hsv, hsv, cv_hsv2bgr); return hsv.at<vec3b>(0, 0); } pastels white, i.e. have low saturation. not zero, though, because entirely white (or grey). noticed, low value dark colors. want high value, , might not want random one. (exactly color parts have random, , why?)

java - visualvm/jvisualvm: not supported for this JVM -

i wanted monitor jvm of wildfly running service jvisualvm/visualvm fail this. tried following things: setting %tmp% , %temp% c:\windows\temp (wildfly console tells me java.io.tmpdir) running console sysinternals pstools system account: psexec -i -s cmd.exe , started visualvm within new console (checked temp folders correctly set). in both cases under local applications process of wildfly listed visualvm told me "not supported jvm". as run wildfly cli, visualvm has no problems , shows me everything. there jdk oracle installed (with corresponding jre). how can monitor process of wildfly running service (local system account)? why not working solutions above? thanks lot (for reading) thank salah with hint (local jmx connection) i've managed make work using following command visualvm (no change of tmp/temp variables in cmd): visualvm.exe -cp:a "<path-to-wildfly>\bin\client\jboss-client.jar" and adding path jmx console (don't

python - Can I store a file (HDF5 file) in another file with serialization? -

i have hdf5 file , list of objects need store saving functionality. simplicity want create 1 save file. can store h5 file, in save file create serialization (pickle) without opening h5 file. you can put several files in 1 using zipfile or tarfile for zipfile write database files , writestr pickle.dumps ed data. for tarfile add database file , gettarinfo , addfile pickle.dump ed data file. i suggest creating zip if not need extended filesystem-attributes because bit easier use.

mysql - Error in your SQL syntax near 'DELIMITER' -

i wanted create trigger database. code that: delimiter ; drop trigger if exists `spi_financial_request_ains`; delimiter $$ create definer = current_user trigger `spi_financial_request_ains` after insert on `spi_financial_request` each row begin declare ev_id int; if check_audit('spi_financial_request')=1 insert spi_audit_event(table_name, record_id,event_type,user_id) values('spi_financial_request',new.id,'ins',@user_id); select last_insert_id() ev_id; insert spi_audit_data(event_id,column_name,new_value)values(ev_id,'id',new.id); insert spi_audit_data(event_id,column_name,new_value)values(ev_id,'request_id',new.request_id); insert spi_audit_data(event_id,column_name,new_value)values(ev_id,'payment_type_id',new.payment_type_id); end if; end; $$ delimiter ; i've executed on local site (using sqlyog , 5

javascript - How to diagnose why added element disappears -

jquery-3.1.0 this script adds "blablabla". after page reloads. so, added element disappears. when stop in debugger (the brekapoint in code), "blablabla" vaisible, make step , occur somewhere in middle of jquery. tried show occur. i have removed irrelevant scripts, still can't localize problem. and of course can't model in jsfiddle. could give me kick here? <script> function show_frame_person_create_get(){ $("#people").after("blablabla"); debugger; } function init_frame_person_create(){ var person_create_button = $('#person_create'); person_create_button.click(show_frame_person_create_get); } init_frame_person_create(); </script> jquery.event = { ... dispatch: function( nativeevent ) { // determine handlers handlerqueue = jquery.event.handlers.call( this, event, handlers ret = ( ( jquery.event.special[ ha

multiple projects in a solution each with a wwwroot asp.net 5 mvc 6 -

my colleague , build mvc 6 multi project solution. far ok. on stage have 3 different mvc projects in solution. has it's own wwwroot. , in end every project stand self (with little changes). what in case best approach copy/export content wwwroot of main project. goal every project has it's own dependencies on .js files etc. pp. are there other solution task? thanks , inputs. kind regards bella

javascript - Error: Assembly binding logging is turned OFF -

i doing online hosting , error come: wrn: assembly binding logging turned off. enable assembly bind failure logging, set registry value [hklm\software\microsoft\fusion!enablelog] (dword) 1. note: there performance penalty associated assembly bind failure logging. turn feature off, remove registry value [hklm\software\microsoft\fusion!enablelog]. how can solve it? this error can solved editing application pool settings have deployed project into. go advanced settings -> change .net framework version = 4. think can solve problem else refer thread:

primary and foreign key relationship in mysql -

i want create 2 tables, 1 having primary key , other foreign key. so requirement values in users should available present in customers table other vice show error constraint violation. did this, still able insert values in users not in customers. create table if not exists customers ( cust_user_id int, primary key (cust_user_id) ); create table if not exists users ( prid int, foreign key (prid) references customers(cust_user_id) on update cascade ); any suggestion ? thanks

stack-protect equivalent in clang compiler? -

most of mature compilers appear have support stack variable clobbers. gcc: -fstack-protector xlc: -qstackprotect intel: -fstackprotector windows: /rtc for clang i've found -fsanitize=safe-stack , doesn't support shared libraries, makes pretty useless me. it looks sanitizer implemented add-on? know if clang has sort of alternate (built-in?) anti stack-smashing support doesn't have no shared library restriction, or if there plans generalize existing limited safe-stack implementation catch other compilers? do want find hidden memory bugs in app or harden production use? former can go -fsanitize=address available both in gcc , in clang, provides excellent buffer overflow detection , can applied parts of program (you won't detect errors in case). it's not suitable production use though has 2x performance penalty , makes program more vulnerable external attacks.

typo3 - ext_emconf.php broken after composer install (EXT: jh_captcha) -

when download extension zip file ext_emconf.php file looks fine, when install extension composer "typo3-ter/jh-captcha": "1.3.0" ext_emconf.php broken , let extensionmanager crash. here both files: https://gist.github.com/misterboe/5386df69c7ea70c6538de5fd3a52e70f the original extension has no composer.json file must auto generated. the problem empty '' => '', dependencie this isn't related composer installers, due (now fixed) error in ter, caused generating corrupted ext_emconf information in t3x extension archive. composer installers rely on information , extract them (faulty) ext_emconf.php. you contact extension author , tell him remove , re-upload extension version, make error go away. alternatively author upload version 1.3.1. if change version constraint "1.3.0" "~1.3.1", recommended anyway, composer download fixed extension archive.

php - Merge 2 queries in 1 Doctrine DQL -

i'm using doctrine 2.4 symfony 2.8 , i'm trying build friendship system. i have materelationship entity : class materelationship { /** * @var integer * * @orm\column(type="integer", name="id") * @orm\id * @orm\generatedvalue(strategy="auto") */ private $id; /** * @orm\manytoone(targetentity="acme\userbundle\entity\user") * @orm\joincolumn(name="sender", referencedcolumnname="id", nullable=false) * */ private $sender; /** * @orm\manytoone(targetentity="acme\userbundle\entity\user") * @orm\joincolumn(name="receiver", referencedcolumnname="id", nullable=false) * */ private $receiver; /** * @var \datetime * * @orm\column(type="datetime", nullable=false) */ private $date; /** * @var boolean * * @orm\column(type="boolean", nu

concurrency - wcf asynchronous concurrent call raised timeout exception -

i making 10 concurrent asynchronous wcf service call silverlight application using multiple threads @ same time. the wcf service take 30 seconds process each call client. when third thread makes call wcf server gives timed out exception. when change send timeout configuration 10 minutes, working fine threads. so confusion is, wcf considering timeout configuration concurrent calls commonly. please note using basic http binding. it sounds there single service instance processing calls. happen if (as in comments) have per-session instancing , concurrency set single. the calls treated belonging same client session, , being queued , processed in turn single threaded, single service instance. requests don't dispatched before client timeout failed. you should set instancing per-call, mean service instance per request, 10 calls should processed concurrently. see https://msdn.microsoft.com/en-us/library/ms731193(v=vs.110).aspx

php - Cannot Set Favicon -

i'm hosting free website through hostinger , , can't seem set favicon @ no matter try. put in .htaccess : rewritebase / errordocument 404 /404.html rewriterule ^favicon.ico /favicon.ico [l] i favicon.ico in root folder /public_html . , added page this: <link rel="icon" type="image/x-icon" href="favicon.ico"> what else can do? website still displaying default favicon. how fix this? you have set infinite redirect. going favicon.ico favicon.ico favicon.ico ... remove rewrite rule , change href attribute href="/favicon.ico" .

java - Namespace in rometools -

i using rometools rss feeds syndfeed , syndfeedoutput. works great. need change namespace. there followings: <rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> and need change to: <rss version="2.0" xmlns="http://something.com/rss2"> how can achieve that? great. thanks.

position - Google Visualization: Sankey chart move label -

if first line small, label cut (see pic). knows solution? enter image description here i found solution: set top , buttom padding of container .sankeychart { padding-top: 10px; padding-bottom: 10px; } after every draw set overflow visible container.find('svg').css("overflow", "visible");

python - What to do with mismatch shape(or size) between data and target to be used in scikit-learn? -

i downloaded several fmri datasets, using nilearn job. somehow, example in nilearn has same shape (or size or length) data vs target (such in haxby dataset, 1452 time series vs 1452 labels). i want use scikit-learn type of classification or transformation using mismatched dataset (for example: target has less length), needs same length of data , target(x_n_samples = y_n_samples). is there type of preprocessing type of problem in scikit-learn?

image processing - photoshop parameters not good on graphicsmagick -

i'm trying translate photoshop setting sharpening images graphicsmagick. therefore found helpful article: https://redskiesatnight.com/2005/04/06/sharpening-using-image-magick/ the problem if use photoshop equivalent values explained in article in graphicsmagick images not sharp , clear on photoshop. for example use settings on photoshop: strength: 500% radius: 2.0 pixel threshold: 8 in article parameters explained this: the radius parameter the radius parameter specifies (official documentation) “the radius of gaussian, in pixels, not counting center pixel” unsharp masking, many other image-processing filters, convolution kernel operation. filter processes image pixel pixel. each pixel examines block of pixels surrounding (the kernel) , calculations on them render output pixel value. radius parameter determines pixels surrounding center pixel considered in convolution kernel: (think of circle) larger radius, more pixels need processed

javascript - IE Fallback for Hover animation -

i trying put fallback in internet explorer hovering on element. in chrome, element pops , looks neat not in ie :( currently there time delay before background colour appears. i'm guessing -webkit-animation-name root of issue. http://jsfiddle.net/8j249sre/ <div class="effects"> <a class="hvr-pop" href="#">pop</a> </div> /* pop */ @-webkit-keyframes hvr-pop { 50% { -webkit-transform: scale(1.2); transform: scale(1.2); } } @keyframes hvr-pop { 50% { -webkit-transform: scale(1.2); transform: scale(1.2); } } .hvr-pop { display: inline-block; vertical-align: middle; -webkit-transform: translatez(0); transform: translatez(0); box-shadow: 0 0 1px rgba(0, 0, 0, 0); -webkit-backface-visibility: hidden; backface-visibility: hidden; -moz-osx-font-smoothing: grayscale; } .hvr-pop:hover, .hvr-pop:focus, .hvr-pop:active { -webkit-animation-name: hvr-pop; animation-name: hvr-po

mysql - output specific columns in SQL -

i want output 2 rows - title , sum. title comes orbiting_group_types table, while sum calculating during sql query. here query output orbiting_group_types joined sum column: select * orbiting_group_types ogt left join ( select sum (val), orbiting_group_type_id report_orbiting_vals subrov subrov.orbiting_group_type_id = 4 group orbiting_group_type_id ) rov on ogt. id = rov.orbiting_group_type_id i want output title , sum columns. how should modify query that? try : select ogt.title, rov.summ orbiting_group_types ogt left join ( select sum (val) summ, orbiting_group_type_id report_orbiting_vals subrov subrov.orbiting_group_type_id = 4 group orbiting_group_type_id ) rov on ogt. id = rov.orbiting_group_type_id

hadoop - Could not format name node in cantos java.lang.Internal Error -

Image
i have attached image shows error i able past running: $ sudo yum update and attempting format namenode again. it seems installation of centos had out-of-date packages, , format (and startup of namenode) worked after update.

javascript - Fill array to nearest multiple of 10 without going over -

been building encryption program. plan have characters mixed around (for example: 1234567890 encrypted 6345809127). unfortunately mix in specific pattern need string multiple of ten, plan add character ' until string had length of multiple of ten. example, if input hello (5 characters) script insert ' until it's 10 characters, hello''''' . any ideas on how this? aside obvious problems of rolling own encryption (about million, billion times long answer here) you're asking quite simple. var padstr = "''''''''''"; var input = "hello"; var output = input + padstr.substring(10-input.length); console.log(output); console.log(output.length); that covers input string up 10 , not multiples of 10 . thats more complex though: var padstr = "''''''''''"; var input = "helloworldlongerthan10"; var

html - Link to a different <li> on another page goes only to the first item on list -

is possible link <li> on page? i have slider made list of images , link specific image of slider. i had tryed anchors on <li> . problem links goes first picture , not others anchors pic2 or pic3. guess i'm doing wrong. thanks <body> <div><a href="https://dl.dropboxusercontent.com/u/74509233/temp/untitled-2.html#pic1">link1</a></div> <div><a href="https://dl.dropboxusercontent.com/u/74509233/temp/untitled-2.html#pic2">link2</a></div> <div><a href="https://dl.dropboxusercontent.com/u/74509233/temp/untitled-2.html#pic3">link3</a></div> </body> $(function () { // slideshow 1 $("#slider1").responsiveslides({ auto: false, pager: true, nav: true, speed: 500, maxwidth: 900, namespace: "centered-btns" }); }); (function(

coffeescript - Append Array to Array of Arrays -

i'm trying write append function, such not mutate input list: append([ [1], [2] ], [3]) should equal [ [1], [2], [3] ] . i tried: append = (arrayofarrays, newelem) -> [first, remainder...] = arrayofarrays [first, remainder.concat(newelem)] but not work intended: append [[1],[2]], [3] == [[1],[[2],3]] the reason why it's not working is: you appending remainder , instead of new array. , concat expects array parameter, combine other array as in case item appended using concat array, need nest inside array. i advise using slice(0) method duplicate initial array, , concat new array it, contains new array: # duplicate array of arrays, , append new array it, returning new array. # @params list [array<array>] array of arrays # @params newitem [array] new array # @return [array<array>] duplicate of array new array appended append = (list, newitem) -> list.slice(0).concat [newitem] = [[], [1,1], [2]] append a, [3,3] # =>

Creating user aliases in gmail using google apps script -

Image
i reading in alias email information google form entry , wish use create alias email. this link talks using directory api accomplish description setting authorization etc. seems web application. how create email alias account using google apps script associated google form? you can use admin sdk's directory api in apps script, need use advanced admin sdk directory service (that must enabled before use . in script editor select resources > advanced google services ... , enable in google developers console .) once enabled can add alias this: function myfunction() { var userkey = 'jane.doe@mydomain.com'; var resource = { alias: 'jenny@mydomain.com' } admindirectory.users.aliases.insert(resource, userkey) } then can verify alias in admin console in users > select user > account > aliases :

compilation - Produce both assembly and object file with gcc/clang: Possible? How? -

is possible produce both object file , source file in once command gcc/g++/clang/clang++ ? how? i need pass lot of other options, avoid duplicating them in 2 separate commands: gcc -s test.cc # produce assembly gcc -c test.cc # produce object file you can give -save-temps option gcc: leave temporary files (including .s files) in current directory (works clang ): gcc -c --save-temps test.cc or use -wa,-aln=test.s option: gcc -c -wa,-aln=test.s test.c from gcc documentation: -wa,option pass option option assembler. if option contains commas, split multiple options @ commas. from as documentation: -a[cdghlmns] turn on listings, in of variety of ways: -al include assembly -an omit forms processing [...] you may combine these options; example, use -aln assembly listing without forms processing. clang has integrated assembler should switched off ( how switch off llvm's integrated assembler? ): clang++ -

for loop - Introductory ARM - Assembly Error -

for class starting out arm assembly language, required implement simple for-loop described below: h=1; (i=0, i<5, i++) h=(h*3)-i; i have written following code in arm assembly: area prog2, code, readonly entry mov r0, #1; initialize h=1 mov r1, #0; initialize i=0 loop cmp r1, #5; @ start of loop, compare 5 mullt r0, r0, #3; if i<5, h=h*3 sublt r0, r0, r1; if i<5, h=h-i (ties in previous line) addlt r1, r1, #1; increment if less 5 blt loop ; repeat loop of less 5 stop b stop; stop program end the problem there error line mullt r0, r0, #3; if i<5, h=h*3 if delete code, works fine. cannot understand issue 1 line. error description given "bad register name symbol, expected integer register." have tried loading #3 register multiplying 2 registers, didn't help. changed error message "this register combination results in unpredictable beha

bash - Get java version in csh (c shell) -

i need java version using c-shell script. i'll need put variable , use afterwards manipulations , tests. in bash command works: local javaversion=$(java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q') but in c-shell, when try: set javaversion=$(java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q') i "ambiguous output redirect." error. yes, have in c-shell, not bash or other language. i searched , other forums in internet didn't find helpful. thanks. here way should works me: > set javaversion=`java -version |& sed 's/.* version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q'` > echo $javaversion 18 changes are: replace $( command ) `command` ; former recommended current posix shell syntax has never been implemented csh . replace 2>&1 | |& ; former bourne shell specific, latter csh specific. replace java versio

c# - How do I change schema in fluent migrator? -

Image
i trying add column 1 of our existing tables not on dba schema. i tried following, alter.table("breakdown").addcolumn("quoteref").asstring(30).nullable().toschema("res"); but blows error message how change schema in fluent migrator? ok figured out myself: it's not .toschema("res") .inschema("res") full code following: alter.table("breakdown").inschema("res").addcolumn("quoteref").asstring(30).nullable();

postgresql - How to get List of Table Entity with only selected columns in Hibernate using native SQL? -

i trying execute sql query using session.createsqlquery() method of hibernate. test table has 3 columns : col1 col2 col3 working string sql = "select * test"; sqlquery query = session.createsqlquery(sql); query.addentity(test.class); list<test> testentitylist = query.list(); not working string sql = "select col1, col2 test"; sqlquery query = session.createsqlquery(sql); query.addentity(test.class); list<test> testentitylist = query.list(); error: the column col3 not found in resultset. i need retrieve a few specific columns table rather whole table. how can achieve this? you can use hibernate projections, see answer hibernate criteria query specific columns or can changing return type list<object[]> , parsing list<test> list<object[]> testentitylist = query.list(); list<test> res = new arraylist<test>(testentitylist.size()); (object[] obj : testentitylist) {

html - Can Bootstrap 2 markup be made to work with Bootstrap 3 CSS/LESS -

i have project lots of old bootstrap 2 markup (.row-fluid, span6 etc.). i'd update project bootstrap 3, modifying legacy html not possible (for complicated reasons). is there way make old bootstrap 2 markup (mostly scaffolding) work bootstrap 3? if wanted update html (depending on how many pages have) try this: http://code.divshot.com/bootstrap3_upgrader/ just paste bootstrap 2 code in , bootstrap 3 out.

javascript - Need help regarding Mapbox markers -

i using mapbox , trying hide marker until building clicked using js. i've tried setting event listeners on whole map pop if exact coordinates clicked. because building can of varied size, how implement click function makes marker appear when actual building clicked , not coordinates?

How to require the same parameter type between scala traits? -

i working on web server process registration form , save datastore. want library , work different instances of registration forms. i have following: trait registrationform case class simpleregistrationform(name: string, email: string, username: string, password: string) extends registrationform i want subclass of registrationform acceptable server. i have following traits: /** * interface saving datastore */ trait registrationdatastore[t <: registrationform] { def save(form: t): either[datastoreexception, string] } /** * trait handle form. */ trait registrationservice[t <: registrationform] { def handleform(form: t): either[akkahttpextensionsexception, string] } and implementation: class registrationserviceimpl[t <: registrationform]( registrationdatastore: registrationdatastore[t]) extends registrationservice[t] { def handleform(for

angular - Property 'forRoot' does not exist on type 'typeof MdCoreModule' -

upgrading angular 2.0.0-rc.6 application angular material 2.0.0-alpha.8-1, compilation errors like: property 'forroot' not exist on type 'typeof mdcoremodule'. and here's appmodule : import { mdcoremodule } '@angular2-material/core/core'; import { mdbuttonmodule } '@angular2-material/button/button'; import { mdbuttontogglemodule } '@angular2-material/button-toggle/button-toggle'; import { mdcardmodule } '@angular2-material/card/card'; import { mdcheckboxmodule } '@angular2-material/checkbox/checkbox'; // ... additional imports @ngmodule({ declarations: [ appcomponent, // ... additional application-specific declarations ], imports: [ browsermodule, commonmodule, reactiveformsmodule, httpmodule, jsonpmodule, mdcoremodule.forroot(), mdbuttonmodule.forroot(), mdbuttontogglemodule.forroot(), mdcardmodule.forroot(), mdcheckboxmodule.forroot(), // ... additional imp

android - Using Ottos bus for 'notification polling' -

on views have icon have red dot if user has notifications, created class (every few minutes) poll , see if have notifications. except @subscrtibe never getting triggered. 1 thing thought maybe cause start post before homeactivity registered timer didn't think problem? public class notificationutils { private static timer timer; private static final int minutes = 1000 * 60; private static context applicationcontext; public static void starttask(context context){ checknotifications(); applicationcontext = context; timer = new timer(); timer.schedule(task, 0l, minutes); } public static void killtask(){ timer.cancel(); timer.purge(); } static timertask task = new timertask() { @override public void run() { checknotifications(); } }; private static void checknotifications(){ restinterface service = restservice.getrequestinstance(applicationcon

caching - Why does this recursive C++ function have such a bad cache behavior? -

Image
let t rooted binary tree such every internal node has 2 children. nodes of tree stored in array, let call treearray following preorder layout. so example if tree have: then treearray contain following node objects: 7, 3, 1, 0, 2, 6, 12, 9, 8, 11, 13 a node in tree struct of kind: struct tree_node{ int id; //id of node, randomly generated int numchildren; //number of children, 2 leafs it's 0 int pos; //position in treearray node stored int lpos; //position of left child int rpos; //position of right child tree_node(){ id = -1; pos = lpos = rpos = -1; numchildren = 0; } }; now suppose want function returns sum of ids in tree. sounds trivial, have use loop iterates on treearray , accumulates found ids. however, interested in understanding cache behavior of following implementation: void testcache1(int cur){ //find positions of left , right children int lpos = treearray[cur].lpos;

soap - Getting the next hundred records from getAddressBook(JDE BSSV) -

i making request /addressbookmanager?wsdl invoking getaddressbook , getting first hundred records , question if there's way next hundred next hundred(pagination)? i've been looking possible solutions sending parameters/arguments method when invoking want know if possible @ all. i don't have access jde , given wsdl, , having hard time guessing possible or not. any appreciated. thank you! the code(node.js): client.addressbookmanagerservice.addressbookmanagerport.getaddressbook({args inserted here passed}, function(err,response){ ... }); you should able see schema if inside wsdl file under types tag under schemalocation : <types> <xsd:schema> <xsd:import namespace="http://oracle.e1.bssv.jp550101/" schemalocation="https://blahblah/addressbookmanager?xsd=1" /> </xsd:schema> </types> inspecting file, should see xml elements - check see if there elements define page number,

php - Instaling magento from command line errors -

i follow guide. http://devdocs.magento.com/guides/v2.1/install-gde/install/cli/install-cli-install.html i tried run web installatin got stucked try this. when go mysql root mysql> show databases; +--------------------+ | database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0,00 sec) there not tables magento. so run command given in link magento setup:install --base-url=http://127.0.0.1/magento2/ \ --db-host=localhost --db-name=magento --db-user=magento --db-password=magento \ --admin-firstname=magento --admin-lastname=user --admin-email=user@example.com \ --admin-user=admin --admin-password=admin123 --language=en_us \ --currency=usd --timezone=america/chicago --use-rewrites=1 but mine cant run magento use ./magento root@vegan:/var/www/html/magento2/bin# ./magento setup:install --base-url=http://127.0.0.1/magento2/ --db-host=localhost --db-na