Posts

Showing posts from September, 2015

c++ - What is the difference between && and ||? -

this question has answer here: is short-circuiting logical operators mandated? , evaluation order? 7 answers i'm getting difficult understand how following programs work, kindly me in understanding. int x=2,y=0; (i) if(x++ && y++) cout<<x<<y; output: (ii) if(y++ || x++) cout<<x<<" "<<y; output: 3 1 (iii) if(x++||y++) cout<<x<<" "<<y; output: 3 0 kindly explain me how program working , also, makes difference between (ii) , (iii). you looking @ "c++ puzzle" using 2 languages tricks. the first postincrement uses value of variable first, increments variable. so x++ has value 2 in expression , x becomes 3 y++ has value 0 in expression, , y becomes 1 && , || or both operators short-circuiting. look @ && first. in order , tru...

jquery - Javascript, returning value from a callback -

i have 3 functions in javascript: function a(){ b(data); } function b(data){ element.on('click',function(){ c(data); }); } function c(data){ //process data } function c data processing, data needs passed on click event, have defined in b. so, need pass data b too, ensure c gets it. here, main program , i'd rather not define click event there. there other way pass data directly c a? is there other way pass data directly c a? you need pass call of c th data b that: function a(){ b(function(){ c(data); }); } function b(data){ element.on('click', callback); } function c(data){ //process data } it work same way code have, has decoupled b c.

Visual Studio Pending Changes not being updated -

i have older changeset had get. once code updated results did not reflect in pending changes. files indeed different on server, since checked few , showed different. there way have pending changes recheck differences in code can added pending changes automatically? here solution found same question asking, worded quite differently. how clear tfs server knowledge of local version

node.js - Unable to access newly added column in sequelize -

i have added migration add new column this: module.exports = { up: function(migration, datatypes, done) { migration.addcolumn('topics','isfeatured',{ type: datatypes.boolean, defaultvalue: false }) done() }, down: function(migration, datatypes, done) { migration.removecolumn('topics', 'isfeatured') done() } } then run migration sequelize -m its add new column default value. when retrieve api updatetopic = function (req, res) { db.topic.find(req.params.id).success(function (topic) { console.log(topic.isfeatured) // code }); }; then got console.log(topic.isfeatured) undefined but console.log(topic) show topic default false value of isfeatured. so can me find out why console.log(topic.isfeatured) undefined. thanks it seems have not added isfeatured column in model definitions, have add model definitions. module.exports = function (db, datatypes) { var topic = sequelize.defi...

c# - Get all combinatiion of Items of n number of lists -

this question has answer here: is there linq way cartesian product? 3 answers how can compute cartesian product iteratively? 4 answers i have list contains further sub lists , have objects stored in sub list. want generate possible combinations of elements. e.g. have list contains 2 list l1,l2 , have different objects stored in example l1 contains {obj1,obj2} l2 contains {obj3,obj4} then result should come in form of {obj1,obj3} {obj1,obj4} {obj2,obj3} {obj2,obj4} all lists being generated dynamically. solution should generic irrespective of count of elements in main list , sub list l1.selectmany(l1 => l2.select(l2 => tuple.create(l1, l2))).tolist();

sql - Show COUNT(*) column for value 0 in multiple rows -

i have table content content (id, contenttext, contentdate, iduser → user, contenttype) and table votequestion votequestion (iduser → user, idquestion → content, isup) i want select, instance, first 30 recent questions. select * "content" "type" = 'question' order "contentdate" limit 30 however, want concatenate columns information related question, don't need query database again each question returned. for instance, want count votes each question, , returned in same row. example: | id | contenttext | contentdate | iduser | contenttype | votes | ----------------------------------------------------------------- | 2 | 'abc' | '2013-03-25'| 192 | 'question' | 10 | i tried following query: with question (select * "content" "type" = 'question' order "contentdate" limit 30 ) select count("votequestion"."iduser") "vote...

c++ - Algorithm for generating a triangular mesh from a cloud of points using kinect -

i'm using openni libraries (kinect) , opengl. can catch depth kinect (using openni , opencv) , can convert in cloud of points . so, have 640*480 points in 3d space and, viewing purpose, generate mesh composed of triangles. i need algorithm simple capable of representing walls , obstacles of every kind. can suggest me? meshlab provides algorithms this: ball pivoting, poisson triangulation , vgc. can find implementations of them in web.

javascript - Sail.js: File Access -

i'm trying use d3 visualize datasets in web app built off of sails.js framework, i'm having trouble specifying d3 dataset .tsv files are. basically, stored "data.tsv" in same folder view that's visualizing data. load data, d3 uses function in fashion: d3.tsv("data.tsv", type, function(error, data) { ... }); however, when function tries retrieve data, goes " http://www.mywebserver.com/analytics/data.tsv " , gets 404 not found error though stored data.tsv in analytics view folder. know because of way sails handles routing - there way bypass this? best way access raw files stored in sails.js project? the view folder not available publicly. files in .tmp/public available when server running. don't copy files folder manually. gets emptied every time server restarts. files in assets/ copied grunt build tool when server starts. want put files there. suggest reading sails asset management. sails assets

excel - How to paste specific columns from ADODB.recordset -

i have recordset contains 10 fileds . need paste fields 1 - field 7 sheet1 a1 , field 8 filed 10 sheet2 a1 . set rs = createobject("adodb.recordset') rs.open sql, connection thisworkbook.worksheets("sheet1").range("a1").copyfromrecordset rs the above code copies sheet1 a1 how can specify need field1 - field7 sheet1 , field8 field10 sheet2 ?

java - stopping threads and where to use locks -

my problem use locks on these threads. when have circles race eachother, when 1 reaches end program should stop , declare winner. instead, finishes of circles finish line, believe due them sharing same lock , maybe resources. here 3 of classes. appreciated. import java.awt.borderlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jbutton; import java.awt.gridlayout; public class horsepanel extends jframe { private jpanel panel; private jbutton reset; private jbutton quit; private jbutton run; private actionlistener listener; public static final int frame_width = 500; public static final int frame_height = 400; private trackpane trackpane; public horsepanel(trackpane t) { trackpane = t; createpanel(); createrunrace(); createquit(); setsize(frame_width, frame_height); } public void createrunrace() { class runrace implements actionlistener { ...

matlab - Determine whether a network (graph) is connected based on its matrix -

how can determine given m x n matrix desribing two-mode network whether connected or not? of course once can create data structure finding out – there mathematical solution? i found out n x n matrices (one-mode network) easy: solution be: m * m , looking @ diagonal in resulting matrix. if there 0 on diagonal not connected. isn't true? what suggestion both problems? it not simple one-mode networks , you're close. the network matrix m tells node connected other node in 1 step. m * m tells node connected other node in exactly two steps, m ^ 3 whether in exactly three steps, , on. "exactly" important, because if nodes not connected (zero diagonal elements), m * m not obtain two-step connectivity, loses one-step connectivity. the products (powers) therefore more useful if nodes connected themselves: a = (m + eye(size(m)) > 0) this step converts weighted matrix pure adjacency matrix. now (a ^ > 0) gives information whether 2 nodes...

wpf - other View(s) dependency? -

Image
i have view image , viewmodel have commands handle button (1,2,3,4) clicks. in work area allow user give inputs. depending upon input users allowed click button; each button leads 1 new window(view viewmodel; model taken inputs). new window have own logic showing data depending upon model injected viewmodel. as per mvvm standards, specify respective view , viewmodels each button? (in view / view model). how can specify same? basically viewmodel link between view , model, each combination of view , model should have separate viewmodel (if valid). in experience in cases dealing 2 kinds of views: small views such icons, advanced buttons , on (which more isolated , more have no reference parents easy manage , generalized) large views such windows, panels (which have lot of children , more changed later) for small views common viewmodels can used multiple views. large views (considering possible changes in future) it's better not use single shared viewmodel...

PHP Remove Get requests from url -

i working on voting system works requests know post id must updated. when vote done there still request in url (/?vote_up=123), if user refreshes page vote set again. , should not happen. i have after vote done, doesn't work. $_server['request_uri'] = strtok( $_server['request_uri'], '?' ); can me this? in first place, vote casting action shouldn't rely on request, definition should retrieve information instead of setting information. that said, should use put request (or post request make things simpler), , vote casting shouldn't access directly backend url, because if it's post request retrigger if user reloads. i'd suggest use ajax voting system in frontend, posts or puts data php backend asynch request doesn't affect current user's location url. in meantime, 1 emergency solution cast vote post request, land on url redirects user wherever came (assuming can vote multiple pages). in end of process, user'...

PHP Array Memory Usage -

i have tab-delimited file need in array (so can values in it). had thought iterate through lines , push exploded values array, so: error_reporting(e_all); ini_set("memory_limit","20m"); $holder = array(); $csv = array(); $lines = file('path\\to\\file\\2014_04_05_08_48.txt'); ($a=0; $a<count($lines); $a++) { $csv = ''; $csv = $lines[$a]; $csv = explode("\t", $csv); array_splice($csv, 10); array_push($holder, $csv); } print_r($holder); this file 11000 lines, 170 fields/line (output of current inventory pos system). file less 6mb. kept getting errors memory limits being exceeded. looking here on found increasing memory limit way of covering memory leak/poor memory usage. i got work setting memory limit 20m , stripping each array after 10th value. my question why need such high memory limit file contents array? more 3x size seems lot. doing wrong? each element in array variable potentially 48 bytes...

php - Detect First Alphabetic Character -

this easier making out looking determine whether entry user form contains alphabetic character "first" letter only. example user input: <input type="text" name="faa_id" size="50" value="<?php echo $_post['faa_id']?>" /> example form processing $faa_id = trim(strtoupper($_request['faa_id'])); if $faa_id = "string character except "n" in first position" { show url-1; } else { show url-2; } context: data aircraft registration numbers. enter them in our form without default "n" (i.e. 345fr , not n345fr) not registration number start n. for example eja345 aircraft callsign shown in place of generic n#, not registration number or c-yehe canadian registration number) i know how strip first letter if "n" don't know how detect if first letters alphabetic. i suppose need determine if first character alphabetic character first check see i...

javascript - Bower downloads entire jQuery -

i have bower version 1.3.1. i've defined following dependencies: "dependencies": { "angular" : "1.2.13", "angular-cookies" : "1.2.13", "angular-resource" : "1.2.13", "angular-route" : "1.2.13", "bootstrap" : "3.1.1", "jqplot" : "b882a2044fe03e4009f49b990155a8e1686a2d67", "jquery" : "2.0.0", "requirejs" : "2.1.11", "requirejs-text" : "2.0.10", "spin.js" : "1.3.3" } after do: bower install. entire project jquery: drwxr-xr-x 6 root root 4096 apr 5 13:41 . drwxr-xr-x 12 root root 4096 apr 5 13:41 .. -rw-rw-r-- 1 root root 6353 apr 18 2013 authors.txt -rw-r--r-- 1 root root 512 apr 5 13:41 .bower.json -rwxrwxr-x 1 root root 212 apr 18 2013 bower.json drwxrwxr-x 2 root root 4096 apr 5 13:41 build -rwxrwxr-x 1 root root 212 apr 18 2013 com...

c# - Lock screen notification not working on store build (Windows Phone 8) -

we have windows phone 8 game includes text notifications on lock screen. when test app on our devices notifications work fine, , app can selected in lock screen settings display notification text. however, once app uploaded windows phone store , downloaded, app not listed in settings lock screen, can't selected show lok screen notifications. has else had problem or might know why it's happening? thinking possibly downloaded version being installed in 'games' folder on device, whereas working test version listed in main list of apps. it turns out limitation windows phone 8. games cannot use lock screen notifications. windows phone developer forums: i hoping find out why limitation exists , if there way around you. unfortunately appears limitation games cannot have lock screen notifications. either need not post game games hub , make app, or not have lock screen notification. there no indication changed in near future, have made them aware of issue...

Vb.Net DataRelation 'column' argument cannot be null. Parameter name column -

Image
i have query display results follows: now want display these results in tree view in vb.net using datarelation. add groupid parent , other details children in tree view. have done using loop, interested in doing via datarelation property of datatables. first create new table distinct groupid follows: dim tbl datatable = dsdataset.tables("groups").defaultview.totable(true, "groupid") then add table dataset able add datarelation. tbl.tablename = "aaa" dsdataset.tables.add("aaa") and add datarelation between new table , original table: dim rel new datarelation("model", dsdataset.tables("aaa").columns("groupid"), dsdataset.tables("groups").columns("groupid")) after running code , when part of creating relation following error occures: 'column' argument cannot null. parameter name column how can solve problem? i think problem here... tbl.tablename = "aaa...

How to terminate a while loop when an Xpath query returns a null reference html agility pack -

i'm trying loop through every row of variable length table on webpage ( http://www.oddschecker.com/golf/the-masters/winner ) , extract data the problem can't seem catch null reference , terminate loop without throwing exception! int = 1; bool test = string.isnullorempty(doc.documentnode.selectnodes(string.format("//*[@id='t1']/tr[{0}]/td[3]/a[2]", i))[0].innertext); while (test != true) { string name = doc.documentnode.selectnodes(string.format("//*[@id='t1']/tr[{0}]/td[3]/a[2]", i))[0].innertext; //extract data i++; } try-catch statements don't catch either: bool test = false; try { string golfersname = doc.documentnode.selectnodes(string.format("//*[@id='t1']/tr[{0}]/td[3]/a[2]", i))[0].innertext; } catch { test = true; } while (test != true) { ... the code logic bit off. original code, if test evaluated true loop never terminates. seems want checking in every loo...

vb.net - How to insert data to DB using datagrid -

i want insert data sql server database using datagrid view.i added data grid , need commit them using loop. dim i, rowcount integer rowcount = dgorder.rows.count = 0 (rowcount - 1) objcon.doexecute("insert ordermf (itemtype,itemnm,unitprice,quantity,discount,totalvalue,freeitem)values('" _ & dgorder.item(i, 1).value & "','" _ & dgorder.item(i, 0).value & "','" _ & txtordno.text & "','" _ & dgorder.item(i, 3).value & "','" _ & dgorder.item(i, 2).value & "','" _ & dgorder.item(i, 5).value & "','" _ & dgorder.item(i, 4).value & "','" _ & dgorder.item(i, 6).value & "')") i...

path - Location of PHP class -

a php newbie question. trying make first web page using php class navigation , php including html files - trying efficient. works fine @ top of directory structure don't know how make work in sub-folders. the (linux) server fileshare , have access root folder www folder serving web pages. i have trawled site , web confused how specify path php , class files included in each page. i know basic php old (well, 60) , learning getting harder. the efficient way suggested jeremy miller in comment, use of variable indicating root folder (absolute path), , referring each time. otherwise, should know "../path" notation indicates parent folder in php, , can use multiple times traverse tree: "../../path" , on.

css3 - Images disappear offscreen in firefox -

this code, though firefox added weird classes each reason: <img id="share_facebook" class="gknwrycuvfcesykaisun" src="http://localhost:80/graphics/share/facebook.png"></img> <img id="share_google" src="http:/localhost:80/graphics/share/google.png"></img> <img id="share_pinterest" class="gknwrycuvfcesykaisun" src="http://localhost:80/graphics/share/pinterest.png"></img> <img id="share_tumblr" class="gknwrycuvfcesykaisun" src="http://localhost:80/graphics/share/tumblr.png"></img> <img id="share_twitter" class="gknwrycuvfcesykaisun" src="http://localhost:80/graphics/share/twitter.png"></img> <img id="share_email" src="http://localhost:80//graphics/share/email.png"></img> in chrome, works expected, in firefox, images don't show @ all. when click on t...

android - Is it possible to know : Did recipient receive my data SMS message -

i'm working on small application use data sms messages. know how manage thé errors during sending. sent several data sms contact don't know how know if data sms have arrived or not can me? when call smsmanager.sendtextmessage deliveryintent parameter tells whether received. no mean user saw it, means network received text. may not have been sent phone, or may have been , user didn't notice text. there no way tell user looked @ it.

sql server - Can I declare a local variable not null? -

in t-sql, declare local variable use query so: declare @var_last datetime; set @var_last = (select top(1) col_date tbl_dates order col_date); in application i'm testing, error query return null, , it's desirable query return crash error if were. i'd set @var_last not null syntax... declare @var_last datetime not null; ...is invalid. can write simple check on return of query see if it's null, , error if is, question is, not possible declare local variable not null? that's right, according documentation declare @local_variable , available at: http://technet.microsoft.com/en-us/library/ms188927.aspx , doesn't accept null | not null parameter -- valid column definitions. if want stop execution if return null , test null and, if is, raiserror ; see: http://technet.microsoft.com/en-us/library/ms178592.aspx .

ruby on rails - Checking if instance of model already exists with certain paremeters -

in application want check see whether or not concert model exists same artist , date fields review model. if want add review concert, if not want create new concert , review, because concert has_many reviews , reviews belongs_to concert... so wrote exists? function in concert controller: def exists(@artist, @date)? @concert_exists = @concerts.find_by_artist_and_date(artist: @artist, date: @date) if @concert_exists.nil? return false else return true end end and in review controller i'm trying create function: def create if concert.exists(review_params[:artist], review_params[:date])? #add review concert else @concert = concert.create(:artist => "artist", :venue => "venue", :date => "2014-2-2") @review = @concert.reviews.create(review_params) @concert.artist = @review.artist @concert.venue = @review.venue @concert.date = @review.date @concert.save ...

javascript - Launch Popup once Page Opens (using Magnific Popup) -

i trying have popup (about page of website) once web first launch. using magnific popup - modal popup , have hard time figuring how that. popup works fine, when such website launches, user clicks "about" button. i appreciate given. thanks, guys:) script: $(function () { $('.popup-modal').magnificpopup({ type: 'inline', preloader: false, focus: '#username', modal: true }); $(document).on('click', '.popup-modal-dismiss', function (e) { e.preventdefault(); $.magnificpopup.close(); }); }); html: <div class="html-code"> <a class="popup-modal" href="#test-modal">about</a> <div id="test-modal" class="mfp-hide white-popup-block"> <p>change way think recipes. text link interchanges verbs , nouns of recipes.</p> <p><a class="popup-modal-dismiss" href...

rspec - Rails –Testing named scopes: test scope results or scope configuration? -

how should rails named scopes tested? test results returned scope, or query configured correctly? if have user class .admins method like: class user < activerecord::base def self.admins where(admin: true) end end i spec ensure the results expect: describe '.admins' let(:admin) { create(:user, admin: true) } let(:non_admin) { create(:user, admin: false) } let(:admins) { user.admins } 'returns admin users' expect(admins).to include(admin) expect(admins).to_not include(non_admin) end end i know incurs hits database, didn't see other choice if wanted test scope's behaviour. however, i've seen scopes being specced confirming they're configured correctly , rather on result set returned. example, like: describe '.admins' let(:query) { user.admins } let(:filter) { query.where_values_hash.symbolize_keys } let(:admin_filter) { { admin: true } } 'filters admin users' expect(filter).t...

sql - Duplicate Column name error while executing mysql query? -

select t1.*,t2.* (select pp.id ppid, pp.*,tab3.*,tab2.* tab1 pp left join tab3 on pp.id = tab3.name_id left join tab2 on pp.id = tab2.name_id) t1 join ( select tab2.id colname_id,tab2.*,tab3.* tab2 left join tab3 on tab2.coltestconsent_id = tab3.coltestconsent_id ) t2 t1.ppid = t2.colname_id; description:above query not running creating error: error code : 1060 duplicate column name 'id' to make above query work had put column name instead of "*" below : select t1.*,t2.* (select pp.first_name,pp.id ppid,tab3.id coltestrisk_id,tab2.id coltest_id tab1 pp left join tab3 on pp.id = tab3.name_id left join tab2 on pp.id = tab2.name_id) t1 join ( select tab2.coltestconsent_id coltestconsent_id,tab3.coltestconsent_id colriskconsent_id,tab2.name_id colname_id,tab3.name_id coltest_nameid tab2 left join tab3 on tab2.coltestconsent_id = tab3.coltestconsent_id ) t2 t1.ppid = t2.colname_id; requirement: want fetch column value of tables. every tab...

r - Predictive Analysis using Java -

i working on spring based web application performs predictive analysis based on user historical data , come offers users. need implement predictive analysis or regression kind of functionality gives confidence score/prediction present offers. java developer , looked @ weka, mahout desired result. both tools dont provide documentation , highly difficult proceed them. need suggestion regarding java based analytics api process data using regression or neural networks or decision trees , provides confidence score depicting customers probablity on buying product in future. any in regard highly appreciable. i'd advise keep trying weka. it's great tool, not implementation idea of algorithms work you, data looks like, etc. book worth price, if you're not willing buy it, this wiki page might starting point. it might best start testing, not programming - believe quote goes "60% of difficulty of machine learning understanding dataset". play around weka gui,...

ruby on rails - What does this line of my Log mean? -

when sending 'post' request, in log. processing subgroupscontroller#add_timespan */* what mean? log tells following: controller_name#action_name respond mime type here list of default rails mime types: "*/*" => :all "text/plain" => :text "text/html" => :html "application/xhtml+xml" => :html "text/javascript" => :js "application/javascript" => :js "application/x-javascript" => :js "text/calendar" => :ics "text/csv" => :csv "application/xml" => :xml "text/xml" => :xml "application/x-xml" => :xml "text/yaml" => :yaml "application/x-yaml" => :yaml "application/rss+xml" => :rss "application/atom+xml...

javascript - Touch/Tap vs href for mobile devices -

i developing mobile website. using lot of links ( href ). want know whether should give normal href link or should use javascript detect touch , direct href value. 1 faster , more user friendly ? using hammer.js touch events. can me figure out ?

core location - iBeacon & XCode - Discovering with CoreLocation and Connecting with CoreBluetooth -

i have little hw ble module communicates ios device. i perform discovery using ibeacon (so using ibeacon advertisement packets) , - - connection (and data exchange) using corebluetooth, there issues. before describing issues, have tell need provide these information in discovery phase: serial number (needed internal purposes) - 6 characters , 10 numbers. a "hw version" specify type of product (each product uses different protocol). the problem have how perform discovery phase , connect particular discovered object: a. in ibeacon adv packet, should use uuid field serial number , major/minor field hw version, if so, devices not discoverable (ibeacon sdk ios needs know uuid before starting monitoring phase, cannot different every device). b. in ios, ibeacon features available through corelocation libraries, standard ble features instead available through corebluetooth. if use ibeacon advertisement packet, objects discovered coreb...

Python (Softimage input box) and function arguments -

i'm new programming (about week old). i've run little problem in python, couldn't find helpful in searches (new here well). the script made below working if don't use softimage's inputbox l1 = ['taskmaster', 'red skull', 'zemo'] l2 = ['capt. america', 'iron man', 'thor'] def findguy (where, inputguy): = "not here" in (range(len(where))): if where[i] == inputguy: = "yes here" print #findguy (l1, 'taskmaster') x = application.xsiinputbox ("who looking for?","find character") y = application.xsiinputbox ('which list?','search list') findguy (y, x) if use findguy(type inputs here directly) code works, if try input through input box in softimage keeps returning "not here" if kind enough week old struggling self learner, appreciated. thanks, gogo your method works fine. problem lies in fact in...

VB.NET Wait a DOS shell program to terminate before continuing- doesn't work -

i building windows forms application on vs2010, through need execute 3d party dos shell program (opensees.exe), open source file in , perform analysis. after this, output files created need read again in vb.net app. thing analysis in opensees may take long time, vb code has wait before carrying on. for this, have tried both "shellandwait" sub along "waitforsingleobject" function , "process class" option, neither of works. dos shell program initializes, closes immediately, not letting analysis complete , required output created. here code snippets used: 1st try: shellandwait private declare function openprocess lib "kernel32" (byval dwdesiredaccess _ long, byval binherithandle long, byval dwprocessid long) long private declare function waitforsingleobject lib "kernel32" (byval hhandle _ long, byval dwmilliseconds long) long private declare function closehandle lib "kernel32" (byval hobject long) long private su...

c++ - LNK2001: unresolved external symbol "public: virtual long __stdcall CTProcessus::Init -

how fix error, please? error: lnk2001: unresolved external symbol "public: virtual long __stdcall ctprocessus::init(class atl::cstringt > >,wchar_t *,wchar_t *,wchar_t *)" code: stdmethodimp ctprocessus::init(bstr bstrconnectionstring, bstr nomposteresponsable, bstr domaine, bstr dns) { m_csconnectionstring = (lpctstr)bstrconnectionstring; m_bstrnomposteresponsable = nomposteresponsable; m_bstrdomaine = domaine; m_bstrdns = dns; m_varnomposteresponsable = (_variant_t)m_bstrnomposteresponsable; m_vardomaine = (_variant_t)m_bstrdomaine; m_vardns = (_variant_t)m_bstrdns; return s_ok; } thanks lot! since code able compile means have correct function signature in header file. .cpp file not have function defined. there chance .cpp file isn't getting compiled @ , .obj files not getting generated.

Error when starting up new installation of Neo4j on Windows 8 -

i've downloaded , installed neo4j 2.0.1 community edition on windows 8 64. i start , set path default database. when after tries start server, following error occurs. starting neo4j server failed: error starting org.neo4j.kernel.embeddedgraphdatabase, c:\neo4j community\db\default pulled messages.log, [o.n.k.embeddedgraphdatabase]: startup failed: component 'org.neo4j.kernel.extension.kernelextensions@152c108d' initialized, failed start. please see attached cause exception.: component 'org.neo4j.shell.impl.shellserverkernelextension@47df4cd0' initialized, failed start. please see attached cause exception.: internal error: objid in use what's wrong? do have other java application running on machine? or older version of neo4j installed service? the error message indicates conflict of sorts remote method invocation registry. (if google error message see that) perhaps can try run neo4j in user account doesn't have preinstall...

javascript - how to get the next image tag after specific dom tag, sibling or not? -

let's code such as <html> <h1>heading</h1> <div> <div> <span> <img src="source"/> </span> </div> </div> </html> the above example, should work html code. need next image tag after <h1> no matter img placed $('h1').nextall('img').first() or $('h1').nextuntil('img').last().next() won't work here because not siblings of <h1> . there way can img without writing loop code? var $h1 = $("h1"); // `h1` var = $("*"); // dom elements var h1idx = all.index($h1); all.splice(0, h1idx); // rid of before , until `h1` var result = all.filter("img").first(); // first `img`

excel - Sum Column based on prior 12 columns' row entries (rolling count) -

Image
really stuck on one. please see picture. have data table multiple rows (the real data i'm working has 2,000+ rows). i need sum row entries in each column, need put sums in 2 different categories: "new", , "return". new starts @ first date value appears, , it's considered new next 12 months (so 10/1/2005 - 10/1/2006). value type after initial 12 month window considered "return". dates first value appears @ different though, each type (rock, paper, scissors), there's not 1 static date can measure from, each row first value appear @ date. so if value occurs, value occurs 9 months later, both values "new". after 12 months since first occurrence become "return". any hugely appreciated. can manually, on 2,000 rows take forever , lead lot of errors. solution helpful- conditional format, formula, vba. hope it's clear. again. wow!! - 1 doozie me, can done using array formulas. (i wanted see if - nicer solution,...

VBA Excel - Returning an array of ListBoxes from a function -

i working on module meant populate 3 activex listboxes. each populated same values: choices axes titles on graph (x-axis, primary y-axis , secondary y-axis). have function called "fillbox" takes listbox argument , populates it. originally used following accomplish this: sub fillallboxes() fillbox x_box fillbox y1_box fillbox y2_box end sub i informed cannot use union compact code because of msforms.listbox object type. there many other subs perform repeated operation on each box, appears sort of array best use. so far, way have found define array of listboxes following, though unsatisfied fact return value variant can't seem work if define function box_array() msforms.listbox: function box_array() variant dim temp(1 3) msforms.listbox set temp(1) = x_box set temp(2) = y1_box set temp(3) = y2_box box_array = this_array end function i can use sub, though needed explicitly define argument fillbox byval, because box_array varian...

node.js - Index optimizations for redundant data? -

i'm storing same tags: ['hello', 'world'] in multiple documents indexed. does make sense use external mapping: tags: { hello: 1, world: 2 } resolved on client in favor of reduced index space , size of tags on disk? essentially, client side compression mapping pulled static config file. if storage space concern, using small field names , values whenever possible possible advantage. surmised reduce amount of data stored on disk. assuming client can handle mapping long term (and can handle maintenance of mappings) cannot see disadvantages.

math - Matlab positioning windows at a 50% overlap -

i using following code windowing data , finding mean of each window. used starting each new window directly @ end of previous window. how code modified each new window starts @ 50% overlap prior window. fq = 51.2; //sample rate of accelerometer windowlength = 5; //length each window in seconds startpos = 1; //starting position 1st win endpos = startpos + (windowlength * floor(fq)); //end position 1st win totalwindows = floor(length(walk)/fq/windowlength); stats = zeros(windowlength,9); = 1:totalwindows epmean = mean(walk(startpos:endpos,:)); //calculate window mean //x, y & z axis values each stat walkfeature(i,1:4) = epmean; //next window position startpos = endpos+1; endpos = startpos + (windowlength * floor(fq)) end not optimized that's close original code , allow specify desired overlap : windowlengthinpoint = windowlength * floor(fq) ; %// store value overlap = 0.2 ; %// in portion of windowlength - 20% in exa...

php - display data in the drop down menu -

i want fetch data database in form of drop down menu. run code, name appear in drop down first 1 in database. how can make name appear in drop down? <?php include('config.php'); $sqladmin = "select * admin"; $result = mysql_query($sqladmin); if($result === false) { die(mysql_error()); } $row = mysql_fetch_array($result); $name1 = $row['name1']; ?> . <tr> <td>user</td> <td>:</td> <td> <label> <select name="user" id="user"> <option selected="selected"></option> <?php echo '<option value="'.$row['name1'].'">' . $row['name1'] . '</option>';?> </select> </label> </td> </tr> use mysql_fetch_assoc() while loop iterate result data <?php include(...

delphi - Correctly allocating/freeing memory for records in static array -

yesterday had memory corruption going on , i'm highly suspect of how record arrays being allocated , deallocated. short version demostration: type tmyrecord = record w: word; s: string; end; tmyrecordarray = array [1 .. 315] of tmyrecord; tarraypointer = ^tmyrecordarray; var pagebase: tarraypointer; procedure ttestform.formcreate(sender: tobject); var irecord: tmyrecord; begin pagebase := allocmem(sizeof(tmyrecordarray)); irecord.w := 1; irecord.s := 'test'; pagebase^[1] := irecord; end; procedure ttestform.formdestroy(sender: tobject); begin pagebase^[1] := default (tmyrecord); freemem(tpagebase); end; i'm sure i'm not doing right, suggestions appreciated. the first thing code present works. finalizes , deallocate correctly without leaking. i'll try answer question more generally. strings managed types , compiler needs use special memory allocation routines able manage them: new , dispose . allocate with ...

php - insert query not working more than 20 times -

i using html , php save data in database unfortunately insert query not executed not more 20 times. in web interface have created row of input fields name, father name , 1 pdf file uploading. there 2 buttons @ bottom, 1 button used adding 1 more row of fields , other saving. code working 100% fine when user enters not more 20 records when user enters more 20 records insert query executed 20 times, , rest of records ignored. here sample code html code <td height="30"><input type="text" name="a[]" size="5" /></td> <td><input type="text" name="b[]" size="10" /></td> <td><input type="text" name="c[]" size="40" /></td> <td><input type="text" name="d[]" size="10" /></td> <td><input type="text" name="e[]" size="10" /></td> <td><in...

cocoa - Xcode IB: Inexplicable area? -

Image
i wondering if knew why ib has inexplicable high lighted areas on odd nib here , there.. below example: what mean light area within area marked out in red... there's no views below split view, there's no bounds correspond , far there's nothing complaining "misplaced views" etc... it? update: worked out when last happened that weird "area" same size rightmost nsview (whether embedded in nssplitview or 2 nsviews side side. many thanks adrian s it's due bug in xcode interface builder. , in experiments it's been predictable according following explanation: the lighter colored area intended highlight container view of current selection. have nstextfield within nsbox, , select text field, box highlighted. it's purpose dim out outside scope can make constraints in. you can see it's dimming down of outside box, if nothing selected, whole ib view port displayed in lighter shade. the bug when make selection, ib cl...

function - Writing a generalised passive metafunction for an array class -

this conceptual, non language specific question. i know these less ideal, think question still quite clear , simple... what want just; write class array of n dimensions/axes, each of length m , , index them. write generalised function can iterate through elements in such array via n nested for loops, array of dimension n . have function nothing, "template", can interact function performs specific action, eg function sets every value in array 1. i don't have deep enough programming knowledge know how easy such thing implement, in language. while idea extremely simple, haven't seen similar example of such flexible , inert "meta" function, or if such thing practicable. so if give me feedback towards performing such implementation, speaking generally, or citing specific language example, helpful. edit: pseudocode illustration class array(arrayaxesnumber, arrayaxeslength) trackallelements (array) #iterate through arrayaxes1# ...

How to flatten array in PHP? -

i have array contains 4 arrays 1 value each. array(4) { [0]=> array(1) { ["email"]=> string(19) "test01@testmail.com" } [1]=> array(1) { ["email"]=> string(19) "test02@testmail.com" } [2]=> array(1) { ["email"]=> string(19) "test03@testmail.com" } [3]=> array(1) { ["email"]=> string(19) "test04@testmail.com" } } what best (=shortest, native php functions preferred) way flatten array contains email addresses values: array(4) { [0]=> string(19) "test01@testmail.com" [1]=> string(19) "test02@testmail.com" [2]=> string(19) "test03@testmail.com" [3]=> string(19) "test04@testmail.com" } in php 5.5 have array_column : $plucked = array_column($yourarray, 'email'); otherwise, go array_map : $plucked = array_map(function($item){ return $it...

Remove node from a linked list in java -

i'm making dictionary type program linkedlist, cant use linkedlist utility, have create own, can't use of methods, have remove node, , can't life of me figure out. can on paper, in code, either removes before it, or freezes , such. here's have far on delete method: void delete(string w) { wordmeaningnode temp = list; wordmeaningnode current = list; wordmeaningnode = null; boolean found = false; while(current != null && !found) { if( current.wordmeaning.gettitle().equals(w)) { found = true; system.out.println("found it!"); } else { = current; current = current.next; } temp = current.next; //this problem starts back.next = temp; } } and here's how i'm calling it: string delword = joptionpane.showinputdialog("enter word dele...

javascript - How to get current position(city,state,zipcode) in safari browser ? -

i have tried below code work chrom,firefox browser not work on safari browser on desktop(wired connection) , not work in windows phone(tested on nokia lumia 625.) work on ipad,iphone (through wifi) safari browser. please give me solution issue. <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"> </script> in header call function on load page. $(document).ready(function() { requestposition(); }); write function in js file function requestposition() { if (typeof navigator.geolocation == "undefined") { alert("your browser doesn't support geolocation api"); return; } navigator.geolocation.getcurrentposition(function(position){ var geocoder = new google.maps.geocoder(); geocoder.geocode({ "location": new google.maps.latlng(position.coords.latitude,position.coords.longitude) }, function (results, status) { if (st...

Partial animal string matching in R -

i have dataframe, d<-data.frame(name=c("brown cat", "blue cat", "big lion", "tall tiger", "black panther", "short cat", "red bird", "short bird stuffed", "big eagle", "bad sparrow", "dog fish", "head dog", "brown yorkie", "lab short bulldog"), label=1:14) i'd search name column , if words "cat", "lion", "tiger", , "panther" appear, want assign character string feline new column , corresponding row species . if words "bird", "eagle", , "sparrow" appear, want assign character string avian new column , corresponding row species . if words "dog", "yorkie", , "bulldog" appear, want assign character string canine new column , corresponding row specie...

jsf - passing object through a setPropertyActionListener returning null -

in application, when user log in need send information menumanagedbean identify menu show (i trying primefaces programmatic menu example) when attempt object sent managedbean via setpropertyactionlistener null , can't figure out fault. this jsf page code <h:form class="contact-us"> <h1 style="font-family: 'segoe ui light'">ged</h1> <div style="margin-left: 33%"> <br></br> <br></br> </div> <div style="margin-left: 25%"> <p:inputtext id="login" placeholder="login ..." required="true" requiredmessage="login obligatoire" value="#{persmb.personnel.login}"> <p:message for="login" display="text" /> </p:inputtext> <p:in...

css - Error when colunm's width is fixed in p:column primefaces -

i want define fixed width column, have this: <p:column style="min-width: 10px;max-width: 10px" > but when text long, not show correctly, it's truncate, example: my text: "this large text, not long", get: |"this large text, | what want: |"this large text, | |but not long" | add css: .ui-datatable-tablewrapper tbody td { white-space: normal !important; } if treetable: .ui-treetable tbody td { white-space: normal !important; }

html - How do i place this menu at the bottom right of its parent div? -

i've been trying absolutely position navigation @ bottom right of parent div (header>nav>menu) , i'm little lost. appreciated! i've been trying relatively position parent div, each property try, either disappears browser, aligns way @ bottom right of page , not parent div, or somewhere else i'm not wanting go. <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <link href="css/style.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="images/favicon.png" /> </head> <body> <div id="wrapper"> <header> <div class="logo"> <img src="images/logo.png" / id="logo"> </div> <nav> <ul id="menu"> <li><a href="i...