Posts

Showing posts from February, 2015

mysql - retrieving information from 3 tables -

i have 3 tables: users: +----------+-----------------------------+-----------+ | users_id | user detail | otherid | +----------+-----------------------------+-----------+ | 1 | user name or details | 1 | | 2 | user name or details | 1 | | 3 | user name or details | 4 | | 4 | user name or details | 1 | | 5 | user name or details | 21 | | 6 | user name or details | 2 | +----------+-----------------------------+-----------+ photos: +----------+----------------+-----------+--------+---------+--------------+ | photosid | url | title | userid | likes | remarksid | +----------+----------------+-----------+--------+---------+--------------+ | 1 | 7459.jpg | title | 1 | 150 | 255 | | 2 | 7510.jpg | title | 1 | 146 | 247 | | 3 | 7460.jpg | ...

php - How to access a public function from a model inside a controller in magento? -

\ magento issue. have controller called imagescontroller.php where class my_sell_imagescontroller extends mage_core_controller_front_action i extending/inhering core controller now, have class class my_advert_model_advert extends mage_core_model_abstract { public function isvalid($arrsteptpcheck){ ... i access isvalid inside my_sell_imagescontroller maybe like $advert = mage::registry('current_advert'); $arrerror = $this->isvalid(array('step1')); but gives me fatal error: call undefined method my_sell_imagescontroller::isvalid() in .....imagescontroller.php i new magento backend. please help? try code mage::getmodel('advert/advert')->isvalid(array('step1')); or my_advert_model_advert::isvalid(array('step1'));

c - Using bitwise operators ~ and & to make | Operator -

i've got solve task can't find answer: compute x | y using ~ , & maximum allowed operations 8 edit: in twos complement , 32-bit representations of integers. right shifts performed arithmetically. by looking @ truth table of x | y see: 0 | 0 = 0 0 | 1 = 1 1 | 0 = 1 1 | 1 = 1 x | y 1 if both x , y not 0 . can translate ~(~x & ~y) : ~(~0 & ~0) = ~(1 & 1) = ~1 = 0 ~(~0 & ~1) = ~(1 & 0) = ~0 = 1 ~(~1 & ~0) = ~(0 & 1) = ~0 = 1 ~(~1 & ~1) = ~(0 & 0) = ~0 = 1

c# - What causes Visual Studio to reload projects? -

our team has solution has 15 projects work on collaboratively using git source control. when switching branches visual studio updates source files , branch switch takes seconds(bounded how fast can type commands). other times though, when switching branches, visual studio popup dialog saying needs reload projects , have sit , wait approximately 5 minutes while visual studio goes through process. i'm guessing we're doing line endings causing touch 1 of visual studio specific files, , causes reload, i'm not sure one, or if that's right path go down. so specific question is, "what causes visual studio need reload projects?" in fact quite easy: every file change cause visual studio reload file, whether has changed, or not. when changing project file, reload entire project. maybe git, or other software, updating attributes of file (so not content). might trigger 'visual studio' file change monitor already. have same issue using tort...

java - JSlider snapping to every 90th number -

my jframe window has system , feel , when add jslider , click on line, goes 90 steps forward or backward depending on mouse position. want diamond go under mouse , work if clicked , dragged on diamond. here minimal program think happens in windows because in default , feel, didnt snap 90th numbers went ahead 1 number. import java.awt.borderlayout; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jslider; import javax.swing.uimanager; import javax.swing.unsupportedlookandfeelexception; import javax.swing.event.changeevent; import javax.swing.event.changelistener; @suppresswarnings("serial") public class test extends jframe { int value = 300; jslider slider; jlabel label; public test() { setsize(300, 200); setdefaultcloseoperation(exit_on_close); setlocationrelativeto(null); label = new jlabel(string.valueof(value)); slider = new jslider(); slider.setminimum(100); slider...

javascript - Parse.com Cloud Code : Can't save data browser object -

i'm using following code delete currentuser user friend list. result.set("dateuserlist", datelistarr); this works, but: result.save(); doesn't work - when checking data browser don't see changes. parse.cloud.define("hello", function(request, response) { response.success("hello world!"); }); parse.cloud.define("deleteuserfromdatelist", function (request, response) { var usertodelete = string(request.params.currentuser); var user = string(request.params.dateid); var query = new parse.query("user"); query.equalto("fbid", user); query.first( { success: function (result) { var datelistarr = result.get("dateuserlist"); for(j = 0 ; j < datelistarr.length;j++) { if (datelistarr[j] == usertodelete) { ...

c# - The use of base in inheritance context -

could please explain me why result here is: dvd unknown dvd:dvd using system; class program { class m { internal string n; internal m() { } internal m(string n) { console.write(n + " "); n = n; } } class d : m { internal d(string n) : base(n) { n = "dvd:" + n; } } static void main(string[] args) { m d1 = new d("dvd"); m m1 = new m("unknown"); console.writeline(" " + d1.n); } } i understand parts of code, except line: internal d(string n) : base(n) { n = "dvd:" + n; } i know base calls parent class, in case don't it. :/ let's break apart line: internal d(string n) : base(n) { n = "dvd:" + n; } the part you're needing clarification on base(n) . base(n) call m(string n) constructor. happens before body of constructor ( n = "dvd... ) r...

How to use Android Volley for parallel calling -

i'm trying use android-volley project network operations of project. and implementation of this , use in project. i have activity list users , feeds. user list in activity , feeds in fragment , can't response of request in fragment , log message. w/singleclientconnmanager﹕ invalid use of singleclientconnmanager: connection still allocated. make sure release connection before allocating one. i think because of using type volley , have changed creation of requestqueue log message version: if (mrequestqueue == null) { // need in order access cookie store mhttpclient = new defaulthttpclient(); // create request queue mrequestqueue = volley.newrequestqueue(this, new httpclientstack(mhttpclient)); } changed version: if (mrequestqueue == null) { mrequestqueue = volley.newrequestqueue(this); } with change, cant response... any appreciated. queue = volley.newrequest...

Youtube API - how to get video with custom controls for iOS -

i'm working on application uploaded app-store every solution suggest has legit licenses against youtube , apple. i'm trying create custom video player youtube, have own play/pause/stop , next/previous buttons. i've searched quite lot legit ways make , have not found correct way yet. the way i'm using @ moment youtube embed player , parameters: controls = 0, playsinline = 1, autohide = 1, showinfo = 0, modestbranding = 1 with that, still have play button on top of video. i've seen iphone application called "itube" , have custom controls on youtube without play button on top of video. in addition, looks , feels of video on there doesn't suits me youtube embed api. feels different. does know how did make that? well after more research i've found used mpmovieplayerviewcontroller custom controls. it uses progressive download think they're using low quality on cellular networks not violate apple's terms. if thinks dif...

How to set range for int in sql server -

hey i'm new in sql server wondering if can set range int (when creating table) set range char testing char(5) not null when tried use same way set range in int testing int(5) not null it error, how set range int. if can't can tell me why? there no int(5) data type in sql server , can make use check constraints put limit/range of values can inserted in column. google check constraint , this..... create table mytable ( testing int check (testing > 100 , testing <500), othercol int )

windows - Read log file and get lines in columns instead of rows -

have log file , want read lines single line columns excel. stacked in rows. want stack 3 lines 1 line in reverse 3>2>1 for /f "delims=~" %%a in (svn.log) echo %%a set col3 = %%a echo col3 col2 col1 is there easy way this? input log: >>>> line#1 >r132852 | userid | 2014-05-14 11:57:38 -0700 (wed, 14 may 2014) | 3 lines line#2 >>>changed paths: m /customer/lag/inilib/asips_4600.ini m /customer/lag/inilib/asips_4600_text_search.ini line#3>> connections tab in plan authoring , wo execution. line#4>> ques id: ques-806 output log: >>> line#4>> ques id: ques-806 line#1 >>> r132852 | userid | 2014-05-14 11:57:38 -0700 (wed, 14 may 2014) | 3 lines line#2 >>>>changed paths: m /customer/lag/inilib/asips_4600.ini m /customer/lag/inilib/asips_4600_text_search.ini line#3 >>> connections tab in plan authoring , wo execution. *** the output should in 1 straight line in colum...

java - Save sensors' data in android -

trying save sensors data file don't know problem here. ui freezes after press start button, , want know how write these data xml file instead of text file. mainactivity public class mainactivity extends activity implements sensoreventlistener { edittext txtdata; button startbutton; button stopbutton; file myfile; fileoutputstream fout; outputstreamwriter myoutwriter; bufferedwriter mybufferedwriter; printwriter myprintwriter; private sensormanager sensormanager; private long currenttime; private long starttime; float[] acceleration = new float[3]; float[] rotationrate = new float[3]; float[] magneticfield = new float[3]; boolean stopflag = false; boolean startflag = false; boolean isfirstset = true; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // file name entered t...

javascript - Dynamic accordion being funny. Every other element treated like content and content not parsed. Why? -

i have following code: $(document).ready(function() { function gendiv () { var = document.getelementbyid("teacher_num").value; // returns fine var thisdiv = document.getelementbyid("effect"); // div i'm stuffing accordion (var num = 1; num <= i; num++) { // generate accordion many elements in variable var elem = document.createelement('div'); // generates fine elem.id = 'teacher' + num; // fine elem.innerhtml = '<h3> teacher ' + num + ' </h3> \n <div> \n <p> <input type="text" name="teacher_name' + num + '" id="teachername' + num + '" /> </p> \n </div>'; // first accordion element generates takes <h3> of second 1 , treats if it's content of first. !!! ...

c# - How to create auto update? -

ok have searched , cannot find im looking for. right need how exe download current folder in , when need switch out old update, overwrite or something. want when click check update button checks see if there update, if there says download yes or no , click yes downloads current folder in , overwrites old update new update. , if there isnt update says have current version. im using xml file has version , download located on website btw. this have, private void checkforupdatesbutton_click(object sender, eventargs e) { string downloadurl = ""; version newversion = null; string aboutupdate = ""; string xmlurl = ""; xmltextreader reader = null; try { reader = new xmltextreader(xmlurl); reader.movetocontent(); string elementname = ""; if ((reader.nodetype == xmlnodetype.element) && (reader.name == "appinfo")) { while (reader.read()) { ...

java - Uploading a file using extjs -

i trying upload file server through extjs. using struts , java. path need upload file constant. there no need file chooser. code have written this var file="c://folder/file.txt"; ext.ajax.request({ url: fileupload.action, params:{ filename:file } }); can me figure out wrong this?

to read a big excel file in java -

i trying read excel file through java apache poi in netbeans containing 8000 columns , 1200 rows getting following exception. have tried increase heap size in netbeans –xmx2048m doesn’t me out. exception in thread "main" java.lang.outofmemoryerror: java heap space @ org.apache.xmlbeans.impl.store.cur$curloadcontext.attr(cur.java:3039) @ org.apache.xmlbeans.impl.store.cur$curloadcontext.attr(cur.java:3060) @ org.apache.xmlbeans.impl.store.locale$saxhandler.startelement(locale.java:3250) @ org.apache.xmlbeans.impl.piccolo.xml.piccolo.reportstarttag(piccolo.java:1082) @ org.apache.xmlbeans.impl.piccolo.xml.piccololexer.parseattributesns(piccololexer.java:1802) @ org.apache.xmlbeans.impl.piccolo.xml.piccololexer.parseopentagns(piccololexer.java:1521) @ org.apache.xmlbeans.impl.piccolo.xml.piccololexer.parsetagns(piccololexer.java:1362) @ org.apache.xmlbeans.impl.piccolo.xml.piccololexer.parsexmlns(piccololexer.java:1293) @ org.apache...

object - Can Java cast anything? -

i've taken year of java course @ school , understanding of casting pretty limited. the type of casting understand casting int double. makes sense; 1 become 1.0 the type of casting don't quite understand is: casting custom object (say superrectangle ) customer object (eg, myrectangle ). (this assuming myrectangle subclass of superrectangle ) happens private or public fields associated instance of superrectangle ? how program know legit move? matters could've casted int string, , supposed mean anyway? strictly speaking, going int double isn't casting , conversion . casting reinterpreting same, unchanged bit pattern in memory belonging type. , precisely casting reference types in java boils down to: have object of definite, unchangeable type, , merely look @ if instance of 1 of supertypes. you not allowed cast integer string because latter not former's supertype. ensured @ compile time , double-checked @ runtime well.

database - Oracle DB multiple simultaneous commits are too slow -

i loading multiple batches of data (~40 mb) in parallel oracle db. noticing parallel oracle commits db slow in case. single commit faster. looks problem related oracle redo log files or log file syncs. solve problem. if have log file switch (checkpoint incomplete) events, it's means sizing redo-logs small. size of them? add more biggest size(it's easy it)?

python incorrect rounding with floating point numbers -

>>> = 0.3135 >>> print("%.3f" % a) 0.314 >>> = 0.3125 >>> print("%.3f" % a) 0.312 >>> i expecting 0.313 instead of 0.312 thought on why this, , there alternative way can use 0.313? thanks python 3 rounds according ieee 754 standard, using round-to-even approach. if want round in different way implement hand: import math def my_round(n, ndigits): part = n * 10 ** ndigits delta = part - int(part) # round "away 0" if delta >= 0.5 or -0.5 < delta <= 0: part = math.ceil(part) else: part = math.floor(part) return part / (10 ** ndigits) example usage: in [12]: my_round(0.3125, 3) out[12]: 0.313 note: in python2 rounding away zero, while in python3 rounds even. (see, example, difference in documentation round function between 2.7 , 3.3).

matlab - What makes this code faster? -

this first question in stackoverflow, ask comprehension might wrong question. also, i'm not native english speaker, i'll try clear possible. i implementing first fit (ff) heuristic 1-dimensional bin packing problem (bpp) in matlab. after first implementation of algorithm, tried improve code , ended second implementation thought better, since pretty more elegant in opinion. curiosity (let me i'm perfectionist) lead me run , compare both implementations. arrived same result (as should be), first implementation more 10 times faster! my question is: can me find why that? part of second implementation slowing down code? thank you. 1st implementation: function packing = firstfit(items) global n_items bin_size item_assign = zeros(n_items,1); residual = bin_size*ones(n_items,1); tmp = residual; % assign each item on list bin = 1:n_items j = 1; % start trying first bin % repeat until item assigned bin while true if items(i) > residual(j) ...

Database design concepts: is it necessary to have a primary key when I use two or more foreign key? -

Image
i not sure if doing things right here: 1) ok put in 1 table user information (name, last name, mail, password, city , state)? 2) ok how cities related states? 3) user able create challenge 1 subject, level, in 1 state, 1 city , 1 date. (single_challenge table). 1 or more users can register challenge (registration_sc). necessary have primary key on "single_challenge" table, when use 2 or more foreign key? design well-posed? 4) if want allow user create tournament challege, (same single_challenge table) 2 more options: "maximum inscriptions" , "end date". should create table called "tournament_challenge" or can add these 2 fields "single_challenge" table? i think design decicions half engineer-matter , half artist-matter. there things can tagged bad practice, many other depends on many factors , linked "application domain" reality. me, question falls category: 1) there 1 bad thing: should keep city id, ...

wget, epoch time & GET requests -

i need able mimic following get request using wget unsure how so. i need able set epoch of day script executed start time of 12:01 a.m. , end time of 11.59 p.m. example date of 2014/01/16 (yyyy/mm/dd) , time of 12:01 a.m. 1400241660 the request needs have following keys. key request accept referer accept-language accept-encoding user-agent host dnt connection cookie with following values appropriate epoch time appended start , end date time. value /archive.cgi?cmd=query&ca=255&start_time=1400284860&end_time=1400371140&dst=2&level=0&username=qwrtaw4=&rnd=6812 http/1.1 */* http://192.168.1.199:8080/export.html en-us gzip, deflate mozilla/5.0 (compatible; msie 10.0; windows nt 6.2; wow64; trident/6.0; maarjs) 192.168.1.199:8080 1 keep-alive mosalanguage=0; dusername=qwrtaw4%3d; dpassword=mdawmdaw; session= edit at suggestion of martin, tried following curl command 404 curl -c cookie.txt --url "http://192.168.1.199:8080/archive.cgi?...

email - Java Mail Using Own Mail Server -

i've tried various codes online , experimenting own keeps throwing exception instead of sending email. sending manually works fine though. wrong? smtp example tls: exception in thread "main" java.lang.runtimeexception: com.sun.mail.util.mailconnectexception: couldn't connect host, port: smtp.gmail.com, 587; timeout -1; ssl: exception in thread "main" java.lang.runtimeexception: com.sun.mail.util.mailconnectexception: couldn't connect host, port: smtp.gmail.com, 465; timeout -1; obviously can reach mail server using ping on cmd , i'm connected internet. alternatively, how can setup own mail server allow messaging without authentification instead of restricted public mail service? preferably free solution. this not authentication problem, can not connect port. port commonly blocked in endpoint firewalls, including windows firewall. remember these block specific applications, might java can not connect outwards. running ...

jquery - How to add context menu to datatables 1.10? -

i'm using datatables (datatables.net) , add context menu table. i found jquery contextmenu , description in datatables forum on how implemented context menu. seems @ least datatables i'm using (1.10) has evolved quite much. have not information context menu plugin. (meaning version using in forum post , have downloaded). if use described in forum post , adapt 1.10 (to humble knowledge) i'm comming this var mytable = $("#mytable ").datatable( { "drawcallback": function( settings ) { $("#mytable tbody tr").contextmenu( { menu: 'mymenu'}, function( action, el, pos ) { var adata = mytable.getdata( el.context ); } ); } } ); but executing code give me error: uncaught error: no selector specified in jquery.contextmenu.js:1273 has implementet context menu datatable 1.10? i have see question, , answer because looking solution t...

java - How to continuously update textView with a different delay parameter -

i'm pretty new java , android, , i'm coding application, takes text action.send , display word word in textview. i have method, returns spanned text, , want continuously update in textview , implement actions, such pause or resume. i've implemented activity using this guide, when iterate on list of words this: for (int = 0; < listsize; ++i){ ((textview) layout.findviewbyid(r.id.textview).settext(sometext); thread.sleep(1000 * coefficient); } the application shows last element of array(when cycle finished). advise technique implement properly? the problem you'er blocking ui-thread sleep method. try using handler (link doc) , method postdelayed (here) .

objective c - Filtering a NSMutableArray and returning only numbers -

i have nsmutablearray called mymutablearray inside him, have following values: ('r$ 118.98','ae 12.00 er','r$ 456.99') what do, find way filter information contained within array, making returns numeric characters, example: ('118.98','12.00','456.99') i have simple code lines inside array: for(int x=0; x<[mymutablearray count]; x++){ mymutablearray[x];//we need find way filter , update informations store numbers. } what code can put in code filter information inside array storing numbers? try: //create new mutable array store modified values nsmutablearray *arrfinal = [[nsmutablearray alloc] init]; //fast-enumerate within mymutablearray (nsstring *strcurrent in mymutablearray) { nsstring *strmodified = [strcurrent stringbytrimmingcharactersinset:[[nscharacterset decimaldigitcharacterset] invertedset]]; [arrfinal addobject:strmodified]; } nslog(@"%@",[arrfinal description]);

inheritance - Unhandled exception - c++ program stops on cast -

i have several structs: struct token { //some content } follows bunch of structs inherit token: struct : public token{ //stuff } . . . struct z : public token{ //other stuff } i have vector std::vector filled subclasses through z , program crashes when try cast element in the vector subclass. i'm casting doing following: a subclass = *((a * ) &vector[0]); what doing wrong? you should use dynamic_cast when casting pointers 1 type in use case. 1 using c style cast , suggest go dynamic_cast . code should like: if(dynamic_cast<a *>(vector[0])) subclass = *(dynamic_cast<a *>(vector[0])); when dynamic_cast fails return null pointer , should take care of appropriately. refer dynamic_cast , static_cast in c++ more information. additionally when should static_cast, dynamic_cast, const_cast , reinterpret_cast used? understand lot more types of casts.

sql - Is there any way to mail the Output of a SELECT query to a pre-defined list of email ids in Oracle? -

everyday @ job, need fetch results of these queries , send them 1 one these recipients.this time consuming. what want do,is automate process. i want in coding script automatically mail results of these queries recipients, @ particular time of day. possible? if yes, how? any kind of appreciated. you can follow following steps configure sending email (results of query) in oracle database: create owner_schema.sp_send_email stored procedures . please refer following links pl/sql scripts sending email. need configure sender, recipients, email server host , email server listening port. make sure have added oracle server on acl list of email server, verify using user@source_oracle_database server $ telnet email_server port . http://www.dba-oracle.com/t_utl_smtp_utility.htm http://www.ryanboyer.net/e-mail-query-results-from-orac/ how sent email in oracle pl/sql package multiple receivers? create oracle scheduler if need send email regularly(hourly, daily, weekly, ...

javascript - jQuery not working well on firefox and not working at all in Safari -

i using jquery.unique() rid of double values inside javascript array. in chrome works nice , length of array goes 60 29, in firefox strange goes 60 43 , in safari doesn't work @ all, hint? here imports use: <title>aps</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <link href="../css/jquery-ui-1.10.4.css" rel="stylesheet"> <link rel="stylesheet" href="../css/reset.css"> <link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet"> <link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css"> <script src="../js/jquery-1.10.2.js"></script> <script src="../js/jquery-ui-1.10.4.js"></script> <script src = "../js/search.js...

jquery - Access to Json array with for function -

how can loop throught array below structure function for? my array is: { "cod": "200", "message": 0.0027, "city": { "id": 2264456, "name": "portimao", "coord": { "lon": -8.53775, "lat": 37.138561 }, "country": "pt", "population": 0 }, "cnt": 1, "list": [{ "dt": 1400328000, "temp": { "day": 24.54, "min": 15.3, "max": 24.69, "night": 15.3, "eve": 23.33, "morn": 23.33 }, ...

R variable in JavaScript -

i displaying map via leaflet r using package rcharts : added polygons map , want information clicking on them. far managed popup window display features name. display values r variables, dont know how pass them over/include them javascript statement (see code.) map <- leaflet$new() map$geojson((polygons), oneachfeature = "#! function(feature, layer){ layer.bindpopup('<b>name:</b>' + feature.properties.name + '<br> <b>precipitation:</b> insert r variable here') } !#") map i don't see why can't paste in value character string. example map <- leaflet$new() map$geojson((polygons), oneachfeature = paste("#! function(feature, layer){", "layer.bindpopup('<b>name:</b>' + feature.properties.name + '<br> ", "<b>precipitation:</b>", varibalename, "')} !#", sep="") ) map

c++ - SDL_RenderDrawPoint vs setPixel function -

is either better choice? have things set setpixel function @ moment, , want know if should change renderdraw functions. here's setpixel function reference. void setpixel(sdl_surface* surface, int x, int y, uint32 color){ uint8* pixel = (uint8*)surface->pixels; pixel += (y * surface->pitch) + (x * sizeof(uint32)); *((uint32*)pixel) = color; }

Sharepoint 2010 SPLongOperation progress message does not display in Windows 7, IE 8 -

we testing sharepoint 2010 web application on windows 7 vpcs running ie8. application uses splongoperation in modal dialog boxes. code works fine in ie8 on win xp service pack 3, , in ie8 directly on windows server 2008 r2 web servers in farm. however, dialog boxes not display splongoperation progress info in ie8 on windows 7. have run script debugging ie 8 developer tools on windows 7 , there no errors cause code break debugger. there no errors in event viewers on either client or server machines, , there's nothing in iis logs. is else running issue?

c# - How to use String.Format specifier in an expression? -

double paintneeded = area/450; when run above, output 0.444444444 , wanted 0.44 . i tried this, throws error: double paintneeded = string.format("{0:0.00}", (area/450)); console.writeline("number of gallons paint needed:\t{0}", paintneeded); how use string.format in expression? or can use in console.writeline ? if so, how implement it? console.writeline("number of gallons paint needed:\t{0:f2}", area/450.0);

unity3d - one project cannot be removed in monoDevelop-Unity -

Image
here's question removing 1 project in monodevelop-unity. i found 1 project opened project opened. following picture detail: the "1"project opened anytime, whatever open other project. , cannot closed, error messages followed: system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.invalidoperationexception: top level items can closed. (etc....) /buildagent/work/9ffd76bfa3f1a926/monodevelop/main/src/core/monodevelop.ide /monodevelop.components.commands/commandmanager.cs:1062 anyone little bit? thanks!

c++ - Unresolved template argument -

i testing template codes today and, find out interesting not find reason explain why happen. request consider , enlighten me knowledge. time. this code block working without problem. template<class titem> class printablequeue : public queue<titem> { public: friend ostream& operator<<(ostream& os, const printablequeue<titem>& queue) { copy(queue.c.begin(), queue.c.end(), ostream_iterator<titem>(os, " ")); return os; } }; int main(int argc, const char* argv[]) printablequeue<int> queue; queue.push(1); queue.push(2); cout << queue; } however, when put definition of friend function outside of class, not work. template<class titem> class printablequeue : public queue<titem> { public: friend ostream& operator<<(ostream& os, const printablequeue<titem>& queue); }; ostream& operator<<(ostream& os, ...

android - Two onCreateDialogs -

im trying use both datepicker , timepicker.i newbie in android. problem 2 oncreatedialogs. eclipce ask me rename second one. when that, timepicker doesnt show up. problem? in advance // datepicker static final int date_dialog_id=0; int yr,mon,day; @suppresswarnings("deprecation") public void showdatepickerdialog(view v) { calendar today=calendar.getinstance(); yr=today.get(calendar.year); mon=today.get(calendar.month); day=today.get(calendar.day_of_month); showdialog(date_dialog_id); } protected dialog oncreatedialog(int id) { switch (id) { case date_dialog_id: return new datepickerdialog(this,datesetlistener,yr,mon,day); } return null; } private datepickerdialog.ondatesetlistener datesetlistener=new datepickerdialog.ondatesetlistener() { @override public void ondateset(datepicker view, int year, int monthofyear, ...

android - Dojo mobile : Selectbox not functioning properly -

just trying make demo android app using dojo mobile , phone gap. moment add selectbox, whole ui goes haywire. buttons stop functioning , don't appear buttons anymore. same happening in case of text box. my setup phonegap 1.2.0 dojo mobile , dojo 1.9.3 please refer code snippet below. <script type="text/javascript"> dojo.require("dojox.mobile.parser"); dojo.require("dojox.mobile"); </script> </head> <body> <div dojotype="dojox.mobile.view" id="testapp" selected="true"> <h1 dojotype="dojox.mobile.heading">test</h1> <div class="text">select semester</div> <select multiple="true" name="multiselect" data-dojo-type="dojox.form.checkedmultiselect"> <option value="s1">opt 1</option> <option value="s2">opt 2</option> </select> <div data-...

Android get json elements -

i implementing moethod json cel l content through google spreadsheet the below part of content [{"scheme":"http://schemas.google.com/spreadsheets/2006","term":"http://schemas.google.com/spreadsheets/2006#list"}],"title":{"type":"text","$t":"traditional"}, "content":{"type":"text","$t":"ridicule: http://hkgalden.com/face/hkg/369.gif, adore: http://hkgalden.com/face/hkg/adore.gif, agree: http://hkgalden .com/face/hkg/agree.gif, angel: http://hkgalden.com/face/hkg/a ngel.gif, angry: http://hkgalden.com/face/hkg/angry .gif, ass: http://hkgalden.com/face/hkg/ass.gif, banghead: http://hkgalden.com/face/hkg/ banghead.gif, biggrin: http://hkgalden.com/face/hkg/biggrin.gif when comes using following methods extract link follows from biggrin: http://hkgalden.com/face/hkg/biggrin.gif to http://hkgalden.com/face/hkg/biggrin.gif using ...

python - node webkit - gclient sync on Windows 7 missing base_window.h -

so i've been trying compile node webkit on windows while , i've gotten stuck on error no amount of googling can me resolve. i run gclient sync on windows cmd , errors with ________ running 'c:\depot_tools\depot_tools\python276_bin\python.exe src/build/ gyp_chromium' in 'c:\www\node-webkit' updating projects gyp files... warning: missing input files: c:\www\node-webkit\src\content\..\chrome\browser\ui\base_window.h c:\www\node-webkit\src\content\nw\src\breakpad_linux_impl.h hook ''c:\depot_tools\depot_tools\python276_bin\python.exe' src/build/gyp_chromi um' took 69.74 secs i've checked permissions of files , given user rights files , i've tried running cmd administrator, makes no difference. i can't work out @ , can't find on google. here full output gclient sync brevity, can assist in why worked fine on osx , can't success winblows? microsoft windows [version 6.1.7601] copyright (c) 2009 microsoft corporation...

c++ - Overloading prefix and postfix increment in class timer. Problems while debugging -

i need overload increment class timer. members of class minutes , seconds. #include <iostream> #include <conio.h> using namespace std; class timer { private: int minutes; int seconds; public: time(){ minutes = 0; seconds = 0; } time(int m, int s){ minutes = m; seconds = s; } void displaytime() { cout << "m: " << hours << " s:" << minutes <<endl; } time operator++ () { ++seconds; if(seconds >= 60) { ++minutes; seconds -= 60; } return time(minutes, seconds); } time operator++( int ) { time t(minutes, seconds); ++seconds; if(seconds >= 60) { ++minutes; seconds -= 60; } return t; } }; int main() { time t1(18, 23), t2(19,12); ++t1; t1.displaytime(); ++t1;...

javascript - Getting "Uncaught TypeError: Cannot read property 'lat' of undefined" with mapbox and leaflet -

i'm new mapbox , leaflet, , apologize in advance if bit basic. i'm trying load map markers. however, i'm getting error , i'm not sure how debug it. self.map.addlayer(connector) throwing error. know i'm doing wrong? thanks. buildmap: function() { console.log('buildmap() function...'); var lat, lng, self = this; navigator.geolocation.getcurrentposition(function(data) { var lat, lng, latlng; lat = data['coords']['latitude']; lng = data['coords']['longitude']; debugger; self.map.remove(); self.map = new l.mapbox.map('map', 'bmy78.map-z27ovm6p') .setview(new l.latlng(lat, lng), 15); console.log('lat', lat); console.log('lng', lng); // use mapbox mapboxurl = "http://a.tiles.mapbox.com/v3/bmy78.map-z27ovm6p.jsonp"; wax.tilejson(mapboxurl, function(tilejson) { connector = new wax.leaf.connector(tile...

android - Only one instance of entire app multiple activities -

i have android app 3 activities. want have 1 instance encompasses 3 activities. so activities a, b, , c, want user able looking @ 1 of @ time. not want multiple instances of of these activities. have tried android:launchmode="singletask" sort of works in way, when user returns app, launches activity again first instead of going activity b, user pressed home button. would best me moved fragments hosted these activities 1 activity , away activities b , c? activity hosts 1 fragment, login/signup page. using singletask launch mode need still add intent flags when starting other activities? so activities a, b, , c, want user able looking @ 1 of @ time. you can have 1 activity on focus @ time. activity might visible behind activity (i.e. top activity might themed dialog ), 1 activity has focus; hence user can interact 1 activity @ time. it launches activity again first instead of going activity b android launch first activity labeled a...

ios - custom style for just the first row of the table view -

i trying set different style first row of table view. i'm doing following code: def tableview(table_view, cellforrowatindexpath: index_path) data_row = @data[index_path.row] puts index_path.row if index_path.row == 0 cell = table_view.dequeuereusablecellwithidentifier(item_cell_id) || begin rmq.create(itemcell, :first_cell, reuse_identifier: item_cell_id).get end else cell = table_view.dequeuereusablecellwithidentifier(item_cell_id) || begin rmq.create(itemcell, :rest_cell, reuse_identifier: item_cell_id).get end end cell.update(data_row) cell end question however weird behavior this. first row have custom styling....but 10th , 20th row!! don't know why happen. rows 2 - 9 , 11-19 different row 0 , 10 , 20. you need use different item_cell_id (reuseidentifiers) each cell type. :first_cell styled cell should have different reuseidentifier constant :rest_cell styled cells. should fix issue since you're seeing ...

installation - Which Libraries are included in PHP? -

are there libraries in every present php installation? an example: i'm using curl in php script, run on every php installation? libraries curl aren't in default php installation. though hosts carry default set of extensions have been used, include curl. php has page on it's built-in functions explain further: http://nl3.php.net/manual/en/functions.internal.php there's page function references find used libraries can installed using pear: http://nl3.php.net/manual/en/funcref.php

css - Sass command stopped working -

i having problem sass today, sass related command type in command line not work, outputs 'sass not recognized....', sass -v. worked fine couple of days ago. went ruby folder , there found "start command prompt ruby" , checking sass there works not on normal command line. installed python recently, maybe there conflict that, not aware. if can shed knowledge or have idea how fix issue, appreciate it. thanks! if ruby not working should check out $path environment variable. try resolve problems sass later, either bundle show sass if use bundler or with gem list sass otherwise. however, both of these rely on working ruby in $path .

php - Why does this version mysqli result work? -

the following code describes substitute mysql function mysql_result. since there none in mysqli, found code same exact thing, except user-created function. reason using function because need data different tables. <?php function mysqli_result($res, $row, $field=0) { $res->data_seek($row); $datarow = $res->fetch_array(); return $datarow[$field]; } ?> the arguments same mysql_result.br> after reading php functions, having problem understanding: what difference between $field=0 , $field i think found similar on object oriented statements, $res->data_seek($row); set $res equal data seek of $row ? $row row one, $res select row 1 of tables selected? read default function parameters in manual . if caller not supply value third parameter ( $field ), set 0 default. read oop basis in manual . $res->data_seek($row); calls method called data_seek on res object 1 parameter, object row . depends on data_seek() whether supplied obje...

java - Why do JButtons that open webpages only work the first time one is clicked and then get deactivated? -

i have set of jbuttons, each of opens separate youtube video webpage. when first running program, can click on 1 button , video page. when try video page button click, doesn't work - in fact, buttons deactivated. case whether or not close video webpage. how can keep buttons activated? in advance. here's code reference. button links , tags populated text file. //import statements public class videorecord extends jframe { private file videorecordfile; public videorecord() throws filenotfoundexception { setvisible(true); setdefaultcloseoperation(exit_on_close); setlayout(new gridlayout(2,2)); setsize(new dimension(500, 500)); videorecordfile = new file("videorecord.txt"); getbuttons(); pack(); } public void getbuttons() throws filenotfoundexception { scanner input = new scanner(videorecordfile); while (input.hasnextline()) { scanner lineinput = new scanner(input.nextline()); while (lineinput.hasnext(...