Posts

Showing posts from January, 2014

Errors with selenium & python, selenese commands throwing errors -

the errors i'm seeing: ====================================================================== error: test_1 (__main__.test1) ---------------------------------------------------------------------- traceback (most recent call last): file "test1.py", line 23, in test_1 driver.find_element_by_link_text("login").click() file "/library/python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 282, in find_element_by_link_text return self.find_element(by=by.link_text, value=link_text) file "/library/python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 712, in find_element {'using': by, 'value': value})['value'] file "/library/python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 201, in execute self.error_handler.check_response(response) file "/library/python/2.7/site-packages/selenium/webdriver/remote/errorhandler....

google analytics - ga:productCategoryHierarchy vs ga:productCategoryLevelXX -

i'm having trouble understanding difference between ga:productcategoryhierarchy , ga:productcategorylevelxx. unfortunately the documentation doesn't tell either, imho. i'm trying represent product in category taxonomy, e.g.: product a: category 1 -> category 1.1 -> category 1.1.2 product b: category 1 -> category 1.2 -> category 1.2.1 i tried separating categories / in ga:productcategoryhierarchy field, didn't work (i.e. showed whole string in ga reports, no possibility drill down individually). i've somewhere read can use ga:productcategorylevelxx (and substitute xx number between 1 , 5) , pass category names that. is there best practice? variant using? when using enhanced ecommerce send in full product category delimited / , example: apparel/men/t-shirts . when using core reporting api can query both category hierachy ga:productcategoryhierarchy return full string apperel/men/t-shirts or can query ga:productcategorylevelx...

ios - Fastlane, Pilot - Automatic Team Selection -

i m using pilot via fastfile: desc "build , upload new build apple testflight" lane :betatest testflight end but it's asked me choose team every time multiple teams found, please enter number of team want use: 1) "team 1" (000000) 2) "team 2" (111111) i tried use testfligh bellow, gives me error: testflight( username: "raed@gmail.com", team_id: "xxxxxx" ) error: [20:16:59]: variable dump: [20:16:59]: {:default_platform=>:ios, :platform_name=>:ios, :lane_name=>"ios betatest"} [20:16:59]: getaddrinfo: nodename nor servname provided, or not known +------+-------------------------------------+-------------+ | fastlane summary | +------+-------------------------------------+-------------+ | step | action | time (in s) | +------+-------------------------------------+-------...

ember.js - View Ember App on Remote Server -

i'm attempting develop ember.js app. required tools (node, ember-cli, bower, etc.) installed on remote machine. can create app no problems, , run ember server, unable access app through browser on local machine. ember server appears run on localhost:4200, meaning have view in browser on remote machine. know how open being viewable outside localhost? have firewall setup on remote machine, , configured allow connections on port 4200. have configured hosts file on local machine can access content served remote server using server's hostname instead of ip address. i've been using $hostname:4200 try access app, connection doesn't go through. best of knowledge, remote machine isn't accessible outside of network it's on (my local machine , remote machine on same network). i've used --proxy option ember serve , didn't work. essentially, know of way can view app through browser local machine? i able see ember application served ember s command o...

objective c - Xcode 4 / iOS - Send an email using SMTP from inside my app -

i've been looking around framework allow me send email inside app. have tried mailcore, pantomime , skpsmtp no luck. can't them compile in xcode, presumed outdated. there way can this? if so, how? thanks. you can send emails ios device. no need implement smtp , all. best thing using inbuilt emailing facilities in ios gives access address book! auto-completes names, email addresses. yaaiiii!! include, addressbook , addressbookui , messageui frameworks , code this. note can choose send content html too! #import <messageui/messageui.h> #import <addressbook/addressbook.h> #import <addressbookui/addressbookui.h> mfmailcomposeviewcontroller *mailcomposer; mailcomposer = [[mfmailcomposeviewcontroller alloc] init]; mailcomposer.mailcomposedelegate = self; [mailcomposer setmodalpresentationstyle:uimodalpresentationformsheet]; [mailcomposer setsubject:@"your custom subject"]; [mailcomposer setmessagebody:@"your custom body content...

c# - Generating a Tree Structure From Table -

i have excel document below +-------+-------+-------+ | col1 | col2 | col3 | +-------+-------+-------+ | item1 | | | | | item2 | | | | item3 | | | | | item4 | | | item5 | | | item6 | | | | | item7 | | +-------+-------+-------+ in table; item1 parent of item2, item3, item5 item3 parent of item4 item6 parent of item7 i want generate tree structure table couldn't figure out how do. how can using c#. thanks keep list of parents columns. parent first column tree root. when treat row, append item resecive parent. (it's error when there no such parent, foe example if item4 in column 3.) add added item list , remove lower items. to illustrate: current item col pnt parent list | | | | [root] | item1 | | | 1 0 [root, item1] | | item2 | | 2 1 [root, item1, item2] | | it...

sql - Adding a computed column in mysql -

i'm trying add column called 'price' order_details table. want calculate price different prices of products other tables. alter table order_detail add column price decimal(5,2) (case (order_detail.item_id, item.item_id, bagel.item_id, bagelfilling.item_id, item.price, bagelfilling.price, order_detail.quantity, order_detail.discount, drink_sizes.price, drink.item_id) when (order_detail.item_id = item.item_id) , (item.item_id = bagel.item_id) , (bagel.item_id = bagelfilling.item_id) ((item.price + bagelfilling.price)*order_detail.quantity)-order_detail.discount when (order_detail.item_id = item.item_id) , (item.item_id = drink.item_id) ((item.price + drink_sizes.price)*order_detail.quantity)-order_detail.discount when (order_detail.item_id = item.item_id) , (item.item_id = bagel.item_id) (item.price*order_detail.quantity)-order_detail.d...

php - Page Break After Specific Number Of Rows -

i developing voucher printing application prints serial numbers , pins mysql table , displays them in page. the php code displays 2 records per row..with being in separate column i.e 2 columns displayed side side due format of page (two records per row)..i can not display each record in seperate table. rather records contained in "general" table. the voucher printing requires 2 rows displayed on each page. i implemented "page-break-after: always" style each row not divisble two, page break not showing. code shown below: $aray=array(); while($row=mysqli_fetch_array($sql_res)) { $aray[]=$row; } $nr_elm=count($aray); $table='<table width=100%><tr>'; $nr_col=2; if($nr_elm>0) { $p=1;//this row counter for($i=0;$i<$nr_elm;$i++) { $table.='<td><div style="border: 2px dashed #000;" ><div id="image" style="float:left;"> '.$p.' <img src="crswb1.p...

google analytics - Page views count decreases when i select page path as dimension -

i using google analytic`s in product calculate page views. facing problem. when call ga api ga:source dimension count 7176 when add ga:pagepath in dimension, count decreased. if understand correctly, page path when visitors click full url of site browse it. source, on other hand, applys when visitors enter website after google search of site, or 1 of pages , added full url. so, logical ga:source greater ga:pagepath

c# - How to change values of column of DataTable and show only in DataGrid not updating actual table of database -

i have column encrypted name(all other columns not encrypted) in sql database table. , have decrypt column encrypted name show in datagrid users of application actual table of sql database should not changed.(has remain encrypted name). i think updatecommand works update actual table , have find alternative below updatecommand. or there alternative way decrypt 1 column on datatable not influencing actual table of database? my simple code is, sqlcommand gridcomm = new sqlcommand(); gridcomm.connection = conn; gridcomm.commandtext = "select id, customername, phonenumber customers"; sqldataadapter gridda = new sqldataadapter(gridcomm); sqldatareader gridreader = gridcomm.executereader(); while (gridreader.read()) { } gridreader.close(); datatable griddt = new datatable("customers"); gridda.fill(griddt); foreach (datarow row in griddt.rows) { string strcustomername = (string) row["customername"].tostring(); bytecustomername = convert.f...

Showing the result of Levenshtein Distance -

Image
given 2 strings (s1, s2), levenshtein distance minimum number of operations needed change s1 s2 or vice versa. i want show result of changing s1 s2. example, changing sunday saturday needs 3 operations. need show s++u+day. "+" each operations needed. here javascript snippet returns want. if familiar dynamic programming algorithm should able follow code. string operations/manipulation of return string r , handling of min / curmin what's changed original version. function edits(t, s) { var r = ""; if (s === t) { return s; } var n = s.length, m = t.length; if (n === 0 || m === 0) { return "+".repeat(n + m); } var x, y, a, b, c, min = 0; var p = new array(n); (y = 0; y < n;) p[y] = ++y; (x = 0; x < m; x++) { var e = t.charcodeat(x); c = x; b = x + 1; var currmin = min; min = n + 1; (y = 0; y < n; y++) { = ...

c# 4.0 - linear increasing algorithm in c# -

Image
from start point 3 variables, x,y,z point; best linear algorithm. example: x:0, y=0, z=0 x:10, y=20, z=50. the way looking equal steps on each homogenised increase block. edit ambiguity: asked question motor control. motors controlling x , y coordinates, can't perform steps @ same time. motion has ladder or squares. so, looking smallest ladder steps 3 (or more) coordinates, least squares logic, in c#. using integer coordinates, can divide differences greatest common divisor : var gcd = gcd(x2 - x1, y2 - y1, z2 - z1); var stepx = (x2 - x1) / gcd; var stepy = (y2 - y1) / gcd; var stepz = (z2 - z1) / gcd; some lines have 2 steps, since can't divided evenly in 3 dimensions. (e.g. (0,0,0)-(17,19,23) ) alternativly, use bresenham's line algorithm public static ienumerable<point> getpointsonline(int x0, int y0, int z0, int x1, int y1, int z1) { bool swapxy = math.abs(y1 - y0) > math.abs(x1 - x0); bool swapxz = math.abs(z1 - z0) > ma...

java - I can not figure it out -

i have following requirements program: write program reads arbitrary number of integers in range 1 50 keyboard , outputs how many of each value read. do not output 0 counts. prompt user inputs shown in sample run. let user enter 0 terminate input. any other value outside range 1 50 should error message. i have done far: import java.util.scanner; public class countingintegers { public static void main(string[] args) { int[] inputarray = new int[51]; scanner keyboard = new scanner(system.in); int[] frequency = new int[50]; for(int = 0; < inputarray.length; i++) { system.out.println("input: "); inputarray[i] = keyboard.nextint(); if (inputarray[i] > 0 || inputarray[i] <= 50) { ++frequency[inputarray[i]]; } else { break; } ...

java - Increase heap size for sqlworkbench/J -

how increase heap size sqlworkbench/j? i have tried different options of says execute below command :- java -xmx4g -jar sqlworkbench.jar even on http://www.sql-workbench.net/manual/install.html#install-increase-memory , provides me solution. now, using macbook. have sqlworkbench.app file only. neither have .ini file or .jar file sqlworkbench. so, how increase memory size? i not find info.plist file in application folder on macbook pro. when searched info.plist, find microsoft office related one. i right clicked sql workbench j icon on desktop, , selected show package contents. find info.plist file there!! changed heap size there 512mb 4096 mb. <string>-xmx4096m</string>

android - is valid Mvp pattern implementation (with rxandroid and retrofit) -

i want data remote server using rxandroid in mvp repository. then,set grid adapter data(in fragment), , replace fragment tablet ui(in activity). if use callback listener need @ least 2 callbacks, notify async(rxjava) done fragment , launch fragment first record data set. is there alternative way solve problem other callback ?? actually not sure if using rxjava properly. for pass observable fragment in order set adapter , launch new fragment returned data. public <t> observable.transformer<t, t> applyschedulers() { return observable -> observable .subscribeon(schedulers.io()) .observeon(androidschedulers.mainthread()); } @override public observable<moviedatacontainer> getmoviebyfilter(string sortby, string apikey, int number) { movieapiservice movieapiservice= retrofit.createservice(movieapiservice.class); return movieapiservice .getmovielist(sortby,apikey,number) .compose(applyschedulers())...

asp.net - Adding runat server to HTML control giving error -

i want access a html control on server side, while adding runat= server , giving me error as 'chka1<%# (container.recordindex) %>' not valid identifier. here html <input type="checkbox" runat="server" id="chka1<%# (container.recordindex)%>" name="chkac1" style="width: 17px; height: 17px;" value="<%# (container.recordindex)%>" onclick="appovechecka(this)" /> when remove runat=server works properly. why not working runat=server . suggestion update the id's changing accordingly of checkboxes. here code have written var checkboxid; var status; var arra = []; var arrb = []; var rowindex function appovechecka(chk) { status = true; checkboxid = $(chk).attr("id"); funclientselectafter(status, checkboxid); } function appovecheckb(chk) { status = t...

How to access any other's google calendar using google php api -

i need access other user's google calendar freebusy using google php api. can 1 me step step process implement that. have checked https://developers.google.com/google-apps/calendar/v3/reference/freebusy/query#response nothing fruitful got. my approach session_start(); require_once ('libraries/google/autoload.php'); $client = new google_client(); $client->setclientid($client_id); $client->setclientsecret($client_secret); $client->setredirecturi($redirect_uri); $client->addscope("email"); $client->addscope("profile"); $client->addscope(google_service_calendar::calendar); $client->addscope(google_service_calendar::calendar_readonly); $client->setaccesstype('offline'); $service = new google_service_oauth2($client); if (isset($_get['code'])) { $client->authenticate($_get['code']); $_session['access_token'] = $client->getaccesstoken(); header('location: ' . filter_var($r...

bash - Press any key with timeout progress displayed in shell -

i want provide user prompt press key or wait timeout continue using shell. case solved following idiom: read -rs -t3 -n1 "press key or wait continue ..." however prompt seems little bit clumsy me , left "press key continue ..." part of message , indicate timeout dots printed each second. write following script: #!/bin/sh echo -n "press key continue"; _ in `seq 3`; if ! read -rs -n1 -t1 ; echo -n "."; else break; fi done echo it works expect, there code, have put in separate file instead of using sh -c "..." in script. there way implement in more concise , compact way? p.s. returning non-zero error code on ctrl-c pressed must. a bit more concise : echo -n "press key continue"; _ in {1..3}; read -rs -n1 -t1 || printf ".";done;echo

html5 - Adding Geolocation Google Map Failed -

i still new html5 trying add google map geolocation , few points people can find. when refresh page after submitting code doesn't appear. can please tell me i'm going wrong or correct code? the site isn't complex, here's code: <!doctype html> <!--[if lt ie 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if ie 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if ie 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt ie 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-sca...

c# - Why cant I add more then 1 item in Visual Studio? -

so i'm not new visual studio, , that's why confusing. i'm working android app , i'm trying add stuff toolbox doesn't let me add more 1 object. i.e have large text in there , when try add person name (or else) doesn't let me, when double click item. i made gif visually show what's happening. here gif what restored , crucial have line of code right here setcontentview(resource.layout.main);

python - How to concatenate a string and an integer to get a three digit number -

i in beginner's course , made code not work random_number = str(random.randrange (1, 1000)) random_number_length = (len (random_number)) zero_number = ("0" * 3 - (random_number_length)) final_number = (random_number_length + random_number) print (final_number) the final output needs like: 004 instead of: 4 i need 3 digit number if generated number 89 or 7. when attempt error: zero_number = ("0" * 3 - (random_number_length)) typeerror: unsupported operand type(s) -: 'str' , 'int' i'm guessing has string , integer. above answers more useful (you don't have reinvent wheel), use own code: import random # random number random_number = str(random.randrange (1, 1000)) # check number of digits in number random_number_length = len (random_number) # use number of digits number of zeros zero_number = "0" * (3 - (random_number_length)) # concatenate zero_number random_number final_number = zero_numbe...

proxy - Apache mod_proxy - Pass through from localhost to another domain? -

i'm not @ experienced when using proxies possible. i have apache running on development machine hosts website (www.testdomain.com). need @ www.testdomain.com phone. don't want root phone can enter ip address of machine (10.8.0.1). site hosted @ www.testdomain.com won't work correctly default site in apache. i need way of passing through request 10.8.0.1 www.testdomain.com without phone having dns record www.testdomanin.com is possible using mod_proxy? there else job? first of all, don't understand why can't point cellphone browser www.testdomain.com. anyway, use proxy, think better approach use serveralias directive in www.testdomain.com vhost: <virtualhost *:80> servername www.testdomain.com serveralias 10.8.0.1 (...) if still want use proxy, setup different vhost 10.8.0.1: <virtualhost *:80> servername 10.8.0.1 errorlog ... transferlog ... loglevel warn # reverseproxy proxyrequests off ...

android - AppCompat does not support the current theme features error -

this error occurs when application goes layout : <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/apptheme.appbaroverlay"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprimary" app:popuptheme="@style/apptheme.popupoverlay" /> </android.support.design.widget.appbarlayout> <include layout="@layout/content_surveillance" /> <android.support.design.widget.floatingactionbutton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dime...

java - How to get default camera storage location when the photo is taken? -

environment.getexternalstoragedirectory().getabsolutepath(); above code absolute path of sd card. don't know how storage location of picture taken using in-built camera in android phone. can give me possible code question . it's in environment class. see javadoc environment.directory_dcim . pass value getexternalstoragepublicdirectory() final directory.

Twitter Streaming Spark : how many filter keywords can i have with a streaming context? -

i using spark streaming context stream twitter data using api below in scala. https://spark.apache.org/docs/1.0.0/api/java/org/apache/spark/streaming/twitter/twitterutils.html i wanted know how many filter keywords can give create streaming function?. (3rd parameter of function below) twitterutils.createstream(ssc,none,keywords) how many filter keywords can twitter api handle. according this question , seems twitter limits not according numer of filters supply, overall volume you're allowed consume. seems limit %1 of total tweets.

javascript - React-Router-Redux and React-Bootstrap -

Image
i've been battling 1 while! i want have 'main app container' has logo, navigation... want use react-bootstrap pretty up. at moment i'm running problems, project based off davezuko's "react-redux-starter-kit" i tried putting of bootstrap <navbar> , <linkcontainers> in root container inside provider. everything shows , looks nice none of links work, , when put regular react-router <link> run same problems. i figured, well, links work in views called routes, copied of routes after export default (store) => ( babel, eslint , webpack allow compile, when run page none of shows up, , when take react-dev console, these react nodes don't appear. here's have, root.js: import react, { proptypes } 'react'; import { provider } 'react-redux'; import { router } 'react-router'; import { indexlink, link } 'react-router'; import navbar 'react-bootstrap/lib/navbar'; import nav ...

vba - How do I retrieve an Excel cell value in another cell, as text, formatted as in the origin cell? -

i have 2 cells custom currency formatting. i display text next sum, describes sum being made. so write = "" & textasdisplayed(a1) & "+" & textasdisplayed(a2) does such function exist in worksheet or have make vba function ? try this: tested , works fine. text , format in dollar(usa) currency. ="" & text(a1,"[$$-409]#,##0.0") & "+" & text(a2,"[$$-409]#,##0.0")

c++ - Why can't I define a forward declared class by aliasing it? -

trying compile code below fails due "conflicting declaration". why can't define forward declared class this? i did hide implementation uses library. although i'll admit not abstract - you'll still need know implementation uses make correct call - still interested in why doesn't work. bar.cpp: #include "bar.hpp" #include "foo.hpp" using foo = ns::foo; void bar::foo(foo f) { } bar.hpp: class foo; class bar { void foo(foo f); }; foo.hpp: namespace ns { class foo { }; } to clear, want know why can't define declared class aliasing - in other words saying "use definition on there has different name" you declaring foo twice conflicting types. first, declare foo in bar.hpp as: class foo; subsequently, declare foo in bar.cpp as: using foo = ns::foo; you cannot put forward declaration if define in source file alias same name, because declare 2 different types same name. based on ...

How to upload CSV/excel file to MySql using PHP with column name not index number? -

my code working good. there little issue csv file column numbers keeps changing time. , it's not possible change index number in code every time. have found solution can read csv column name not number. how can fetch record of csv file based on column name behalf of column number? in advance. if ($_post["upload"] == "freight") { $file = $_files['file']['tmp_name']; $handle = fopen($file, "r"); $c = 0; $branch=$_post["freight"]; while (($filesop = fgetcsv($handle, 3000000, ",")) !== false) { $invoice_number = $filesop[3]; $freaight3 = $filesop[12]; $freaight2 = substr($freaight3, 0, -2); if($freaight2=="") { $freaight2=0; } $with_tax = $filesop[10]; $with_tax2 = substr($with_tax, 0, -2); $invoice_number = $branch."_" .$invoice...

java - How to get the details of a class/interface just by knowing its name(not fully qualified name) -

i want know using name of class/interface ( not qualified name),can details of class/interface i.e using methods isinterface(),getsuperclass(),getinterfaces() . i have gone through oracle doc not find way. can me this? no, since can't have reference class class name, won't able execute of methods. packages there reason.

hadoop - Oozie email action, how to set a specific "from address" -

i want set parameter oozie.email.from.address 1 action. i know oozie-site.xml exists sets parameter every action. in 1 of workflow.xml tried this <action name="sendemail5530"> <email xmlns="uri:oozie:email-action:0.1"> <configuration> <property> <name>oozie.email.from.address</name> <value>myfromadress@gmail.com</value> </property> </configuration> <to>${parammaillist}</to> <subject> subject</subject> <body> body </body> </email> <ok to="mailsent"/> <error to="fail"/> </action> but not work. have better solution? (using oozie)

iostream - Meaning of trailing stream manipulator in C++ expression -

what difference between both expressions of each pair ? don't understand effect of trailing std::dec @ end of expressions. with cin , between : int i; std::cin >> std::hex >> >> std::dec; and : int i; std::cin >> std::hex >> i; same question cout , between : int i; std::cout << std::hex << << std::dec << std::endl; and : int i; std::cout << std::hex << << std::endl; thanks ! some flags set manipulators active next output or input operation. others, formatting flags set std::hex or std::dec set permanently in stream object, , affects output , input operations after setting flag. so if use std::hex integer output , input point in hexadecimal notation. if want output or input single number in hexadecimal need "reset" default decimal notation using e.g. std::dec leading statements like std::cin >> std::hex >> >> std::dec;

ajax - net::ERR_CONNECTION_RESET in axios while requesting from a Dropwizard server -

i have dropwizard server , universal app using react , redux. when trying post call using axios universal app. getting net::err_connection_reset error. i have set cors in dropwizard as: filterregistration.dynamic filter = environment.servlets().addfilter("cors",crossoriginfilter.class); filter.addmappingforurlpatterns(enumset.allof(dispatchertype.class), true, "/*"); filter.setinitparameter(crossoriginfilter.allowed_methods_param, "get,put,post,delete,options"); filter.setinitparameter(crossoriginfilter.allowed_origins_param, "*"); filter.setinitparameter(crossoriginfilter.access_control_allow_origin_header, "*"); filter.setinitparameter(crossoriginfilter.allowed_headers_param, "*"); i have following debug log jetty : debug [2016-03-07 05:42:04,189] org.eclipse.jetty.servlets.crossoriginfilter: cross-origin filter configuration: allowedorigins = *, allowedmethods = get,put,post,delete,options,...

Entering no character for input in C -

is there way user enter nothing input(for character array) in c? tried following: using '\n' character delimiter: scanf("%[^\n]s",str); gave me junk. used custom delimiter ' ` '. additional task required in case if entered in between, etc. tried using command line arguments input string (as know no input gives one argument expected ) tried entering null alt+space . did not work either. please suggest me new way or correct me if doing of above steps wrong. note: using windows. if take input command line arguments, can specify empty string with: c:\>myprogram "" argc 2 , argv[1] pointer empty string.

Neo4j In-Memory implementation -

i have been working neo4j ha. gives average performance, dependent on network , machines used. however, i've noticed write transactions, take more time, write transactions through master. part of graph includes continuous reads , write operations.[atleast 20 each, per second ]. think might reason average performance i'm getting. there way, through can implement sub-graph using in-memory db of neo4j?

Reset autoincrement value in mysql -

i have table having serial no. 1,2,3,4,5 , on if delete data of ex. 2 no. table shows 1, 3,4,5,6.... want should reset serial no field. can me in this? pravin you can renumber rows of table recreating it. that's foolproof way if table small ... 100k rows or smaller. something trick. rename mytable mytable_previous; create mytable mytable_previous; truncate table mytable; alter table mytable auto_increment = 1; insert mytable (col, col, col) /* name cols except autoincrementing */ select (col, col, col) /* same names, same order */ order id; this allow insert operation redo autoincrementing in same order previous table, without gaps. beware ... bad idea. if autoincrementing id column used in other tables reference table, doing wreck database. production database tables have delete operations ordinarily live gaps in autoincremented row numbers. gaps cause no harm.

mongodb - Mongo DB-adding Json object to existing document without creating a new entry(not an array) -

i have json object in mongodb inserted. { "appname":"abcd", "appid":"e3456", "modules":{ "sales":{ "apis":{ "get sales":{ "method":"get", "access_ctrl_level":"admin", "req_fields":[ ], "url":"url_to_api", "error_code":[ { "code":502, "desc":"no authentication" } ] } } } } } now want add object "sales.apis". "get sales details":{ "method":"get", "access_ctrl_level":"admin", "req_fields":[ "saleno" ...

php - I am trying to redirect my page through header function but it will not work rather my query is working ...why? -

this index file: session_start(); include_once 'conn.php'; if(isset($_session['hell'])!="") { header("location: home.php"); } if(isset($_post['login'])) { $email = $_post['email']; $pass = $_post['pass']; $res=mysql_query("select * studentreg email='$email'"); $row=mysql_fetch_array($res); if($row['password']==$pass) { $_session['hell']=$row['stu_id']; header("location: home.php"); } else { echo "hello"."<br/>"; echo $row['password']."<br/>"; echo $row['qualification']; } } this home file: session_start(); include_once 'conn.php'; if(!isset($_session['hell'])) { header("location: index.php"); } $res=mysql_query("select * studentreg stu_id = ".$_session['hell']); $sturow=mysql...

php - Laravel 5 build with Sximo -

helou, i'm frontend developer , php knowledge on begginers level. have laravel site build sximo other developer. need add new .css , .js files backend platform, don't know where. added public folder these files, don't know how call them. can me? p. s. no, can't add manuel, it's not frontend page. :) you need add .js , .css files public directory inside of laravel project directory: public/css/my.css public/js/mybig.js please read here how add them view (recipe valid laravel 4 apps , laravel 5 apps laravel collective installed): http://laravel-recipes.com/recipes/184/generating-a-link-to-a-css-file also, think you'd want learn how blade template system works.

python - get mongodb "_id" in django template -

Image
my question related this question . i trying display _id of mongo database in django template last 2 days unable it. this error: this code trying: views.py register = template.library() port = 27019 client = mongoclient(port=port) mydb = client.catalogdb data = mydb.productcatalog def index(request): values = data.find() @register.filter("mongo_id") def mongo_id(value): return str(value['_id']) return render(request, 'product.html', {"values":values}) product.html <ul class="row catalog-list"> {% value in values %} <li class="col-xs-12 col-sm-6 col-md-4 col-lg-4"> <div> <img src={{value.image_url_medium}}> <label> <input type="checkbox" name="sync-check" class="catalog-checkbox"> </label> </div> <div> {% csrf_token %} ...

javascript - Meteor cannot configure login (accounts-google, etc...) -

i added following packages: accounts-password accounts-ui accounts-google accounts-facebook accounts-twitter but when click of 3 red button configure google, facebook or twitter, buttons absolutely nothing, can't configure app... screenshot any idea ? i noticed problem iron router , didn't understand removing {{> yield}} main.html solved problem. cheers !

android - RTSP Url of video not working in VideoView -

i creating video playing app youtube. have extracted video data using gdata api , got 3gp url format 1,6. got extracted media:group --> media:content element. device info android 4.0.3 , model micromax p350. these video working in vlc player not in videoview enter code here in app. here code: <linearlayout android:id="@+id/linearlayout01" android:layout_height="fill_parent" android:paddingleft="2px" android:paddingright="2px" xmlns:android="http://schemas.android.com/apk/res/android" android:paddi`enter code here`ngtop="2px" android:paddingbottom="2px" android:layout_width="fill_parent" android:orientation="vertical"> <videoview android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/videoview" /...

sql - Translate mssql trigger to mysql trigger -

i migrated mssql mysql , using insert trigger. want convert mssql server trigger script mysql. help? create trigger trgautoinsert on dbo.profile after insert declare @var1 int ,@var2 int ,@var3 char (100) ,@var4 char (100) , @var5 char (3) select @var1 = profile_id, @var2 = profile_id, @var3 = fname , @var4 = fname ,@var5 = fpage profile begin if @var5 = 'yes' insert friends (req_id,resp_id,req_name,resp_name,fpage) values (@var1,@var2,@var3,@var4,'yes') create trigger trgautoinsert after insert on t1 each row begin declare var1 int; declare var2 int; declare var3 char(100); declare var4 char(100); declare var5 char(3); select profile_id, profile_id, fname, fname, fpage profile ...

cmake - How to set the shared library soversion at the build-time? -

this sets version @ cmake-time: set_target_properties(${this_lib} properties soversion ${project_version}) but use scripts extract info git (is dirty or wrong branch, etc). for example, can generate version.cpp info @ build-time: add_custom_command( output ${cmake_current_binary_dir}/version.cpp depends ${git_commit_dirtiness_file} command ${cmake_command} -dsrc=${cmake_current_source_dir}/version.cpp.in -ddst=${cmake_current_binary_dir}/version.cpp -p ${cmake_source_dir}/cmake/configure-file.cmake ) so executable has various information source tree state. how same kind of operation on soversion, in package lib appear libmy.so.0.0.1.sha.~dirty example?

MySQL chained select -

i have table family +----------------------------+ | id | name | age | parent | |----------------------------| | 1 | father | 60 | null | |----------------------------| | .. | ...... | .. | ..... | | n | luke | 20 | n | +----------------------------+ the column parent reference family - id . starting of father, how can select last descendant using single select query? the long way n = select * family parent = 1 , o = select * family parent = n , etc. do recursive query : select @pv:=id family join (select @pv:=1)tmp parent=@pv to last descendant use max aggregate function select max(@pv:=id) family join (select @pv:=1)tmp parent=@pv update : other way around. ancestor please test query select min(case when parent null id else @pv:=parent end) ancestor family join (select @pv:=3)tmp (case when parent null or id=@pv 1 else 0 end) = 1

assembly - Bytes of memory in the entire program -

hey guys have quick question. hoping explanation on how go doing type of question. suppose program's data , executable code require 1024 bytes of memory. new section of code must added; used various values 39 times during execution of program. when implemented macro, macro code requires 74 bytes of memory. when implemented procedure, procedure code requires 104 bytes (including parameter-passing, etc.), , each procedure call requires 9 bytes. questions such these ask, how many bytes of memory entire program require if new code added ___ (macro or procedure). any appreciated. proc: 1024 + (39 * 9) + 104 = 1479 macro: 1024 + (39 *74) = 3910

ios - Why I can't call a method stored in parent UIViewController from embedded UITableViewController? -

i have parent ui view controller , has method responsible printing data console: func printsomedata() { print("printing data") } it has container embedded uitableviewcontroller . table has pull refresh functionality implemented , prints string when user pulls table: func refresh(refreshcontrol: uirefreshcontrol) { print("refreshing!!") refreshcontrol.endrefreshing() } now want call printsomedata refresh method. this try: parent uiviewcontroller: class mainmenu: uiviewcontroller, printing{ func printsomedata() { print("some date") } } embedded uitableviewcontroller: protocol printing{ func printsomedata() } class mainmenutableviewcontroller: uitableviewcontroller { var delegate: printing? func refresh(refreshcontrol: uirefreshcontrol) { print("refreshing!!") if let _ = delegate{ delegate?.printsomedata() } refreshcontrol.endrefreshing() } but when...

How to upload image to direct link on Android -

on android i want uploading image internet after uploaded , got it's url direct link like.." http://sivertimes.com/wp-content/uploads/2016/02/apple_logo_black.svg_.png " or.." http://gloucesterstage.com/_website/wp-content/uploads/2015/06/apples2.jpg " how can this? thanks edit i find same case android, uploading photo host on imgur programatically but method old use, many codes deprecated

c# - choose only related columns ignoring rest -

i have 1 question paper when start test got next question according id topic ids randomly means topic ids alternately. suppose topic id 4 , primary keys alternatively when click next question got blank if topic id not 4 please me here code private void getquestion(int no) { //con.open(); // sqlcommand cmd = new sqlcommand("select count(topicid) quetionbank topicid='"+topicid+"'", con); // int32 count1 = (int32)cmd.executescalar(); // lbltotque.text = count1.tostring(); // con.close(); topicid=((practice_test)frm1).cmbtopic.selectedvalue.tostring(); // clear(); if (incquestion <= 40)//&& topicid!= null { string str = "select * quetionbank topicid='" + topicid + "' , quetionid='" + no + "' "; sqldataadapter da = new sqldataadapter(str, con); dataset ds = new dataset(); da.fill(d...

go - Using reflect, how do you initialize value of a struct pointer field? -

package main import ( "fmt" "reflect" ) type struct { d *int } func main() { := &a{} v := reflect.valueof(a) e := v.elem() f := e.field(0) z := reflect.zero(f.type().elem()) f.set(z) fmt.println(z) } panic: reflect.set: value of type int not assignable type *int how set *d default value use reflect you need have pointer value (*int), reflect documentation states func zero(typ type) value that: the returned value neither addressable nor settable. in case can instead use new : z := reflect.new(f.type().elem())

boolean logic - sum of minterm vs product of maxterm -

Image
given following boolean expression of f(a,b,c): f(a,b,c) = a' + b + c' of following statements is/are true above expression? (i) sop expression (ii) pos expression (iii) sum-of-minterms expression (iv) product-of-maxterms expression the model answer question i),ii) , iv) my question why iii) not 1 of answers? drew k-map , found out possible derive such sum-of-minters expression a cluster of literals in boolean expression forms minterm or maxterm only, if there literals (variables of given function or negation) included in it. a minterm product of literals of function, maxterm sum of literals of function. in k-map minterm or maxterm marks out 1 cell. in truth table maxterm or minterm matches 1 row. the following truth-table corresponds given function: index | | b | c || f(a,b,c) | term matching row/k-map cell -------|---|---|---||----------|---------------------------------- 0 | 0 | 0 | 0 || 1 | minterm: m0 = (¬a⋅¬b⋅¬c) 1 | 0 | 0 | 1 ...