Posts

Showing posts from April, 2010

Django admin interface to display aggregates -

i want use django admin interface display aggregates of data in model. ex: model has following fields [employee name, salary, month] want aggregate table fields [month, total_salary_paid, cumulative_of_month_salaries_paid]. how do ?? have searched internet didn't find way it..any reference or guidance help here's snippet recent project of mine. adds column in admin "are there entries in m2m related table?" , "what's count of entries in m2m related table?". similar things other aggregate functions django offers. from django.db.models import count django.contrib import admin class expertmodeladmin(admin.modeladmin): def num_companies(self, obj): """# of companies expert has.""" return obj.num_companies num_companies.short_description = "# companies" def has_video(self, obj): """does expert have video?""" return bool(obj.has_v

c++ - Setting class member to null in destructor -

in this page there's piece of code: class mystring { private: char *m_pchstring; int m_nlength; public: mystring(const char *pchstring="") { // find length of string // plus 1 character terminator m_nlength = strlen(pchstring) + 1; // allocate buffer equal length m_pchstring = new char[m_nlength]; // copy parameter our internal buffer strncpy(m_pchstring, pchstring, m_nlength); // make sure string terminated m_pchstring[m_nlength-1] = '\0'; } ~mystring() // destructor { // need deallocate our buffer delete[] m_pchstring; // set m_pchstring null in case m_pchstring = 0; } char* getstring() { return m_pchstring; } int getlength() { return m_nlength; } }; in destructor, writer sets m_pchstring null , says in case. can happen if don't set null? have deallocated specified memory , class members killed u

Issue creation and commenting via email in Redmine -

i'm redmine user , administrator. want configure redmine allow issue creation , commenting via email. need configure in such way reads emails standard input. (not imap, pop3, or email server) can please suggest suitable way , required code segment this? redmine have rake tasks query pop3 , imap mail accounts. see redmine wiki

c# - How to set focus on a textbox when I close another Form? -

i have 2 forms, form1 , form2. form2 opened button located in form1. want when close form2 x(cross) button in upper right corner of window, focus set textbox1 of form1. regarding ?? try private void button1_click(object sender, eventargs e) { form2 f = new form2(); f.show(); f.formclosed += f_formclosed; } void f_formclosed(object sender, formclosedeventargs e) { textbox1.focus(); }

php - How to fetch specific elements from an array and create a new array based on the comparison of an array key's value? -

my question may sound confusing people. in fact it's quite simple one. let me clear scenario. i've array titled $test_result_data follows: array ( [0] => array ( [test_pack_id] => 8ed32f6479a0169db3531d3366996d35 [test_pack_name] => cpt free samples [test_pack_desc] => package contains free sample test of 30 minutes containing 30 questions - fundamentals of accounting, mercantile law, general economics , quantitative aptitude. perfect discover beauty of online exam preparation. [test_pack_type_id] => 7 [test_pack_image] => [test_pack_validity_year] => 0 [test_pack_validity_month] => 0 [test_pack_validity_days] => 3 [test_pack_plan] => free [test_pack_price] => 0.00 [test_pack_no_tests] => 0 [test_pack_publish] => yes [test_pack_code] => [test_pack_sol

iphone - Usage of captive network -

sorry english. want app use captive network. idea when user try connect captive portal network app open instead od relative web sheet. know have use function cnsetsupportedssids(), don't understand how implement it. in advance! this code have wrote. - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { nsarray *array = [nsarray arraywithobjects:@"ssid of network",nil]; bool ok = cnsetsupportedssids((__bridge cfarrayref) array); if(ok) { nslog(@"completed %lu",(unsigned long)[array count]); } else { nslog(@"failed"); } // override point customization after application launch. return yes; }

.htaccess - How to force htaccess to index.php if no file or parameters specified -

i want if user enters site url without specifying file or parameters site.com or site.com/ , should redirected site.com/index.php if enter file site.com/somefile.php or give parameters site.com/?param=val , htaccess should not , let run. in .htaccess, add line: directoryindex index.php this way apache index.php requests yoursite.com & yoursite.com/. there no need add rewrite condition rule! plus, servers don't allow rewrite conditions. in wamp, rewrite disabled default.

Sharrre social jquery plugin | Google+ -

i use sharrre on site. google+ share not works days. it's not showing. <div class="googleplus" data-url="<?=$gallery->link?>" data-text="<?=(strlen($gallery->name)?$gallery->name:'')?>" data-title=" "></div> $('.googleplus').sharrre({ share: { googleplus: true }, enablehover: false, enabletracking: true, title: $(this).attr('data-href'), url: $(this).attr('data-url'), urlcurl: '<?=base_url('js/sharrre/sharrre.php')?>', click: function(api, options){ api.simulateclick(); api.openpopup('googleplus'); } }); please give me tips! thanks! the google+ "sharrre" here needs file sharrre.php, configured in settings in base_url("js/sharrre/sharrre.php"). is file available under given url? dont know function base_url() , , not. seems, url, applied sharrre-con

Linux command for finding a particular word and finding its number of occurrences for a particular date -

i have log files roll out every day. i need find out, error occurrences particular day ( 20/3/2014 ) i need find out no of occurrences of word error particular day or set of days in log files , print errors in separate file. and mail should sent details of errors. egrep can lookup such occurrences , store them in file. expression below ocurrence of token error , print line token found. egrep -i "\s*error\s*" your_file > stored_errors_file you can redirect output of egrep file , count number of ocurrences with wc -l stored_errors_file i hope helps

ios - Replacing some characters in a NSString -

i have xml file encoded in windows-1252 , haven't found method proper utf-8 encoding file far. it's file containing lot of accented characters need display. what want do, replace encoding windows-1252 character myself. know how : nsstring * eat = @"j'ai mangu00c8 une pomme"; to nsstring neweat = @"j'ai mangé une pomme"; i found many ways replace character not in word, need here replace characters (so here u00c8 ) can anywhere in given string. decoding not giving proper result try nsstring * eat = @"j'ai mangu00c8 une pomme"; eat = [eat stringbyreplacingoccurrencesofstring:@"u00c8" withstring:@"é"];

graphics - Libgdx: how to draw a rounded border around a TiledMap with dynamic dimensions? -

Image
in libgdx have tiledmap fill different cells: cell.settile(new statictiledmaptile(reg1)); cell.settile(new statictiledmaptile(reg2)); cell.settile(new statictiledmaptile(reg...)); where reg texture region. i render with: render = new orthogonaltiledmaprenderer(map); render.setview(cam); render.render(); throughout game, number of columns, number of rows , size of cells vary, must remain dynamic. now, around tiledmap, want add rounded border. below showing examples in png of how planning : left right, first top border, top-right corner, right border. each of these png files has square dimensions. what want achieve below, here zoom top right corner of tiledmap: i planning use these pngs textureregions can set cells in tiledmap, that: (int x = 0; x < numcol+2; x++) { (int y = 0; y < numrow+2; y++) { cell cell = new cell(); if (y==numrow+1) { cell.settile(new statictiledm

How to save data from serial port to an array in Matlab gui? -

i want read serail port every 0.1s , append incoming data array, can show data time array seems store newest data. can tell me why? thanks. here code: function wtsmat_openingfcn(hobject, eventdata, handles, varargin) ..... %%tact array store data tact=ones(1,84); handles.tact=tact; % update handles structure guidata(hobject, handles); here setting of scom scom=serial(com_cur,'baudrate',baud_curnum,'parity','none','databits',8,'stopbits',1,... 'inputbuffersize',1000,... 'timeout',1,... 'timerperiod',0.1,... 'timerfcn',{@mycallback,handles}); fopen(scom); handles.scom=scom; guidata(hobject,handles); here mycallback function function mycallback(scom,bytsavailable,handles) %start single frame acquisition showdata=ones(84,1); showwin=ones(14,6); %%get previous data handles tact=handles.tact; fwrite(scom,uint8(hex2dec(['aa';'aa';'aa';'20';'01';'00&

winforms - How to handle "window.Close" JS in a WebBrowser in c# -

i have code program library, have embed web browser website web browser can’t close. have cancel closing when user clicks on button in js closing window (window.close) program crash. add : htmldocument htmldocument = this.webbibliotheque.document; htmldocument.window.unload += new htmlelementeventhandler(window_unload); when document charged. code works , gets catch evenment don’t know have in function : void window_unload(object sender, htmlelementeventargs e) { } can me please? you should handle windowclosing event on underlying webbrowser activex control ( webbrowser.activexinstance ). there option cancel (disclaimer: untested). check this answer more details on how handle "raw" webbrowser events this.

javascript - Making azuremobileclient globally accessible in Ember.js -

i using ember-app-kit build spa , using azure mobile services on backend of hold data. forced declaring: var client = new windowsazure.mobileserviceclient( "xxxxxx", "xxxxxx" ); i have been doing declaration in of models , controllers. how can make globally relevant application?

html5 video tag subtitles srt won't work -

i'd use captions mp4 video downloaded youtube. used googlesrt2 create .srt file youtube link. html using: <video controls="controls" height="480" width="640"> <source type="video/mp4" src="video1.mp4" /> <track kind="captions" src="output1.srt" srclang="en"> </video> ironically, works in browsers sans actual captions, except ie doesn't work @ (i thought ie native mp4!). i'm rather frustrated , not sure how fix this. appreciated.

regex - .htaccess Remove .php keep regular indexing -

i'm using: rewriterule ^([^\.]+)$ $1.php [nc,l] rewritecond %{the_request} ^[a-z]{3,}\s([^.]+)\.php [nc] rewriterule ^ %1 [r,l,nc] this makes don't have use ".php" @ end of pages. however, if don't specify index gives 404. example: example.com/content.php directed example.com/content ^ works well. however, if want go directory example.com/users gives 404 error. example.com/users/index works. i want able remove .php way doing already, still want directories work without specifying page(automatically display index.php). i'm not fluent in regex or htaccess coding have been unable tweek myself. any appreciated. thank you! replace code these 2 rules: rewritecond %{the_request} \s/+(?:index)?(.*?)\.php[\s?] [nc] rewriterule ^ /%1 [r=301,l,ne] rewritecond %{request_filename} !-d rewritecond %{document_root}/$1.php -f [nc] rewriterule ^(.+?)/?$ /$1.php [l]

html - css expression :not with two condition -

this question has answer here: can :not() pseudo-class have multiple arguments? 4 answers i have weird situation cannot make work :not has 2 condition. want hide div in container except having specific class. for example html <div id="container"> <div class="show"></div> <div class="extra"></div> <div class="about"></div> <div class="sample1"></div> . . . <div class="sampleetc"></div> </div> now css expression , not working #container > div:not(.show), #container > div:not(.about){ display:none; } any ideas why not working or css expression this, presume, :not not work 2 condition, or guessing first expression hide .about i believe can chain :not selector this: div#container > di

javascript - jQuery order of execution, document.ready -

when calling selector within document ready function, first call returns element el.length == 1 second call returns empty set el.length == 0 . can clarify going on here? http://jsfiddle.net/47gnx/ it seems map dom element being emptied in _.init function have created...

route provider - Angularjs same template and controller on different urls -

i have application can run 2 contexts -- 1) global , 2) client when in global context urls mydomain.com/#login, mydomain.com/#register when in client context urls mydomain.com/#/clientkey/login , mydomain.com/#/clientkey/register. in both contexts want open same template i.e login.html , register.html. 1 way achieve replicate routeprovider.when both cases following $routeprovider.when('/:clientkey/_login', { templateurl: 'views/login.html', controller: 'loginctrl', }) $routeprovider.when('/_login', { templateurl: 'views/login.html', controller: 'loginctrl', }) my question is there way in single routeprovider.when, instead of replicating twice small difference. important application because there several such links login, register, editprofile, changepassword etc. like this? var routes = { '/_login' : { templateu

java - What is the logic of creating the Mysql SELECT Statement for drop down in Struts + JSP? -

can please me rectify code below, i'm trying create populated drop down list in struts 2 in eclipse ide. first time use 'struts' 'ide eclipse'. specific select statement not know how write code that, when user selects 'make' of car, database extracts different 'models' of make. other select items 'color', should optional in user can proceed search 'make' minus choosing option them. please i'm new in actionclass , database. thanx in advance. package drive; import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; import java.sql.resultset; import com.opensymphony.xwork2.actionsupport; public class carsearch extends actionsupport { private string model; private string modification; private string engine; private string color; private string bodytype; private string minprice; private string maxprice; private string mileage; private int minyear; private int maxyear; private string

java - Making an exception class and leaving it empty -

now i've created exception class haven't created constructor shown public class invalidchoiceexception extends exception { } but catch block handles want display. try { if(readfile.hasnextint() == false) throw new inputmismatchexception(); else { num = readfile.nextint(); readfile.nextline(); } } catch (inputmismatchexception e) { system.err.println("integer expected"); e.printstacktrace(); system.exit(0); } is ok do? edit: let's pretend input mismatch empty exception class though it's not.. creating empty subclass of exception allowed. catch not able tag instance error message or cause (these standard piece of information associated exception). however if use case doesn't require specify messages or causes of exceptions such design.

php - UTF-8 encoded content not displaying correctly, � symbol -

i pulling information table in phpmyadmin. created in wordpress , encoded in utf-8 (i have checked config file). when echo content displayed characters � characters include double spaces, apostrophes, line breaks , ™ i have used function forceutf() here https://github.com/neitanod/forceutf8 (including updated fix). replaced � ? is there method can use? update i have checked database tables, symbols appear correctly in table. this appears in phpmyadmin mainpage server: localhost via unix socket server version: 5.5.36-log protocol version: 10 user: ******** mysql charset: utf-8 unicode (utf8) i have set <meta charset="utf-8"> in php file. have got utf-8 check in script, returns : current character set: utf8 if (!$con->set_charset("utf8")) { printf("error loading character set utf8: %s\n", $con->error); } else { printf("current character set: %s\n", $con->character_set_na

Arquillian with Wildfly 8.0.0.Final Managed not working -

i have been using arquillian jboss-as-7.1.1.final while now. i want start using wildfly 8.0.0.final cannot work. i have changed pom.xml , arquillian.xml. this "properties": <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <version.joda.time>2.1</version.joda.time> <version.junit>4.11</version.junit> <version.mockito>1.9.5</version.mockito> <version.jacoco>0.6.0.201210061924</version.jacoco> <version.arquillian.bom>1.1.3.final</version.arquillian.bom> <version.arquillian.drone.bom>1.3.0.final</version.arquillian.drone.bom> <version.arquillian.jacoco>1.0.0.alpha6</version.arquillian.jacoco> <version.arquillian.persistence>1.0.0.alpha6</version.arquillian.persistence> <version.commons.collections>3.2.1</version.commons.collections> <version.commons.io>2.4</vers

java - Mapping Objects From Resultsets and efficiency -

i working on program outputs names , various other details(name, address, id, etc) user object. user object populated through using jdbc db. have learned how map resultset object user object , how display various info(name etc) object screen. my query need access many objects(sometimes all: searching, updating) , think may silly make connection db, receive resultset , map object every time need information. instead thought rows database , map objects , put them in arraylist pick out particular information wanted more easily. is inefficient or bad coding practice? there gaping flaw in logic? caching rows in application has many strong disadvantages: it doesn't scale: if have 1 million users? if every user has 5 orders, referencing 7 products, etc. etc. you'll end full database in memory, , that's not sustainable. it's harder correctly: you'll have deal several requests reading , modifying users concurrently. database transactions you. it forces

mysql - Corrupt Wampserver - how to recover? -

Image
my laptop crashed morning after wampmanager.ini corrupted. found out how resolve pasting in replacement , ensuring line pointed correct directories: action: run; filename: “c:/wamp/bin/php/php5.4.3/php-win.exe”;parameters: “refresh.php”;workingdir: “c:/wamp/scripts”; flags: waituntilterminated however, still error "exception eception in module wampmanager.exe @ 000f15a0. not execute run action: directory name invalid. i have check: “c:/wamp/bin/php/php5.4.3/php-win.exe” , “c:/wamp/scripts”. pasted them address line @ top of page make sure , found. what options please? can run repair? quicker reinstall? if reinstall directories need copy in order save database? i not know if can specific please appreciated (e.g., full file paths possible). thanks, glyn i have found this: http://forum.wampserver.com/read.php?2,71125,printview,page=1 https://superuser.com/questions/373255/wamp-not-working-on-windows-7-64bit now need work out whether using wampserver 32 bit

c# - Sum and grouping multiple columns into one value in linq -

i have table fields: id,sales1, sales2, sales3 1 25 15 15 1 10 7 3 2 8 11 9 3 10 5 7 3 22 9 4 i need filter table id , return sum of sales1 + sales2 + sales3. in mysql done select (sum(sales1) + sum(sales2) + sum(sales3)) total id = 1 group id but can't work in linq. can me this? scratched in linqpad: void main() { //since don't have suitable database @ hand //i'm emulating list var sales = new list<sale>() { new sale() {id = 1, sales1 = 25, sales2= 15, sales3= 15}, new sale() {id = 1, sales1 = 10, sales2= 7, sales3= 3}, new sale() {id = 2, sales1 = 8, sales2= 11, sales3= 9}, new sale() {id = 3, sales1 = 10, sales2= 5, sales3= 7}, new sale() {id = 3, sales1 = 22, sales2= 9, sales3= 4}, }; var filteredsales = sales.groupby (s => s.id)//need group able use .sum() //.where (s => s.

c# - How to use variables from another class -

alright, here go. kinda new programming , c#, i'm learning john sharp's visual c#: step step book. (i wonder if dude's last name sharp) anyway, i'm trying create application me transpose note. it's windows forms app , i'm using 2 classes: form1.cs code happens , vars.cs variables stored. my problem want use string vars.notechosen , define comboboxnote 's selected item (e.g. c). whenever this, however, when execute vars.notechosen = combonote.selectedtext; "object reference not set instance of object." error. ideas? (combonote combobox) this vars.cs namespace transposer { class vars { public static bool rbtransposeup = true; public static string notechosen = ""; // public static string totranspose = ""; // public static int note = 0; public static string boxresulttext = note.tostring(); } } and part of form1.cs namespace transposer { public partial clas

javascript - Page load flickers on PhoneGap iOS app -

my phonegap application uses slide in , slide out animations using entirely css animations. you can find project based app on here . as can see demo slide transition quite smooth, add images, after new page loaded flickers/blinks fraction of second. interesting thing ui elements shown on screen , flickers occurs. more, page scrolling becomes buggy , doesn't let me scroll bottom of page images are. i cached images using css improve image load again no luck. found on different blogs similar issue on jq mobile , tried adding without luck: webkit-backface-visibility: hidden; you don't know how appreciate spent whole saturday trying figure out. after hours of fiddling realized issue because of scrolling mechanism , fixed header poorly supported -webkit browser. using iscroll 5 , issue disappeared.

arrays - Reading in a list of numbers from a file C -

i trying read in list of numbers file array using scanf. print out array. the list composed of on thousand numbers example looks this. 70.3 71.5 70.1 71.1 71.8 71.6 72.0 72.0 71.8 i have but, prints out list of incomprehensible numbers. int main () { file *temp; temp = fopen("temp.txt", "r"); int readings[2881]; int temps; if (!temp) { printf("cannot open file!\n"); return 0; } (temps = 0; temps < 2881; temps++) { fscanf (temp, "%d", &readings[temps]); } (temps = 0; temps < 2881; temps++) { printf("the readings %d\n", readings[temps]); } fclose(temp); return 0; } what doing wrong? you using %d when should using %f, , declaring readings[] double.

floating point - Simple int to float conversion in c++ -

my function called "inverzmatrika" returns int type of variable. need convert floating-point number. suggestions? float inverz; inverz = (float)(inverzmatrika(matrika)); use static_cast , don't use c style cast float inverz = static_cast<float>(inverzmatrika(matrika));

Getting facebook friends checkin using Foursquare API -

i'd query facebook friend's check-ins using foursquare. possible , how can this? thanks you can't see check-ins of unless friends them on foursquare first (regardless if you're friends them on facebook). if friends on foursquare, should able see users' check-ins via checkins/recent or users/checkins

ruby on rails - Paperclip and S3 storage seed -

i've setup rails 4 app use s3 storage on paperclip gem. upload of files working through create method, images show using = image_tag(@listing.avatar.url) ... problem have when use seed_dump , create seed.db; reset database , seed data again paths s3 images not correct anymore?! application.rb config.paperclip_defaults = { :storage => :s3, :s3_credentials => { :bucket => env['fog_directory'], :access_key_id => env['aws_access_key_id'], :secret_access_key => env['aws_secret_access_key'] } } listing.rb has_attached_file :avatar validates_attachment_content_type :avatar, :content_type => /\aimage\/.*\z/ long story short: how dump data , seed again without losing avatar url?

aop - Difference between Refactoring and Aspect Oriented Programming -

i have difficulty in understanding different between refactoring , aspect oriented programming. i understand aspect oriented programming aims increase modularity separating cross cutting concerns, includes code duplication, tangling, etc. but refactoring process of restructuring code without changing behavior , includes code duplication, etc. do understand wrong or can explain me in easy way how understand two? thank you.. aop , refactoring 2 different things. refactoring has goal improve internal qualities of code without breaking features/functionality visible user. aop @ other side programming language paradigm introducing new language constructs aspects , pointcuts modularizing cross-cutting concerns. can used refactoring code improve modularity, refactoring isn't main goal.

wxpython - Is it possible to draw on a TextCtrl? And if so, how? -

i'm trying elaborate textctrl line drawings: simple stuff want draw on text, next it, between lines, etc. , i'm approaching drawing in wx i've done before, on wxpanels: dcs: $dc->drawline( 15, 15, 120, 120); etc. so far, i'm doing this: in class derived textctrl, catch evt_paint , implement own onpaint function: sub new { $class = shift; $parent = shift; $self = $class->super::new( $parent, -1, '', wxdefaultposition, wxdefaultsize, wxte_multiline); evt_paint($self, \&onpaint ); return $self; } sub onpaint { print"onpaint: @_ \n"; # @ravenspoint: there call base's paint method # first, right? how?? $linescnt = $_[0]->getnumberoflines(); $dc = wx::paintdc->new($_[0]); $dc->drawline( 15, 15, 120, 120 ); # commented out base class' paint method follow, # erasing we've drawn # $_[1]->skip(1); }; now, t

excel vba - fill a range until a certain value is reached -

is there way in vba fill range until value reached? for example, want fill column dates starting value in cell b1 (let’s 1/1/2014) till reaches value in cell c1 (let’s 1/15/2014) stepping 1 day. is possible please? thank u. here proposition, put dates in b1 , c1 cells , run "dates" macro. sub dates() dim startdate date dim enddate date dim row double startdate = range("b1").value enddate = range("c1").value row = 0 range("a1").select until dateadd("d", 1, startdate) = enddate + 1 activecell.offset(row, 0).value = dateadd("d", 1, startdate) startdate = startdate + 1 row = row + 1 loop end sub

augmented reality - Create an application to measure an object from a photo -

i trying devise way of creating application can measure object in photo - automatically. far, have come across following systems: augmented reality trigonometry + phone sensors (gyroscope) known scale item in photo (credit card, etc.) however, have couple of questions. 1) of these methods efficient, large batches? 2) how can automate process - i.e. how camera or software detect object going measured (will same, i.e. leaf), measure according either augmented reality marker, scale in photo (credit card), or trig? any input appreciated. if want detect particular object automatically (always same object i.e. stop sign) there object detection algorithms works adequately. nice example scale invariant feature transform algorithm (sift) http://docs.opencv.org/trunk/doc/py_tutorials/py_feature2d/py_sift_intro/py_sift_intro.html but have problem of photo scale typically cannot calculated single image if want high acuraccy results. can though through stereo pairs of

css - CodeKit 2.0.2: Sass source maps not working -

i’ve been trying enable better part of last few hours… i enabled source maps in project settings in codekit. however, no css source map being generated. i’ve checked chrome settings, source maps option enabled, individual switches css , js under sources, still doesn’t work. does know how activate this? thanks. source maps aren't supported compass projects, soon. i'm waiting on actual release of compass 1.0.0 (we're still on pre-release version)

SockJS and meteor: what if load balancer do not support sticky sessions? -

Image
i'm exploring balancing options meteor. this article looks cool , says following should supported load balance meteor: mongo optailing. otherwise, may take ten seconds 1 instance of meteor updates another, because polling mongo driver used, polls-and-diffs db each ten seconds. websocket. it's clear - otherwise clients fallback http , long-polling, work, it's not cool websocket. sticky sessions 'which required sockjs'. here question comes: as understood, 'sticky sessions support' assign 1 client same server during session. essential? may happen if don't configure sticky sessions @ all? here's came myself: because meteor stores data sent client in memory, if client connects x servers, x times more memory consumed some minor (or major, if there no oplog) lag may appear same user in, say, different tabs or windows, may surprising. if sockjs reconnects , wants data persist across reconnections, gonna have bad time. i'm not sure how

Inheritance in C++; Is class data inherited as well? -

so if there function greet in parent class base , virtual. there's property named name in parent class. now class named child inherits , greet not implemented property name has changed in child class. when calling child.greet() uses child's name or parent's name ? explanation on reason of design decision appreciated. it uses value of name @ point of calling. if child sets name before call greet uses value set child. if child sets name after call greet uses default value or whatever has been set before call.

java - ant install via npm - requires node 0.8.0+ but fails to install? -

i'm attempting install apache ant via npm, install fails following message; npm http https://registry.npmjs.org/ant npm http 304 https://registry.npmjs.org/ant npm warn engine ant@0.2.0: wanted: {"node":"~0.8.0"} (current: {"node":"v0.10.2" ,"npm":"1.2.15"}) ant@0.2.0 c:\users\yousef\appdata\roaming\npm\node_modules\ant the related package docs state node 0.8+ requirement, , have v0.10.2, i'm wondering if compatibility issue authored on 2 years ago, or perhaps i'm doing wrong? https://www.npmjs.org/package/ant any appreciated :) (running windows 7 x64) this warning. ant should still have installed successfully.

Adding objects to array in C++ -

in header.h: before class: class treadmill; private: treadmill* treadmilllist; public: bool addtreadmill(treadmill *obj); in header.cpp: constructor: treadmilllist = new treadmill[listsize]; bool trainee::addtreadmill(treadmill *obj) { treadmilllist[numoftreadmills++]=obj; } result of compiling: treadmill.cpp: in member function ‘bool trainee::addtreadmill(treadmill*)’: treadmill.cpp:39:34: error: no match ‘operator=’ (operand types ‘treadmill’ , ‘treadmill*’) treadmilllist[numoftreadmills++]=obj; ^ treadmill.cpp:39:34: note: candidate is: in file included treadmill.cpp:3:0: treadmill.h:3:7: note: treadmill& treadmill::operator=(const treadmill&) class treadmill { ^ treadmill.h:3:7: note: no known conversion argument 1 ‘treadmill*’ ‘const treadmill&’ from looking @ code posted think trying store treadmill pointers, or addresses treadmill objects in array of type treadmill. if want store pointers t

powershell - API to trigger OneNote synchronization? -

i'm looking way programatically trigger onenote synchronization onedrive (e.g. vba, powershell etc). the case following: 1) i've done changes on laptop , sync notebook on tablet. 2) have open onenote , click sync button. i'd run cmd/bat/ps1 file sync notebook without opening onenote application. (like synchronize files via robocopy) is possible? if - please provide details how can it? googled possible apis, haven't found relevant :( regards, vitaliy does tablet have full version of onenote installed? if com api , synchierarchy method might help? synchierarchy method description forces onenote sync specified object source file on disk. syntax hresult synchierarchy ( [in]bstr bstrhierarchyid); parameters bstrhierarchyid—the onenote id of object synced.

java - Push notification in local web without internet -

i'm aware of gcm services push notifications, have issue. i have android app send data local web server (php) response android device data sent, normal push notification gcm, think. but need work without internet, because local web app work that. is possible? android device x send json data web server send data other android device y. how can verify exists new data in device y ? thanks. know little wierd. yes, possible. not easy develop. why: push notifications work attached account service. have implement authenticator service , whole push platform yourself. i not use gcm doing though. if working on local network, can use "polling" (request server every , updates)

hyperlink - Regular link to URL in Foundation tabs -

i using foundation 5.2.1 , want use vertical tabs navigation. <div class="small-1 column"> <div class="languagetabs"> <dl class="tabs vertical" data-tab> <dd><a href="/lang/uk">uk</a></dd> <dd><a href="/lang/ru">ru</a></dd> <dd><a href="/lang/en">en</a></dd> </dl> </div> </div> what unusual here use not links sections href="#section1" links external url. when click on tab becomes highlighted active no redirection specified url happens. is there way make links external pages work tabs in foundation, or should use different? i've found solution. strange not documented anywhere. all 1 needs remove data-tab attribute <dl> element. then links work usually.

java - How to get rid of the nullpointerexception in jframe? -

my intention create login page using jframe. have created database connection class in separate file below , when run login jframe, error saying nullpointer exception. please assist me :) dbconnection class ---------------------------------------------- package vehicle_renting; import java.sql.*; import javax.swing.joptionpane; public class dbconnection { connection con; statement stmt; resultset rs; public dbconnection() {} public void connect() { try { class.forname("com.jdbc.mysql.driver"); con=drivermanager.getconnection("jdbc:mysql://localhost:3306/vehicle_renting_1","root","qwer1234"); } catch (exception e) { e.printstacktrace(); } } } and below code placed in jframe source. package vehicle_renting; import java.sql.* ; import javax.swing.* ; public class login extends javax.swing.jframe { co