Posts

Showing posts from February, 2013

vb.net - how to import data from excel vb using Microsoft.Office.Interop.Excel -

sorry bad english can export data excel file code imports excel = microsoft.office.interop.excel dim xlapp new excel.application dim xlworkbook excel.workbook dim xlworksheet excel.worksheet xlworkbook = xlapp.workbooks.open("my excel path") xlworksheet = xlworkbook.sheets("sheet1") xlworksheet .range("d8").value = "1" .range("d9").value = "2" end xlapp.visible = true i want import data(d8,d9) excel file text box .can u me? thank i not sure want import data, should work , give value. imports excel = microsoft.office.interop.excel dim xlapp new excel.application dim xlworkbook excel.workbook dim xlworksheet excel.worksheet dim strone string dim strtwo string xlworkbook = xlapp.workbooks.open("my excel path") xlworksheet = xlworkbook.sheets("sheet1") xlworksheet strone = .range(...

php - Change Multiple "Sample Products to Variable Product" | WordPress wooCommerce -

is there easy way change product data type 1000 products "sample products" "variable products" ? in wordpress > woocommerce > under products tab > filter required category of products , choose bulk edit, here not see option change " product date type " sample products variable products. is there easy way multiple products ?

java - Display selected Item in JComboBox when item is clicked -

i have 2 jcomboboxes. when item in first jcombobox selected, relevant items displayed in jcombobox2. when try select items in second jcombobox keeps returning default. registering value of item selected, not displaying selected item in jcombobox. here snippet of code: maincombobox = new jcombobox( treeitems); maincombobox.addactionlistener( ); getcontentpane().add( maincombobox, borderlayout.west ); // create sub combo box multiple models subcombobox = new jcombobox(); subcombobox.addactionlistener(this); subcombobox.setprototypedisplayvalue("xxxxxxxxxx"); // jdk1.4 getcontentpane().add( subcombobox, borderlayout.east ); string [] chromalveolataitems = chromalveolatatreeset.toarray(new string[chromalveolatatreeset.size()]); subitems.put(treeitems[1], chromalveolataitems); string [] mycetozoaitems = mycetozoatreeset.toarray(new string[mycetozoatreeset.size()]); subitems.put(treeitems[2], mycetozoaitems); string ...

java - Get list of quarter from startDate and enddate -

i'm working struts2 , jpa , mysql in webapp . in table have 2 column startdate , enddate , want quarters between startdate , enddate . example have 2 dates below : startdate 2013-01-23 enddate 2015-11-29 i want list : jan 2013 apr 2013 jul 2013 oct 2013 jan 2014 apr 2014 jul 2014 ...... ...... ...... jul 2015 oct 2015 my goal quarters in select list. edite 1 : to start i'm working on query in phpmyadmin : select listt ( select cast(select `startdate` tablea date) datevalue union select date_add(q,1,datevalue) listt date_add(q,1,datevalue) < cast(select `enddate` tablea date) ) select convert(varchar(3), datename(month,datevalue))+ ' ' +convert(varchar(4),datepart(yyyy,datevalue)) listt option (maxrecursion 0) and put query in dao class : public list<date> listdate() { list<date> pay = null; try { pay = session.createquery("my query").list(); ...

sublimetext3 - Sublime Text - Ignore files in search -

there way exclude file (javascript compresed) searchs in sublime text? find > find in files... ( ctrl+shift+f on windows, cmd+shift+f on mac) find: string find where: path/to/folder, path/to/another/folder, -*.min.js you can either manually type comma-separated paths 'where' input field or click ... button right of field select criteria. exclude minified js files add -*.min.js

ios - Error in Launching Watchkit Extension -

Image
i getting following error while try run app in watchkit extension. i tried clean , re-build project no result. please me solve this... fixed issue in case going simulator's watch companion app, unchecking installation watch app, turning on. nothing else worked

scala - Joda-time parser with instance-local default timezone -

is there "instance-local" version of joda's datetimezone.setdefault? i'm trying achieve this: val parser = new parserwithdefaulttimezone("gmt+1"); parser.parse("1970-01-01 00:00:00").getmillis // -3600000l parser.parse("1970-01-01 00:00:00 utc").getmillis // 0l without polluting global. can find in joda docs (ironically) modifies global state. if there non-joda solution, interested in that, too. edit: forgot mention if there no ready-to-use class this, i'll settle for: "what easiest way see if time string contains explicit timezone?" can't distinguish between explicit 1 , timezone joda set default. edit 2: don't have format string feed; i'm looking infers format @ runtime. you can use withzone alter date/time zone used: val fmt = datetimeformat.forpattern("yyyy-mm-dd hh:mm:ss zzz").withzone(datetimezone.forid("europe/berlin")) val date = fmt.parsedatetime(???); the ...

javascript - How to use the search feature in PDFObject? -

i'm using pdfobject try search pdf term , highlight it. website generates code such application automatically reason code isn't searching pdf @ all, nor highlighting word want highlight... know how can or rectify code? here code website auto generates me (in html): <!-- insert in document body --> <object data='sample#search=location&highlight=20,20,20,20' type='application/pdf' width='100%' height='100%'> <p>it appears web browser not configured display pdf files. no worries, <a href='sample'>click here download pdf file.</a></p> </object> the search term want find (and have highlighted) in pdf object word called 'location'. i've copied code overall html code, follows: <html> <head> <title>pdfobject example</title> <script type="text/javascript" src="pdfobject.js"...

jar - How can I run a java program from a java program? -

this question has answer here: running java program java program 3 answers i write java program can run java programs main class in runtime. how can that? read this . basically run new process , execute process tr = runtime.getruntime().exec( new string[]{ "xxx" } ); where xxx phrase type in commandline. remember program might in different location current execution might have type command java \path\to\program\program or such.

javascript - How to include and use jQuery in Angular properly? -

i building ionic application android. have added jquery index.html: <script src="lib/jquery/jquery-1.11.3.min.js"></script> <script src="lib/ionic/js/ionic.bundle.js"></script> then in controller function did this: .controller('bluetoothctrl', function($scope, $cordovabluetoothserial, $timeout, $ionicmodal) { var $jq = jquery.noconflict(); $scope.dosomething = function(){ $jq.grep(...); }; .... }); however when load application on android, below error: failed load resource: net::err_file_not_found

xml - XSLT - Add new attribute to existing node by checking existing attribute -

hi have following xml, <doc> <footnote> <p type="footnote text"> <link ref="http://www.facebook.org"/> </p> </footnote> <footnote> <p type="footnote text"> <link ref="http://www.wiki.org"/> </p> </footnote> <footnote> <p type="footnote paragraph"> <link ref="http://www.wiki.org"/> </p> </footnote> </doc> what need add new attribute (id='number-1') <p> nodes attribute type eqal footnote text . in case first 2 <p> nodes should apply new <id> attribute. so wrote following code, <xsl:template match="p/@type[.='footnote text']"> <xsl:copy> <xsl:attribute name="id"> <xsl:value-of select="'number-'"/><xsl:number level="any"/> </xsl:attribu...

Jquery escaping characters ajax, convert back PHP -

the data being sent via ajax escaping characters, how convert characters normal html in php. this example of ajax response of html table sent , echoed. <td width=\"5%\" style=\"border-right:2px dashed #95989a\">�</td> what php function use revert html table original characters? the php function stripcslashes allows this. have @ the documentation here

xsd - XML schema key pairs, references -

how write xsd schema check if reference in xml element valid? schema should mark error if "redbox" style absent in "styles". code : <styles> <style name="www" color="#f0ff00" text-transform="uppercase"/> <style name="redbox" background-color="#ff0000" border="1"/> </styles> now want make reference use predefined attributes in new element. <div style="redbox" position="20 50 500 0" /> after 'decode' div object like <div background-color="#ff0000" border="1" position="20 50 500 0" />

postgresql - Oracle equivalent to Postgres' @> (contains) function -

i'm trying write conversion postgresql work in oracle. problem struggling find oracle sql statement replace postgres @> (contains) operator. the query in postgres reads this: case when descriptivegroup @> '{building}' , descriptiveterm null 'building fill' when descriptivegroup @> '{"general surface"}' , descriptiveterm = '{"multi surface"}' 'multi surface fill' etc., meaning 'building' or 'general surface' (in above example) should contained within array called descriptivegroup. i've been trawling through stackoverflow , other websites , think nearest equivalent can find @> in oracle 'member of' in example: how check if array contains particular string? however, i'm struggling work out how work statement case > when type of statement or suggestions community gratefully received! many thanks. ps promised, here truncated version of postgres que...

html - How to copy selected file into folder using javascript -

i want store/copy file folder using javascript. file getting input type file. . javascript code - function submitform(action) { // here want copy file folder } html code- <form id="exampleform" method="post" action="" enctype="multipart/form-data" > <input type="file" class="upload" name="imagename" id="imagename" /> <input type="button" name="save_exit" id="save_exit" onclick="submitform('add_question_sql.php')" value="save &amp; exit" /> </form> i can not use submit button reason. how can copy file folder using javascript ? as commented paulo, not javascript topic. on selection of file , submission of form, server-side application receive request , in position receive uploaded file , store somewhere on server.

Meteor data context with collectionFS -

i want fave.title within collectionfs each block have "title here", ideas? <template name="myfaves"> <div class="container"> <div class="page-header"> <h2>your favourites</h2> </div> <div class="row"> <div class="col-md-12"> {{#each faves}} {{> singlefave }} {{/each}} </div> </div> </div> </template> <template name="singlefave"> <div class="row"> <div class="col-md-12"> <div id="freewall" class="freewall"> {{#each getmedia this.fileid}} {{#if isimage store='thumb'}} <div class="brick"> <img src="{{this.url store='thumb...

xamarin - Error installing calabash-android on Windows -

i trying install calabash-android on windows machine have serious problem. follow xamarin guide install ruby , calabash-android , succeed other day. when try create own scenario computer cause me problem scenarios , scenarios become fails. search , read comments gherkin mismatch , wanted reinstall everything. uninstall ruby , and delete related files pc.(calabash , gem files etc.) want install calabash-android again having problem. tried different versions of ruby effort come dead end. last effort bring me step 6 on guide (manually installing calabash). ps c:\users\alper.silistre> gem install ffi –-platform=ruby --no-ri --no-rdoc system cannot find path specified. fetching: ffi-1.9.10-x64-mingw32.gem (100%) installed ffi-1.9.10-x64-mingw32 error: while executing gem ... (uri::invalidurierror) bad uri(is not uri?): ?gems=û-platform=ruby this error gave on step 6 . continue because says succesfully installed ffi gives executing gem error have no idea. step 7; ps c...

sql - Bulk update in Postgres -

i need update 1 table records based on one. i tried update currencies set priority_order= t2.priority_order currencies t1 inner join currencies1 t2 on t1.id = t2.id but giving error (same query work mysql , sql server) then tried below update currencies set priority_order= (select priority_order currencies1 currencies.id=currencies1.id ) it working slow, need big tables well. any ideas? in postgres, like: update currencies t1 set priority_order = t2.priority_order currencies1 t2 t1.id = t2.id;

java - Tomcat 7 HTTP Status 500 - Servlet execution threw an exception -

i have created small extjs app looks send request through servlet. servlet looks respond using json getting class not found exception json array: exception in log: org.apache.catalina.core.standardwrappervalve invoke severe: servlet.service() servlet [itemmaintenance] in context path [/exttestservlet] threw exception [servlet execution threw exception] root cause: java.lang.noclassdeffounderror: not initialize class net.sf.json.jsonarray @ com.as400samplecode.itemmaintenance.doget(itemmaintenance.java:44) @ javax.servlet.http.httpservlet.service(httpservlet.java:624) @ javax.servlet.http.httpservlet.service(httpservlet.java:731) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:303) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchai...

objective c - IOS custom pin is not showing -

i trying show image instead of default red pin source location , image destination location. - (void) sourcemarker:(mkplacemark * ) homeloc { mkannotationview *point = [[mkannotationview alloc] init]; mkpointannotation *ml = point.annotation; ml.coordinate = homeloc.coordinate; ml.title = @"home"; point.image = [uiimage imagenamed:@"home.png"]; point.canshowcallout = yes; [self.mapview addannotation:ml]; } as suggested apple doc annotating maps . 1 has create custom annotation class, please refer following code. myannotation.h @interface myannotation : nsobject<mkannotation> { cllocationcoordinate2d coordinate; nsstring *title; nsstring *subtitle; nsstring *type; } @property (nonatomic, assign) cllocationcoordinate2d coordinate; @property (nonatomic, copy) nsstring *title; @property (nonatomic, copy) nsstring *subtitle; @property (nonatomic, copy) nsstring *type; @end myannotation.m @implementation myannotation @synthesize c...

PHP trying to display data from MySQL Database -

i'm trying display records database code: <?php include("carconnect.php"); $sqlget ="select * cars"; $sqldata = mysqli_query($connect , $sqlget) or die ("error retrieving data!"); while ($row = mysqli_fetch_array($sqldata , mysqli_assoc)) { echo $row['car']; } ?> basically i'm getting on webpage error retrieving data message.. updated: speech marks shouldnt have been there sorry. there " in $sqldata = "mysqli_query before mysqli_query . please remove or try following code. try include("carconnect.php"); $sqlget ="select * cars"; $sqldata = mysqli_query($connect , $sqlget) or die ("error retrieving data!"); while ($row = mysqli_fetch_array($sqldata , mysqli_assoc)) { echo $row['car']; }

oracle - updating rows on table 1 based on data from table2 -

need query update columns of table1 based on field of table 2 if field of table 1 , table2 matches. i want update id(1234 , 7891) of tbl 1 ids (4321 , 1987 respectively) of tbl2 if ids not same loc1 , loc2 same , upd y in tbl2. tbl1 tbl2 id loc1 loc2 id loc1 loc2 upd 1234 a1 b1 4321 a1 b1 y 4567 a2 b2 4567 a2 b2 7891 a3 b3 1987 a3 b3 y 3456 a4 b4 6543 a4 b4 try this merge tbl1 e using tbl2 h on (e.loc1 = h.loc1 , e.loc2=h.loc2 , h.upd='y') when matched update set e.id = h.id; you can leave not matched clause.

c# - How to get the process Id safely after process.Start()? -

when program copied many locations , started independently, error may appear: processstartinfo startinfo = new processstartinfo(exepath); startinfo.windowstyle = processwindowstyle.hidden; startinfo.errordialog = false; process process = new process() { startinfo = startinfo }; bool isstarted = process.start(); int processid = process.id; // failed bellow when isstarted false system.invalidoperationexception: no process associated object. since starting exe files don't need useshellexecute feature. unfathomable reason useshellexecute set true default. using entails lot of complexity. set useshellexecute false , start should return true . then, id should valid. sure dispose of process instance.

r - Optimal/efficient plotting of survival/regression analysis results -

Image
i perform regression analyses on daily basis. in case typically means estimation of effect of continuous , categorical predictors on various outcomes. survival analysis common analysis perform. such analyses presented in convenient way in journals. here example: i wonder if has come across publicly availble function or package can: directly use regression object ( coxph , lm, lmer, glm or whatever object have) plot effect of each predictor on forest plot, or perhaps allow plotting of selection of predictors. for categorical predictors display reference category display number of events in each category factor variables (see image above). display p values. preferably use ggplot offer sort of customization i aware sjplot package allows plotting of lme4, glm , lm results. no package allows abovementioned coxph results , coxph 1 of used regression methods. i have tried create such function myself without success . have read great post: reproduce table , plot journal not...

java - No setter found for property 'dataSource' in class 'org.springframework.security.provisioning.JdbcUserDetailsManager' -

hi new spring. trying implement spring security spring web mvc. tried user repository application works fine when try authenticate user using database. i below error. not getting why problem there though have datasource defined in root-context.xml no setter found property 'datasource' in class 'org.springframework.security.provisioning.jdbcuserdetailsmanager' [config set: firstapp/web-context] here pom.xml <modelversion>4.0.0</modelversion> <groupid>com.shivaji</groupid> <artifactid>testapp</artifactid> <name>firstapp</name> <packaging>war</packaging> <version>1.0.0-build-snapshot</version> <properties> <java-version>1.6</java-version> <org.springframework-version>4.1.7.release</org.springframework-version> <org.aspectj-version>1.6.10</org.aspectj-version> <org.slf4j-version>1.6...

c# - Getting Business Exception While retrieving Values from Service Reference while debugging -

this error getting. when trying go inside method using 'f11' not allowing me , getting error (screenshot attached. please tell me there way can debug this? have googled god knows how many times haven't had luck ! please help. error screen-shot

javascript - Make mmenu.js open on widescreen and can also be closed -

i'm making menu made mmenu.js open when opened on widescreen , closed on medium mobile. want, on widescreen, able close toggle button. right now, can close while on mobile. here's fiddle $(function() { var $menu = $('nav#menu'), $html = $('html, body'); $menu.mmenu({ extensions: ["widescreen", "theme-dark"] }); var $anchor = false; $menu.find( 'li > a' ).on( 'click', function( e ) { $anchor = $(this); } ); var api = $menu.data( 'mmenu' ); api.bind( 'closed', function() { if ( $anchor ) { var href = $anchor.attr( 'href' ); $anchor = false; ...

java - Understanding mutal exclusion lock -

i'm reading documentation readwritelock whether or not read-write lock improve performance on use of mutual exclusion lock depends on frequency data read compared being modified, duration of read , write operations, , contention data - is, number of threads try read or write data @ same time. what "mutual exclusion lock" mean? mean can perform 1 operation (reading or writing) @ time? instance, synchronized block. a mutual exclusion lock ensure 1 operation can performed @ time (one reader or 1 writer). according javadoc of readwritelock : the read lock may held simultaneously multiple reader threads, long there no writers. write lock exclusive. in practice means if have large number of writers, becomes hard readers gain access single writer lock out readers. alternatively, if have many readers performing short reads overhead of readwritelock perform worse simple mutual exclusion lock readwritelock has greater overhead. i have par...

android - Make bottom of the screen appear above keyboard -

hi developing multiline edittext has 3 lines. , keyboard appears below cursor, want show whole 3 lines if i'm writing in first one. need way put bottom of view(screen/layout) on top of keyboard. now use simple edittext 3 lines , flag multiline . <edittext android:id="@+id/edittextmessage" android:layout_width="0dip" android:layout_height="match_parent" android:layout_marginbottom="2dp" android:layout_marginleft="10dp" android:layout_weight="0.7" android:background="@drawable/button_background" android:ems="10" android:gravity="top|left" android:hint="message" android:inputtype="textmultiline" android:lines="3" android:maxlength="140" android:paddingleft="5dip" android:paddingright="5dip" and...

angularjs - Javascript outside angular js -

in angular js instead of using service in module, can create javascript functions outside controller , call when want to? for example: var urlpath="http://www.w3schools.com//angular//customers.php" //this contain functions function testing_model ($http){ var self=this; self.getrecords=function(){ $http({ method:'get', url: urlpath, }).success(function(data){ self.record=data.records; }); } self.getrecords(); } angular.module("myapp", []); app.controller('mycontroller', function ($scope, $http) { $scope.testing_model = new testing_model();} when run code above, says "$http not function". thanks in advance. you need pass $http function... $scope.testing_model = new testing_model($http); although work goes against idea of angular. must inject function service in controller write testable code, track dependencies , respect other developers going support project later.

javascript - Get file contents from Ractive on-change event -

i'm trying headers of csv file i've attached file input. fire function on change of file input , check if there files in event , start filereader onload can contents onload function doesn't fired. there i'm missing? ractive.on('getheaders', function(target) { // check file file if(target.node.files !== undefined) { var reader = new filereader(); var headers = []; reader.onload = function(e) { console.log(e); }; } }); you need pass files reader, this: ractive.on('getheaders', function(target) { // check file file if(target.node.files !== undefined) { var headers = []; target.node.files.foreach(function(file){ var reader = new filereader(); reader.onload = function(e) { console.log(e); console.log(reader.result); }; reader.readasdataurl(file); }); } });

java - Merging two paragraphs in itext to Single line -

i want create paragraph contains text , image. paragraph pararevenue = new paragraph(); paragraph imagepara = new paragraph(); paragraph com = new paragraph(); pararevenue.add("text here"); imagepara.add(new chunk(imgrevenue, 0, 0)); imagepara.setalignment(element.align_right); com.add(pararevenue); com.add(imagepara); image should right aligned. my problem coming in 2 different lines. there way can display in single line ? there 2 ways it. you can use table make paragraph , image appear on same line. use setabsoluteposition on image set exact position, e.g. myimg.setabsoluteposition(400f,400f); . set position of image wherever want , can set text on same line.

ruby on rails - How do I update a counter of an associated object before it is saved? -

i have attribute on node object called cached_comment_count need updated whenever new comment created. this part of create action in commentscontroller : @node = node.find(params[:node_id]) @comment = current_user.comments.new(comment_params) @comment.node = @node @node.cached_comment_count = @node.comments.count however, doesn't work because when @node.comments.count returns current comments on @node object before new @comment saved. what work if do: @node.cached_comment_count += 1 the obvious issue is increment of 1 - , doesn't feel complete. best, complete, way comments.count after save has taken place. but don't want end in infinite loop. what's best way approach this? just consider counter_cache rails functionality. can check old, still ryan bates railscast

ruby on rails - RSpec deprecated behavior 'let' -

i receiving these warnings when running rspec tests using rspec-rails 2.14. want upgrade rspec 3 see if there performance improvements, assume these fail due warning? using factory girl also. this deprecated behavior not supported in rspec 3. `let` , `subject` declarations not intended called in `before(:all)` hook, exist define state reset between each example, while `before(:all)` exists define state shared across examples in example group. warning: let declaration `fa` accessed in `before(:all)` hook at: d:/railsapps/uwb/spec/models/fa_commercial_spec.rb:77:in `block (2 level s) in <top (required)>' here 1 example, how can changed ok in rspec 3? require 'spec_helper' describe 'facommercial' let(:admin_user) {create(:user_admin_dev)} let(:template) {create :fa_commercial_template} let(:fa) {create :fa_commercial, fa_template: template} let(:stmt_template_bal_sheet) {create :fa_commercial_stmt_template_bal_sheet, fa_template: template}...

is it possible to change where github pages looks for index.html?i -

i have searched alot can't find solution. i'm using middleman aand directory structure project --source ---javascript ---stylesheets ---index.html.erb ---submit.html.erb when deployed project on github , tried access site it's giving me 404 error cannot find index.html page can tell me if there way can change link index.html i have tried solution not works can have github pages index.html in subfolder of repository? here's link git repo https://github.com/gardezi1/gardezi1.github.io

mysql - Select multiple values from a column based on a certain value from another column -

i have 3 mysql tables "courses", "modules", , "course_managements" following... "modules" table... module_id module_title 1 accounting 2 management 3 marketing "courses" table... course_id course_title 1 cima 2 aat 3 slim 4 mba "course_managements" table... cm_id module_id course_id 1 1 1 2 1 2 3 2 1 4 2 4 5 3 3 6 3 4 i want assign sql query, selecting course id (let's '1') available module_ids have listed as... '1' , '2' i'm trying develop interface user can select course / can view modules under it... could suggest sql query it..? you have take input of courseid user , use following query modules . select * modules inner join course_managements on modules.modul...

Ruby on Rails ActiveRecord query to find single lines -

modela has_many modelb, , want find of modela have 1 modelb. came with modelb.select('modela_id').group('modela_id').count to number of occurence of each one, there nice ruby way list of modela_id count 1? or better way beginning? try using having clause modelb.select('modela_id').group('modela_id').having('count(modela_id) = ?', 1)

android - On Call HangUp, Media Recorder does not stop and save the recorded call -

i'm new android programming. trying build call recorder. able detect incoming calls , start media recorder , record voice. on call disconnect, stop() method not trigger. stops when close app. working except stop(). when close app recordings saved. how stop() recording after call disconnected? import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.media.mediarecorder; import android.os.environment; import android.telephony.telephonymanager; import java.io.ioexception; import java.util.calendar; public class ncallreceiver extends broadcastreceiver { @override public void onreceive(context context, intent intent) { mediarecorder callrecorder = new mediarecorder(); if (intent.getstringextra(telephonymanager.extra_state).equals(telephonymanager.extra_state_ringing)) { string incomingnumber = intent.getstringextra(telephonymanager.extra_incoming_number); calendar c = cale...

swift - Singleton pattern and proper use of Alamofire's URLRequestConvertible -

this 2 part question first similar question here: proper usage of alamofire's urlrequestconvertible . need little more help! 1) create enum router implements urlrequestconvertible each model in model layer? the alamofire github page provides example of router i've copied here: enum router: urlrequestconvertible { static let baseurlstring = "http://example.com" static var oauthtoken: string? case createuser([string: anyobject]) case readuser(string) case updateuser(string, [string: anyobject]) case destroyuser(string) var method: alamofire.method { switch self { case .createuser: return .post case .readuser: return .get case .updateuser: return .put case .destroyuser: return .delete } } var path: string { switch self { case .createuser: return "/users" case .readuser(let usernam...

JavaScript global boolean Variable convert itself to string -

first i'm new javascript, please don't hate me if ask such trivial question. i've searched hours on google, cannot find solution problem. have declared global variable "status", false. if check datatype within function, says "string", allways true, script doens't work @ all. var status = false; function slide(element) { if (status) { slideup(element); } else { slidedown(element); } } function slidedown(element) { status = true; // testprint todo remove alert('status ' + status + ' , type: ' + typeof status); // todo } function slideup(element) { status = false; // testprint todo remove alert('status ' + status + ' , type: ' + typeof status); // todo } am wrong or have write myself function convert every time boolean var "real" boolean var? have tested myself , show me boolean datatype... this works fine....

How to parse a two dimensional JSON array in java -

this json data { "tag1":["haaai ","hello"], "tag2":[["haai1","haai2"],["hello1","hello2","hello3"]] } i can read array tag1 using java code jsonarray msg = (jsonarray) jsonobject.get("tag1"); iterator<string> iterator = msg.iterator(); while (iterator.hasnext()) { string text = iterator.next(); system.out.println(text); } but, can't read tag2 array using above method. idea? you can't read using same method because format different. have use 2 loops instead. jsonarray msg = (jsonarray) jsonobject.get("tag2"); iterator<jsonarray> iterator = msg.iterator(); while (iterator.hasnext()) { iterator<string> inneriterator = iterator.next().iterator(); while (inneriterator.hasnext()) { string text = inneriterator.next(); system.out.println(...

osx - Console.log Launchd Throwing error, InVisionSyncHelper. -

i m seeing on console log keeps relaunching great. - jul 8 09:48:35 --- last message repeated 1 time --- - jul 8 09:48:35 ozcans-macbook-pro com.apple.launchd.peruser.501[317] (com.invisionapp.invisionsynchelper[2403]): exited code: 1 - jul 8 09:48:35 ozcans-macbook-pro com.apple.launchd.peruser.501[317] (com.invisionapp.invisionsynchelper): throttling respawn: start in 10 seconds i have checked, ~/library/launchagents /library/launchagents /library/launchdaemons /system/library/launchagents /system/library/launchdaemons thanks in advance. here how found quick way rid of it, here how remove service launchd . launch terminal , use following syntax launchctl command: launchctl remove name for example, if want remove service named “com.annoying.service” syntax be: launchctl remove com.annoying.service you may need prefix command sudo in order remove service, in case command be: sudo launchctl remove com.annoying.service with sud...