Posts

Showing posts from August, 2010

mongoDB error: Error: failed to connect to [localhost:27017] -

i'm trying install habitrpg locally keep getting mongodb error after typing node src/seed.js : error: failed connect [localhost:27017] i saw on other questions same error people have suggested typing in 'mongod' , fixes creating local server. error: -bash: mongod: command not found can't figure out what's wrong. ideas? open cmd (in windows) or terminal (in ubuntu). type command >cd path_for_mongodb_bin_folder cd c:\program files\mongodb\server\3.2\bin for ubuntu command same : cd /home/mongodb/server/3.2/bin then type command >mongod --dbpath path_for_data_folder mongod --dbpath c:\data\db for ubuntu command : ./mongod --dbpath /home/data/db you can specify folder data folder. wait till cmd or terminal shows "waiting connections" 2016-09-01t21:38:33.170+0530 network [initandlisten] waiting connections on port 27017 then open new cmd or terminal window. type command >cd pat

php - PDO connection to MS SQL Server 2008 -

i have done once before in vm, however, needed create second instance of vm, , trying connect ms sql server. have php-5.3.6-nts-win32-vc9-x86 version of php installed. have correctly configured php.ini , running phpinfo() can verify have sqlsqrv pdo drivers installed correctly. using in conjunction iis 7, , have webserver , running. have following line in index.php file $conn = new pdo("sqlsrv:server=$servername; database=classreg"); i have following give me feedback on if made successful connection database. if($conn) { echo "connection established. </br></br>"; } else { echo "connection not established. </br>"; die(print_r(sqlsrv_errors(), true)); } problem is, i'm not getting out of $conn variable. i've tried echo variable, , i'm not getting feedback. fwiw php.ini file reads these 3 lines @ end of file [php_ms_sql_pdo] extension=php_sqlsrv_53_nts_vc9.dll extension=php_pdo_sqlsrv_53_nts_vc9.

javascript - Why does the position of scroll change when I append data? -

i appending data not in same div . when append data, focus or scroll position goes in between append content. appending data when user scroll bottom. when save google images, loads images when user goes last lines loads more images without changing scroll position. can in example http://jsfiddle.net/cq75j/10/ var pages = [page_1, page_2, page_3, page_4, page_5]; var backuppages=new array(); var totalpage = "page_" + pages.length; $("#current").html(pages.pop()); $("#fullcontainer").scroll(function () { if ($(this).scrolltop() >= $(this)[0].scrollheight - document.body.offsetheight && pages.length) { // alert("--") $("#next").html('') $("#pre").html('') $("#pre").html($("#current").html()); $("#current").html(''); $(this).scrolltop( $("#current").html(pages.pop()

sql - Table in Derby with complex primary key -

is possible have primary key composed of foreign keys fk1 , fk2 , fk3 where: fk1 should never null fk2 , fk3 can null i have following sql: create table role_mappings ( role_name varchar(64) not null, nested_role_name varchar(64) default null, privilege_name varchar(64) default null, primary key (role_name, nested_role_name, privilege_name), constraint fk_access_roles_rm_1 foreign key (role_name) references access_roles (role_name), constraint fk_access_privileges foreign key (privilege_name) references access_privileges(privilege_name), constraint fk_access_roles_rm_2 foreign key (nested_role_name) references access_roles(role_name) ); when insert null nested_role_name or privilege_name , get: column 'nested_role_name' cannot accept null value. what's proper way of doing this? primary key values must unique. if allow null values these fields makeup pr

c# - Pulling single elements for headers from a List Model -

i have list model several rows. in model , pull out parts display in top of page, titles data , data parts itself. when pull list or ienumeration view display data expected, not able display first() or other way of getting these headers out. should go view display way? goal: header row event name , date (currently in each row of list) groups or tables of data own headers based on data in list data detail per group above. i have partial view loop through core data.. advice please? code messy, here is: view @model ienumerable<emanager.web2.models.eventclasscomplistvm> @{ viewbag.title = "eventcompclassreport"; } <h2>eventcompclassreport</h2> <table class="table"> @html.displayfor(model => model.eventname) //tried several ways identify this, in list no way single out. @html.editorformodel() } </table> partial view (works expected looping through list) @model emanager.web2.models.e

c# - How to get strings from other processes -

i'm trying make security software in c# monitors words on other processes , act when specific word found. example: application show message box saying " beware viruses! " when other running process contains word " torrent ". hope got idea. update: oh, , realize yet, it's still crude idea. that's why gave simple example (which know useless on real program). update 2: why know software called block free 4 . blocks programs contains blacklisted words. it's lightweight software , works well. i'd improve these features , make better program. this not sound idea, except maybe joke program. absurdly slow, , become classified malicious, useless. however, there @ least educational value in this. it should possible long running admin. note admin cannot perform action on system processes. first, need acquire sedebugprivilege. see this example. then, need enumerate processes. see example: http://msdn.microsoft.com/en-us/library/

css - SVG fill and link not working -

here's html: <a href="#"> <object type ="image/svg+xml" class="dribbble" data="img/dribbble.svg"></object></a> and here's css: .dribbble{ fill: #ffffff; width: 40px; height: 40px;} i saved svg fill in illustrator, went svg code , deleted fill. however, white fill have in css isn't showing @ all, , icon showing black. it's supposed link, , unclickable

How to store detached objects in hibernate -

i developing order management application , there different pages complete order. should store full order object in http session or on every page, should retreive object database using cart number or order number? i know depends on design decisions. looking best practices ppl uses. thanks in advance help. yes , no. no not use session (most of time) storing request objects. eat server's ram , depending on how heap memory have left start page i/o. don't know framework using web tier, should using backing objects gets/sets in controller. there can have service tier processing business logic. and finally, answer question, map data received hibernate entities , if prefer use detached criteria have @ - http://docs.jboss.org/hibernate/orm/3.5/javadocs/org/hibernate/criterion/detachedcriteria.html and https://gist.github.com/jeffsheets/5292986 yes because cart can go in session, there no need persistence until user decides , need maintain throughout browser

java - XML Parsing with XPath -

so pretty new xml parsing, looked around , found info of value me. came across called xpath , thought might work. unfortunately, having trouble it. currently trying string using line of code: string summaryfedex = (string) xpath.evaluate("/soap-env:envelope/soap-env:body/v4:trackreply/v4:highestseverity", dom, xpathconstants.string); before ask, dom fine. leaves me believe expression wrong. below have xml trying parse. maybe give assistance? i should note: trying "v4:highestseverity" data. xml: <?xml version="1.0" encoding="utf-8"?> <soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:header /> <soap-env:body> <v4:trackreply xmlns:v4="http://fedex.com/ws/track/v4"> <v4:highestseverity>error</v4:highestseverity> <v4:notifications> <v4:severity>error</v4:severity>

Two Forms on the Same Bootstrap HTML Doc -

i trying 2 modal forms work independently on same html document. html document standard bootstrap template. if click submit button in form 1, nothing happens. however, when click submit button in form 2, submits data entered in both forms. here git hub link code... https://github.com/locutustheborg/bootstrap-modal-form/blob/gh-pages/index.html

java - How to do lastIndexOf compared to indexOf? -

for java program, i'm using singlelinkedlist. following code indexof tested , worked. question how can change indexof lastindexof. i'm kind of confused on how works , how it. /** * returns index of first occurrence of specified element in list, or -1 if list * not contain element. more formally, returns lowest index such * (o==null ? get(i)==null : o.equals(get(i))), or -1 if there no such index. * @param item * @return index of first occurrence of specified element in list, * or -1 if list not contain element */ public int indexof(e item) { node<e> temp = head; for(int i=0; < size; i++){ if(temp.data.equals(item)) return i; temp = temp.next; } return -1; } here java doc , header lastindexof: /** * returns index of last occurrence of specified element in list, * or -1 if list not contain element. more formally, returns highest * index such (o==null ? get(i)==null : o.equals(get(i))), or -1 if there no

php - How to modify two databes tables in one form in Yii -

i have created 1 form eddit 1 table(hotel_rooms) in database website page, works perdectcly. need include fields,not table, table (hotel_rooms_checked)in edditing web page of privious table (hotel_rooms) how can please ? hotel_rooms.id = hotel_rooms_checked.id here code form <?php /* @var $this hotelroomscontroller */ /* @var $model hotelrooms */ /* @var $form cactiveform */ ?> <div class="form"> <?php $form=$this->beginwidget('cactiveform', array( 'id'=>'hotel-rooms-form', 'enableajaxvalidation'=>false, )); ?> <p class="note">fields <span class="required">*</span> required.</p> <?php echo $form->errorsummary($model); ?> <div class="row"> <?php echo $form->labelex($model,'id'); ?> <?php echo $form->textfield($model,'i

ios - Displaying multiple annotations when location is updated using startUpdatingLocation -

my mapview showing number of userannotations when user location updating when user moving. want know how userannotaion displayed once when user location changed. [self.mymapview removeannotation:userannotation]; not working -(void) viewdidload { [super viewdidload]; [locationmanager startupdatinglocation]; } -(void) checklonglatitudeagain { [locationmanager startupdatinglocation]; } -(void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation { userlat=self.lastlocation.coordinate.latitude; userlong=self.lastlocation.coordinate.longitude; cllocationcoordinate2d usercord = {userlat, userlong}; pins *userannotation = [[pins alloc] initwithcoordinate:usercord]; [userannotation settypeofannotation:cur_annotation]; if (newlocation.coordinate.latitude != self.la

python - Pygame text not updating -

the following code being looped - in loop - when 'inputstr' changes, display not. printing inputstr yields expected results, though. deffnt = pygame.font.font("cp437.ttf", 72) txttorndr = deffnt.render(inputstr,false, (0,0,0)) disp.blit(txttorndr, (100,300)) download link; http://www.mediafire.com/download/a4hp9wgojxgiao9/functgroup.rar if print inputstr right before rendered prints bit stops, meaning isnt getting rendered after point, think because condition: if (16-len(gnots))>0: it must coming out false therefore code render new text isnt being executed: if print gnots after condition, prints until length 16 items stops change number 16 in condition 1000 test try typing , text changes

c++ - Undefined symbols for architecture x86_64 using OpenCV -

i'm getting error, i've read other relevant post yet still can't find solution. when compiling, getting error. using opencv framework , own additional c++ classes. undefined symbols architecture x86_64: "person::detectedpersoninimage(cv::cascadeclassifier, cv::mat, double, int, int)" within .mm implementation file using c++ static method so, cv::mat matimage = [image cvmat]; matimage = person::detectedpersoninimage(cascade, matimage, scale, min_neighbors, max_size); in person header, static cv::mat detectedpersoninimage(cv::cascadeclassifier cascade, cv::mat image, double scale, int min_neighbors, int max_size); in person.cpp file, static cv::mat detectedpersoninimage(cv::cascadeclassifier cascade, cv::mat image, double scale, int min_neighbors, int max_size) { //work done here. return image; } any ideas on how can resolved? regards, c. in person head

unit testing - How to set environment-specific parameters in Symfony bundle? -

i writing unit tests symfony2 controller uses service access external api. i've made mock subclass of service unit testing purposes, checks controller gives right input. the config service in {bundle}/resources/config/parameters.yml . @ moment overriding service class parameter in app/config/config_test.yml unit tests use mock service. i'd put test config somewhere in bundle if can, when make config_test.yml in {bundle}/resources/config gets ignored. there way make work, or environment-specific config have stay under app directory? i'll suggest use own loader in bundle. , depending on env load different yml file.

html - Make tooltip position fixed -

i have been able create tooltips app. tooltips content comes db , dynamic. have 2 lines of text , have 5 lines of text. struggling keep position fixed regardless of content is. there can try fix this? here fiddle demonstrating facing. .tooltip:hover .dumclass { display: inline; color: #ffffff; border: 1px solid #dca; background: #444; -moz-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 11px; } enter code here css .tooltip{position:relative;} .tooltip .dumclass { z-index: 10; display: none; padding: 14px 20px; bottom:20px; left:0; width: 240px; line-height: 16px; position: absolute; } demo

sql - Database design for frequent select and insert -

i'd know best database design following case. i use spring , sql server , case simplified follow: let there're 3 tables here: item: id(unique,primary-key,auto-increase) name category address: id(unique,primary-key,auto-increase) address postcode order: id(unique,primary-key,auto-increase) price date itemid(foreign-key) addressid(foreign-key) the business logic spring handling incoming message including information of item, address , order. if incoming item data exists in database(exist means name , category identical), return id of record. it doesn't exist, insert new record , return new id. address pretty same. if incoming address data exists in database(exist means address , postcode identical), return id of record. it doesn't exist, insert new record , return new id. and insert order table previous item id , address id foreign key. what did right put select , insert logic 1 stored procedure reduce latency between comm

ios - How to activate loudspeaker in ios7 from our app? -

i want turn on speakerphone whenever app used need activate speaker phone when call triggered app. is possible? if please advice how do? this goes against apple's sandbox limits. apps have limited number of resources may use. speaker phone definite no. irritate users of app. consider different approach current goal, better route take here. for reference: https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/theiosenvironment/theiosenvironment.html under heading "the app sandbox"

python - Error importing hashlib -

i have problem similar one: error importing hashlib python 2.7 not 2.6 however, need different solution because on embedded system , can't use pip or apt-get install everything. need know is: specific files missing , how can hashlib import correctly? to clarify, errors same in original post. core issue appears built-in _hashlib module seems missing, there's no _hashlib.so i'm not sure find it.

mysql - PHP mysql_num_rows () expects parameter 1 to be resource -

i'm having problem being said on title simple code. //only validate if date unique $checkdatequery = mysql_query("select top 1 * user_info date ='".mysql_real_escape_string(stripslashes($_request['date']))."'", $db); $rownumxx = mysql_num_rows($checkdatequery); if($rownumxx == 0) { echo'you allowed proceed.'; } else { echo'you not allowed proceed.'; } i'm not sure did wrong it. in advance help there no top keyword in mysql , should make use of limit should be $checkdatequery = mysql_query("select * user_info date ='".mysql_real_escape_string(stripslashes($_request['date']))."' limit 1", $db);

rest - Spring MVC 4.0 RESTFul Web Services -

i trying build hello world restful web service of spring mvc 4.0 framework. created dynamic web application added web.xml , rest-servlet.xml , mycontroller.java file in package mythird.attempt.sample.controller. web.xml <?xml version="1.0" encoding="utf-8"?> <web-app> <display-name>my sample rest</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>rest</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>rest</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app> rest-servlet.xml <?xml version="1.0" encoding="utf-

ruby on rails - Using paperclip gem to add an attachment -

i've attempted use paperclip gem add attachments contact model. looks though can add attachment - can select file without problem. when create contact, attachment not saved. know because can see in rails console document_id 'nil'. in _form.html.erb creating new contact, have: <%= simple_form_for(@contact, html: {class: "form-inline well", multipart: true}, role: "form") |f| %> <% if @contact.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@contact.errors.count, "error") %> prohibited contact being saved:</h2> <ul> <% @contact.errors.full_messages.each |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="form-group"> <%= f.input :name %> <%=

MySQL query sum number by row -

i sum row. quick way? current query: select t1.name domain, cast(sum(t2.http_out)/1024/1024/1024 decimal(8,2)) http_out_gb, cast(sum(t2.ftp_out)/1024/1024/1024 decimal(8,2)) ftp_out_gb, cast(sum(t2.smtp_out)/1024/1024/1024 decimal(8,2)) smtp_out_gb, cast(sum(t2.pop3_imap_out)/1024/1024/1024 decimal(8,2)) pop_imap_out_gb domains t1 join domainstraffic t2 on t1.id = t2.dom_id t2.date between '2014-02-01 00:00:00' , '2014-02-28 23:59:59' group domain; example: +--------------------------------+-------------+------------+-------------+-----------------+ | domain | http_out_gb | ftp_out_gb | smtp_out_gb | pop_imap_out_gb | +--------------------------------+-------------+------------+-------------+-----------------+ | abc.com | 0.00 | 0.00 | 0.08 | 0.39 | | def.com | 0.00 | 0.00 | 1.84 | 2.45 | | fgh.com

c++ - DoxyGen ignores a functions -

i have example file this /** @file description */ void somefunc();///< brief function description the @file keyword needed document global functions, as told in doxygen mailing . here is, anyway, doxygen continues ignoring code, i.e. somefunc() doesn't appears anywhere in documentation. the @file keyword used specify file name , not description. try this: //! //! @file filename.h //! @brief description //!

angularjs - XMLHttpRequest POST response with "Location" header not accessible to javascript code in cross domain situation -

facts : rest specification post states : "post : create new entry in collection. new entry's uri assigned automatically , returned operation." i have read somewhere uri sent in response header 'location'. i using angularjs javascript client , jersey server responding rest requests. when both client , server present in same package , deployed togheter, 'location' header present javascript client: working fine ! when client , server deployed in different sites 'location' header not present javascript client. note1 : cross-origin resource sharing : cors used in order enable interaction: not clear me if in situation 'location' header should present javascript client. note2: 'location' header being produced server , arrives client browser (it displayed in devtools of client browser). my question : in javascript client in order know uri of created instance ? must use other post (may put) ? must fire second

jquery - animate.css sequentially one after another -

i have added fadein effect using animate.css 4 div boxes works absolutely fine, these boxes being animated @ same time. there way animate 1 after adding sort of delay? some expert appreciated. you can use delay method $( "#foo" ).delay( 800 ).fadein( 400 );

javascript - Extract fixed values from json object -

i have json object : [ [ "a", "1" ], [ "b", "2" ], [ "c", "3" ], [ "d", "4" ], [ "e", "5" ], [ "f", "6" ] ] i want retrieve key/value pair except a, d . there way in javascript ? this doesn't json object, more 2-dimensional array. here how can retrieve 2-dimensional array excluding "a" , "d" elements: <script type="text/javascript"> var = [ [ "a", "1" ], [ "b", "2" ], [ "c", "3" ], [ "d", "4" ], [ "e", "5" ], [ "f",

How to compare only date part with linq expression? -

Image
i want make column filter grid view. simple want filter grid view column stuff. here have created 1 iqueryable returns queryable result. here code : ------------------------------------------updated------------------------------------------------ public static iqueryable<t> filterforcolumn<t>(this iqueryable<t> queryable, string colname, string searchtext) { if (colname != null && searchtext != null) { var parameter = expression.parameter(typeof(t), "m"); var propertyexpression = expression.property(parameter, colname); system.linq.expressions.constantexpression searchexpression = null; system.reflection.methodinfo containsmethod = null; system.linq.expressions.methodcallexpression body = null; system.nullable<datetime> nextdate = null; expression ex1 = null; expression ex2 = null; switch (colname) { case "jobid":

java - How to use system environment variables in log4j.properties? -

i added system environment value project_home=c:\program files\project now i'm trying use system environment value in log4j.properties didn't set **log4j.properties** **log4j.appender.logfile.file="${env.project_home}"/project.log** could please tell me how set system environment variables in log4j.properties? using log4j-1.2.7 version this supported environmentlookup in log4j - 2. see examples. use ${sys:project_home} instead of ${env.project_home}

Python, delete specific names from list -

first select group named hairsystem1follicles , make list of make empty list things delete i have tried 2 things, both useless. isolate elements in list name curve1 curve2 etc. not other things in list named loftfolicle* assuming list named "hairsystem1follicles". try list comprehension: isolated = [ name name in hairsystem1follicles if name != "loftfolicle" ]

mongodb - Get all dynamic fields of a groovy class -

in application need use dynamic fields of class. object persisted mongodb (also dynamically) json request: object obj = new object() def objectdata = request.json.object for(item in objectdata) { obj[item.key] = item.value } obj.save(flush: true) however, when trying objct mongo, way: list<object> objects = object.list() def objlist = new arraylist(); def filtered = ['class', 'active', 'metaclass', 'version'] for(obj in objects) { objlist.add(obj.properties) } i getting this: "objects" : [ { "dbo" : { "_id" : "531afe54300426462e60c1ce", "key2" : "val2", "key3" : "hello", "version" : 1, "key1" : "val1" } }, ... of coarse can take "dbo" of every object, , filter don't need manually, looks wrong. right way properties of object including dynamic ones? definit

php - Update/append redis values -

i have started using redis. it's simple key value storage. example: $this->redis->set('get_all_devices', json_encode($data)); now if there new entry device table, want append new entry same cached data have. don't want flush cached object , create new 1 reflect new entry. there way in redis? there no table in redis. must learn redis specific data types are. in case, set right structure used, if don't need data ordered. should perform sadd (adds value set) instead of set instruction, sets value single string. $this->redis->sadd('get_all_devices', json_encode($data)); according use case, list or sorted set may more appropriate set store data.

c# - Difference of disable form -

this.enabled = false; when used in initialiser, form disactived can move or close. using in code (call button click event), disabled including form move or close. using debug mode, checked 'this' (i thought may different) same. what different between using in initialiser , public code? check locked property in both case. this.locked;

Addtional pack size attribute in magento shopping cart price rules -

Image
my catalog contains number of configurable products configurable attribute custom attribute called pack_size. ie: t-shirt - single t-shirt - pack of 10 t-shirt - pack of 25 i need able access attribute in cart price rule if rule applies discount 100 + t-shirts, achieved by: 100 single t-shirts 10 packs of 10 shirts 4 packs of 25 2 packs of 25 , 5 packs of 10 etc etc... can please this? thanks, matt i think can achieve building shopping cart price rule conditions each case. familiar how set rule that? the logic is: apply discount if... if (qty>99 , pack_size="t-shirt") or if (qty>49 , pack_size="2 pack") or if (qty>24 , pack_size="4 pack") the top rule needs changed all any or, or, or. in teh sub rules want product attribute combination rule. , set additional rule each pack size , corresponding quantity. see screenshot below (i used size in place of pack_size example). you may need set pack_size attribute us

c++ - Print or examine semaphore count value in GDB -

i trying implement thread pool using ace semaphore library. not provide api sem_getvalue in posix semaphore. need debug flow not behaving expected. can examine semaphore in gdb. using centos os. i initialized 2 semaphores using default constructor providing count 0 , 10. have declared them static in class , initialized in cpp file as dp_semaphore threadpool::availablethreads(10); dp_semaphore threadpool::availablework(0); but when printing semaphore in gdb using print command, getting similar output (gdb) p this->availablework $7 = { sema = { semaphore_ = { sema_ = 0x6fe5a0, name_ = 0x0 }, removed_ = false } } (gdb) p this->availablethreads $8 = { sema = { semaphore_ = { sema_ = 0x6fe570, name_ = 0x0 }, removed_ = false } } is there tool can me here, or shall switch posix thread , re-write code. edit: requested @timrau output of call this->availablework->dump() (gdb) p this->availablework.dump()

network programming - How to receive UDP broadcasts on an Android device -

how can make android phone receive udp broadcasts? at moment testing app using tablet , phone. problem tablet can work server, not phone. the scenario of app problem is: - client sending broadcast in local network - server receiving broadcast , sending response client directly i pretty sure think know what's wrong app works when server running on tablet , phone can't receive broadcasts standard.. how around this? i have tried implementing following code server make receive broadcasts: wifimanager wifi = (wifimanager)getsystemservice(context.wifi_service); if (wifi != null){ toast.maketext(getapplicationcontext(), "wifilock create!", toast.length_long).show(); wifimanager.wifilock lock = wifi.createwifilock("mylock"); lock.acquire(); } also, have following permissions in app: <uses-permission android:name="android.permission.internet" /> <uses-permission android:name=&quo

json - How to use to use Pentaho Kettle when we have 2 distinct arguments -

Image
i new kettle , kind of stuck in this. want read json file , csv files, , change values in csv file according in json before storing it. example if have in csv row value saying "test", , in json {"key": "test", "value": "val"}, want replace "test" in csv "val" before storing in db. however not sure how can that, think thing must use "user defined java class" step have no idea how access each argument individually inside it, since can seem able read csv rows 1 one. i modifying existing csv file not best practice in case. rather, suggest consider using kettle transform data , generate csv file fits bill desired result. in generalized way possible, kindly @ following process (see screenshot below): retrieve data json input, retreive data csv file input; do magic/clean up/staging of data columns; join 2 streams on specific values; write new csv file or overwrite existing one; i hope

c# - How to check whether server is accessible? -

directory.exists(@"\myserver\images") command works correctly while directory.exists(@"\myserver") doesn't. can suggest me "directory.exists" equivalent check accessibility of servers. please don't suggest ping server , because icmp blocked server firewall , ping command doesn't work. , don't refer similar questions using ping command can acceptable question posters.

Reading Excel files and creating an array in MATLAB -

i have software coordinates exported xls file, want create function within matlab uses xls file not wish change original software (therefore xls file have remain in same format). i using code file = 'ken file2.xls'; [num,txt,raw]=xlsread(file); xarray = cell2mat(raw(:,1)) yarray = cell2mat(raw(:,2)) which not enough excel file following: 1 2 2 2.1 3 2.2 4 2.3 value of ken 27 because of text in column code falls over, can manually edit excel file above code works rather have code handles this. any ideas? you find cut off cell array using ismember : %//example data = {'1';'2';'3';'4';'';'value'}; last = find(ismember(a,''),1)-1; a_new = a(a:last);

jQuery - Updating all the divs using wildcard selector -

i've jsfiddle , not working. all want update divs starting mydiv , text, onclick of button. doing wrong or wrong way of doing. you need use text() instead of val() set text inside divs: $("#btn").click(function(e){ $('[id^=mydiv]').text('testing divs'); });

jquery - Removing bindings in Knockout js -

i using kogrid in jquery mobile. when user click on row, go detail page. in page user can update data , save it.blow implementation var progressgrid = function(){ var self = this; self.ticketlist = ko.observablearray(servicet.filtertsfromstatus('progress')); columndefs: [ { field: 'ticketnumber', displayname: 'ticket', celltemplate: "<button data-bind=\"click: function() {getrowdetails($parent.entity)}\"><span data-bind=\"text:$parent.entity['ticketnumber']\"></span></button>", width: '*', minwidth: "200px" } self.getrowdetails = function(row){ var rtjs = servicet.getticketbyid(row.id); servicet.gototicketdetails(rtjs,false); }, } ticket object function runticket(jsrunticket) { ko.validatedobservable(ko.mapping.fromjs(jsrunticket, val

OSB returns differents results when using a breakpoint in Eclipse -

weird problem osb, while debugging in eclipse. if send request particular request, osb returns error. if send same request again, breakpoint in message flow, different result. anyone has seen before? it's messing error handler debugging. my error handler should catch bea errors, wich when using breakpoint. of them aren't catched if don't use breakpoint. @wesley, know mistake of developer in such cases. without looking @ code, can guess. 1. log $body @ every step of message flow , skip breakpoint better investigation. 2. if using javacallout, not thread safe default.

groovy - Create and Get Session in grails -

currently working grails. tried create , session in grails controller: if (user) { session.user = "user" flash.message = "hallo ${user.fullname}!!!!!" println(session.user) redirect(action: "login") } but failed create , get. about session object in grails, try following official document: [http://grails.org/doc/2.3.4/ref/servlet%20api/session.html][1] so, try : session["user"] = "john" asset "john" == session.user

ios - Failed to resume in time - Crash -

i'm experiencing strange exception. when send app background, open other apps e.g. whatsup , open app again, crashes stacktrace . it happens seldom makes hard reproduce error. i have no code in appdelegate resume method, problem come from? issue related short memory or (i'm testing on old iphone 4)? try catch bug? i read few threads error-code, i'm aware common problems doing main-thread. thanks hints lead me solution!

java - zip/compress a folder on android -

i used following code zip files , works great zip subfolders , not have root of tree show in zip file. public boolean zipfileatpath(string sourcepath, string tolocation) { // arraylist<string> contentlist = new arraylist<string>(); file sourcefile = new file(sourcepath); try { bufferedinputstream origin = null; fileoutputstream dest = new fileoutputstream(tolocation); zipoutputstream out = new zipoutputstream(new bufferedoutputstream( dest)); if (sourcefile.isdirectory()) { zipsubfolder(out, sourcefile, sourcefile.getparent().length()); } else { byte data[] = new byte[buffer]; fileinputstream fi = new fileinputstream(sourcepath); origin = new bufferedinputstream(fi, buffer); zipentry entry = new zipentry(getlastpathcomponent(sourcepath)); out.putnextentry(entry); int count; while ((count = origin.read(data, 0, buffer)) != -1) { out.write(data, 0, count);