Posts

Showing posts from July, 2012

apache pig - Avoiding multiple headers in pig output files -

we use pig load files directories containing thousands of files, transform them, , output files consolidation of input. we've noticed output files contain header record of every file processed, i.e. header appears multiple times in each file. is there way have header once per output file? raw_data = load '$input' using org.apache.pig.piggybank.storage.csvexcelstorage(',') do transforms store data '$output' using org.apache.pig.piggybank.storage.csvexcelstorage('|') did try option? skip_input_header see https://github.com/apache/pig/blob/31278ce56a18f821e9c98c800bef5e11e5396a69/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/csvexcelstorage.java#l85

Marketo REST API - Company API disabled error -

Image
i having trouble getting company information using marketo rest apis. (describe company » marketo developers ) everytime use call /rest/v1/companies/describe.json?access_token= i error [{\"code\":\"1018\",\"message\":\"company api disabled\"}]} however when check on user role permissions have enabled seem have access of apis. there other permissions need use company api? any appreciated. thank you the company api available on instances there no native crm sync, such microsoft dynamics or salesforce, enabled. instance has 1 of these enabled , company api not available.

Why is python setup.py saying invalid command 'bdist_wheel' on Travis CI? -

my python package has setup.py builds fine locally on ubuntu trusty , on fresh vagrant ubuntu trusty vm when provision this: sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7 sudo -h pip install setuptools wheel virtualenv --upgrade but when same on travis ci trusty beta vm: - sudo apt-get install python python-dev --force-yes --assume-yes --fix-broken - curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7 - sudo -h pip install setuptools wheel virtualenv --upgrade i get: python2.7 setup.py bdist_wheel usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'bdist_wheel' this why can not create wheel in python? related note installing wheel , upgrading setuptools. t

java - Get textView value from fragment to MainActivity -

i using fragments. have textview in fragment , want value in main activity. this fragment layout <gridlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/gridlayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginbottom="30dp" android:layout_marginend="50dp" android:layout_marginstart="55dp" android:layout_margintop="10dp" android:columncount="20" android:orientation="horizontal" android:rowcount="16" tools:context="com.lipi.worldofelements.mainfragment"> <space android:layout_width="25dp" android:layout_height="35dp" android:layout_column="2" android:layout_row="2" android:background=&q

c# - How to get selected listbox item to update another listbox? -

i'm new wpf , mvvm , hope makes sense... i have listbox of checkbox items. when check or uncheck item, want know how fire event or whatever give me ability add selected items text different listbox. here's i've done far: xaml: <listbox itemssource="{binding target}" isenabled="{binding iscontrolenabled}"> <listbox.itemtemplate> <datatemplate> <checkbox content="{binding titlename}" ischecked="{binding ischecked}" /> </datatemplate> </listbox.itemtemplate> </listbox> main viewmodel class: private observablecollection<checkserveritem> _target = new observablecollection<checkserveritem>(); small class handle checkbox events: public class checkserveritem : viewmodelbase { private bool _ischecked { get; set; } private string _title { get; set; } public bool ischecked { { return _ischecked; }

ms access - Show on Main form the value of a Text box on sub form -

i have sub form (continuous form) shows sum of fee in text box in subform footer: text5 data =sum(fee). this works correctly. can't show value in text box on main form. have tried tfees = forms!frminvoice![frminvoicedetails].form.text5 this shows nothing (null?) on main from. no errors. data subform is: select tblinvoicedetails.invoicelookup, tblinvoicedetails.disclookup, [applicantsurname] & ', ' & [applicantforenames] appname, [dbsfee]+[myfee] fee, tbldisclosure.client, tbldisclosure.payer tblinvoicedetails inner join tbldisclosure on tblinvoicedetails.disclookup = tbldisclosure.id (((tbldisclosure.payer)='client')) order [applicantsurname] & ', ' & [applicantforenames]; try: =forms!frminvoice!nameofyoursubformcontrol.form!text5 replace "nameofyoursubformcontrol" name, not name of form.

JOIN on a Table Valued Parameter - Sql Server T SQL -

i have stored procedure accepts table valued parameter. join table if has values. create proc dbo.testproc (@name uniqueidentifier = null, @hascityguids bit, @cityguids dbo.guidtabletype readonly) begin select x1 , x2 address (@hascityguids = 0 or a.cityguid in (select value @cityguids)) end the other option outer join select x1 , x2 address left outer join @cityguids cg on a.cityguid = cg.value is there faster option these 2 ? have complex query , had use filter on multiple places, slowing down query. if it's issue i've had in past, it's slow because of or here , optimizer wasn't behaving , using indexes where (@hascityguids = 0 or a.cityguid in ( select value @cityguids )) instead, ended actual if statement, like create proc dbo.testproc( @name uniqueidentifier = null, @hascityguids bit, @cityguids dbo.guidtabletype readonly) b

javascript - jscript to run at window.onload AND item.onchange -

i'm using jscript load string in several elements of array, display useful element in html. there's pulldown menu causes string change. so, need function re-run when happens. i have been able display element using window.onload and, have been able display element after pulldown menu has been changed. but, can't seem display element window.onload , subsequently after item.onchage if has suggestions, i'd grateful. here code works window.onload window.onload = function() { var selectedoptionid = jquery('select').val(); var optionpartnumber = jquery('input[name="optid_' + selectedoptionid + '"]').val(); //loads string in array , returns 2nd element var optionpartnumber = optionpartnumber.split(".")[1]; document.getelementbyid("masnum").innerhtml=optionpartnumber; } here code works pulldown.onchange jquery(function(){ jquery('.dropdownimage-format select').on('chan

cython - Extending Python 3.5 (Windows) with C++ -

my goal have ability call functions in c++ meaningful arguments. i can't subprocess.call because go main(int argc,char** argv) , have bunch of strings deal with. not want have parse matrices out of strings. i'm trying use cython because seems reasonable thing do. although there amount of guides getting cython running of them 2.7, , it's rare see 2 advise same thing. my question here know how cython running on py3.5? or know of guide or something? i'm lost. okay had pretty silly mistake, compiling msvs, spent so time trying mingw work forget that, 'msvc' trick. passersby if you're on 3.5+ should using visual studio 2015. after installing cython 'pip3 install cython', create setup.py file put this from distutils.core import setup cython.build import cythonize setup(ext_modules = cythonize( "testcython.pyx", # our cython source #sources=["rectangle.cpp"], # additional source file(

mysql - How to get the difference of a column between the most current date and the earliest date on multiple rows -

here's columns table users . +--------+-----------------+------+-----+---------+----------------+ | field | type | null | key | default | | +--------+-----------------+------+-----+---------+----------------+ | uid | int(6) unsigned | yes | | null | | | score | decimal(6,2) | yes | | null | | | status | text | yes | | null | | | date | datetime | yes | | null | | | cid | int(7) unsigned | no | pri | null | auto_increment | +--------+-----------------+------+-----+---------+----------------+ i want difference between user's current score , earliest score. tried: select co1.uid, co1.score, co1.date users co1, (select uid, score, min(date) users group uid) co2 co2.uid = co1.uid; this not work. tried select co1.uid, co1.score, co1.date users co1, (select uid, score, max(date) - min(date) users group uid) co2 co2.uid = co1.

c++ - opencv stitching with free dll -

i have function in project stitching, function working fine, simple: mat output(m_img, true), pano; // panaoramic image bool try_use_gpu = true; stitcher isticher = stitcher::createdefault(try_use_gpu); // set feature finder orb isticher.setfeaturesfinder(new detail::orbfeaturesfinder()); try{ stitcher::status status = isticher.stitch(imgs, pano); if (status != stitcher::ok) { log("error stitching - code: %d", int(status)); return -1; } } catch(exception e) { log("cannot stitch image,%s",e.what()); } the code works , able stitch images well. problem when want deploy code, realized have use non-free dll. otherwise, .exe won't run. questions are: in order use stitcher class opencv mean have pay, even if not using surf or sift algorithms? there way without using "nonfree dlls"? note: using opencv 2.4.2 . edit: tested opencv 2.4.11

bash find with two commands in an exec ~ How to find a specific Java class within a set of JARs -

my use case want search collection of jars specific class file. more specifically, want search recursively within directory *.jar files, list contents, looking specific class file. so have far: find . -name *.jar -type f -exec echo {} \; -exec jar tf {} \; this list contents of jar files found recursively. want put grep within seconed exec because want second exec print contents of jar grep matches. if put pipe , pipe grep afterward, like: find . -name *.jar -type f -exec echo {} \; -exec jar tf {} \; | grep $classname then lose output of first exec , tells me class file (the name of jar file not match class file name). so if there way exec run 2 commands, like: -exec "jar tf {} | grep $classname" \; then work. using grep $(...) in exec command wouldn't work because need {} find take place of file found. is possible? ( also open other ways of doing this, command line preferred. ) i find difficult execute multiple commands within

ruby on rails - Instance variable not showing in view forms -

i'm having issues getting instance variable show in views. i'm setting using private method, , i'm using before_filter ensure can access in 2 places need it. however, instance variable not showing in view, let alone having needed action. in controller have class userscontroller < applicationcontroller before_action :set_user, only: [:show, :edit, :update, :destroy] before_filter :set_form, :only => [ :edit_password, :edit_email ] ... def edit_password @user = current_user set_form('password') end def edit_email @user = current_user set_form('email') end ... private def set_form(edit_type) @form = edit_type end here view file <h1>edit account</h1> <title><%= @form %></title> <% if @form == 'email' %> <%= render 'edit_email_form' %> <% else %> <%= render 'edit_password_form' %> <% end %> <%= link_to 'back', user_path(@user) %> i&#

asp.net - Integration with Active Directory as a native Windows client? -

i'm working requirements specification , trying understand 1 of requirements: "integration active directory should done native windows client , not ldap-application". is there particular api, protocol or similar "as native windows client" refer to? kerberos etc? i believe requirement stated in context of authenticating users present username/password in web gui, , web application should verify details ad domain controller. if there api or protocol scenario, simple example or code pointers appreciated.

c++ - Can't figure out what's wrong not a right variable value in class after functions and so on -

heyo! got interested in c++ coding out of blue , started researching, decided write little text based pokemon game! can't figure out wrong in code, maybe i'm doing newb mistake have no knowledge for? because don't know should search in google. here code: class charmander { public: int lvl=0; int xp=0; int str=15+3*lvl; int agi=15+3*lvl; int hp=30+6*lvl; int energy=25+5*lvl; int cen=0; int nxp=1000; }cha; class squirtle { public: int lvl=0; int xp=0; int str=15+3*lvl; int agi=15+3*lvl; int hp=30+6*lvl; int energy=25+5*lvl; int cen=0; int nxp=1000; }squ; class pikachu { public: int lvl; int xp; int str=10+2*lvl; int agi=25+5*lvl; int hp=25+5*lvl; int energy=25+5*lvl; int cen=0; int nxp=1000; }pik; class bulbasaur { public: int lvl=0; int xp=0; int str=20+4*lvl; int agi=10+2*lvl; int hp=35+7*lvl; int energy=25+5*lvl; int cen=0; int nxp=1000; }bul; class currentpokemon { public: int lvl=0; int fl=0; int xp=0; int str=0; int agi=0; int hp=0; int energy=0; int cen=0; i

c# - Assembly.Load throws a bad format exception if i load a winform application -

this error code get system.badimageformatexception: impossible load file or assembly '6632 bytes loaded quick test 2, version=1.0.0.0, culture=neutral, publickeytoken=null' or 1 of dependencies. attempt load program in bad format. nome file: '6632 bytes loaded quick test 2, version=1.0.0.0, culture=neutral, publickeytoken=null' ---> system.badimageformatexception: format il not correct. in system.reflection.assembly.nloadimage(byte[] rawassembly, byte[] rawsymbolstore, evidence evidence, stackcrawlmark& stackmark, boolean fintrospection) in system.reflection.assembly.load(byte[] rawassembly) in quick_test_2.form1.button2_click(object sender, eventargs e) in c:\users\hhh\documents\visual studio 2010\projects\quick test 2\quick test 2\form1.cs:riga 175 in system.windows.forms.control.onclick(eventargs e) in system.windows.forms.button.onclick(eventargs e) in system.windows.forms.button.onmouseup(mouseeventargs mevent) in system.windows.fo

python - Ineq and eq constraints with scipy.optimize.minimize() -

i attempting understand behavior of constraints in scipy.optimize.minimize : first, create 4 assets , 100 scenarios of returns. average returning funds in order best worse d > b > > c #seed first np.random.seed(1) df_returns = pd.dataframe(np.random.rand(100,4) - 0.25, columns =list('abcd')) df_returns.head() b c d 0 0.167022 0.470324 -0.249886 0.052333 1 -0.103244 -0.157661 -0.063740 0.095561 2 0.146767 0.288817 0.169195 0.435220 3 -0.045548 0.628117 -0.222612 0.420468 4 0.167305 0.308690 -0.109613 -0.051899 and set of weights weights = pd.series([0.25, 0.25, 0.25, 0.25], index=list('abcd')) 0 0.25 b 0.25 c 0.25 d 0.25 we create objective function: def returns_objective_function(weights, df_returns): result = -1. * (df_returns * weights).mean().sum() return result and constraints , bounds cons = ({'type': 'eq', 'fun&

httprequest - Get referrer URL with parameters in Rails -

i have site basic rails scaffold, when user deletes record default action redirect home page. return list user looking at. right i'm using request.referrer technically getting referral url parameters not included... in rails logs can see "started /books/book_preview?name=hunger+games" request.referrer shows " https://x.x.x.x/books " have tried .original_url , .original_fullpath return path of current page record "/books/hungergames". tried uri(request.referrer).query @ least parameters threw error. previous path parameters like: /books/books_preview?name=hunger+games also list remote partial rendered through js. can't see url in browser url bar when highlight on or in rails logs. doesn't show in request when looked through using request.inspect . thanks in advance help! have been stuck on day! you're not getting query string url, according this answer (& docs ), need: request.fullpath #-> book_preview?na

android - Cannot find method onClick in the Activity even though it is there -

i have made button: <button android:id="@+id/btn_dialog" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/showdig" android:onclick="onclick" /> and onclick method in main activity public void onclick(view v){ log.d("click test", "log"); this.showdialog(0); } but when click button get: 03-12 16:37:24.995: e/androidruntime(755): fatal exception: main 03-12 16:37:24.995: e/androidruntime(755): java.lang.illegalstateexception: not find method onclick(view) in activity class com.example.telefon.mainactivity onclick handler on view class android.widget.button id 'btn_dialog' 03-12 16:37:24.995: e/androidruntime(755): @ android.view.view$1.onclick(view.java:2670) 03-12 16:37:24.995: e/androidruntime(755): @ android.view.view.performclick(view.java:3110) 03-12 16:37:24.995: e/a

php - Implement secure login in Codeigniter test with Wireshark -

today try test website build codeigniter. try check using wireshark (for network administrator). in traffic, still see username , password login. maybe ideas solve problem. maybe else have problem too. here controller public function val() { $this->form(); if($this->form_validation->run()==false) { $this->load->view('form_login_val'); }else { $username = $this->input->post('username'); $password = $this->input->post('password'); $cek = $this->m_login->takevalidator($username, $password ); if($cek <> 0) { $this->session->set_userdata('validator_status', true); redirect('home/validate'); } else { $this->session->set_flashdata('gagal_login', "username atau password yang anda masukkan salah

Do-while loop to erase cells with certain values in Excel -

i want delete cells have '+' , '-' in d column. i've tried following macro, thought work, nothing happens. sub dowhile4() 'replace blank spaces underscores in range of cells, using vba loops; or 'remove blank spaces in range of cells, using vba loops. dim icell range dim textstring string dim n integer 'icell cell in specified range contains textstring 'textstring text in cell in blank spaces replaced 'underscores. n position of blank space(s) occurring in textstring each icell in activesheet.range("d2:d34") textstring = icell n = instr(textstring, "+") 'the vba instr function returns position of first occurrence of string within 'another string. using determine position of first blank space in 'textstring. while n > 0 textstring = left(textstring, n - 1) & right(textstring, len(textstring) - n) 'this line of code remove blank spaces in

hibernate - onetomany unidirectional with jointable setup using jpa -

i have 2 entities namely customer , order in onetomany relationship. 1 customer can have multiple orders. since needed relationship unidirectional, using jointable. i able add entries customer entity using jpa. able add entries order entity using jpa. i wondering how connect 2 data. let's have 1 entry in customer table , 2 entries in order table. associate these 2 entries in order table 1 entry in customer table. currently, don't see entries in jointable customer_order. how make association? guess while adding orders order table, have mention customer id number somehow. not sure how that. there criteria query in jpa? thanks. customer class - @entity public class customer implements serializable { @id @generatedvalue(strategy = generationtype.table, generator = "generatorcustomer") @tablegenerator(name = "generatorcustomer", allocationsize = 1) @column(name="customer_id") private long id; public long getid() {

r - Color mismatch using rgl -

i using rgl create scatterplot of points imported .csv dataset. colors i'd points set in dataset. works fine, except when scatterplot displayed colors of points not match colors defined in data. e.g., points designated "blue" might green, , points designated "yellow" might show red. data=read.csv("explayout.csv", header = true) x=data$x y=data$y z=data$z color=data$color plot3d(x=x, y=y, z=z, type="s", col=color) this due read.csv converting strings factors see difference in reproducible example library(rgl) x<-1:5 y=1:5 z <- 1:5 colors <- c('red','green','blue','orange','purple') plot3d(x=x,y=y,z=z,col=colors, type = 's') colorsf <- factor(c('red','green','blue','orange','purple')) plot3d(x=x,y=y,z=z,col=colorsf, type = 's') so, either read in color character column using stringsasfactors=false or coerce char

android - "Layout or its parent is useless". How to avoid this? -

Image
i have 2 bordered textviews center vertically , horizontally, side side shown in following image: on top of each of these 2 textviews, have add 't' textview on bottom left , unit on bottom right ('uv/m'). end following layout xml code: <linearlayout android:id="@+id/layout_small_rectancle" android:layout_width="match_parent" android:layout_height="@dimen/drv3lite_small_rectangle_height" android:baselinealigned="false" android:layout_centervertical="true" android:orientation="horizontal" > <!-- small rectangles. defines whole width --> <relativelayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:orientation="vertical" > <!-- small rectangle (left) --> <relati

xamarin - Mvvmcross Android - Error Inflating Class: ClassNotFoundException -

i getting error in onviewmodelset() function when trying inflate xml file. when calling layoutinflater inflater = layoutinflater.from(this); view mainview = inflater.inflate(resource.layout.main, null); i getting "java.lang.classnotfoundexception: mvx.mvxbindablelistview" here whole exception: android.views.inflateexception: binary xml file line #1: error inflating class mvx.mvxbindablelistview @ android.runtime.jnienv.callobjectmethod (intptr,intptr,android.runtime.jvalue[]) [0x00024] in /users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/mono.android/src/runtime/jnienv.g.cs:145 @ android.views.layoutinflater.inflate (int,android.views.viewgroup) [0x0003e] in /users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/mono.android/platforms/android-12/src/generated/android.views.layoutinflater.cs:543 @ androidcornerstonemobile.mainview.onviewmodelset () [0x00010] in c:\users\david\documents\work\androidxamar

Website Loading Problems -

so have website, tildetictac.atwebpages.com gives me unable connect error when access pc on mediacom wifi, can access fine phone, on verizon 4g lte. able access site last night. i error message: connection has timed out the server @ tildetictac.atwebpages.com taking long respond. the site temporarily unavailable or busy. try again in few moments. if unable load pages, check computer's network connection. if computer or network protected firewall or proxy, make sure firefox permitted access web. and dashboard hosting provider says good, there no firewall on site , plain ole windows defender on pc. there no firewalls on phone. i'm not sure how diagnose problem. error message vague, every other website works fine both computer , phone. there unique problems websites using free subdomains? hosting company reputable , says site fine doubt problem on there side, have tried multiple browsers on pc , don't have besides default browser settings. , websites ge

postgresql - What's the "E" before a Postgres string? -

i reading postgres/postgis statement this: select st_asbinary( st_geomfromwkb( e'\\001\\001\\000\\000\\000\\321\\256b\\312o\\304q\\300\\347\\030\\220\\275\\336%e@', 4326 ) ); the above creates known binary (wkb). haven't seen specific way of quoting here string single quoted e preceding beginning quote. what format called? , formatting rules this? e.g. 336%e@ @ end special or binary value? this postgres9.3/9.4; postgis 2.1. as per postgresql documentation http://www.postgresql.org/docs/9.0/static/sql-syntax-lexical.html (emphasis mine) postgresql accepts "escape" string constants, extension sql standard. an escape string constant specified writing letter e (upper or lower case) before opening single quote , e.g., e'foo'. (when continuing escape string constant across lines, write e before first opening quote.) within escape string, backslash character () begins c-like backslash escape sequence, in combination of backslash

java - Running Threads on a File Method -

hi try run thread on "threadedsort", can not use traditional void run method because returns void. tried using synchronised method don't think made difference...same reentrant method, don't know i'm doing wrong. private static string[] getdatathread(file file) throws ioexception { arraylist<string> data = new arraylist<string>(); bufferedreader in = new bufferedreader(new filereader(file)); // read data file until end of file reached while (true) { string line = in.readline(); if (line == null) { // end of file reached break; } else { //synchronized(line){ lock.lock(); try{ data.add(line); }finally{ lock.unlock(); } //} } } //close

html - How to put two div boxes side by side -

Image
so i'm quite new writing codes(about few weeks) , i've hit wall while writing codes website. want have layout such this can't figure out how put 2 boxes side side(one box video explaining website, other box sign registration form.) want them next each other, inch separation between boxes. i need width of website? right looks header doesn't fit on page, causing horizontal scroll. kinda want entire website looks 1 big box, , want content inside box. can please me? appreciated. thank in advance. it's quite simple: http://jsfiddle.net/kkobold/qmql5/ <div id="header"></div> <div id="container"> <div id="first"></div> <div id="second"></div> <div id="clear"></div> </div> -- #header { width: 100%; background-color: red; height: 30px; } #container { width: 300px; background-color: #ffcc33; margin: aut

Explanation needed for this Ruby challenge -

i need understanding code: def simpleadding(num) sum = 0 (num + 1).times |x| sum = sum + x end return sum end simpleadding(12) #=> 78 simpleadding(140) #=> 9870 i not sure of method. why method written way is? why sum on first line set 0 ? , why sum = sum + x used on third line? in ruby, def keyword delimits start of method , in case named simpleadding . takes 1 argument (in parentheses) named num . in method body, variable sum given initial value of 0 . the line containing (num + 1).times |x| tells ruby execute code between do , end keywords set number of times (an iterator ), in case num + 1 . remember, num represents value received in form of argument when method called. on next line, variable sum (initialized 0 @ beginning of method) assigned value of plus x . next line, our iterator end s. finally, return value stored inside of variable sum . and, end of our method. enjoy learning ruby!

templates - C++ argument should be passed by value, but compiler sees it as reference -

so weird behaviour not understand. have: template <typename t> node node::apply() { return ptr->graph->derived_node(std::make_shared<t>(ptr->graph, this)); } template <typename t> node apply(node parent1, node parent2){ graphinptr graph = parent1.ptr->graph; return graph->derived_node(std::make_shared<t>(graph, parent1, parent2)); } template <typename t> node apply(nodevec parents){ graphinptr graph = parents[0].ptr->graph; return graph->derived_node(std::make_shared<t>(graph, parents)); } i have this: node gt(node node1, node node2){ return apply<greaterthan>(node1, node2); } however, here compiles error: node node::gt(node node) { return apply<greaterthan>(node(this), node); } the error is: error: no matching function call ‘metadiff::node::apply(metadiff::node, metadiff::node&)’ return apply<greaterthan>(node(this), node); note: candidate is: n

android - Skipping an activity in a sequence of activities (including a facebook activity) -

i creating android app action bar sherlock library. action bar has 3 tabs, 1 tab requires user login via facebook. there 3 activities in login process: step 1 - user clicks on image button (facebook) in 1 of action bar tabs, calls facebook login activity. step 2 - facebook login activity shows facebook web view, stores users details in shared preferences , calls final activity step 3 - final activity displays data belonging user , user can logout activity. question: is possible skip activity when going i.e if user in final step (3) when press button go step 1. step 2 not in sequence when user has logged in. and in addition possible skip step 1 - step 3 if user has logged in? i've thought of overriding button in step 3 wanted concrete thoughts on i'm still new android. if situation have overridden onbackpressed method or can try hoan nguyen's solution. if user has logged in can check access token in shared preferences(if have stored on successf

How to Count Children Nodes on Javascript Fancytree? -

Image
i created category tree using fancytree drag & drop functionality like now, want set limit child node. if parent node have 3 child node not able create new child not example category parent category child category allowed child category allowed child category not allowed move like create javascript this. dragdrop: function(node, data) { if( node.getlevel() >= 3 ){ return false; } console.log( node ); console.log( data ); var parentnodekey = node.key; var sourcenode = $(data.helper).data("ftsourcenode"); if( !data.othernode ){ var title = $(data.draggable.element).text() + " (" + (count)++ + ")"; node.addnode({title: title}, data.hitmode); return; } data.othernode.moveto(node, data.hitmode); } this working fine when move single category. not working when move "moved node" category because category have 2 child node , child node have 2 child nodes like i move "moved node" , workin

Using non-variable in file path -

i want make file path changeable user. far can tell has static in order so. here got. private string texturepath; more code... public string gettexturepath() { return (string)texturepath; } public void onupdate() { super.onupdate(); this.texture = "/adventure/" + this.gettexturepath() + ".png"; } there multiple objects, , when using static variable changed of theirs same, without being able change them individuality. you need send parameter method. public void onupdate(string path){ super.onupdate(); this.texture = path + this.gettexturepath() + ".png"; } static vars belong class, not instances.

android - Coordinator Layout with RecyclerView -

i using coordinatorlayout recyclerview .the app runs fine problem the view should scroll items in recyclerview .in case have 3 items cordinatorlayout scroll recyclerview till snap top because of getting below part white listsize 3. xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.appbarlayout android:id="@+id/app_bar_layout" android:layout_width="match_parent" andro

horizontal scrolling - How to swipe pdf pages horizontally in android using MuPDF library -

i have built mupdf source following these steps http://www.mupdf.com/docs/how-to-build-mupdf-for-android . have integrated in app , working fine. in page scroll vertically want scroll horizontally. please me possible or not , if possible give me hint or if other solution thanks. you can use mupdfpageview instead of mupdfreaderview , manage horizontal scroll manually.

mysql - select last record in each group for large database -

i want fetch last record in each group. have used following query small database , works - select * logs id in ( select max(id) logs id_search_option = 31 group items_id ) order id desc but when comes actual database having millions of rows ( 80,00000+ rows ), system gets hanged. i tried query, gives result in 6.6sec on average -- select p1.id, p1.itemtype, p1.items_id, p1.date_mod logs p1 inner join ( select max(id) max_id, itemtype, items_id, date_mod logs id_search_option = 31 group items_id) p2 on (p1.id = p2.max_id) order p1.items_id desc; please ! edit:: explain 2nd query id select_type table type possible_keys key key_len ref rows 1 primary <derived2> null null null null 1177 using temporary; using filesort 1 primary p1 eq_ref primary primary 4 p2.max_id 1 2 derived logs

Upload image path to server android json -

i have tried lot of examples , watched many videos , done stackoverflow, not getting want. 1] want upload image path server . 2] php query required image of type file, cant send string. need upload image file path. know how send string , decode image.but have no idea how send image file path , image. plz me this,i in big trouble. things have tried : private static final int pick_from_camera = 1; private static final int pick_from_file = 2; private string imgpath = null; private uri mimagecaptureuri; private string encodedimage; @override public void onclick(view v) { // onregisterbuttonclick(); imgpath = null; intent intent = new intent(); intent.settype("image/*"); intent.setaction(intent.action_pick); startactivityforresult( intent.createchooser(intent, "complete action using"), pick_from_f