Posts

Showing posts from May, 2013

c++ - How to add additional dll search directories for native unit tests? -

i'm working on big code base has many solutions , many more projects. when write unit tests depend on number of dlls being present built other solutions different output folders current solution. i add build steps copy required dll's current solution's output folder can found when run unit tests. can end in lot of wasted space , confusion duplicate dlls , master copy of each dll 1 should go installer. is there better way of adding additional search directories? i considering having test_module_initialize adddlldirectory() , marking dll's delay loaded when load added dll directory searched. but, don't think works have mark dll's delay loaded in exe. but, exe testrunner out of control. it may not best method, since you're using visual studio 2013, should test settings control deployed when run tests. inside of test settings can specify files or folders in deployment section allow select files outside of current solution. can create mult

php - CodeIgniter: Your system folder path does not appear to be set correctly...using HTTPS -

i'm working website didn't build, uses codeigniter framework. had relatively simple task: secure site ssl certificate. no problem. except, site not load https, although still loads correctly using http. gives following error https: your system folder path not appear set correctly. please open following file , correct this: index.php now, error message seems self explanatory...change system path in index.php file, system path set in file: $system_path = '/codeigniter/2_1_3'; fine, folder doesn't exist in directory structure, , neither folder named 'system.' so, don't have clue how fix problem. isn't clear me how website functions @ since can't find folder supposed using system folder. any appreciated. please ask if there additional information need help.

swift - How to forward streaming media (music ) in ios? -

var url = nsurl(string: musicarr?.objectatindex(count) as! string) player = mpmovieplayercontroller(contenturl: url) self.view.addsubview(player.view) player.moviemediatypes.rawvalue player.preparetoplay() player.play() using movie player , playing media remote url! if click on middle of slider mp3 should start there.

c# - Entity Framework Context.Set<T>().Local would not sync with Datagrid after calling LoadAsync -

entity framework local property observablecollection , can bind lets datagrid. items not update call loadasync, or update not reflect datagrid. consider following example: xaml <grid> <grid.rowdefinitions> <rowdefinition height="auto" /> <rowdefinition /> </grid.rowdefinitions> <stackpanel orientation="horizontal"> <button content="load" click="btnload_click"/> <button content="loadasync" click="btnloadasync_click"/> <button content="setdatasource" click="btnsetdatasource_click"/> </stackpanel> <datagrid name="grdtest" grid.row="1"/> </grid> code behind testcontext db = new testcontext(); public mainwindow() { initializecomponent(); } private void window_loaded(object sender, routedeventargs e) { grdtest.itemssource = db.suppliers.local;

bash - RPM: include a set of constants -

so i know how define macros , include these in main spec file. however, want able include set of constants; this: hostnames.spec %define host1 host1 %define host2 host2 ... main.spec %include hostnames.spec ... checkhost %{host1} is there way rpm? perhaps can: according more "rpm argh" or how use %includes , rpm (no version mentioned) allows %include , provided list (and package) included files sources in rpm. blog entry goes on mention complicates include path, making refer ../sources (under rpmbuild directory) rather within build-directory. another ( can rpm spec file “include” other files? ) asserts "sufficiently recent versions of rpmbuild support %include", , reiterates problem include-directories. "sufficiently recent" might not problem, since feature mentioned in 2002 report rpm 3.0.6 ( two issues related %if , %include ).

how fetch kml google earth api -

my fetch kml not work. here code: function initcallback(object) { ge = object; ge.getwindow().setvisibility(true); function finished(object) { if (!object) { settimeout(function() { alert('bad or null kml.'); }, 0); return; } ge.getfeatures().appendchild(object); } var url = 'http://localhost/ta/bangun.aula.kml'; google.earth.fetchkml(ge, url, finished); document.getelementbyid('installed-plugin-version').innerhtml = ge.getpluginversion().tostring(); } kml file not directly parsed js in browser. google needs access kml file. need place kml file google can access (host online). since kml file on localhost , google not able access it.

xml - C# check XmlNode value attribute -

i wrote code check if xmlnode has value, when run crash on !=null. strange because solution known. private static void traversenodes(xmlnodelist nodes) { foreach (xmlnode node in nodes) { if (!node.haschildnodes) { console.writeline(node.name + " " + node.attributes["id"].value); } if (node.attributes["splitcombinationoperator"].value != null) { console.writeline(node.name + " " + node.attributes["splitcombinationoperator"].value); } else { console.writeline(node.name); } traversenodes(node.childnodes); } } the error following: object reference not set instance of object. you should check null values this: node.attributes["splitcombinationoperator"] != null && node.attributes["splitcombinationoperator"].value != null otherwise nullreferenceexception when node.

php - How to get Facebook Page info using Guzzle -

i'm sure i'm missing but, currently, don't understand what. i'm playing guzzle, , i'm trying page info: <?php /** * example of usage of apiconnect information * facebook page through graph api. */ require('../vendor/autoload.php'); /** set here page */ $page = 'samplepage'; $remoteurl = 'https://graph.facebook.com/' . $page; $client = new guzzlehttp\client(); $res = $client->get($remoteurl); echo $res->getstatuscode(); // "200" echo $res->getheader('content-type'); // 'application/json; charset=utf8' echo $res->getbody(); // {"type":"user"...' this code guzzle documentation shows. now, i'm expecting calling code, returns objects contains, in 1 of properties, following json response, 1 receive if call url directly in browser: { "error": { "message": "an access token required request resource.", "type"

java - Math from extended class being ignored? -

have been working code couple days , cannot figure out why skills not using math assigned in attributes.java if allocate 5 points intelligence, science should compute 60. instead science computing 30. think program using original 5 points set @ calculation, instead of upgraded 10? attributes.java public class attributes { static int strength = 5; static int perception = 5; static int endurance = 5; static int charisma = 5; static int intelligence = 5; static int agility = 5; static int luck = 5; static int hitpoints = ((endurance * 4) + (strength)); static int armorclass = (endurance + 1); static int actionpoints = (agility + 1); static int carryweight = ((strength * 30) + 5); static int meleedamage = (strength / 2); static int damageresis = (endurance + 1); static int poisonresis = (endurance * 5); static int radresis = (endurance * 2); static int sequence = (perception + agility); static int healingrate = (

javascript - Gridstack undefined when calling $(".grid-stack").data("gridstack") in global context -

gridstack javascript library can found here . don't know whether need define grid within original function created, can't seem call gridstack , defined. how call gridstack in context want below? thank in advance. $("#button").click(function(){ //var el ='<div class="grid-stack-item-content" />test<div/>'; var grid = $(".grid-stack").data("gridstack"); alert(grid); //this undefined }); $(function () { var options = { cell_height: 80, vertical_margin: 10 }; $('.grid-stack').gridstack(options); });

ansi sql - Longest value of a data in a column -

query display name of user(s) having longest name, sorted name of user. please note there may leading or trailing spaces in names of users. i tried following query: select name, max(length(trim(name))) length user group name order name; but gives me length of values of name column without spaces. but need values have maximum length. suppose there 15 names in column , there 5 names of longest length, 5 names , corresponding length. table name: user column name , datatype: name varchar(255) select * users length(trim(name)) = (select max(length(trim(name))) users) order name

javascript - Making links active dynamically upon click -

i'm using bootstrap's default navbar . want active page represented dark gray block dynamically upon clicking link. can't seem work. here's code have far. it's similar question except i'm trying integrate bootstrap. codeply went down? new demo edits here . i think want $(".navbar-nav a").click(function() { $(".navbar-nav > .active").removeclass("active"); $(this).parent().addclass("active"); return false; });

Importing an empty CSV file in SAS -

i'm trying import series of csv files macro loops thru files in given folder.but, there empty csv files in folder exclude loop. there way in sas find csv file size ? proc import out=&output datafile= "&input" dbms=csv replace; getnames=yes; datarow=2; *guessingrows=32000; run; thanks, sam. here's away in datastep: filename fileref 'c:\date.tmp'; data a; infile fileref truncover; fid=fopen('fileref'); bytes=finfo(fid,'file size (bytes)'); crdate=finfo(fid,'create time'); moddate=finfo(fid,'last modified'); input var1 $20.; run;

java - Why does a TextView from a TableLayout not "update"? -

i have class extends tablelayout, on have textview. correctly displayed first time when constructor called. have method inside class follows: public class verticalb extends tablelayout public textview piece1 ... public verticalb(context con){ super(con); piece1 = new textview(con){ { setid(1); setvisibility(view.visible); setbackgroundcolor(color.green); } }; ... } public void painter(double angle, double initangle) { int finalangle = (int) (angle - initangle); if(finalangle>0 && finalangle<10){ piece1.setbackgroundcolor(color.green); } ... i call method class , parameters passed correctly, , if statement entered when corresponds (i have checked), piece1 not coloured (or @ least not showed in screen). it there way update ui? if not, other alternatives have (maybe override method or asynctask or runonuithread...) thanks in advance!

shell - How wait the end of N process in ksh and after run another process? -

i want run 3 process @ same time , when 3 process finished want run process. for example: ./script1.sh & ./script2.sh & wait script1 , script2 finished , after run ./script3 thanks help man ksh wait [ job ... ] wait specified job , report termination status. if job not given, active child processes waited for. so, e. g. ./script1.sh& ./script2.sh& ./script3.sh wait ./script4.sh will long there no other active child process.

ClassNotFoundException after updating to SoapUI 5.2.0 -

after having updated soapui 5.2.0 i'm getting 15:58:00,756 error [soapui] error occurred [com.eviware.soapui.plugins.auto.factories.autoimportmethodfactory], see error log details java.lang.classnotfoundexception: com.eviware.soapui.plugins.auto.factories.autoimportmethodfactory @ java.net.urlclassloader$1.run(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ java.lang.class.forname0(native method) @ java.lang.class.forname(unknown source) @ com.eviware.soapui.plugins.loaderbase.loadautofactories(loaderbase.java:96) @ com.eviware.soapui.plugins.loaderbase.loadfactories(loaderbase.java:64) @ com.eviware.soapui.plugins.pluginloader.loadpluginfact

mysql - Convert SQL query to Rails ActiveRecord query -

i have sql query multiple left joins works fine: query = <<-eos select date(t.completed_at) completed_date, s.id district, assignee_id, u.first_name, u.last_name, count(t.id) completed_tasks tasks t left join tickets k on k.id = t.ticket_id left join installations on i.id = k.installation_id left join administrative_areas on i.ward_id = a.id left join service_areas s on s.id = a.service_district_id left join users u on u.id = t.assignee_id 1 = 1 , s.id = '#{district_id}' , t.status = '#{status}' , t.kind = 1 , t.completed_at >= '#{days_ago.days.ago.beginning_of_day.to_s(:db)}' , t.completed_at <= '#{days_until.days.ago.beginning_of_day.to_s(:db)}' group date(t.completed_at), s.id, s.name, u.first_name, u.last_name, t.assignee_id eos i got value after mapping: [{:completed_date=>"2015-07-11", :district=>"1339", :assignee

sql server - SQL, get max id of column -

i've got table in ms sql server management studio +------+-----------+-------- | id | client id | bla bla blaaaa +------+-----------+-------- | 1 | 1 | ....... | 2 | 2 | ....... | 3 | 3 | ....... | 4 | 8 | ....... | 5 | 9 | ....... | 6 | 15 | ....... | 7 | 1 | ....... | 8 | 16 | ....... | 9 | 2 | ....... | 10 | 9 | ....... | 12 | 12 | ....... +------+-----------+-------- i need unique [client id] max value of [id], this +------+-----------+-------- | id | client id | bla bla blaaaa +------+-----------+-------- | 3 | 3 | ....... | 4 | 8 | ....... | 6 | 15 | ....... | 7 | 1 | ....... | 8 | 16 | ....... | 9 | 2 | ....... | 10 | 9 | ....... | 12 | 12 | ....... +------+-----------+-------- i tried code, doesn't work .. can me? select * table 1 inner join table 2 o

javascript - Wrapping long-running function in asynchronous call -

i have code causing browser "hang" or "stop responding" due slowness of call rest. browser timeout afaik. (this done way due legacy code, in case might ask why did not use jquery or something--where there stuff in c++ code (activex) needed before calling rest api) so here's code: for (var = 0; < rowelems.length; i++) { var resp = activexobject.writetorest(_rowtodata(rowelems[i])); } how write asynchronous callback activexobject.writetorest call wrapped , not cause timeout issue? passing parameters , getting response back. i can't use jquery since javascript environment code runs not have jquery.

csv - How can I automate exporting of an Oracle table/view? -

i have table in oracle need export file, xls, csv or otherwise. attempting using sqlplus export view csv in shell script setup cronjob. this seems inelegant separators, line size , pagesize seem create lot of errors in data. is there better way accomplish sqlplus? i'm not sure sql*plus configuration elements should causing problems output -- if are, open second question on it. one method can explore using dbms_scheduler-driven pl/sql program write data out utl_file. if consider export process part of database functionality route go. i'd want know want data? exported data on own using disk space. are importing system? if so, more robust connect database system , pull data using sql, writing data disk fraught issues concerning date formats, presence of cr lf in data, number formats, etc.

javascript - Attach to a Socket.io server instance in a background task -

i using socket.io in conjunction express in web application this: var server = express(); var http = require('http').server(server); io = require('socket.io')(http); ... server.set('port', process.env.port || 3000); http.listen(server.get('port'), function() { console.log('listening on port ' + server.get('port')); }); this works totally fine. however, using kue (a job queue system) queue web workers in totally separate thread. need emit messages clients attached socket.io instance shown above web worker. pretty stuck. does know how this?

parsing - SQL Split Multiple Multivalue Columns into Rows -

i have data sent me, , need normalize it. data in sql table, each row has multiple multi value columns. example following: id fname lname projects projdates 1 john doe proja;projb;projc 20150701;20150801;20150901 2 jane smith projd;;projc 20150701;;20150902 3 lisa anderson projb;projc 20150801;20150903 4 nancy johnson projb;projc;proje 20150601;20150822;20150904 5 chris edwards proja 20150905 needs this: id fname lname projects projdates 1 john doe proja 20150701 1 john doe projb 20150801 1 john doe projc 20150901 2 jane smith projd 20150701 2 jane smith projc 20150902 3 lisa anderson projb 20150801 3 lisa anderson projc 20150903 4 nancy johnson projb 20150601 4 nancy johnson projc 20150822 4 nancy johnson proje 20150904 5 chris edwards proja 2

javascript - fengyuanchen cropper how to set up dynamic fixed crop box -

i'm using crop tool fengyuanchen , has awesome features. i'm trying make fixed crop-box dynamic sizes. but i'm stuck on how figger out how make size. i've tried following: $(function() { $('.img-container > img').cropper({ aspectratio: 16 / 9, autocroparea: 0.65, strict: false, guides: false, highlight: false, dragcrop: false, cropboxmovable: false, cropboxresizable: false, setcropboxdata('1600', '1200') }); }); but setcropboxdata doesn't work me. doing wrong? update on matter: this should te correct syntax set fixed width actual cropbox, still don't results: $(function() { var $tocrop = $('.img-container > img'); $tocrop.cropper({ aspectratio: 16 / 9, autocroparea: true, strict: false, guides: false, highlight: true, dragcrop: false, cropboxmovable: false, cropboxresizable: false, built: function () {

windows - findwindow doesn't work c++ -

so im trying create camo unlocker have never had trouble getting process id through findwindow but im trying find black ops 2's proc id window name doesn't work call of duty®: black ops ii code: #include <iostream> #include <windows.h> #include <tchar.h> using namespace std; int main(){ hwnd hwnd = findwindow(0, _t("call of duty®: black ops ii - multiplayer")); if(hwnd){ cout << "window found" << endl; } return 0; } findwindow works correctly. possible causes problem are: you have encoding error. should use unicode api: hwnd hwnd = findwindoww(null, l"call of duty®: black ops ii - multiplayer"); there no top level window window text. use tool spy++ check that. you should make sure read documentation carefully. states following: if function fails, return value null. extended error information, call getlasterror . you should says , call getlasterror in

node.js - Passport.js always executing "failureRedirect" -

first of all, i'm new passport.js maybe ends being naïve question. have strategy signup: // configuring passport var passport = require('passport'); var expresssession = require('express-session'); var localstrategy = require('passport-local').strategy; var facebookstrategy = require('passport-facebook'); app.use(expresssession({secret: 'mysecretkey'})); app.use(passport.initialize()); app.use(passport.session()); app.use(flash()); //[...] passport.use('signup', new localstrategy({ name : 'name', password : 'password', email : 'email', passreqtocallback : true }, function(req, username, password, done) { findorcreateuser = function(){ // find user in mongo provided username user.findone({'name':username},function(err, user) { // in case of error return if (err){ console.log('error in signup: '+err); r

tortoisesvn - How to copy svn directory with all files and subdirectories by file? -

we have huge svn repository. need copy 1 directory subdirectories , not files place, create branch, need exclude many files while copying. thought copying whole directory using tortoisesvn mouse right click , drag , drop , going through created copy , doing "undo add" files don't want see there , commit branch problem files copied individually method , can "undo add" other files linked group of files and/or parent directory , cannot "undo add" individually. can "undo add" whole group. is possible copy such way files copied independently , "undo add" individually? there way maybe break files/parent directory link , still "undo add" individually after mouse right click drag , drop? use remove instead undo add: svn rm path/to/unwanted/file

edit crowd.server.url on confluence to access jira directory (crowd) -

we have jira , confluence hosted external (no direct server access) behind apache. our confluence uses jira logins via atlassian crowd. wanted secure our production jira ssl. add forward rule http-request forwarded https, no longer able login confluence. temporarily let forwarding disabled again. we found in confluence-administration @ user-directories there overview showing "crowd.server.url": "http://<our-jira-url>" , guessed culprit. found posibility edit value. neither in confluence-administration nor there crowd.properties file found in server-paths (installation , application-data) have access to. can please tell , how should configure confluence being able access our jira-user-directory via https? found it. must change value internal crowd (or jira) server url: mysql> use confluence; mysql> update cwd_directory_attribute set attribute_value = 'https://your.new.jira.tld/' attribute_name = 'crowd.server.url

c# - Showing Only Date in Shamsi Calendar -

Image
i using codes show persian date : this model : public class paperorder { public int paperorderid { get; set; } [displayname("سفارش دهنده")] public string customername { get; set; } [displayname("گیرنده")] public string receivername { get; set; } [displayname("شماره تماس")] public string tel { get; set; } [displayname(" نوع سفارش")] public string ordertype { get; set; } [displayname("تعداد")] public string count { get; set; } [displayname("وضعیت سفارش")] public orderstatus orderstatus { get; set; } [displayname("تاریخ ارسال سفارش")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:yyyy-mm-dd}", applyformatineditmode = true)] public datetime? startdate { get; set; } [displayname("تاریخ اتمام سفارش")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:yyyy-mm-dd}",

objective c - How to generate CGPath values from logo -

at bottom of this page there's interesting animation. it's animating cashapelayer uipangesturerecognizer . animation http://ronnqvi.st/images/peak.gif i wanted see how accomplished went github page , found this . below small piece of code. - (cgpathref)loadpath { cgmutablepathref path = cgpathcreatemutable(); // load cgpathmovetopoint(path, null, 7.50878897, 25.2871097); cgpathaddcurvetopoint(path, null, 7.50878897, 25.2871097, 21.7333976, 26.7812495, 29.6894527, 20.225586); cgpathaddcurvetopoint(path, null, 37.6455074, 13.6699219, 39.367189, 3.85742195, 31.9697262, 1.25976564); cgpathaddcurvetopoint(path, null, 24.5722639, -1.33789083, 21.99707, 10.9072268, 21.99707, 22.2255862); cgpathaddcurvetopoint(path, null, 21.9970685, 33.5439456, 15.9355469, 45.8212894, 8.99707031, 47.7294922); ... how can generate these cgpath values? kind of example helpful. you can build simple svg , use https://github.com/arielelki

c# - Tracking a game object transform - Why using FindGameObjectWithTag doesn't work? -

i'm following tutorial (precisely survival shooter ), , @ stage implement navmesh. original script this: transform _player; navmeshagent nav; void start() { _player = gameobject.findgameobjectwithtag("player").transform; nav = getcomponent<navmeshagent>(); } void update() { nav.setdestination(_player.position); } so far nothing special. press play , strangely enemy (i have 1 @ moment in scene) reaches initial position of player (0,0,0) instead of following around if player moves. realized position of player not updated in _player field , stays @ 0,0,0 . i tried different approach: dragged , dropped player's game object onto property in ui (i made property public first , changed gameobject ). in case works flawlessly: gameobject _player; navmeshagent nav; void start() { //player not retrieved here before, it's passed assigning gameobject property directly through ui nav = getcomponent<navmeshagent&g

symfony - Symfony2-Doctrine ManyToMany with 3 fields related -

i'm having problems define association mapping , don't know solve. i want build relation many many between 2 objects not 1 field. one table refers persons , other image, target of relation represent when person has been tagged other person image i need this: | tagged | tagger | photo | | person_id_1 | person_id_2 | image_id_1 | | person_id_3 | person_id_2 | image_id_1 | | person_id_2 | person_id_4 | image_id_2 | i try using many many relations this: /** * @orm\manytomany(targetentity="media") * @orm\jointable(name="persons_tagged", * joincolumns={ * @orm\joincolumn(name="user_tagged", referencedcolumnname="id"), * @orm\joincolumn(name="user_tagger", referencedcolumnname="id") * }, * inversejoincolumns={ * @orm\joincolumn(name="media_id",referencedcolumnname="id") * } * ) **/ private $employeetagged; when try update schema console, table

jms - Generate Client ID on deploy -

i have wildfly cluster should share topic messages different nodes , keep them if 1 node offline. case need durable subscriper. @messagedriven( activationconfig = { @activationconfigproperty(propertyname = "destinationtype", propertyvalue = "javax.jms.topic"), @activationconfigproperty(propertyname = "destination", propertyvalue = "jms/topic"), @activationconfigproperty(propertyname = "subscriptiondurability", propertyvalue = "durable"), @activationconfigproperty(propertyname = "subscriptionname", propertyvalue = "anam123e"), @activationconfigproperty(propertyname = "clientid", propertyvalue = "abcd"), } ) i have noticed if using same clientid system doing load-balancing. if change clientid or subscriptionname unique value works. so when use unique clientid , when subscriptionname ? answer was, unique clientid per node , subs

wcf binding - Wcf service configuration issue -

i getting issue wcf service have created. issue not coming on clients - i.e. on systems working others not. error 1: maximum message size quota incoming messages (65536) has been exceeded. increase quota, use maxreceivedmessagesize property on appropriate binding element. error 2: on system operation contract not exposed properly. red symbol coming across operation contract. , unable call using wcftestclient. config file: <system.servicemodel> <bindings> <basichttpbinding> <binding name="basichttpbinding" maxreceivedmessagesize="2147483647" maxbufferpoolsize="2147483647" > <readerquotas maxarraylength="2147483647" maxstringcontentlength="2147483647" /> </binding> </basichttpbinding> </bindings> <services> <service name="externalservice.service.mydashboardservice"> <host> <baseaddresses> <add baseaddre

java - Stateful bean passivation fails because of Stateless beans references -

i using weblogic 12c (12.1.3 specific) deploy (ejb 3.1) application. in application, have @stateful bean, holds references entitymanager , other @stateless beans, injected using @persistencecontext , @ejb annotations respectively. my issue when stateful bean being passivated , serialized disk, weblogic tries serialize references stateless beans well, , throws notserializableexception referring bean's proxy injected weblogic. comparison - entitymanager reference passivated , reactivated without issue @ all. stateless beans cause issues. i know can define @prepassivate , @postactivate methods make code work, there way can make container handle stateless beans references on own? attaching sample code reproduces problem me. remote bean interface: import javax.ejb.remote; @remote public interface passivate { public void dosomething(); } stateful bean implementation: import javax.ejb.ejb; import javax.ejb.postactivate; import javax.ejb.prepassivate; imp

c# - How to create a Union type in F# that is a value type? -

normal f# discriminated unions reference types. how can create simple (non-recursive , value-type fields) union type in f# value type? based on internet searching current (non-working) attempt looks follows: [<structlayout(layoutkind.explicit)>] type float = [<defaultvalue>] [<fieldoffset 0>] val mutable val1 : float [<defaultvalue>] [<fieldoffset 0>] val mutable int1 : int new (a:float) = {val1 = a} the following blog post appears show possible via c# i'm aware above not idiomatic use of f# trying optimize performance of portion of application , profiling has shown cost of heap allocations (jit_new) causing performance bottleneck... simple union type perfect data structure needs, not heap allocated one. first of all, not this, unless had very reasons. in cases, difference between structs , reference types not big - in experience, matters when have large array of them (then structs let allocate 1 big memory chunk)

php - How to get folder name with "input file webkitdirectory"? -

<head> <script type="text/javascript"> function getfileinfo () { var fileinput = document.getelementbyid ("ctrl"); document.getelementbyid("directory").value = fileinput.val; } </script> </head> <body onload="getfileinfo ()"> <input type="file" id="ctrl" webkitdirectory directory multiple size="60" onchange="getfileinfo ()" /> <div id="info" style="margin-top:30px"></div> <input type="textarea" id="directory" name="directory" value=""> </body> how can assign select folder name directory ? i got looping through files. see var folder in code below. files = e.target.files; var allfiles = new array(); (var = 0, len = files.length; < len; i++) { allfiles[i] = new array()

terminal - Export two different commands to txt -

this beginner question, knowledge of applescript , terminal limited. essentially want run 2 commands , output results single text file on desktop. ping -t 10 *ipaddress* > ~/desktop/wifi.txt system_profiler spairportdatatype > ~/desktop/wifi.txt i have been trying in applescript, , expecting the first command not return result (i'm expecting packet drops) keep resulting in errors like: the command exited non-zero status. an example of how write out wonderful! thanks in advance. sam here's 1 way it: do shell script "(ping -t 10 www.google.com > ~/desktop/wifi.txt || true) && system_profiler spairportdatatype >> ~/desktop/wifi.txt"

angularjs - Retrieve data from Redis and display them on the frontend -

i push , retrieve data redis list in nodejs(express), cannot send them , display on frontend (angular). i push message lpush method , retrieve lrange , want send these data frontend (with express -> app.get{}). on frontend use angular angular-socket-io factory . please take @ server.js file bellow. var express = require('express'); var app = express(); app.use('/', express.static('../app/')); app.use('/bower_components', express.static('../bower_components/')); var server = require('http').createserver(app); var io = require('socket.io').listen(server); var bodyparser = require('body-parser'); var jsonparser = bodyparser.json(); var urlencodedparser = bodyparser.urlencoded({ extended: false }); var redis = require('redis') var redisclient = redis.createclient(); /** * store message in redis * * @function storemessage * @param {string} name * @param {object} data */ function storemessage

ios - When uploading app the CFBundleShortVersionString field must be greater than the previous one -

i'm having problem when uploading new version store. previous build (the latest successful update): version : 3.0 build : 3.0.3 before there : version : 3.0 build : 3.0.2 now i'm trying load : version 3.0 build : 3.0.4 trying upload version i'm receiving following error: error itms-90062: "this bundle invalid. value key cfbundleshortversionstring[3.0] in info.plist file must contain higher version of approved version[3.0]." i checked this post seems pretty old, , talks cfbundleversion , not cfbundleshortversionstring.. need upload new build , not new versione, way approved faster , can test it. if can helpful i'm using xamarin studio.

c# - Fileupload in gridview edittemplate not working in update panel -

i have fileupload control inside gridview edittemplate: <asp:templatefield headertext="template file" itemstyle-horizontalalign="left"> <itemtemplate> <asp:label id="lbltemplatefilename" runat="server" text='<%# eval("templatefilename")%>'></asp:label> </itemtemplate> <edititemtemplate> <asp:fileupload id="futemplate" runat="server" /> <asp:requiredfieldvalidator id="rftemplatefile" display="dynamic" controltovalidate=&

c# - How to identify the Excel custom property is exists or not? -

using excel = microsoft.office.interop.excel; i using method set excel custom property if property exists throws exception, , how can update property if exists public excel.workbook workbk; application _excelapp; public void setdocumentproperty(string propertyname, string propertyvalue) { try { _excelapp = new application(); workbk = _excelapp.workbooks.open(@"c:\12345.xlsx", type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing); object odoccustomprops = workbk.customdocumentproperties; type typedoccustomprops = odoccustomprops.gettype(); object[] oargs = {propertyname,false, msodocproperties.msopropertytypestring, propertyvalue}; typedoccustomprops.invokemember("add", bindingflags.default |