Posts

Showing posts from August, 2014

How do I convert a string into an integer in objective C? -

How do I convert a string into an integer in objective C? - possible duplicate: how string conversions in objective-c? i trying convert user's guess integer. how do that? this trivial in objective-c... nsstring *inputstring = @"75"; int value = [inputstring intvalue]; you can utilize floatvalue, doublevalue or (i believe) boolvalue convert nsstring other types. here page lists mutual tasks may need perform strings; http://borkware.com/quickies/one?topic=nsstring objective-c string int

cocos2d iphone - On CCBitmapFontAtlas effect (Display on by one) -

cocos2d iphone - On CCBitmapFontAtlas effect (Display on by one) - i'm trying create effect using ccbitmapfontatlas, here want: the string "abcdefg" beingness dispayed 1 one, each 1 won't displayed until 1 before displayed. and here tried: -(id) init { if( (self=[super init] )) { label = [ccbitmapfontatlas bitmapfontatlaswithstring:@"abc" fntfile:@"bitmapfonttest.fnt"]; [self addchild:label]; cgsize s = [[ccdirector shareddirector] winsize]; label.position = ccp(s.width/2, s.height/2); label.anchorpoint = ccp(0.5f, 0.5f); label.visible = no; //hide first [[cctouchdispatcher shareddispatcher] addtargeteddelegate:self priority:0 swallowstouches:yes]; } homecoming self; } -(bool) cctouchbegan:(uitouch *)touch withevent:(uievent *)event { ccsprite achar = (ccsprite) [label getchildbytag:0]; ccsprite bchar = (ccsprite) [label getchildbytag:1]; ccsprite cchar = (ccsprite) [label...

java - How to specify SQL comments through JPA annotations? -

java - How to specify SQL comments through JPA annotations? - is there way specify sql comments through jpa annotations? comments tables , columns. is there way specify sql comments through jpa annotations? comments tables , columns. no. if want define tables , columns comments, best alternative after facts in generated ddl, before executing against database. java orm jpa

bash - Preserving 'ls' output format over network -

bash - Preserving 'ls' output format over network - i have 2 machines , b. i wish have output b printed in terminal on a. i run next in loop on a: nc -l -p 65000 on b, output tee'd /dev/tcp/a/65000 this works of time, output programs such 'ls' lose colour , tab formatting. there way work, such writing straight tty on a? how this? thanks. you need utilize unbuffer fool programme thinking it's connected tty. bash scripting networking

c++ - How to convert a labview image type to opencv image type (or Mat)? -

c++ - How to convert a labview image type to opencv image type (or Mat)? - i'm using labview acquire image usb photographic camera , want process image using opencv functions through dll file (which used in phone call function vi). want convert image format labview produce process opencv. how can so? you can utilize "imaq getimagepixelptr" pointer on image in labview. in dll, should able : int function(unsigned __int8 *lvimagepointer, int linewidth, int height, int width) { mat image(height, width, cv_8uc1, lvimagepointer, linewidth); ... } c++ opencv labview

Ruby Active Record Relational -

Ruby Active Record Relational - still newbie here, still couldn't logic right. currently, have: user has many products. product has 1 user cost attribute. i trying add together on: user can offer 1 cost on product sold user. user can offer cost on multiple products. a product can have many offered cost multiple users. i have come out with: class user < activerecord::base has_many :products has_many :offered_prices end class product < activerecord::base belongs_to :user has_many :offered_prices end this have done far. still doesn't seem quite right rather confused @ same time. help much appreciated! :) define 3 models: user | offeredprice | product the association amongst them be: class user < activerecord::base has_many :products has_many :offered_prices, through: :products end class offeredprice < activerecord::base belongs_to :user belongs_to :product # create sure user can offer cost 1 time against ...

Javascript: Why is a constructor's __proto__ property Empty() { }? -

Javascript: Why is a constructor's __proto__ property Empty() { }? - this question has reply here: what - function empty() - in javascript ? [duplicate] 1 reply i created simple constructor like: function car() { this.notires = 5; } car.__proto__ prints out empty() {} what mean? protoype property of every constructor object prototype of new instance. can define this. car.prototype.name="audi"; car.prototype.model="a4"; making constructor not mean making prototype. prototypes used when want create instances pointeng same block eg. function person(){ } person.prototype.name = "detailer"; person.prototype.age = 17; person.prototype.job ="developer" person.prototype.sayname = function(){ alert(this.name); }; var person1 = new person(); var person2 = new person(); person1.name = "lakshay...

javascript - I want to create an input number box in AngularJS app on which a user should not be able to type decimal numbers. (an integer number input box) -

javascript - I want to create an input number box in AngularJS app on which a user should not be able to type decimal numbers. (an integer number input box) - the thought user should not able come in decimal point while tries type in number number-input-box. thought of capturing $event on controller , alter info on input control. didn't work me. have input box in angular app web page: <input type="number" ng-keydown="checkfordecimal($event, age)" min="1" max="125" name="inputage" ng-required="true" ng-model="model.age" /> controller: $scope.checkfordecimal = function($event, age) { if($event.which === 110 || $event.which === 190) { //do } } can think of improve way accomplish this? this should directive . here's 1 illustration i've seen here (credit @my mai): app.directive('onlydigits', function () { homecoming { require: ...

Android - Easy/comfortable way to design DrawerLayout using Android Studio? -

Android - Easy/comfortable way to design DrawerLayout using Android Studio? - in app have implementer drawerlayout 1 of activities, , added listview in center of activity. in order add together items ( button s , textview etc..) add together them manually editing xml layout file (by adding raw attributes page). there way design drawer in android studio design simple activity ? added screen shot of how looks in studio, elements appear on left of page, outside of emulator. edit: here xml layout: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- first kid in layout main activity ui--> <relativelayout android:layout_width="match_parent" a...

ios - Unable to select the correct first row in UITableView -

ios - Unable to select the correct first row in UITableView - i have table row 6 rows. want have background colour of first row different background color of 4th row ( index 3 ) changes. adding screenshot of same , here code import uikit var items = ["admksalmdlsamdlsamdlkasmdlasmdlsamdlksamdlkasmdlkasmdlksamdklasmdlkasmdlkasmdlkasmdcjkndscnksndcdkcnksdjcnksdnckjsdncsdnjkanckjanckjsnckjasncjkasnckjasncjkasnckdslnjcvlkjdncjsnjkasncjkasncjkasnckjasncjkasnckjsanckjsanckjasncjksancjksancjksancjkasncjasncjkasncklas;nkcndjkvalnvjksdanckscnjsncjksdcnkjsdnckjancdknlsacnjdkcnjkncakjnacjknkjanckjsnc","badmksalmdlsamdlsamdlkasmdlasmdlsamdlksamdlkasmdlkasmdlksamdklasmdlkasmdlkasmdlkasmdcjkndscnksndcdkcnksdjcnksdnckjsdncsdnjkanckjanckjsnckjasncjkasnckjasncjkasnckdslnjcvlkjdncjsnjkasncjkasncjkasnckjasncjkasnckjsanckjsanckjasncjksancjksancjksancjkasncjasncjkasncklas;nkcndjkvalnvjksdanckscnjsncjksdcnkjsdnckjancdknlsacnjdkcnjkncakjnacjknkjanckjsnc", "cadmksalmdlsamdlsam...

spring roo - how to resolve the errors coming in jspx file -

spring roo - how to resolve the errors coming in jspx file - i created project through spring too. after added 1 table , create model, controller , view. in view show.jspx when run it, got error in browser console "empty string passed getelementbyid()" . here show.jspx : <?xml version="1.0" encoding="utf-8" standalone="no"?> <div class="mainbar" xmlns:spform="http://www.springframework.org/tags/form" xmlns:form="urn:jsptagdir:/web-inf/tags/form" xmlns:util="urn:jsptagdir:/web-inf/tags/util" xmlns:table="urn:jsptagdir:/web-inf/tags/form/fields" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:spring="http://www.springframework.org/tags" xmlns:field="urn:jsptagdir:/web-inf/tags/form/fields" xmlns:jsp="http://java.sun.com/jsp/page" xmlns:page="urn:jsptagdir:/web-inf/tags/form" version="2.0"> <jsp:directive.page...

java - Is it possible to get Javascript array in JSP page -

java - Is it possible to get Javascript array in JSP page - i developing web application in which have javascript array , want array in jsp page , iterate save info in database. var value = response; (var key in value) { if (value.hasownproperty(key)) { alert(key + " -> " + value[key]); var sample = new array(); sample=value[key]; console.log(sample); // document.getelementbyid(''); } } }); i want info on jsp page possible. if possible, how? you can have javascript in jsp execute on client side. if want save stuff on trigger of event within browser can making ajax phone call or form submission. ajax preferred way because faster , improve experience user but if have intention of execution of javascript on server side thats not possible java javascript jsp

ruby - Unable to load JSON data for Cities gem in rails -

ruby - Unable to load JSON data for Cities gem in rails - i using cities gem allowing users select city. according documentation path json info should set using next line of code. cities.data_path = '/path/to/cities' i not able figure out add together , how load. i've tried adding line location of json files in app directory no luck. still error, "not able load json data". i beginner , can see documentation not much beginner friendly. what in rails create initializer file in config/initializers , give proper name cities.rb , set code in there. ruby-on-rails ruby json gem

javascript - overlaying text on image with flickity? -

javascript - overlaying text on image with flickity? - using flickity, how overlay vertically , horizontally aligned text on images? here jade: .gallery .cell h2 1 img(src="01.jpg") .cell h2 2 img(src="02.jpg") .cell h2 3 img(src="03.jpg") and js: $(document).ready(function(){ $('.gallery').flickity({ autoplay: 3000, prevnextbuttons: false }); }); i tried this sec , 3rd images appear shrunk. clues? javascript css

visualforce - cant able to query and view parent and son opportunity -

visualforce - cant able to query and view parent and son opportunity - i converting code parent , boy chance public class accconhierarchy { private list<account> acc; public list<accountwrap> accountlist { get; set; } public accconhierarchy (){ list<contactwrap> cw; accountlist = new list<accountwrap>(); acc = [select id,name,industry,billingcountry,createdbyid,(select id,name,email,phone contacts) business relationship limit 20]; for(account a:acc){ cw = new list<contactwrap>(); for(contact co : a.contacts){ cw.add(new contactwrap(co)); } accountlist.add(new accountwrap(a,false,cw)); } } public class accountwrap{ public business relationship oaccount{get;set;} public boolean isselected{get;set;} public list<contactwrap> contactset{get;set;} public accountwrap(account a,boolean b, lis...

where do I get a key for google-translate? -

where do I get a key for google-translate? - it appears utilize google translate have utilize api key can't find anywhere key. key same used search apis? yes, search api key should work, though isn't required, according docs http://code.google.com/apis/ajaxlanguage/documentation/ (i read bit of docs while back, never did thought using it, there difference between theory , practice didn't find). google-translate google-ajax-api

c# - DoDragDrop from standard Label not working -

c# - DoDragDrop from standard Label not working - i can't figure out why attempting drag text standard label notepad (or other command accepting text) doesn't work. i've looked @ documentation , examples , i'm not seeing problem. cursor remains circle line through , if register feedback callback event none. creating standard windows forms application, dropping label command , registering mousedown & mousemove events have code phone call label1.dodragdrop (label1, dragdropeffects.all | dragdropeffects.link). help appreciated. here form code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace dragdroplabel { public partial class form1 : form { point m_clicklocation; bool _bdragging = false; public form1() { initializecomponent(); } private v...

c# - Unit Testing - Resolution of the dependency failed -

c# - Unit Testing - Resolution of the dependency failed - i'm new unit testing. wanted unit test existing webapi controller. within controller, i'm resolving dependencies using unitycontainer. while running test case, getting exception microsoft.practices.unity.resolutionfailedexception: resolution of dependency failed can guide me resolve dependency? in advance!! class="lang-cs prettyprint-override"> public class pqcontroller : apicontroller { public ihttpactionresult getbyid(int pqid) { if (!isvalidpqids || sourceid <= 0) { homecoming badrequest(); } iunitycontainer container = new unitycontainer(); container.registertype<ipqadapter, pqadapterdesktop>(); var pqdesktopadapter = container.resolve<ipqadapter>(); var pq = pqdesktopadapter.getpqbyids<pqdesktop>(pqid); homecoming ok(pq); } } test code: c...

c# - WPF: Binding with two different lists -

c# - WPF: Binding with two different lists - i have few problems databinding in wpf. i have listbox has binding bindinglist. <listbox x:name="samplelistbox" itemssource="{binding list1}" itemcontainerstyle="{staticresource listboxstyle}" borderthickness="0" selectedindex="0" margin="0"> <listbox.itemtemplate> <datatemplate > <border x:name="border" width="185"> <textblock text="{binding name}"/> </border> </datatemplate> </listbox.itemtemplate> </listbox> till here, works fine. have datagrid should linked bindinglist , display strings of it. example, if first item of listbox selected, grid should show info of first item of sec list. know, how work if both, listbox , grid info same list, have no idea, ...

c# - Color GridView Expiration Date -

c# - Color GridView Expiration Date - i "new" in c# programming , trying color date expire in few days or expired. code sqlconnection cs2 = new sqlconnection(@"data source=.\sqlexpress;attachdbfilename=c:\\users\nikola\documents\visual studio 2010\projects\gym software\gym software\data.mdf;integrated security=true;connect timeout=30;user instance=true"); sda = new sqldataadapter("select datumistice korisnici", cs2); foreach (datagridviewrow row in datagridview1.rows) { var = datetime.now; var expirationdate = datetime.parse(row.cells[0].value.tostring()); var sevendaybefore = expirationdate.adddays(-7); if (now > sevendaybefore && < expirationdate) { row.defaultcellstyle.backcolor = color.yellow; } else if (now > expirationdate) { row.defaultcellstyle.backcolor = color.red; } } the lastly row shoud colored, not: how this: row.backcolor = color.red; c# asp....

xcode - How can I populate a table view, not a table view controller? -

xcode - How can I populate a table view, not a table view controller? - i have table view within normal view controller , wondering how should go out populating data? after researching it, everywhere have seen done uses table view controller: using view controller table view within it. how should populate data? have created iboutlet in viewcontroller.swift , i'm not sure add together data. the reason not using table view controller because couldn't navigation bar show , heard navigation bar scrolled. is possible utilize table view within normal view controller? should using table view controller? if possible utilize table view within normal view controller, how populate table view? the coding language using swift. a uitableviewcontroller normal uiviewcontroller has main view replaced uitableview , uses uitableviewdelegate , uitableviewdatasource protocols. uitableviewcontroller subclass of uiviewcontroller . so add together protocols , ...

c# - Mvc List Strongly type View DropDownListFor not showing current value -

c# - Mvc List Strongly type View DropDownListFor not showing current value - i have next dropdownlistfor control @html.dropdownlistfor(m => item.relationshipid, new selectlist(viewbag.relationship,"id", "title"), new { @id = "ddl_" + @item.userid, @class = "form-control", onchange = "update(this,'" + @item.userid + "','" + @item.sentbyuserid + "');" }) i bind type view @model list<mvcui.models.userdetails> in viewbag.relationship have next list public static list<idtitledto> datatabletorelationshiplist(this datatable table) { var list = table.asenumerable() .select(dr => new idtitledto { id = dr.field<int>("relationshipid"), title = dr.field<string>("relationshipname") }).tolist(); homecoming list; } i passing list...

email - Trying to set up basic mail configuration Jenkins -

email - Trying to set up basic mail configuration Jenkins - i'm trying set basic mail service configuration jenkins (with hotmail). searched lot on net can't find i'm doing wrong. configuration e-mail scheme admin : adminmail@hotmail.com smtp server : smtp.live.com standard e-mail suffix : / utilize smtp authentication : yes name user : adminmail@hotmail.com password : ******* utilize ssl : yes smtp port : 25 (or 587, used both) reply-to addres : / charset : utf-8 i error: javax.mail.messagingexception: not connect smtp host: smtp.live.com, port: 587 or 25; nested exception is: java.net.socketexception: connection reset when i'm trying ssh smtp.live.com port, or when set ssl off: error this: must issue starttls command first your error message pretty much says all. have searched error message , found following: server says: 530 5.7.0 must issue starttls command first posted honor doyle smtp error code server sa...

html - How to show full webpage height in iFrame -

html - How to show full webpage height in iFrame - i want iframe height of src page fits whole page without scrolling iframe. so far, width works not height. class="snippet-code-css lang-css prettyprint-override"> #iframe { overflow:hidden; width: 100%; max-width: 600px; height: 100%; } class="snippet-code-html lang-html prettyprint-override"> <iframe id="iframe" src="page.html" frameborder="0" scrolling="no"></iframe> html css iframe

Adding Gmail API to android app -

Adding Gmail API to android app - since gmail api not part of google play services sdk (according this), part of google apps apis, how create login using gmail android app? i need access user emails (read-only). i have this downloaded, not sure of how utilize it. android gmail google-play-services gmail-api

javascript - Simple Node.js chat program NOT using socket.io -

javascript - Simple Node.js chat program NOT using socket.io - i trying larn node , build simple chat application. seems uses socket.io. understand how on more fundamental level using , post. basically, want have form takes input , reposts below form see. this have far: //requirements var express = require('express'); var app = express(); //get app.get('/', function (req, res) { // res.send('hello world!'); var response = "<head>"+ "<title>chat</title>\n"+ "</head>\n"+ "<body>\n"+ "<form action=\"/\" method=\"get\">\n" + "<p>\n" + "enter phrase: <input type=\"text\" name=\"phrase\"><br>\n" + "<input type=\...

junit - idea.properties change/addition not working -

junit - idea.properties change/addition not working - i upgraded injellij14, , there's bothers me, run configurations tests. used have alternative run tests junit, , maintain way, see have 2 options junit/gradle. found same issue , solution here, not working: run junit test in intellij thought 14 without choosing configuration type i added value idea.properties , not working. no java.exe process in background, no matter how many times restart intellij or restart pc. not working , still showing me 2 options when running test... i'm seeing 1 idea.properties file under installation/bin folder, updating right one??? its bugging hell out of me :) any ideas? intellij-idea junit gradle junit4 intellij-14

how to make json on iphone using jquery -

how to make json on iphone using jquery - i can utilize create json on web browser: var json_string = json.stringify(array); but , has not object named "json" on iphone , so can ? thanks check @ sbjson library here it has 2 facility method: one operating on nsobject ( - (nsstring *)jsonrepresentation ) transform them json nsstring one operating on nsstring ( - (id)jsonvalue ) create nsarray or nsdictionary json nsstring. jquery iphone json

User Google Closure to lazy load javascript -

User Google Closure to lazy load javascript - i'm liking ability require other javascript classes using google closure, i'm wondering if it's possible utilize goog.require lazy load other javascript classes. when trying using goog.require after page has loaded, seems refresh or go blank :( way script on demand, , maybe set callback, can run javascript when it's done loading? closure library modulemanager: https://github.com/google/closure-library/blob/master/closure/goog/module/modulemanager.js javascript google-closure

How can I build a lookup table in C++? -

How can I build a lookup table in C++? - i finish novice in c++. trying read file , build lookup table (more hashtable check existence of string value). file has 300 one thousand entries utilize build lookup table. , after this, performing 1 1000000 lookups on this. efficient way of doing this? map (google's first result) or there improve construction purpose? based on scenario, want @ tries c++

sort items by date joined in tableview JavaFX -

sort items by date joined in tableview JavaFX - i have tableview there items in date joined , date joined form dd nameofmonth, yyy , how can sort items date joined ? here part of code item class: public static class person1 { private stringproperty firstname; private stringproperty joined; public person1(string firstname, string joined) { this.firstname = new simplestringproperty(firstname); this.joined = new simplestringproperty(joined); } public stringproperty firstnameproperty() { homecoming firstname; } public stringproperty joinedproperty(){ homecoming joined; } } javafx tableview

Perl: library to log on specific files -

Perl: library to log on specific files - i'm creating library stuffs want log errors on specific file. unfortunately, while works if initiate 1 single instance of library, doesn't if initiate more 1 instance. the results in case output logged in lastly file , not half , half expecting. this main.pl eval 'exec /usr/bin/perl -i `pwd` -s $0 ${1+"$@"}' if 0; utilize strict; utilize mylibrary; ($rc, $test_2, $test_1); # output not going file exit $test_1 if (($test_1 = mylibrary->new("/tmp", "test_1")) !~ "hash"); # going file exit $test_2 if (($test_2 = mylibrary->new("/tmp", "test_2")) !~ "hash"); exit $rc if ( $rc = $test_1->test() ); exit $rc if ( $rc = $test_2->test() ); and mylibrary.pm package mylibrary; utilize strict; utilize symbol; utilize vars qw($version @isa @export %default); @export = qw( ); $version = '1.00'; require 5.000; %default; $f...

python - Using Sine sample in a loop to per form calculation -

python - Using Sine sample in a loop to per form calculation - i trying generate sine wave , sample , take each sample of , perform calculations using sample's value, save calculated value in array , plot output array against sine wave. however, not able below code. def sampled_sine_wave(freq): samples = 1000 time_period = 1 time = linspace(0,time_period,samples) _ = plot(time,[sin(t*freq*2*np.pi) t in time]) vin=sampled_sine_wave if vin > 0: vpos=vin dw = (1 - numpy.exp(-(1-w)/1))*lamda*((eta1)* numpy.sinh(eta2*vpos) - (w/tau)) * dt elif vin < 0: vneg=vin dw = (1- numpy.exp(-w/0.3))*lamda*((eta1) * numpy.sinh(eta2*vneg) - (w/tau)) * dt current=((1-dw) * alpha * (1 - numpy.exp(-beta * vin)) + (dw * gamma * numpy.sinh(delta * vin))) so, going explanation trying sample vin 0.001s timestep "dt" , @ particular time step compare vin's value greater or less 0 calculate "dw" , utilize "dw" calculat...

c# - Generic inherited methods -

c# - Generic inherited methods - i have question generic inherited methods. say illustration have have base of operations manager class listmanager: public class listmanager<t> { private list<t> m_list; public listmanager() { m_list = new list<t>(); } public int count { { } } public void add(t atype) { } public bool deleteat(int anindex) { } public string[] tostringarray() { } public list<string> tostringlist() { } public bool checkindex(int index) { } } and animal manager class inherits list manager class above: public class animalmanager : listmanager<animal> { private list<animal> animallist; //list public animalmanager() { animallist = new list<animal>(); } public void add(animal animal) // same base of operations class method different method "content". { an...

c++ - wxSizers not arranging correctly in wxWidgets -

c++ - wxSizers not arranging correctly in wxWidgets - i have 2 wxtextctrl s , 2 wxbutton s within panel. want arrange them using sizers. want set wxtextctrl s horizontal , wxbutton s vertical. seems not work, here's code: wxpanel* panel = new wxpanel(this); wxpanel* panel2 = new wxpanel(this); wxstatictext* u = new wxstatictext(panel, wxid_any, "username"); uid = new wxtextctrl(panel, wxid_any); wxstatictext* p = new wxstatictext(panel, wxid_any, "password"); pass = new wxtextctrl(panel, wxid_any, "", wxdefaultposition, wxdefaultsize, wxte_password); wxbutton* r = new wxbutton(panel, 1, "register"); wxstaticline* line = new wxstaticline(panel2, wxid_any, wxdefaultposition, wxsize(0,15)); wxbutton* l = new wxbutton(panel, 2, "login"); //wxdefaultsize, wxte_multiline | wxhscroll | wxte_readonly); wxboxsizer* panelsizer1 = new wxboxsizer(wxhorizontal); panelsizer1->add(u, wx...

python - Heroku and Django -

python - Heroku and Django - i'm trying follow tutorial: http://tutorial.djangogirls.org/en/index.html i'm part: http://tutorial.djangogirls.org/en/deploy/readme.html where force heroku via git. i'm familiar git not heroku , while know python i'm django beginner. when command git force heroku master output prevents app beingness deployed. here error receiving: (myvenv) $> git force heroku master counting objects: 19, done. delta compression using 8 threads. compressing objects: 100% (16/16), done. writing objects: 100% (19/19), 3.81 kib | 0 bytes/s, done. total 19 (delta 0), reused 0 (delta 0) remote: compressing source files... done. remote: building source: remote: remote: -----> python app detected remote: -----> installing runtime (python-3.4.1) remote: -----> installing dependencies pip remote: exception: remote: traceback (most recent phone call last): remote: file "/app/.heroku/python/lib/python3.4/s...

javascript - Changing portnumber of localhost in Cordova project -

javascript - Changing portnumber of localhost in Cordova project - anyone knows how alter default port-number on cordova-project runs on localhost? i'm using visual studio 2015. in web-application, can alter portnumber of localhost in project properties in cordova-project, alternative doesn't exist. didn't find thing on internet. by default, visual studio 2015 sets cordova project debug using ripple emulator. i'm assuming you're seeing port 4400 default port. in vs2015, go tools -> options. search options ripple emulator - it's under tools apache cordova. alter port number away 4400 whatever want be. since ctp stuff, might require saving , restarting visual studio. edit: i've provided screenshot of see. have vs 2015 ctp 6 (latest) javascript visual-studio cordova visual-studio-2015 visual-studio-cordova

Android - PX to DP - Wrong height of layout -

Android - PX to DP - Wrong height of layout - i giving layout height 64dp in layout file , observed mismatch in calculated , actual pixel height. hdpi device - calculated height - 96 pixels, actual height: 102 pixels xxhdpi device - calculated height - 192 pixels, actual height: 204 pixels any 1 can help me understand difference in calculated , actual height. mdpi , hdpi , xhdpi etc "generalized densities". is, dpi groups or ranges. from android guide: for illustration 2 devices can have dpi values of 310 , 320 dpi respectively , fall in same group: xhdpi . the calculations done device code using exact dpi value. while calculations based on dpi groups assume following: ldpi (low) ~120dpi mdpi (medium) ~160dpi hdpi (high) ~240dpi xhdpi (extra-high) ~320dpi xxhdpi (extra-extra-high) ~480dpi xxxhdpi (extra-extra-extra-high) ~640dpi update: the next code: int widthdp = 160; log.i("test", "actual dpi: " + getresources().ge...

Java difference between "split(regEx)" and "split(regEx, 0)"? -

Java difference between "split(regEx)" and "split(regEx, 0)"? - is there difference between using split(regex) , split(regex, 0) ? because output cases tested same. ex: string mys = stack overflow; string[] mysa = mys.split(' '); results in mysa === {'this','is','stack,'overflow'} and string mys = stack overflow; string[] mysa = mys.split(' ', 0); also results in mysa === {'this','is','stack,'overflow'} is there "hidden" going on here? or else needs known .split(regex, 0) ? they same. quoted string.split(string regex) documentation: this method works if invoking two-argument split method given look , limit argument of zero. trailing empty strings hence not included in resulting array. java split

c# - Converting multidimensional array elements to different type -

c# - Converting multidimensional array elements to different type - suppose have multidimensional array: float[][,] vertices = { new float[,]{ {0f, 1.28f}, {1.28f, 2.56f}, {3.84f, 2.56f}, {5.12f, 1.28f}, {3.84f, 0f}, {1.28f, 0f}, {0f, 1.28f} }, new float[,]{ {0f, 3.83f}, {1.27f, 5.12f}, {3.87f, 5.12f}, {5.12f, 3.83f}, {5.12f, 1.26f}, {3.87f, 0f}, {1.27f, 0f}, {0f, 1.26f}, {0f, 3.83f} } }; now, want convert each subarray array of type vector2[] vector2 public class, contains x , y properties: public class vector2 { public float x; public float y; public vector2(float x, float y) { this.x = x; this.y = y } } so want build vector2 elements array[2] elements, subarrays in above vertices array variable. i this: array.convertall(vertices[0], new converter<float[], vector2>(verticessequence => { homecoming new vector2(verticessequence[0], verticessequence[1]); })); however, in homecoming receive error mes...

java - Trying to sort a map where the value is an object and I can sort by multiple values in the object -

java - Trying to sort a map where the value is an object and I can sort by multiple values in the object - i'm trying sort map based on different possible values in pupil object. doesn't seem working me , can't seem figure out why. help appreciated. thanks! protected static map<integer, student> sort(map<integer, student> unsortermap, string field) { comparator<integer> valuecomparator = new comparator<integer>() { public int compare(integer k1, integer k2) { int compare; if(field.equalsignorecase("name")) { compare = unsortermap.get(k1).getname().compareto(unsortermap.get(k2).getname()); } else { compare = integer.compare(unsortermap.get(k1).getindex(), unsortermap.get(k2).getindex()); ...

php - Error with postgres/pdo query binding values -

php - Error with postgres/pdo query binding values - i'm running next query in postgres: select (sum(g.grade_days_late) - sum(s.ex_late_days)) used_late_days grades g left bring together ( select * late_day_exceptions ) s on s.ex_rubric_id = g.rubric_id , s.ex_student_rcs=g.student_rcs g.student_rcs='?' , g.status=1 , g.rubric_id < ? with next commands: $statement = database::$link->prepare($query); $statement->execute($parameters); $parameters equal to: array (size=2) 0 => string 'test' (length=7) 1 => int 6 and next error: pdoexception: sqlstate[42p18]: indeterminate datatype: 7 error: not determine info type of parameter $2 i run query straight against database replacing 2 ? stuff in $parameters , works fine. if add together ' around sec parameter, query returns nil (yet still returns proper reply if run straight against values inserted). i have no thought what's going on here...

java - How can I access flash variable by using JSP -

java - How can I access flash variable by using JSP - have created simple login form in adobe flash cs6 2 fields, username , password. want send these info jsp page rest processes such authentication. next image visualize problem the actions script utilize this stop(); btnlogin.addeventlistener(mouseevent.click, submitted); function submitted(event:mouseevent):void { try{ trace("mouse clicked in button"); trace(txtusername.text); trace(txtpassword.text); var myrequest:urlrequest = new urlrequest("http://localhost:9093/java&flash/index.jsp"); myrequest.method = urlrequestmethod.post; var variables:urlvariables = new urlvariables(); variables.username = txtusername.text; variables.password = txtpassword.text; myrequest.data = variables; var loader:urlloader = new urlloader(); loader.dataformat = urlloaderdataformat.variables; loader.addeventlistener(event.complete, dataonload); loader.load(myrequest); }catch(e:error){ r.text=e.message; } } fu...

hadoop - How to run map reduce program from windows using eclipse -

hadoop - How to run map reduce program from windows using eclipse - i have installed eclipse in windows scheme , hadoop cluster on centos server machines. i've used cdh5.3 cluster. how can run eclipse hadoop eclipse plugin on windows machine? i not able figure out how can run map cut down programs windows machine hadoop master node. any thought how ? in advance. all nodes in hadoop - master nodes, slave nodes , including client should have same hadoop distribution. client in case machine, should using cent os , same hadoop distribution. eclipse hadoop mapreduce

Yii2.0 user management migration failed -

Yii2.0 user management migration failed - installed yii 2.0, need install yii2.0 user management extension. when run migrate command shows next error. i kept webvimark folder within vendor folder. if wrong, please guide me in right way. had tried importing mysql.schema.sql. didn't work. sorry if had asked immature question!! i guess have wrong console app configuration. see whether there 'bootstrap' section within config/console.php , has ['gii'] value. should remove it. yii2 user-management

properties - Objective-C: use variable in children class, which is created automatically by property in parent class? -

properties - Objective-C: use variable in children class, which is created automatically by property in parent class? - i want subclass icarousel have troubles private variables. example: icarousel.h @interface icarousel : uiview ... @property (nonatomic, assign, getter = isvertical) bool vertical; ... @end icarousel.m @implementation icarousel - (void)setup { ... _vertical = ...; ... } - (void)setvertical:(bool)vertical { if (_vertical != vertical) { _vertical = vertical; [self layoutitemviews]; } } @end they set variable _vertical without accessing of property , avoid calling of overridden setter method. could access same variable, not property in kid class without changing of icarousel .h , .m files? objective-c properties private protected icarousel

javascript - Highcharts resize issue with Angularjs -

javascript - Highcharts resize issue with Angularjs - in dashboard application using highcharts generate charts, works fine. have embedded charts within div , assigning id chart. generates chart. using resizeable directive resize chart whenever user resizes div. var chart1 = chart.highcharts(); throws error saying "uncaught typeerror: undefined not function" this worked before days. there dependency issue? here html , directive. html: <md-card-content> <highchart id="{{widget.id}}" config="widget.chartconfig"> </highchart> </md-card-content> routerapp.directive('resizeable', function() { homecoming { restrict: 'ea', link: function(scope, element, attrs) { $(element).resizable({ resize: function(event, ui) { var widgetid = attrs.identifier; var chart = $('#'+widgetid); var chart1 = chart.highc...

PostgreSQL How to get a result, transactions via php -

PostgreSQL How to get a result, transactions via php - i need transaction update, do: $sql = 'begin;set transaction isolation level serializable; update partner_statistic set "views_count"="views_count"+1 "id"=15 returning id; commit;'; transaction query success,but utilize unit test, , not test transaction don't success result pg_query, whow can test ? do 1 phone call pg_query per query. php postgresql phpunit

How can an Android application find out that files have been modified from a PC? -

How can an Android application find out that files have been modified from a PC? - my application accessing files single special directory. want application notified when user connects device computer , modifies files (adds, removes, renames etc.). per-file notifications not necessary, application needs know should rescan directory. ideal solution work sd card. the fileobserver doesn't work in case (and documentation indirectly says so). i have tried using broadcastreceiver watch action_media_mounted intent, no luck. since i'm interested in sound files, have experimented action_media_scanner_started has proven unreliable: works on sgs3 not on nexus 7 android 5.1. assume media scanner not guaranteed run on devices. i seek using combination of different methods (watching of intents come mind above , maybe others lie action_power_disconnected ) if possible, i'd utilize more reliable approach. i wasn't able find solution think have found satisfactor...

ios - index 0 beyond bounds for empty array parse.com -

ios - index 0 beyond bounds for empty array parse.com - i'm trying parse list of objects current user has created custom table view parse.com. i'm getting error when run it: [__nsarraym objectatindex:]: index 0 beyond bounds empty array here's how i'm doing it: @interface profileviewcontroller () @property (nonatomic, retain) pfquery *query; @end @implementation dailyprofileviewcontroller - (void)viewdidload { [super viewdidload]; [self refresh]; self.tableview.delegate = self; _projects = [[nsmutablearray alloc] initwithcapacity:100]; } - (void)refresh { pfquery *query = [pfquery querywithclassname:@"projects"]; [query includekey:@"user"]; [query wherekey:@"user" equalto:[pfuser currentuser]]; [query orderbydescending:@"createdat"]; [query findobjectsinbackgroundwithblock:^(nsarray *posts, nserror *error) { if (!error) { [_projects setarray:posts]; ...

linux - Writing a function to replace duplicate files with hardlinks -

linux - Writing a function to replace duplicate files with hardlinks - i need write bash script iterates through files of specified directory , replaces duplicates of files hardlinks. right now, entire function looks this: #! /bin/bash # sameln --- remove duplicate copies of files in specified directory d=$1 cd $d #go directory specified default input filenum=0 #loop counter dir=".*|*" f in $dir #for every file in directory files[$filenum]=$f #save file array filenum=$((filenum+1)) #increment counter done for((j=0; j<$filenum; j++)) #for every file if [ -f "$files[$j]" ] #access file in array for((k=0; k<$filenum; k++)) #for every other file if [ -f "$files[$k]" ] #access other files in array test[cmp -s ${files[$j]} ${files[$k]}] #compare if files identical [ln ${files[$j]} ${files...

How to use the if-else statements in batch programming? -

How to use the if-else statements in batch programming? - i writing batch code. want take character user , if true set of statements should executed else set of statements. i tried : set /p aj= if %aj%==y ( set of commands... ) else ( set of commands... ) but unable perfect output supposed get. please help. if code script long find using goto easier. seek this: set /p "aj=: " if /i "%aj%"=="y" goto :yes :no rem set of commands... goto :post :yes rem set of commands... goto :post :post rem code after if-statement that way know don't need enabledlayedexpansion , can have long pieces of code little worry formatting. batch-file

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

java - How to set log4j.defaultInitOverride property to false in jboss server 6 - how set log4j property false in jboss. not using log4j in application still property has set true. the reason, why trying set property false is, suspecting property overrides java.util.logging.logger configuration provided application. might because of this, log file not getting generated. boot.log infomation below: 02:46:10,495 debug [serverinfo] log4j.defaultinitoverride: true 02:46:10,496 debug [serverinfo] org.jboss.deployers.spi.deployer.matchers.nameignoremechanism: org.jboss.deployers.spi.deployer.helpers.dummynameignoremechanism 02:46:10,496 debug [serverinfo] org.jboss.logging.logger.pluginclass: org.jboss.logging.logmanager.loggerpluginimpl i have found in boot.log in jboss. in 1 of blog, developers told me that, log4j.defaultinitoverride property should set false avoid override of java.util.logging.logger. comment same if wrong. java logging jboss log4j

c++ run python code to import custom module -

c++ run python code to import custom module - i new writing c++/python mixed programs. i have compiled my_class.so (in c++) , can import in python. the next programs run without problem. #!/user/bin/env python my_class import * l = my_class() l.dosomething("filename") i have under same folder , if start python environment, can next without error >>>import my_class this tried next, tried phone call python scripts c++, "hello" , "import numpy" part run without problem. next tried purely experimental, want test possibility, don't expect real application, want import own class. following(i know creating c++/python/c++ chain): #include <python.h> int main(int argc, char *argv[]){ py_initialize(); //pyrun_simplestring("print \"hello!\""); //pyrun_simplestring("import numpy"); pyrun_simplestring("import my_class"); py_finalize(); ho...

performance - Efficiency issue on Guile SCHEME: member and equal? -

performance - Efficiency issue on Guile SCHEME: member and equal? - i new on scheme programming , after while succeeded on writing couple of scripts deal long maths formulas. the issue execution pretty slow. after profiling realized execution takes 35% of time executing built-in functions equal? , member. my question regarding whether there exist more efficient version of functions or should re-factor code in order remove calls? i'm re-write code appreciate piece of advice. thanks! edit 1: i add together code making question clearer. next function takes 2 parameters, pair (x,y) , term, x , y variable names(symbols), may symbol , number, list , symbol, etc. term list such (+ w y z (* (- 1) x)) so after function execution (+ w z) the code looks following: (define (simp-by-term_eq t_cc t) (cond ((and (member (list '* (list '- 1) (car t_cc)) (cdr t)) (member (cadr t_cc) (cdr t))) (delete-1st (cadr t_cc) (...

C# evaluate for a value greater than 0 given 3 variables -

C# evaluate for a value greater than 0 given 3 variables - is more efficient use: if ( a+b+c > 0) or if ( a>0 || b>0|| c>0) or there improve way either of these? these 2 expressions not equivalent: first look false a=1, b=0, c=-1 , while sec true . the first look require 2 additions, comparing zero, , branch, while sec look require 3 comparisons 0 , 3 branches, because || operator short-circuiting. in end, difference going undetectably small. the case when sec look win when a , b , c represent expensive computations: if (expensivecomputationa() > 0 || expensivecomputationb() > 0 || expensivecomputationc() > 0) { ... } since computation above stop after first success, resultant code faster result of short-circuiting expensive branches. c#