Posts

Showing posts from January, 2011

AngularJS Events vs Watches -

what happens inside angularjs when event fired angular internal event system? from performance point of view, should tend use watches or events update parts in application? when js event fired, typically handled in same way js events handled - there nothing special or unique this. however, angular wrap handler inside of $apply block after executes function, can trigger digest cycle: $scope.$apply(function(){ $element.on('click',function(e){ ... }); }) a digest cycle iterates on scope variables, compares each 1 previous value determine if has changed, , if has, corresponding $watch handlers called update view. since using angular, set $watch expressions when want detect model on scope has changed, , dom manipulations inside $watch handler. if concerned performance, make sure $watch function optimized (i.e. avoid full jquery, avoid expensive query selectors, minimize dom manipulation etc.) to answer question, should use $watches moni...

.net - adding value together with the existing value in database -

i developing application , want update information , add value of quantity in existing database new value enter user. it's updating instead of adding quantity it's putting new value @ d of existing value in database e.g if have 5 in database before , 3 in new textbox instead of new value 8, it's showing 35 in database. code, how can adding value con = new oledbconnection("provider=microsoft.jet.oledb.4.0; data source=" & application.startuppath & "\pharmacy.mdb") con.open() dim ct1 string = "select * stock code= '" & txtcode.text & "'" cmd = new oledbcommand(ct1) cmd.connection = con rdr = cmd.executereader() if rdr.read con = new oledbconnection("provider=microsoft.jet.oledb.4.0; data source=" & application.startuppath & "\pharmacy.mdb") con.open() dim cb string = ...

sql server - Multiple drop menus with one PHP script -

website has several pages forms. many of have drop menus. write 1 php script populate multiple drop menus. i'm including code have far, don't think i'm on right track here. order.php <?php include 'functionsfile.php'; ?> <form method="post" action="order.php"> <select name="order_status" id="order_status"> <?php foreach ($data $row): ?> <option><?=$row["order_status"]?></option> <?php endforeach ?> </select> <!-- 3 more drop menus --> </form> <?php $table = array('order_status', 'customer', 'warehouse_id', 'order_description'); fillform($conn, $table); ?> functionsfile.php <?php require 'databaseconnection.php'; function fillform($conn, $table) { foreach ($table $menu) { $query = 'select * $table'; $smt ...

java - Why tomcat is not running in user account of window 7? -

i have installed netbean ide8.0 , tomcat (by customize option in netbean during installation) in administration account of window7. when running project in netbean ok . when running same project in same netbean, in window user account, asking tomcat user id , password, while have not setted user id tomcat. can 1 me, how resolve problem. in advance. go tomcat-users.xml in conf directory of tomcat installation , edit username , password accordingly. can learn userdatabaserealm in tomcat 7 here note : netbeans might have set credetials tomcat during installation

c# - Update Panel AsyncPostBack and PostBack triggers -

i have page in of html generated client side script (jquery). added server side asp.net file control upload files server. now files getting uploaded on button click, causes postback , textboxes company name, street name, city client etc lost, generated jquery. i put upload portion in updatepanel , registered asyncpostback trigger, not getting httpcontext object @ code-behind. turned async full postback using postbacktrigger things became same before(i.e. without update panel). now have 2 questions people: - use of update panel if behaves in same way page without update panel. (postbacktrigger) - should above problem? code: <asp:updatepanel id="uploadupdatepanel" runat="server"> <contenttemplate> <input id="filefield" type="file" runat="server" multiple="multiple" /> <asp:button id="uploadbutton" runat="server" text=...

c# - Implementation of Dependency injection -

i working on web api project. calling repository responsible database interaction. repository interacts third party data source. i want implement dependency injection (di) repository layer inject dependency of third party data source,but how can achieve since there no interfaces in third party dll? i use unity framework. the third party dll includes 1 class: using system; using system.collections.generic; namespace movieslibrary { public class moviedatasource { public moviedatasource(); public int create(moviedata movie); public list<moviedata> getalldata(); public moviedata getdatabyid(int id); public void update(moviedata movie); } } how 3rd party component relate repository? standalone service that's internally used repository? if so, sounds 3rd party component dependency should abstracted. you creating interface of own reflects business operations intend perform, , service implement. might mat...

java - Creating OrderColumn for OneToMany list mapping on a join table in Hibernate -

i have productjob table , quadrat table. every quadrat can installed on many productjob , every productjob can have between 1 , 4 quadrats of same or different kinds! i'm interested keep order of quadrat installation on product jobs. example first, second, third or forth place! following mapping doesn't create order column on jointable telai_quadrati . problem of mapping? ordercolumn isn't created in anyway! @entity @table(name = "telai") public class productjob implements iproductjob, iproductjobprocessing{ @embedded private quadratgroup quadrategroup = new quadratgroup(); } @embeddable public class quadratgroup implements serializable{ @onetomany(targetentity = quadrat.class, cascade = cascadetype.all) @jointable( name = "telai_quadrati", joincolumns = {@joincolumn(name = "dbid", table = "telai")}, inversejoincolumns = {@joincolumn(name = "id", table = "quadrati...

java - Problems writting in archive using TrueZip and symbolic links -

i use truezip (v 7.6.4) write zip archive. have set of folders this: > ls -l /home/remi drwxr-xr-x 2 remi remi 4096 sept. 10 16:49 testtz drwxr-xr-x 2 remi remi 4096 sept. 10 16:49 symlinktarget lrwxrwxrwx 1 remi remi 14 sept. 10 16:47 symlink -> symlinktarget/ > ls -l /home/remi/testtz lrwxrwxrwx 1 remi remi 25 sept. 10 16:47 symlink -> /home/remi/symlinktarget/ here code: package com.tests.forstackoverflow.truezip; import java.io.file; import java.io.writer; import org.slf4j.logger; import org.slf4j.loggerfactory; import de.schlichtherle.truezip.file.tfile; import de.schlichtherle.truezip.file.tfilewriter; import de.schlichtherle.truezip.file.tvfs; import de.schlichtherle.truezip.fs.fssyncexception; public class testtz { logger logger = loggerfactory.getlogger(getclass()); public void writeinarchive(string archivename) { final file f = new tfile(new file(archivename) + "/hello.txt"); try (writer writer = new tfi...

Java replace matches with variables -

/* phone numbers starting 0 after space character , replace 0 "+44 (0)" */ import java.util.regex.*; public class reg6 { public static void main (string [] args) { string variable1 = "test"; pattern phone = pattern.compile("\\s0"); matcher action = phone.matcher(args[0]); string worldwide = action.replaceall(" +44 (0) "); system.out.println(worldwide); } } how can place variable1 replaceall method? if there string {$variable_1} wish replace variable_1 possible? its in php template "{$test}" - want use name matches in string , find variable matches string , put there replacing variable value its in templates you don't have use pattern or matches try following string number ="028346"; if(number.startswith("0")) system.out.println("+44 (0)" + number.substring(1));

PhotoChooserTask built in crop option for windows phone 8.1 -

Image
in windows phone 8 using photochoosertask images phone gallery , when fixed pixel width , height automatically windows phone start page cropping selected image. can tell me how enable option fileopenpicker? unfortunately windows phone 8.1 sdk not have operation, , swear tried in every where, , people of mdsn tell me impossible.... can try 2 options: first: in workflow of fileopenpicker user has 2 options take image file exists or take new picture follow pic: so in case nothing , talk ux area impossible =) . second: can create module(separated project) in same project solution uses windows phone 8.0 sdk (instead 8.1). need job done using photochoosertask... after in main project add reference , happy. some big projects using solution because 8.1 sdk removed lot of features of 8.0 sdk , did things hard do. one project should take in source code https://telegram.org/apps i hope helps. good luck!

eclipse - Hadoop program runs well with "java -jar" but not with "hadoop jar" -

i have coded mapreduce program connects 2 hbase databases. have written on eclipse , have exported "runnable jar" option (with libraries). runs java -jar command. output next: $ java -jar mr.jar log4j:warn no appenders found logger (org.apache.hadoop.metrics2.lib.mutablemetricsfactory). log4j:warn please initialize log4j system properly. log4j:warn see http://logging.apache.org/log4j/1.2/faq.html#noconfig more info. and expected output. however, if run same program hadoop jar command don't know happens guess nothing. expected output doesn't show up. $ hadoop jar mr.jar 14/09/10 17:22:07 info configuration.deprecation: mapred.jar deprecated. instead, use mapreduce.job.jar 14/09/10 17:22:07 info configuration.deprecation: mapred.mapoutput.value.class deprecated. instead, use mapreduce.map.output.value.class 14/09/10 17:22:07 info configuration.deprecation: mapreduce.map.class deprecated. instead, use mapreduce.job.map.class 14/09/10 17:22:07 info configurati...

sharepoint - Required field in custom content type not required in custom list instance -

i have issue custom sharepoint 2013 solution. among other components, consists of: a feature several custom fields different types, of taxonomy fields, a feature 3 custom content types using different sets of custom fields partially different configuration, e.g. whether required or not, a feature custom document library template , instance using 2 of custom content types , default picture library programmatically customized when feature activated, e.g. assigned third custom content type. when deploying solution , activating feature, set correctly except single taxonomy field 1 of doc lib's content types. defined required in both content types indeed not show required default content type whereas works fine other. , not matter of 2 custom content types defined first (= default) in list template's schema.xml, issue occurs same taxonomy field in doc lib's default content type. when use built-in document content type default, field required both custom content types...

build.gradle - How/when to generate Gradle wrapper files? -

i trying understand how gradle wrapper works. in many source repos, see following structure: projectroot/ src/ build.gradle gradle.properties settings.gradle gradlew gradlew.bat gradle/ wrapper/ gradle-wrapper.jar gradle-wrapper.properties my questions: how/when 1 generate gradlew / gradlew.bat ? supposed generate them 1 time when project first created, generate them every time commit/push changes? , how generated? same question above, gradle/wrapper/* files ( gradle-wrapper.jar , gradle-wrapper.properties )? some times see other *.gradle files inside project's gradle directory. these additional gradle files , represent/do? custom plugins? what difference in properties go settings.gradle vs should defined inside gradle.properties ? you generate once, , again when you'd change version of gradle use in project. there's no need generate often. here docs. add wrapper task build.gradle f...

android - Not Run App With Admob (help) Error (Import -

please send tested admob working api 18(android4.2) or higher mainactivity.java error @ import files not exist related admob import com.google.android.gms.ads.adrequest; import com.google.android.gms.ads.adview; package com.a.test; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import com.google.android.gms.ads.adrequest; import com.google.android.gms.ads.adview; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); adrequest adrequest = new adrequest.builder() .build(); adview adview = (adview) view.findviewbyid(r.id.adview); adview.loadad(adrequest); } } androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" ...

javascript - Redirect the Chrome extension popup.html page to a URL for Oauth -

is possible redirect popup html of chrome extension remote url? i'm looking scenario purpose of oauth. when user clicks on "login fb" button, i want html page of chrome extension redirect to: https://www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri={redirect-uri} user prompted log in. is right approach authentication in chrome extension anyway? popups very.. fragile. easy close, user can't use password managers fill form etc. size-constrained. maybe not best idea. you can, instead, use chrome.windows create login-type window: chrome.windows.create({ url: "yourloginurl", type: "popup", focused: true }); however, not "native" way oauth in chrome extensions. the native way use chrome.identity api, chrome.identity.launchwebauthflow . as added bonus, allows use virtual https: callback url, supported option, without having own domain.

java - See cache's hit and misses -

i using hibernate , ehcache second level cache enabled. put @cacheable on user entity, this: @cacheable @cache(usage = cacheconcurrencystrategy.nonstrict_read_write, region = "userscache") public class user extends abstractentity { ... } but when enable hibernate's sql logging, still see `select * users userid = ?" query... thought maybe normal behavior , cache process somehow transparent hibernate, querying , ehcache intercepts , gets data cache... how can see whether query hit or miss? you can enable hibernate statistics generation setting hibernate.generate_statistics property true . can monitor cache hit/miss count via sessionfactory.getstatistics() . sessionfactory.getstatistics().getsecondlevelcachestatistics() provides information. also can seen through jconsole , refer this .

matlab - Modifying Iteration for Multiple Inputs -

i doing iteration find corresponding latitude/longitude @ height (h_intercept). code works single height value. however, want find lat/long of 79 heights (1x79 matrix) , therefore have output 3x79 matrix (llh_test). i've tried loop can't seem results want. doing stupid. basically, need modify run rng_sat, u_sat , h_intercept being 1x79 matrices. needs step through entire iteration before moving next values of rng_sat, u_sat , h_intercept also, want store of llh_test values (3x79 matrix) rng_sat= sat_look_tcs_pass1(3,1)/2e2; u_sat=[sat_look_tcs_pass1(1,1)/sat_look_tcs_pass1(3,1);sat_look_tcs_pass1(2,1)/sat_look_tcs_pass1(3,1);sat_look_tcs_pass1(3,1)/sat_look_tcs_pass1(3,1)]; h_intercept=sat_look_pass1_llh(3,1)/2e3; h_test=0; rng_test_min=0; rng_test_max=rng_sat; err=0.01; while abs(h_test-h_intercept)>err rng_test=(rng_test_min+rng_test_max)/2; tcs_test=u_sat*rng_test; llh_test=tcs2llht(tcs_test,station_llh); h_test=llh_test(3,:); if h_test>=h...

php - MAMP Pro 3.0.6 crashes with every save -

mamp pro closes unexpectedly every time click save button. it appears settings saved, , applied after re-launching application. steps reproduce: launch mamp pro enter osx authentication allow services start click hosts tab add new host or edit existing host edit setting click save mamp pro closes unexpectedly, prompting file report apple restart mamp pro. settings saved, hit stop/start restart services. the crash report says: exception type: exc_bad_access (sigsegv) exception codes: kern_invalid_address @ 0x0000000000000000 i have 4 virtual hosts defined, each ip address set "*" (the default). using port 80/443/3306 configuration. wondering if network issue, tried restarting machine, didn't seem fix problem. i using trial version of mamp pro on mac osx 10.9.4 ( more specs ). if didn't crash every time saved, buy it. i have bug filed @ http://bugs.mamp.info/view.php?id=4595 .

c# - How can I insert 10 million records in the shortest time possible? -

i have file (which has 10 million records) below: line1 line2 line3 line4 ....... ...... 10 million lines so want insert 10 million records database. read file , upload sql server. c# code system.io.streamreader file = new system.io.streamreader(@"c:\test.txt"); while((line = file.readline()) != null) { // insertion code goes here //dal.executesql("insert table1 values("+line+")"); } file.close(); but insertion take long time. how can insert 10 million records in shortest time possible using c#? update 1: bulk insert: bulk insert dbname.dbo.datas 'f:\dt10000000\dt10000000.txt' ( rowterminator =' \n' ); my table below: datas ( datasfield varchar(max) ) but getting following error: msg 4866, level 16, state 1, line 1 bulk load failed. column long in data file row 1, column 1. verify field terminator , row terminator specified correctly. msg 7399, lev...

android - Java preferred line break in a String -

i have string this: "speed1: 10 km/h, speed2: 20 km/h, speed3: 30 km/h, speed4: 40 km/h, speed5: 50 km/h" i want display string in textview, can have variable width. on devices, hole string fits in 1 line. on other devices, 2-3 lines needed. i want string broken @ comma- characters, parameters , values on same line. is there special character in android that? (or have first let string drawn, count number of lines, , replace commas newline character). maybe ugliest solution in world, how replacing "normal" spaces except ones after comma, unicode non-breaking space? ("\u00a0")?

r - LyX 2.1.1 fails to compile knitr-manual.lyx -

Image
lyx 2.1.1 fails compile knitr-manual.lyx , knitr-graphics.lyx (currently installed knitr version 1.6). the error not (i.e. lyx: cannot convert file -- see screenshot). related file-permission bits? how should go it? maybe of interest, sys.getlocale() [1] "lc_ctype=en_us.utf-8;lc_numeric=c;lc_time=en_us.utf-8;lc_collate=c;lc_monetary=en_us.utf-8;lc_messages=en_us.utf-8;lc_paper=en_us.utf-8;lc_name=c;lc_address=c;lc_telephone=c;lc_measurement=en_us.utf-8;lc_identification=c" update from message pane, there indeed error line: 12:28:16.235: quitting lines 93-93 (/tmp/lyx_tmpdir.gwilgtom2017/lyx_tmpbuf1/knitr-graphics.rnw) 12:28:16.238: error in loadnamespace(name) : there no package called 'cairo' 12:28:16.241: calls: knit ... trycatch -> trycatchlist -> trycatchone -> <anonymous> 12:28:16.244: 12:28:16.247: execution halted no cairo? mean in contect of knitr , lyx/latex? r missing "cairo" package. , "tik...

javascript - Getting user location using wikitude SDK for Android -

i'm using wikitude sdk 4.0 android , trying out the sample of multiple pois in app. https://github.com/wikitude/wikitude-sdk-samples/tree/master/3_pointofinterest_3_multiplepois i got instantiated stuck user location. i don't understand how user's location pulled javascript https://github.com/wikitude/wikitude-sdk-samples/blob/master/3_pointofinterest_3_multiplepois/js/multiplepois.js the "ar.context.onlocationchanged = world.locationchanged;" in js magic. after line executed 'world.locationchanged' (or other given) function fired on every android/ios native call of architectview's setlocation executed. check out locationprovider-implementation in sample application basic approach. state-of-the-art location fetching recommend have @ google's location strategies . kind regards.

java - Can't close a print dialogue while clicking print button using javascriptexecutor in selenium Web driver firefox -

i working on automate functional testing using selenium web driver. came across scenario in need click print button on window (say a) open new window (say b). print dialogue got popped window b. need close print dialogue using java script executor. i have tried this. did not work. code: public void handleprintbuttonscenario { string parentwindow_a = driver.getwindowhandle(); //get current window handle printbutton().click(); //clicking print button //switch focus of web driver newly opened window b (string winhandle : driver.getwindowhandle()) { driver.switchto().window(winhandle); } //closing printdialoge closewindowbyjs(); driver.close();// closing window b driver.switchto().window(parentwindow_a); // switching focus window } public void closewindowbyjs() { javascriptexecutor js = (javascriptexecutor) driver; string script = "window.onbeforeunload = null;" + "window.close();"; js.executescript(script); } right happened print dialogue ...

nginx - Rewrite query string to path params -

i have following configuration of nginx hosts image service: upstream thumbor { server localhost:8888; } server { listen 80; server_name my.imageserver.com; client_max_body_size 10m; rewrite_log on; location ~ /images { if ($arg_width="10"){ rewrite ^/images(/.*)$ /unsafe/$1 last; } rewrite ^/images(/.*)$ /unsafe/$1 last; } location ~ /unsafe { proxy_set_header x-real-ip $remote_addr; proxy_set_header host $http_host; proxy_set_header x-nginx-proxy true; proxy_pass http://thumbor; proxy_redirect off; } location = /favicon.ico { return 204; access_log off; log_not_found off; } } i trying rewrite following urls: from http://my.imageserver.com/images/jenesis/embeddedimage/image/jpeg/jpeg/9f5d124d-068d-43...

java - Refreshing JTable data using JcomboBox items coming from Access Database -

how refresh jtable ? here code. public void itemstatechanged(itemevent evt) { string text=(string)to_cmb2.getselecteditem(); try { // connect access database connection con=drivermanager.getconnection("jdbc:odbc:flightdsn"); statement s=con.createstatement(); // read data table resultset rs = s.executequery("select flightno,city,to,arrives,departs i_flights_routes ='"+text+"' "); resultsetmetadata md = rs.getmetadata(); int columns = md.getcolumncount(); // column names (int = 1; <= columns; i++) { columnnames.addelement(md.getcolumnname(i)); } // row data while (rs.next()) { vector<object> row = new vector<>(columns); (int = 1; <= columns; i++) ...

algorithm - search in array with specific properties -

i have 2d array in values monotonic. how find (x,y) |f(x,y) – v1| < t in best way. searching value in matrix sorted rows , columns classic problem. initialize row maximum value , column minimum value. examine matrix entry @ row, column . if it's less target value, increase column one. if it's greater target value, decrease row one. number of matrix entries inspected @ #rows + #columns - 1 . if search continued after target value found decreasing row 1 (respectively, increasing column one), obtain byproduct a determination of elements less than (respectively, less or equal to) the target value . perform search algorithm 2|v| times different target values (less or equal v_i - t , less v_i + t ) solve problem o(|v|n) matrix elements inspected. various optimizations possible. obvious cache matrix values. is, instead of stepping one, use unbounded binary search determine appropriate increment/decrement. it's unclear in prospect whether higher worst-cas...

r - ggplot2 use toupper in aes -

i call toupper within aes call in ggplot2 . example, using plantgrowth change variable group caps. i've been able change x labels caps, x axis title takes on odd title. can manually drop x axis title, seems there easier way. edit 1: should have stated rather not change data in dataframe, i.e., d$group <- toupper(d$group) . instead change labels within aes statement, if possible. library (ggplot2) d <- plantgrowth p <- ggplot () + geom_bar (data=d, aes(toupper(x=group),y=weight),stat='identity') p <- p + theme (axis.title.x=element_blank()) #workaround drop x axis title p thanks -cherrytree use levels() library (ggplot2) d <- plantgrowth levels(d$group) = toupper(levels(d$group)) ggplot() + geom_bar(data=d, aes(x=group,y=weight), stat='identity') edit: not change data.frame version library (ggplot2) d <- plantgrowth ggplot() + geom_bar(data=d, aes(x=group,y=weight), stat='identity') + scale_x_discrete(label = to...

java - Firefox WebDriver: error in command_processor.js? -

from began: i connect autoit selenium tutorial used: runtime.getruntime().exec("d:\autoit\autoittest.exe"); driver.get("http://www.example.com"); and naw i’m have big problem: org.openqa.selenium.webdriverexception: [javascript error: "a null" {file:...anonymous654436572778016798webdriverprofile/extensions/ fxdriver@googlecode.com/components/command_processor.js" line: 8732}]' [javascript error: "a null" {file: ".../appdata/local/temp/ anonymous654436572778016798webdriverprofile/extensions/fxdriver@googlecode.com /components/command_processor.js" line: 8732}]' when calling method: [nsicommandprocessor::execute]

ios - cordova build to *.ipa -

trying create *.ipa file files generate cordova. found useful manual automating cordova ios build . first of such commands: cordova create <folder-name> <package-name> <app-name> cordova platform add ios then when try execute command cordova build ios --device i got errors code sign error: no matching codesigning identity found: no codesigning identiti es (i.e. certificate , private key pairs) matching “iphone developer” fou nd. codesign error: code signing required product type 'application' in sdk ' ios 7.1' ** build failed ** what i`m doing wrong? suggestions.

mysql - Access more than one db with ScalaAnorm with Play -

how access 2 separate mysql databases scalaanorm? the documentation seems provide examples single db access. you give second db name (instead of default ) in application.conf it's own settings: db.default.driver=com.mysql.jdbc.driver db.default.url= ... db.default.user= ... db.default.password= ... db.anotherdb.driver=com.mysql.jdbc.driver db.anotherdb.url= ... db.anotherdb.user= ... db.anotherdb.password= ... then can specify database want use so: db.withconnnection("default") { implicit connection => // uses database named "default" } db.withconnnection("anotherdb") { implicit connection => // uses database named "anotherdb" }

localization - How to keep currency (keeping it localized) independent from system locale on android app? -

i've been researching solution issue while , not find proper solution. closest i've got this entry stackoverflow. since asked 4 years ago (and not issue although solve problem), 'll ask again see if there better workaround. context: want release android app in several countries. available in spain. i've read android developers documentation localization. pretty clear dynamic localized information on code should based on "system locale" when presenting user. problem: problem comes when user changes language on settings manually , want display price (generated app) bases it's currency on system locale preference. example lets live in spain , set device language & input/language english(united states). when app shows prices in dollars ($) want keep showing eur (€) since i'm in spain. how achieve this? this mi actual code showing "localized" price user based on system locale: locale currentlocale = locale.getdefault(); ...

Unable to use Zend\I18n\View\Helper\CurrencyFormat class -

i'm trying implement currencyformat helper, when instance , object of currencyformat application raising exeption: $var new currencyformat(); file: /site/vendor/zendframework/zend-i18n/zend/i18n/view/helper/currencyformat.php :63 message: zend\i18n\view\helper component requires intl php extension in controller i'm including library use zend\i18n\view\helper\currencyformat; i guess need add in composer.json or config files? thanks! the error pretty clear. component requires intl php extension . (usually) bundled php , needs enabled on server.

powershell - Is return code required for Invoke-Command -

powershell script enables psremoting on remote computer executes setup.exe on remote computer disables psremoting on remote computer how can sure disabling psremoting after remote computer able execute setup.exe? am disabling psremoting before remote computer able execute setup.exe? $password = get-content d:\script\cred.txt | convertto-securestring $credentials = new-object -typename system.management.automation.pscredential -argumentlist "administrator",$password $j = "remote_computer" $comp = "\\"+$j $exe = "setup.exe" [string]$cmd = "cmd /c 'c:\share\$exe'" [scriptblock]$sb = [scriptblock]::create($cmd) $bstr = [system.runtime.interopservices.marshal]::securestringtobstr($password) $str = [system.runtime.interopservices.marshal]::ptrtostringbstr($bstr) [system.runtime.interopservices.marshal]::zerofreebstr($bstr) $enable_command = "d:\pstools\psexec.exe $comp -u administrator -p $str -accepteula...

Actionscript 3: assigning variable name to XML data to populate text fields -

here's xml file: <?xml version="1.0" encoding="utf-8"?> <root> <driverone>mario andretti</driverone> <drivertwo>luigi andretti</drivertwo> </root> super simple - have 2 names, driverone , drivertwo. and here's actionscript 3: import flash.events.event; import fl.controls.label; import flash.events.mouseevent; import flash.net.urlloader; import flash.net.urlrequest; stop(); var myxml:xml; var myloader:urlloader = new urlloader(); myloader.load(new urlrequest("bulkfuel.xml")); myloader.addeventlistener(event.complete, processxml); function processxml(e:event):void { myxml = new xml(e.target.data); trace(myxml.driverone); trace(myxml.drivertwo); } //define variable xml data var firstdriver:string = string(myxml.@driverone); var codriver:string= string(myxml.@drivertwo); //populate text fields variables driverone_txt.text=string(firstdriver); drivertwo_txt.text=string(codriv...

c# - What is causing this implementation of GetHashCode to be 20 times slower than .net's implementation? -

i got idea of substring struct this post , this one. second post has implementation of .net's string.gethashcode(). (i'm not sure version of .net from.) here implementation. (gethashcode taken second source listed above.) public struct substring { private string string; private int offset; public int length { get; private set; } public char this[int index] { { return string[offset + index]; } } public substring(string str, int offset, int len) : this() { string = str; offset = offset; length = len; } /// <summary> /// see http://www.dotnetperls.com/gethashcode /// </summary> /// <returns></returns> public unsafe override int gethashcode() { fixed (char* str = string + offset) { char* chptr = str; int num = 352654597; int num2 = num; int* numptr = (int*)chptr; (int = length; > 0; -= 4) ...