Posts

Showing posts from February, 2014

ios - Data is persistent in one table view, but not when switching between other view controllers -

i'm looking implement contacts list app. have add contact working , actively uses nscoding writing disk contacts. update between list of contacts , new contact view, doesn't when switch view. do need prepareforsegue when coming non-contact views in way prepares data? or need create set<contacts> in first view , pass references through when going between views. of updates data when unwindsegue add contact view controller. i need more context (code) sure solve case. but had similar issues in past 1 simple reason: i put refresh code in viewdidload() . called when viewcontroller loaded (first time appears), not every time switch (doesn't reload it). you should put code in viewdidappear() , or viewwillappear() if want executed each time "switch" view. here code: viewdidappear(){ code code code refreshes view contacts } here should be: viewdidload() { code code } viewdidappear() { code refreshes view contacts } code want ex...

tsql - Create Tree Query From Numeric Mapping Table in SQL -

i have exported table accounting software below. accountid accountname --------- ----------- 11 acc11 12 acc12 13 acc13 11/11 acc11/11 11/12 acc11/12 11/111 acc11/111 11/11/001 acc11/11/001 11/11/002 acc11/11/002 12/111 acc12/111 12/112 acc12/112 then want convert tree query in ms-sql server 2008 use treelist datasource in win aaplication. expected sql query result: accountid accountname id parentid level haschild --------- ----------- --- --------- ------ -------- 11 acc11 1 null 1 1 12 acc12 2 null 1 1 13 acc13 3 null 1 0 11/11 acc11/11 4 1 2 1 11/12 acc11/12 5 1 2 0 11/111 acc11/111 6 1 2 0 11/11/001 acc11/11/001 7 4 ...

Why can't I filter out an element by its id using jQuery? -

try in browser's javascript console: $('<p><span id="wow">foobar</span></p>').filter('#wow') what [] . why that? isn't supposed filter out span who's id isn't "wow"? .filter() filters set of matched elements. element in set of elements <p> tag, doesn't match selector. you want use .find() instead: > $('<p><span id="wow">foobar</span></p>').find('#wow') [<span id=​"wow">​foobar​</span>​]

ms access - SQL: Remove top 4 records from table -

i have table called temptable imported excel sheet. however, how can make use of vba code remove top 4 records unnecessary data. know "select top 4 * temptable" select job. how do delete? appreciated. try delete (select top 4 * temptable) just in case make sure backup before delete

Why default specifier is not allowed to specify for any class member in Java? -

the default access specifier of java class member " default ". mean when no specifier has specified before member of class, java takes default implicitly. have ever tried put default specifier explicitly before method or variable in class. try once , see. class demo{ default string name; // valid??? } i wanted know reason behind it? default keyword has nothing access modifiers. in access modifier's context, absence of specific access modifier called default. default keyword's actual usage - the default keyword can optionally used in switch statement label block of statements executed if no case matches specified value; see switch. the default keyword can used declare default values in java annotation. from java 8 onwards, default keyword used specify method in interface provides default implementation of optional method.

android studio app, press home button while application is working -

i developed android studio app. however, when pressed home button while playing app phone.(not android emulator) then start app again, shows splash activity first shows 1 error. like unfortunately, app stopped. what want is, when pressed home button , start app again, then should start activity pressed home button. don't show splash thing again. as understood, have problems activity lifecycle. think this link you.

chunking - Why does PHP chunk_split() default to a chunk length of 76? -

can explain why 76 characters default, , why might useful in practice? because rfc 2045 semantics specify encoded lines must not longer 76 characters, not counting trailing crlf. addendum: [warning: highly pedantic presentation follows] there several different mechanisms "content-transfer-encoding" , 2 of main methods (for discussion) "quoted-printable" , "base64". quoted-printable encoding intended represent data correspond printable characters in us-ascii character set. base64 content-transfer-encoding designed represent arbitrary sequences of data in form need not humanly readable. both encodings transform input arbitrary domain material safe carry on restricted transports . "restricted transports" means transport can handle 7-bit data, i.e. acoustic modems , analog lines. in other words, it's designed reliable in crappy conditions. because quoted-printable expected line-oriented , because rfc 2045 dates 1996 seem...

email - Edit the subject of a forwarded message using Applescript - encountering error when editing subject line -

i have been trying write applescript forward message , edit subject. working on forwarding , populating of recipient , subject line. when run gives me error: "mail got error: can't set subject of item any." here code: tell application "mail" set theselection selection set theforwardedmessage forward (item 1 of theselection) opening window tell theforwardedmessage make new recipient properties {address:"address@blahblah.com"} set subject "blahblahblah" end tell end tell i can't figure out why it's telling me can't edit subject line. pointers? i hope little bit, don't understand script , question. set recipientname "zwekkerboy" set recipientaddress "john@doe.com" set thesubject "subject here" set thecontent "content" --mail tell block tell application "mail" --create message set themessage make new outgoing message proper...

unix - Bash : Huge file size processing issue in vim mode -

i have huge file size of 500mb , each line have data mentioned below. #vim results.txt {"count": 8, "time_first": 1450801456, "record": "a", "domain": "api.ai.", "ip": "54.240.166.223", "time_last": 1458561052} {"count": 9, "time_first": 1450801456, "record": "a", "domain": "cnn.com.", "ip": "54.240.166.223", "time_last": 1458561052} ......... 25 million lines in total. now , keep results.txt file , 8,1450801456,a,api.ai,54.240.166.223,1458561052 9,1450801456,a,cnn.com,54.240.166.223,1458561052 .... by removing unwanted strings count , time_first , record ,domain , ip , time_last. right , in vim mode i'm removing each , every string. example, %s/{"count": //g . for 1 string , took more time replace it. i'm beginner in bash/shell, how can using sed / awk ? suggestio...

javascript - Lightbox 2 Implementation -

i have tried implement , use lightbox jquery function on website not working. have looked @ documentation , structured page site says yet know why plug in not working the lightbox resources (the css , js files) aren't being loaded. thats why lightbox isn't working. take @ how did reference these files, referenced wrong folder, or something...

python - Subtract each row in dataframe by one preceding it -

i have dataframe so: day 123 126 210 230 and want create new column subtracts each row 1 preceding it. have tried this: df['diff']=df.set_index('day').diff() but doesn't seem correct. my desired output is: day diff 123 0 126 3 210 84 230 20 you don't need set day index that: in [55]: df.day.diff().fillna(0) out[55]: 0 0.0 1 3.0 2 84.0 3 20.0 name: day, dtype: float64 or if have 1 column: in [56]: df.diff() out[56]: day 0 nan 1 3.0 2 84.0 3 20.0 if need integers: in [58]: df.diff().fillna(0).astype(int) out[58]: day 0 0 1 3 2 84 3 20

html - Use global-messages.properties with Struts2 label tag -

normally use html label label fields follows <div class="col-sm-2 col-xs-12"> <label class="pull-right"> <s:text name="fax"></s:text>: </label> </div> <div class="col-sm-3 col-xs-12 text-left"> <s:property value="organizationinfo.fax"/> </div> where fax defined in global-messages.properties file. need use struts2 <s:label> inside of <s:iterator> each label have unique id connect each field. tried several ways including following <s:iterator value="chosenshipperviewlist" status="status"> <div class="col-sm-2 col-xs-12 "> <s:label for="%{'deleteshipper'+#status.index}" class="pull-right"> <s:text name="deleteshipperinfo"></s:text>: </s:label> </div> <div class="col-sm-3 col-xs-1...

hadoop - Read records from Hive Table using Java (through Hivemetastoreclient or Hcatalog or WebHcat) -

one hive table t_event in demo_read database. table has more 100,000 records.how read records through java api. well, don't want read data. need transform , upload database or (if data relatively small) export common format (csv, json, etc.). you transform data hive cli, webhcat or jdbc hive driver.

python - UnboundLocalError: local variable 'user_a' referenced before assignment -

this question has answer here: python variable scope error 10 answers i cannot figure out how make code below work. getting exception: unboundlocalerror: local variable 'u' referenced before assignment user_a = "no selection" def if_statement(): user_choice = input("pick 1 or 2\n") if user_choice == "1": user_a = input("what equal?\n") if_statement() elif user_choice == "2": print("a equals: " + user_a) if_statement() if_statement() can me on this? must specify new python. thank in advance. solution(s): use default values parameters: def if_statement(user_a='no selection'): user_choice = raw_input("pick 1 or 2\n") if user_choice == "1": u = input("what equal?\n") if_stateme...

ios - Delay when using instantiateViewControllerWithIdentifier but not performSegueWithIdentifier? -

the code below used push view controller onto navigation stack. when using instantiateviewcontrollerwithidentifier , segue noticeably sluggish first time (~3 seconds) occurs reasonably fast each subsequent time. other posts suggested ensuring segue occurs on main thread, code accomplishes, didn't fix problem. however, using performseguewithidentifier causes no delay. the viewdidload code sendviewcontroller same first , subsequent pushes. tried blanking out viewdidload destination view controller, still lag exists instantiateviewcontrollerwithidentifier not performseguewithidentifier . how fix delay instantiateviewcontrollerwithidentifier ? no delay: @ibaction func buttontapped(sender: uibutton) { performseguewithidentifier(sendsegue, sender: self) } results in delay when showing sendviewcontroller first time: @ibaction func buttontapped(sender: uibutton) { dispatch_async(dispatch_get_main_queue()) { let vc = self.storyboard!.instantiatev...

sql - Making a column having an "unique" value depending on the value of another column -

let's have simple table called "characters": realm_id | character_name | xp ---------|----------------|---------- 1 | "mike" | 10 1 | "lara" | 25 2 | "mike" | 40 what want have unique names depending on realm_id . so, example, while having 2 "mikes" different realm_id s allowed, it's not allowed have 2 "mikes" within same realm_id . possible? if you're looking perform select statement on data you'll looking (assuming highest xp wins); select realm_id character_name max(xp) xp characters however, if want table not allow duplicates in first place you're best looking @ making teh realm_id , character_name composite primary key. stop duplication happening in first place although you'll have consider happens when tries insert duplicate, it'll throw error.

html - Source code error in webpage caused by revolution slider -

at moment check source code of web page shows errors (view-source:http:// www. lamina-galvanizada.com/) any idea causing them? cant let page having those revolution slider errors it shows , says theres missing nav tag open missing tag in code any idea how solve this? thanks

linux - How to compile and run c program using exec command in php? -

when run <?php echo exec('whoami'); ?> it works fine, other single word command but exec('gcc -o hello.c'); not create object file a. or when try exec('./a'); precreated object file, not make change. no error no notification! any appreciable! basic reference: exec() manual page bash redirections (applies other shells) with elements, it's straightforward obtain error messages: <?php exec('gcc -o hello.c 2>&1', $output, $return_value); echo ($return_value == 0 ? 'ok' : 'error: status code ' . $return_value) . php_eol; echo 'output: ' . php_eol . implode(php_eol, $output); e.g., in (windows) computer: error: status code 1 output: "gcc" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable.

c# - Importing csv file with commas in it Asp.net -

this question has answer here: dealing commas in csv file 21 answers i importing csv file , column in csv file can have commas in it. when import increases columns . 3,stage3,"desc stage,test,test2",55.98,98.76 this row , want columns : 3, stage3, "desc stage,test,test2", 55.98, 98.76 try this public static string[] splitcsv(string csvlinewithquotedtextwithcommas) { regex regextoseperate = new regex("(?:^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)", regexoptions.compiled); list<string> result = new list<string>(); string curr = null; foreach (match match in regextoseperate.matches(csvlinewithquotedtextwithcommas)) { curr = match.value; if (0 == curr.length) { result.add(""); ...

c++ class the output doesn't display completely -

this code produces no errors, in output line show program exits: cout << "write 1 areaoftrapezium , 2 areaofrhombus , 3 areaofparallelogram " << endl; cin >> option; and here full code don't know wrong #include<iostream> using namespace std; class project { private: float base, base2, height; float diagonal, diagonal2; float base3, aldtude; public: void trapezium() { float areaoftrapezium; areaoftrapezium = 0.5*(base + base2)*height; cout << "the area of trapezium is:" << areaoftrapezium; } void rhombus() { float areaofrhombus; areaofrhombus = 0.5*diagonal*diagonal2; cout << "the area of rhombus is:" << areaofrhombus; } void parallelogram() { float areaofparallelogram; areaofparallelogram = base3*aldtude; cout << "the area of parallelogram is:" << areaofparallelogram; } project(int a, int b, int c){ b...

python - Slicing numpy recarray at "empty" rows -

i created numpy.recarray .csv-inputfile using csv2rec() -method. inputfile , consequently recarray have empty rows no data (resp. nan -values). want slice recarray @ nan -rows multiple sub-arrays, excluding nan -rows in final arrays shown below. original recarray 2 columns: [(1,2) (2,2) (nan,nan) (nan,nan) (4,4) (4,3)] 2 sub-arrays without nan-values: [(1,2) (2,2)] and [(4,4) (4,3)] i know managed using loop maybe there's simpler , more elegant way? additionally: possible keep header-information of each column can refer columns parameter-name , not col-index after slicing? for 2d-array : a[~np.all(np.isnan(a),axis=1)] for structured array (recarray) can this: def remove_nan(a, split=true): cols = [i[0] in eval(str(a.dtype))] col = cols[0] test = ~np.isnan(a[col]) if not split: new_len = len(a[col][test]) new = np.empty((new_len,), dtype=a.dtype) col in cols: new[col] = a[col][~np.isnan(a[col])] ...

Parsing JSON Results with PHP - Yahoo Search API -

i able retrieve results yahoo api key, using instructions found on yahoo developers website. http://developer.yahoo.com/boss/search/boss_api_guide/codeexamples.html# code: if ($_post['query']) { $newline="<br />"; $query = urlencode("'{$_post['query']}'"); require("oauth.php"); $cc_key = "key goes here"; $cc_secret = "secret goes here"; $url = "http://yboss.yahooapis.com/ysearch/web"; $args = array(); $args["q"] = "$query"; $args["format"] = "json"; $consumer = new oauthconsumer($cc_key, $cc_secret); $request = oauthrequest::from_consumer_and_token($consumer, null,"get", $url, $args); $request->sign_request(new oauthsignaturemethod_hmac_sha1(), $consumer, null); $url = sprintf("%s?%s", $url, oauthutil::build_http_query($args)); $ch = curl_init(); $headers = array($request->to_header()); curl_setopt($ch, curlopt_httpheade...

html - How to left text align on desktop but text align center on small devices? -

this code use not working: .test-one { text-align-last: left } @media screen , (min-width: 400px) { .test-one { text-align: center; } } can please tell me i`m wrong? instead of min-width use max-width (using non-mobile approach) , , use text-align , not text-align-last because align last line in case. see basic demo here: .test-one { text-align: left } @media screen , (max-width: 480px) { .test-one { text-align: center; } } <div class="test-one">lorem ipsum dolor sit amet, consectetur adipiscing elit. mauris finibus mauris. vestibulum pellentesque libero eget rutrum pellentesque. aenean sit amet ullamcorper erat, quis egestas ex. nulla non suscipit enim, @ pretium nisl. donec euismod dolor ante, id vulputate tortor sagittis ut. praesent ullamcorper justo et tortor venenatis, tempor efficitur nunc aliquet. in bibendum, magna sed pretium pellentesque, sem justo porttitor risus, vitae dapibus urna lectu...

jenkins - For loop in groovy with two list of variables -

i have list of batch commands performs xcopy 's, this. jenkins pipeline script: bat "xcopy %cd%${some_path1}\\obj\\lab5\\package\\packagetmp ${host1}\\dir1 /e /y /v" bat "xcopy %cd%${some_path2}\\obj\\lab5\\package\\packagetmp ${host1}\\dir2 /e /y /v" bat "xcopy %cd%${some_path3}\\obj\\lab5\\package\\packagetmp ${host1}\\dir3 /e /y /v" how use loop in groovy, can have 1 line of batch command , pass value of variables ("some_path1", "some_path2", "some_path3") & ("dir1", "dir2", "dir3") so, given list of paths: def paths = ['some_path1', 'some_path2', 'another_path'] and list of directories each path (in 1:1 relationship) def dirs = ['dir1', 'dir_for_some_path2', 'another_dir'] you can do: [paths, dirs].transpose().each { path, dir -> bat "xcopy %cd%${path}\\obj\\lab5\\package\\...

c# - Image server path ASP.NET Including controller and method -

i having problem deleting image in asp.net mvc 5 application. creating user management module of application requires images/photos of staff uploaded. however, since profile should editable, image should made possible deleted. when try delete image, find difficult locating correct path of image. when use var filetodelete = path.combine(server.mappath("~content/photos/people/"),updatedstaff.photo); system.io.file.delete(filetodelete); or `var filetodelete = server.mappath("~content/photos/people/"+updatedstaff.photo); system.io.file.delete(filetodelete);` the path returned image wrong in that, contains controller , method in path , cannot delete image. this error message get: could not find part of path 'c:\users\josh\documents\visual studio 2015\projects\eduplus\eduplus\staffmembers\edit\~content\photos\people\de1e1cf0-d.jpg' "staffmembers" controller , "edit" method p...

c# 4.0 - VS 2015: Project not loaded for debugging -

i have solution 15 projects. environment vs enterprise 2015 on windows 10. while debugging, breakpoints on (about 3/4) of projects show "the breakpoint not hit. no symbols have been loaded document....". while looking possible reasons issue breakpoints, opened modules window (debug -> windows-> modules) , found these projects don't show in list of loaded modules. other projects in solution there in loaded modules list. reason debugger unable load these projects?

vb.net - Visual basic 2010, database – how to fill specific field -

Image
i'm creating database connection in visual basic. when user click on "borrow book" transfer chosen data table used lent books. works alright, need last thing. in database in lent table have attribute "end date of lent" , want fill everytime when user borrow book date today + 1 month (for instance, if 19/04/2016, end date 19/05/2016). created method "borrowtime" this, don't know should type , how can value of inserted row "row". , sorry horrible of code , form... public class frm_userview dim bookssource new bindingsource dim borrowsource new bindingsource dim booksview new dataview dim borrowview new dataview dim ds new dataset dim borrow byte private sub frm_userview_load(sender system.object, e system.eventargs) handles mybase.load tmr_timer.start() me.loanerbookstableadapter.fill(me.gmitlibrarydataset1.loanerbooks) me.bookstableadapter.fill(me.gmitlibrarydataset.books) ...

JavaScript closure within eventlistener -

<button>test</button> <button>test</button> <button>test</button> <button>test</button> <button>test</button> <script> var nodes = document.getelementsbytagname('button'); function clicked(i){ console.log('pass'); // closure // return function(){ // console.log(i); // } } (var = 0; < nodes.length; i++) { nodes[i].addeventlistener('click', clicked(i)); } </script> i try have understanding on js closure, above function add listener buttons. console log 'pass' 5 times , nothing when button clicked. if uncomment out closure bit (return), console.log echo out i, not log 'pass'. did find relevant answer don't why closure onclick doesn't log ' pass ' string when button clicked instead log out i . how javascript closures work? what doing here directly calling function clicked instead of setting event handler. i don...

amazon web services - Unable to Connect AWS to boxfuse -

i trying connect boxfuse aws account getting below. highly appreciated `role arn arn:aws:iam::535880694150:role/boxfuse-access has not been configured. please check configuration , try again. (awssecuritytokenservice: accessdenied -> user: arn:aws:iam::762186188748:user/boxfuse-console not authorized perform: sts:assumerole on resource: arn:aws:iam::535880694150:role/boxfuse-access)` i followed instructions provided boxfuse, missing something, need special.i used policy provide boxfuse {"version": "2012-10-17","statement":[ {"sid":"allow","effect":"allow","resource":["*"], "action":["ec2:*","elasticloadbalancing:*","autoscaling:*","rds:*","cloudwatch:*","iam:listinstanceprofiles","iam:passrole"]}, {"sid":"ec2deny","effect":"deny", "action":[...

How to keep storage bucket synced with Google Cloud Source Repository -

question: does google automatically update storage buckets changes pushed project's cloud source repository? example: i create google cloud platform project called cooking , store file recipe.txt in bucket. i modify recipe.txt , push changes local master branch cloud source repository cooking . when @ source code panel project, see recipe.txt up-to-date latest changes. when @ storage bucket project, see recipe.txt not up-to-date (i.e. not in sync project's cloud source repository). no. google cloud source repositories can configured stay in sync other git repository services, such github or bitbucket, there no relationship between google cloud source repository repositories , gcs buckets.

Using jquery .load to load cross domain site using James Padolsey's jquery mod -

i trying use mod performing cross domain requests jquery: http://james.padolsey.com/javascript/cross-domain-requests-with-jquery/ . the script available @ https://github.com/padolsey/jquery-plugins/blob/master/cross-domain-ajax/jquery.xdomainajax.js . firstly test functionality of mod performing .load function quoted on page: $('#container').load('http://google.com'); // seriously! my simple guess on how following <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <script type="text/javascript" src="jquery.xdomainajax.js"></script> </head> <body> <div id="container"> google.com should placed here </div> <script type="text/javascript"> $('#container').load('http://google.com'); </script> </body> </html> this doesn't work, th...

javascript - jquery_accordion.js code needed for nested accordions -

i want know new coding, js. capable @ html , css, beyond clueless. however, @ following instructions. have spent days researching , still clueless how fix problem...i have read cannot have multiple accordions open, have seen done...i don't know how. using jquery_accordion.js faq page. coding have @ top of faq.page.liquid template. <script type="text/javascript" src="{{ 'jquery_accordion.js' | asset_url }}"></script> $(document).ready(function() { $('.accordion').accordion({ cookiename: 'accordion_nav' }); }); </script> /** * accordion, jquery plugin * * plugin provides accordion cookie support. * * @version 1.1 */ (function($) { $.fn.accordion = function(options) { //firewalling if (!this || this.length < 1) { return this; } initialize(this, options); }; //create initial accordion function ini...

How does Spark Sql Parse Json? -

i working spark sql , considering using data contained within json datasets . aware of .jsonfile() method in spark sql. i have 2 questions: what general strategy used spark sql .jsonfile() parse/decode json dataset? what other general strategies parsing/decoding json datasets? (example of answers i'm looking json file read etl pipeline , transformed predefined data structure.) thanks.

datetime - Python Pandas Combined Date and Hour Into One Column -

how combine day (datetime64[ns]) , hour (int64) 1 datetime column? day hour 0 2010-04-24 17 1 2012-08-20 10 2 2016-03-06 9 3 2016-01-02 10 4 2010-12-21 4 df = pd.dataframe({ 'day': np.array(['2010-04-24', '2012-08-20', '2016-03-06', '2016-01-02', '2010-12-21'], dtype=np.datetime64), 'hour': np.array([17, 10, 9, 10, 4], dtype=np.int64)}) >>> pd.to_datetime(df.day) + pd.to_timedelta(df.hour, unit='h') 0 2010-04-24 17:00:00 1 2012-08-20 10:00:00 2 2016-03-06 09:00:00 3 2016-01-02 10:00:00 4 2010-12-21 04:00:00 dtype: datetime64[ns]

arrays - Is it possible to grab the NUMBER that was concatenated to a string? (Javascript) -

i'm using cookies , setting them this: document.cookie ="cookievalue1="+cookievalue1; document.cookie ="cookievalue2="+cookievalue2; document.cookie ="cookievalue3="+cookievalue3; then put in array called cookie array: var allcookies = document.cookie; cookiearray = allcookies.split(';'); if print out array, like: cookievalue1= 23 or cookievalue2= 42. but there way value after string (23 or 42 only) rather string , number? i tried deleting "cookievalue=" part, makes can't store cookies. i'm using forms , want numbers inputted can use them , add/subtract them on page. right now, can't add or subtract anything. you do: allcookies.split(';').map(c => c.split('=')[1]); it'd give cookie value string. if numbers can do: allcookies.split(';').map(c => +c.split('=')[1]); this gives cookie values numbers.

asp.net core - Building web app on ubuntu 14.04 -

i'm trying add sqlite db ubuntu server following tutorial: http://ef.readthedocs.org/en/latest/platforms/coreclr/getting-started-linux.html#install-sqlite but i'm come across error on to make sure files correct, can compile project on command line running dnu build --quiet part. after running command (dnu build --quiet) following errors: building keepitsolved dnxcore,version=v5.0 system.unauthorizedaccessexception: access path '/var/www/kis/src/keepitsolved/bin/debug/dnxcore50' denied. @ system.io.unixfilesystem.createdirectory(string fullpath) @ system.io.directory.createdirectory(string path) @ microsoft.dnx.compilation.csharp.roslynprojectreference.emitassembly(string outputpath) @ microsoft.dnx.tooling.buildcontext.build(list`1 diagnostics) @ microsoft.dnx.tooling.buildmanager.buildconfiguration(string baseoutputpath, ienumerable`1 frameworks, list`1 alldiagnostics, string configuration) @ microsoft.dnx.tooling.buildmana...

material design - Android shared element transition on ImageView scale is wrong -

i have tried many different variations , cannot return transition work properly. when exit activity b image transitions activity scaled until disappears after disappearing shows should. i have tried different variations of following , others in group activity coming click listener in recyclerview. intent intent = new intent(getactivity(), applyactivity.class); activityoptionscompat transitionactivityoptions; transitionactivityoptions = activityoptionscompat.makescenetransitionanimation(getactivity(), imageview, getstring(r.string.transition_image_details)); intent.putextra(applyactivity.extra_name, selected_launcher); intent.putextra(applyactivity.extra_installed, mlaunchers.get(position).getinstalled()); getactivity().startactivity(intent, transitionactivityoptions.tobundle()); activity layout <imageview android:id="@+id/launcher_icon" android:transitionname="@string/transition_image_detail...

multithreading - Removing idle threads from thread pool in Java? -

i'm using java thread pool of fixed size (executorservice). let's assume submit job thread pool , job gets idle. is there possibility idle jobs removed thread pool, other jobs queue can processed , idle job later added again? if move executorservice threadpoolexecutor , can achieve below api public void setcorepoolsize(int corepoolsize) sets core number of threads. overrides value set in constructor. if new value smaller current value, excess existing threads terminated when next become idle. if larger, new threads will, if needed, started execute queued tasks. if want re-size pool @ run time, ((threadpoolexecutor)service).setcorepoolsize(newlimit); //newlimit new size of pool other api: public void setmaximumpoolsize(int maximumpoolsize) sets maximum allowed number of threads. overrides value set in constructor. if new value smaller current value, excess existing threads terminated when next become idle.

java - FileNotFoundException (sunrsasing.jar) -

i'm translating api php java, i've wrote following code emulate sha1 method php. problem when creates new formatter object, filenotfoundexception, debugging found out couldn't find "sunrsasing.jar", looking through stackoverflow found: which i'm reading before jdk5, in separate jar provided sun mentioned. after that, distributed part of jdk, , not separate jar. blockquote so question is, there way can fix error other copy & paste jar other source? if not, can find it? private static string encryptpassword(string password) { string sha1 = ""; try { messagedigest crypt = messagedigest.getinstance("sha-1"); crypt.reset(); crypt.update(password.getbytes("utf-8")); sha1 = bytetohex(crypt.digest()); } catch(nosuchalgorithmexception e) { e.printstacktrace(); } catch(unsupportedencodingexception e) { e.printstacktrace(); } retur...

c# - Selecting multiple ListBox items in the same ListBox with one click -

how can programmatically select other items in listbox clicking item in same listbox? c# winforms project. for example when click clothes below, pants , shirts need highlight automatically. same goes auto parts highlight tires , transmissions. clothes pants tires shirts transmissions auto parts i have listbox bound datasource (itemlist) , tried add "itemindex" each item in list handle sorting (i'm sure there better way?) made sense me @ time, couldn't figure out how make work outside head... here current code, please bare me still learning this. suggesstions fantastic. using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace listbox_test { public partial class form1 : form { bindinglist<item> itemlist = new bindinglist<item>(); public form1() { initializeco...

java - How to set trust manager in Spring to connect to webservice over https -

i'm stuck! tried said in internet no luck. there webservice configured ssl , want send soap message server on https. here message sender i've created spring: public class keystoreawaremessagesender extends httpsurlconnectionmessagesender { public cbiskeystoreawaremessagesender() { try { keystore ks = keystore.getinstance("jks"); inputstream = new fileinputstream("d:\\dev\\keystore\\my-keystore.jks"); ks.load(is, "mypass1".tochararray()); setsslprotocol("tlsv1"); sslcontext c = sslcontext.getinstance("tlsv1"); certificatefactory cf = certificatefactory.getinstance("x.509"); trustmanagerfactory tmf = trustmanagerfactory.getinstance(trustmanagerfactory.getdefaultalgorithm()); tmf.init(ks); super.settrustmanagers(tmf.gettrustmanagers()); //x509trustmanager defaulttrustmanager = (x509trustmanager) tmf.gettrustmanage...

angular - Routing redirecting to root -

i trying route using router.navigate method. followed instructions letter, when route via api, reloading root page. in rootcomponent trying use this._router.navigate(['abc', 'page1']); should redirect me application/abc/xyz but if directly visit application/abc/xyz through browser, working seamlessly app.component.ts import {component} "angular2/core"; import {routeconfig, router_directives, router_providers} "angular2/router"; import {rootcomponent} "./components/root.component"; import {page1component} "./components/page1.component"; @component({ selector: 'app', template: '<router-outlet></router-outlet>', directives: [router_directives], providers: [ router_providers ] }) @routeconfig([ { path: '', name: 'root', component: rootcomponent, useasdefault: true }, { path: '/abc/......

Replace underlying standard errors in lm() OLS model in R -

i run ols model using lm() in r , replace standard errors in model. in following example, replace each standard error "2": set.seed(123) x <- rnorm(100) y <- rnorm(100) mod <- lm(y ~x) ses <- c(2,2) coef(summary(mod))[,2] <- ses sqrt(diag(vcov(mod))) <- ses any thoughts on how this? thanks. those assignments not going succeed. coef , sqrt , vcov not going pass values "upstream". this: > false.summ <- coef(summary(mod)) > false.sqrt.vcov <- sqrt(diag(vcov(mod))) > false.summ estimate std. error t value pr(>|t|) (intercept) -0.10280305 0.09755118 -1.0538371 0.2945488 x -0.05247161 0.10687862 -0.4909459 0.6245623 > false.summ[ , 2] <- ses > false.sqrt.vcov (intercept) x 0.09755118 0.10687862 > false.sqrt.vcov <- ses you modify summary-object @ least coef -matrix, there no "vcov" element in summary despite fact vcov return value. > sum...