Posts

Showing posts from April, 2014

Accesing access 2003 application in workgroup -

i have application shared in workgroup. app shared workgroup users. when 1 user connected on application no other users can connect on application. tables linked well. if 1 user have opened application when other user start application on computer application hanged. when first user close application hanged application opens in moment on other user computer.

specifying AngularJS controller: benefits using ngController vs. $routeProvider -

there 2 ways (afaik) associate controller view template/partial: route specified in $routeprovider , ngcontroller directive. (but not exclusively) simple routing, there benefit/efficiency of 1 on other? my project uses $routeprovider approach, i've been given task of nesting views. seems simple enough nginclude, long partial specifies ngcontroller. if think of view including scripts self-contained package, developed single person or team, ngcontroller way go, imho. $routeprovider on other hand provides advanced features injection of values via resolve property of route. way can have ajax loaded data directly injected controller, e.g., instead of controller having itself. or have route change wait data etc. btw: if need routing , nested views can take @ angular ui-router

c# - Retrieve google contact based on contact Id -

when issue contacts request of user's contacts contacts id's of form: http://www.google.com/m8/feeds/contacts/sometestaccount%40gmail.com/base/4f822c758a541b6b reading google contacts api 3.0 bit confused on uri should use delete contact. doing: var cr = new contactsrequest(settings); var uri = new uri("http://www.google.com/m8/feeds/contacts/sometestaccount%40gmail.com/base/4f822c758a541b6b"); var contact = cr.retrieve<contact>(uri); cr.delete(contact); fails with google.gdata.client.gdatarequestexception : execution of request returned unexpected result: http://www.google.com/m8/feeds/contacts/sometestaccount%40gmail.com/base/4f822c758a541b6b?max-results=50movedpermanently what's correct way contact id , request contact deletion? in advance. i did research on , found 2 errors. 1) got "moved permanently because issued request in http , should have done in https. 2) uri format strictly : https://www.google.com/m8/feeds/co...

ssas - Data Warehouse - Multidimensional Model - Fact Table is Smaller than Dimension Table -

i working on data warehouse project customer dimension table larger fact table. dimension , fact tables created crm system. the fact table monitors activities such letter sent customer or customer calls assistance. half of customers have no activities , remaining customers have few activities; of customers have activities have single activity. i not sure if star schema best solution project. have worked on similar projects & solution. if many of dimension members not related facts @ all. sugest filter unused dimension members during etl process. so a select customer_id, name dil.customers customer_id in (select customer_id dil.calls)

python - AttributeError: 'module' object has no attribute 'error' -

i have following code in order create socket: #!/usr/bin/python import socket import sys try: s = socket.socket(socket.af_inet, socket.sock_stream) except socket.error, msg: print 'failed create socket. error code: ' + str(msg[0]) + ' error message: ' + msg[1] sys.exit(); print 'socket created!' but have following error: attributeerror: 'module' object has no attribute 'error' you have different module named socket on path. did not import stdlib module because being masked. print out filename of masking module locate it, rename it: print socket.__file__

javascript - Dynamic routes with static parts on express js -

i'm trying path express catches types of url: /events/0.json what i've tried is... (and it's not correct): router.put('/events.json/:id.json', islogged, events.update); is possible express? yes, catch pattern x.json x 1 or more characters. so /events/0.json save '0' in req.params.id. note id string, not number. have convert if want number number arithmetic or put in database number/int type

.net - Reference a workflow activity from a different project within the same solution -

Image
how can reference workflow activities different sharepoint project within same solution? what i've tried: i created new sharepoint 2013 project , called "referencingtest". added workflow it. then, created different sharepoint 2013 project within same solution , called "frameworktest". added new workflow activity called "frameworkactivity". now want use "frameworkactivity" within "referencingtest" project. can see below, it's added references. it's visible in toolbox. when trying drop activity workflow, mouse icon changes show not permitted. as can see below, "referencingtest" has reference "frameworktest" project. i've tried adding frameworkactivity referencingtest project, , tried adding reference in xaml referencingtest workflow. other ideas? try adding frameworkactivity assemly gac. take assembly bin\debug\partitionedworkflowbuild\frameworkactivity.dll not bin\debug fol...

javascript - Do you really need a width on floated element? -

say have div ( id="toolbar" ), , inside toolbar have div ( id="buttonholder" ) contains 2 buttons. if float #buttonholder right , don't set explicit width on it, kosher? i've read on stack overflow should set width on floated element. buttons text might change, save apply, , don't want have adjust #buttonholder 's width every time. i thought setting #buttonholder 's width auto , browser default seems unnecessary set it's width auto. i'm worried browser might not float #buttonholder way think should. a change "save" "apply" isn't going take more room, honest. in principle, yes should set width - if don't, have button float:left; , <div> float:right; . if don't set widths, they're not going take full screen width, elements put in below going try position in gap between two. it idea have 100% width container element particular scenario prevent described effects.

memory - Facing Problems while displaying entire hashmap - java out of heap space -

public static void main(string args[]) throws filenotfoundexception, ioexception { filereader in = new filereader("/home/aoblah/downloads/file1.txt"); bufferedreader br = new bufferedreader(in); // scanner in = null; string answer = null; string verb = null; string line = null; string [] split_npn = null; string [] split_pn = null; string [] split_dp2 = null; string [] split_dp3 = null; hashmap<string, hashmap<string, arraylist<string>>> hmap = new hashmap<string, hashmap<string, arraylist<string>>>(); try { while ((line = br.readline()) != null) { if(line.contains("verb")) { verb = line.substring(0, line.indexof("(")); if(line.contains("npn")){ string test = line.substring(line.indexof("npn")); answer = test.substring(test.index...

go - Can't use struct from own package -

i created following file structure in $gopath/src bitbucket.org/myname/projectname i have follwoing files here projectname - controllers/ - mecontroller.go - app.go in app.go i'm importing controller that: import "bitbucket.org/myname/projectname/controllers" and in main func i'm trying use it's method. mecontroller = new(controllers.mecontroller) m.get("/", mecontroller.index) my mecontroller.go looks this package controllers type mecontroller struct { } func (controller *mecontroller) index () string { return "hello world" } but i'm getting error: ./app.go:5: imported , not used: "bitbucket.org/myname/projectname/controllers" ./app.go:12: undefined: mecontroller i don't have idea how work. any ideas? thanks! in go, every symbol starts lowercase not exported package. call struct mecontroller , you'll fine.

PHP Multidimensional array within nested foreach loop -

working on wordpress metabox-plugin , trying save metadata multidimensional array (in text explode later on). this code: function wordpress_metabox() { $event_adress = explode('|', get_post_meta($post->id, '_event_adress', true)); foreach ($event_id $key => $id){ echo '<div class="event"> <div class="ticket"> <input type="text" name="_event_adress[]" value="'.$event_adress[$key].'" /> <input type="text" name="_event_price[]" value="'.$event_price[$key].'" /> </div><!-- end .ticket --> <div class="ticket"> <input type="text" name="_event_adress[]" value="'.$event_adress[$key].'" /> <input type="text" name="_event_price[]" value="'.$event_price[$key].'" /> </div><!-- end .ticket --> ...

How to make an android service that runs a notification persistent -

i want service keep running when app killed phone(when needs ram other apps). is there way this? no, can make service persistent if developing system apps. these services un-killable.

Ternary Plot in R -

Image
sincerely don't know how because i'm new r , codes seems confusing. saw following codes on website , trying apply own work. #load data df <- read.table(file = "~/desktop/pps-data.txt", header = t) #create plot , store plot <- ggtern(data = df, aes(x = xyp, y = xo, z = xy)) + geom_point(aes(fill = root), size = 4, shape = 21, color = "black") + ggtitle("pps 3-state model") + labs(fill = "root states") + theme_tern_rgbw() + theme(legend.position = c(0,1), legend.justification = c(0, 1)) the text file used not available, couldn't file know how file arranged. here data: gravel sand mud 0.95 93.55 5.49 8.06 44.38 47.55 1.76 79.35 18.89 10.11 87.37 2.53 1.35 90.03 8.62 6....

rm - bash script that delete file according to date in file name -

i busy writing bash script can delete file according date in file name example xxxxxxxxx140516.log. should delete file day after 16 of may 2014. script read file character 25 because date start , should regular checks see if there old files. current script looks this: #!/bin/bash rm *$(date -d "-1 day" +"%y%m%d")* the problem script if computer not , running couple of days not delete old files past date , not start on character 25. please help, thanks for day in {1..7}; rm -f ????????????????????????$(date -d "-$day day" +"%y%m%d").log done this allow script not running week; can change range handle longer periods. there 24 ? characters in wildcard, find date starting @ character 25. the -f option keeps rm printing error message if no matching files found. warning : prevents asking confirmation if don't have write permission file. the notation {start..end} expands sequence of numbers start end , {1..10} sh...

android - ListView duplicate content after notifyDataSetChanged -

i'm designing listview powered custom adapter. in fragment, assign adapter in onactivitycreated() : private list<datas> values = new arraylist<datas>(); private myadapter adapter; @override public void onactivitycreated(bundle savedinstancestate) { adapter = new myadapter(values, getactivity()); listview.setadapter(adapter); .....} later in app, load datas internet, , put values : while(loop on every datas items) { values.add(new datas(...)); } adapter.notifydatasetchange(); when user scrolls down, load more items (thanks onscrolllistener , record), previous snippet called again. basically, before update scrolling, have : a, b, c, d, e, f. after update, have a, b, c, d e, f, a, b, c, d e, f, g, h, i, j, k ... the first values appears twice, instate of append @ end. thanks reading , :) edit : re-considered class, new adapter , everything. now, without rational explanation, works. anyway ;) that's because downloading exist...

authentication - Upload to Google Drive use C# -

i have problem. use c# .net 2013 windows form application. want upload google drive file of user selected.(the user cannot have gmail account.) project can work in copmuter .exe. however, project wants login in each case when try. when logged in, project wants allow me. don't want this. users select files want send , after click on send button. users should not see question. selected file should sent automatically. how can this? thanks help. emrah. it sounds want end users upload files single google drive account. in case should using service account , allows application have it's own account without prompting user authorization.

c# - Make scrollable dynamic list of objects in Windows form -

i make simple windows form application displays list of persons. list dynamic (coming webservice). for example, assume have class person properties id , age , name , email . code make request webservice , retrieve list<person> list = ...; in gui, show person in table-like, scrollable structure (each row person). important me can design rows myself , not use boring basic list text only. example, there should contact button in every row in order contact person email. or 1 column contain user image etc. question what common way that? use table layout panel? there tutorials out there show workflow of setup? is there way design 1 row in visual studio designer , dynamically generate others pattern? i appreciate tips. i think datagridview you're looking for. can add buttons, checkboxes, ect... table like, , can sorted if needed.

debugging - How to passing input data in GDB mode for programming C. Already passed parameters and run program -

i know how pass parameters in gdb mode running: "run parameters". however, when continuing debug using n or s go, pass data program, let text/string. example, want send string "testing" program because program waits receive command console. if type "testing" "undefined command: "testing". try help". (gdb) b 100 (gdb) run "pass parameters program here" (gdb) n (gdb) want send string program, how can it? so how can send text program while debugging gdb in step mode? much. for real, type in. sample session: paul@local:~/src/c/scratch$ gdb ./deb gnu gdb (gdb) 7.4.1-debian copyright (c) 2012 free software foundation, inc. license gplv3+: gnu gpl version 3 or later <http://gnu.org/licenses/gpl.html> free software: free change , redistribute it. there no warranty, extent permitted law. type "show copying" , "show warranty" details. gdb configured "x86_64-linux-gnu". bug reporti...

Capistrano Error: '/usr/bin/env ruby : No such file or directory' -

when try restart unicorn using capistrano : $ cap production deploy:restart_unicorn i got error: debug [c65b4a92] /usr/bin/env: debug [c65b4a92] ruby debug [c65b4a92] : no such file or directory my environment: mac osx 10.9.2 capistrano version: 3.2.1 (rake version: 10.3.1) rvm 1.25.25 (stable) ruby 2.1.2p95 rails 4.1.1 bundler 1.6.2 my server environment: ubuntu 14.04 lts (gnu/linux 3.13.0-24-generic x86_64) my config/deploy.rb: lock '3.2.1' set :application, 'my_app' set :repo_url, 'git@gitrepo.com:my_app.git' set :deploy_to, '/var/www/my_app' set :linked_files, %w{.env} set :linked_dirs, %w{bin log tmp/pids tmp/cache public/system} set :rvm_ruby_version, '2.1.2' namespace :deploy desc 'restart application' task :restart_unicorn on roles :app, in: :sequence, wait: 5 execute 'service unicorn upgrade' end end after :publishing, :restart_unicorn end my unicorn init...

tomcat7 - Jmeter keeps failing -

i have simple web application checks price of books. web application called books. using jmeter test performance aspects application. have created thread group in have simple controller in have sampler http request. have following tree in jmeter thread group simple controller books in books pass in following values in parameter(price) , value 40 when run tests error message thread name: thread group 1-1 sample start: 1970-01-01 10:00:00 est load time: 0 latency: 0 size in bytes: 1098 headers size in bytes: 0 body size in bytes: 1098 sample count: 1 error count: 1 response code: non http response code: java.lang.illegalargumentexception response message: non http response message: protocol = http host = null response headers: httpsampleresult fields: contenttype: dataencoding: null not sure doing wrong. tomcat server running application works fine. new jmeter not it. check server name, port number, method , path correct. no...

android - How to list all the KEYS packed in a bundle? -

i tried below code, still did not find method lists contained keys in bundle. javacode: private void unpackbundle() { // todo auto-generated method stub set <string> mbundlekeysset = this.mbundle.keyset(); int size = mbundlekeysset.size(); toast.maketext(getapplicationcontext(), size+" keys",toast.length_long).show(); if ( mbundlekeysset.iterator().hasnext() ) { //here should display list of contained keys //in bundle } } actually, found answer: private void unpackbundle() { // todo auto-generated method stub set <string> mbundlekeysset = this.mbundle.keyset(); int size = mbundlekeysset.size(); toast.maketext(getapplicationcontext(), size+" keys",toast.length_long).show(); toast.maketext(getapplicationcontext(), mbundlekeysset.tostring() ,toast.length_long).show(); }

c# - How do i display the first item in the already? -

this question exact duplicate of: how set item in combobox “selectedtext” property of combobox dynamically in load 3 answers how display first item combobox ? combobox empty when click on collapse list see list of items. for (int = 0; < 9; i++) { combobox1.items.add("reduced by: " + i.tostring()); } if mean select first item in combobox can this: combobox1.selectedindex = 0;

jQuery echo a statement in a textbox if a value is greater than another -

i have code calculates mileage both point , point b. if mileage less 75 miles away either point or point b, want return "free" however, if more 75 miles away both want return statement "you charged expenses". i thought handle simple if, else if , else statements, it's not working @ all: function initialize() { directionsdisplay = new google.maps.directionsrenderer(); } var directionsservice = new google.maps.directionsservice(); var directionsservice2 = new google.maps.directionsservice(); function calcroute() { var distance1input = document.getelementbyid("distance1"); var mileageinput = document.getelementbyid("mileage"); var start = "de75 7ah"; var end = document.getelementbyid("end").value; var request = { origin:start, destination:end, travelmode: google.maps.directionstravelmode.driving }; directionsservice.route(request, function(response, status) { if (status == google.maps.directionsstatus.ok) { directi...

javascript - C# Populate generated datagrid using Selenium WebDriver -

i have page seems generate spreadsheet-style grid table using javascript. trying populate cells, cant locate elements using selenium. when inspect cell wish populate using firebug can see has long dynamic id selenium cannot detect. visible when use firebug, however, when right-click + view source, there no grid visible. i have tried selectors (id, css, xpath, etc) , have tried populating using ijavascriptexecutor. nothing seems work, , ready give up. i have tried running ide; fails when comes dynamic fields. any assistance appreciated. found work around (its kind-of obvious , not ideal, meh...) instead of targeting grid programmatically, simulated keystrokes using instance of actions: actions actions = new actions(driver); actions.sendkeys(keys.tab).build().perform(); actions.sendkeys("text enter").build().perform();

c++ - Program crashes when changing status bar text from thread -

i'm using qt interface , winapi threading , index files on hard drives. have status bar qlabel show directory indexing. change qlabel text pass pointer parameter function runs in thread. program crashes when changes qlabel text, if run without changing qlabel text executes propely. debugger stops @ last row of following function: ntdll!rtlpsetuserpreferreduilanguages 0x77d656a9 <+0x38ae> add (%eax),%al 0x77d656ab <+0x38b0> je 0x77d656c4 <ntdll!rtlpsetuserpreferreduilanguages+14537> 0x77d656ad <+0x38b2> mov 0x8(%ebp),%eax 0x77d656b0 <+0x38b5> movb $0x1,0x77d7f0a5 0x77d656b7 <+0x38bc> mov %eax,0x77d7f0a0 0x77d656bc <+0x38c1> int3 0x77d656bd <+0x38c2> movb $0x0,0x77d7f0a5 the function runs in thread uintptr_t __stdcall threadfunction(void* labelptr) { for(std::list<std::wstring>::iterator = discletters.begin(); != discletters.end(); ...

Certificate Error while running Selenium test cases in IE -

i trying run selenium test cases in ie,and facing issues first, element.click() not working sometimes. according to observation when try else while script running in machine, it's not working, didn't face kind of issue in firefox , chrome. second, there links in application when click on them window come up. script, when use click() function it's not able click on link. issue not there in firefox or chrome. third, in application getting certificate exception. avoid used: desiredcapabilities caps = desiredcapabilities.internetexplorer(); caps.setcapability(internetexplorerdriver.introduce_flakiness_by_ignoring_security_domains, true); system.setproperty("webdriver.ie.driver", "browserdrivers/iedriverserver.exe"); web = new internetexplorerdriver(caps); web.manage().timeouts().implicitlywait(120, timeunit.seconds); web.manage().timeouts().pageloadtimeout(120, timeunit.seconds); web.get(url...

firewall - How can I programatically manage pf rules on the fly? -

i need query, modify, add , delete rules. haven't found api's doing this. the closest i've found pfctl tool using pfctl -s , and pfctl -f dump rules, modify the, , readd them. solution i've considered regenerating entire ruleset , track changes separately. need careful drop few packets possible. an api in c great; libraries in language fine too. there no "official" api, can take @ pfctl source code , see how interfaces kernel.

javascript - How to show a document from Alfresco in own application? -

i making application gets data alfresco , want show document (which in alfresco) on page controls going previous , next page. found jquery media library, opens pdf files. question is, best way of showing .doc, .docx, .ppt, .pptx, etc. files without going alfresco itself? i've tried prism viewer , google docs viewer both cant open files alfresco reason. thanks! you should take @ pdf.js - pdf.js browser-side pdf viewer. if you're using current head of alfresco community, alfresco transforms content automatically pdf , stores pdf rendition (as new new alfresco share viewer uses pdf.js internally). there community addon alfresco share 4.2 uses pdf.js document viewer & contains pdf rendition configs. should starting point: https://github.com/share-extras/media-viewers or checkout current head: https://github.com/alfresco/community-edition here current thumbnail-service-context.xml pdf rendition defined: https://github.com/alfresco/community-edition/blob/mas...

ruby on rails - How to manually send a Devise email? -

i want manually send devise confirmation email user of app. this: u = user.last devise::mailer.confirmation_instructions u but devise's confirmation_instructions takes 3 parameters, second being token (according documentation) , third being hash. how in order able send these emails? here’s confirmationscontroller sends email : self.resource = resource_class.send_confirmation_instructions(resource_params) have tried this? u.send_confirmation_instructions edit add devise::mailer -based method: u.send(:generate_confirmation_token) devise::mailer.confirmation_instructions(u, u.instance_variable_get(:@raw_confirmation_token))

c++ - "ambiguous overload for 'operator<<'" *without* a catch-all overload -

so trying implement xorshift prngs parameterised stl-style class random , e.g. std::mersenne_twister_engine , can use quite convenient distributions random library etc. anyway, have problem overloading operator<< and, frankly, completely stumped. the class parameterised this: template <size_t __n, int_least8_t __a, int_least8_t __b, int_least8_t __c, uint64_t __m> class xorshift_engine { ... the overload declared friend inside class this: template <size_t __n_, int_least8_t __a_, int_least8_t __b_, int_least8_t __c_, uint64_t __m_, typename _chart, typename _traits> friend std::basic_istream<_chart, _traits>& operator<< (std::basic_ostream<_chart, _traits>& _os, const xorshift_engine<__n_, __a_, __b_, __c_, __m_>& _x); and implementation outside class looks this: template <size_t __n, int_least8_t __a, int_least8_t __b, int_least8_t __c...

sprite kit - Porting iOS Spritekit to Android, what is animateWithTexture equivalent? -

i've created new cocos2d project android try , port across ios spritekit 2d game android , can't seem figure out how animate in android cocos2d? my code in ios want port follows: sktexture* crowtexture1 = [sktexture texturewithimagenamed:@"crow1"]; sktexture* crowtexture2 = [sktexture texturewithimagenamed:@"crow2"]; skaction* flap = [skaction repeatactionforever:[skaction animatewithtextures:@[crowtexture1,crowtexture2] timeperframe:0.5]]; [crow runaction:flap]; my cocos2d java code follows, far: cgsize winsize = ccdirector.shareddirector().displaysize(); ccsprite player = ccsprite.sprite("crow1.png"); player.setposition(cgpoint.ccp(player.getcontentsize().width / 2.0f, winsize.height / 2.0f)); addchild(player); any ideas?

windows - how to resolve this issue "the type or namespace name 'service' could not be found" in C# -

i working on project of c# using visual studio 2010, in need running services of system servicecontroller[] scservices = servicecontroller.getservices() , need manipulate result, there need these objects help, whenever declaring it's showing "the type or namespace name 'service' not found" , have added reference , using system.serviceprocess . service rsvc = new service(); list<service> rsvclist = new list<service>(); listservicesreply rreply = new listservicesreply(); can me out, how rid of this? imo, there 2 possible reasons error. in application have namespace = service. in case, compiler finds ambiguous resolve 'service'. suggested in comments, using qualified namespace help. there dependent assembly reference missing in project. in case, running msbuild more logging help. can use following command visual studio command prompt ( msdn reference) msbuild /verbosity:detailed yourpath/yoursolution.sln

php - Results filtering on mysql query left join 4 big tables -

query this: select t1.id, t1.info1, t1.info2, t1.info3, t2.info1, t2.info2, t2.info3, ........ t4.info1, t4.info2, t4.info3 table1 t1 left join table2 t2 on t2.id_key=t1.id left join table3 t3 on t3.id_key=t1.id left join table4 t4 on t4.id_key=t1.id t1.id = '1' , t1.active='1'; t1 - !1.5 milions inserts t2 - ~2 milions t3 - ~2.5 milions t4 - ~2 milions on results page want add sidebar filtering in website add in query left conditions t2.info2='3' , t3.info4='11' . take century query every time filter checked, need advice sql guru. appreciated. thanks

eclipse - Java does not find class file -

Image
i have problem running java program cli: as can see, run javac main.java main.class file. , when trying execute java main , java can't find main class. there class in eclipse: what doing wrong? you have go 1 dir cd .. , java stitching.main

onchange - Jquery Want to retrieve value and print it -

i want select change: replace value in #yourdiscount discount='' of each option <select name='purchase'> <option value='100 ' discount='95.05'>100 testów/ 1,045.50 pln</option> <option value='500 ' discount='567.39' selected>500 testów/ 4,350.00 pln</option> <option value='1000 ' discount='1,416.67'>1000 testów/ 8,500.00 pln</option> <option value='2500 ' discount='4,000.00'>2500 testów/ 20,000.00 pln</option> <option value='10000' discount='13,846.15'>10000 testów/ 60,000.00 pln</option> <option>inna ilość...</option> </select> </div> <div class='l' style='color:green;margin-top:3px'>&nbsp; <b>i rabat: <span id='yourdiscount'>567.39</span> pln</b></div> any suggestions how this? you attr('discount') of option i...

html - Photos that won't show up -

Image
i'm developing website , when have these 5 or 6 social icons 2 show up. using firefox's built-in dev console shows me 2 tags inside class="" element, this: and when @ source code shows me there 1 tag inside class="" element, example: and use css positioning them, , not other here. you have import css sheet html document doing this: <link href="linktocssfile" type="text/css" rel="stylesheet"> or using image files load photos? edit: change height , width of images 32 32px . first have add style attribute doing this: <img src="https://www.logicaltrainers.com/gallery/html5css3.png" alt="" style="height: 32px; width: 32px"> see demo here

java - is there a simple way to convert Date(sql) to following format Month(3 character) day(int) , year(2014) -

is there simple way convert date(sql) following format month(3 character) day(int) , year(int)? for example: jan 3, 2014 feb 2, 2014 have this: "2014-02-14" (i use postgresql, java , javascript on client) assuming , if want achieve in database side itself. use below sql query. lets "stack" column containing date value ie "2014-02-14" select to_char(stack,'mon dd, yyyy') testing; to_char -- feb 14, 2014

jQuery or CSS Animate - HTML Element moves down on scroll -

i'm trying set timeline, marker moves user scrolls down. i've set code follows: html <div class="boxone"></div> <div class="boxtwo"><div class="animatedcircle"></div></div> css .boxone { width: 400px; height: 4000px; background: red; float: left; } .boxtwo { width: 400px; height: 4000px; background: blue; border-left: 1px solid black; float: left; } .animatedcircle { border: 1px solid black; width: 25px; height: 25px; border-radius: 40px; position: absolute; right: 403px; top: 50px; } jquery $(document).ready(function () { var el = $('.animatedcircle'); var originalelpos = el.offset().top; // take on page //run on scroll $(window).scroll(function () { var el = $('.animatedcircle'); // important! (local) var elpos = el.offset().top; // take current situation var windowpos = $(window).scrolltop(); var fin...

java - JButton Display text in JLabel -

i develop game in first button, write word. in second button , enter letter i find word register first button. problem can not previous research do. i not understand how do, maybe me, great! sorry approximativ example : if write word first jbutton : "hello" program return _ _ _ if search "h", second button program return : h _ _ _ _ // in labelword but now, if search "e" program return e _ _ _, "h" not repost. my code, first jbutton : controllerpendu = new controllerpendu(); final jframe popup = new jframe(); this.word = joptionpane.showinputdialog(popup, "enter 1 word", null); //control lenght of word, if word < = 3 string afterctrl = a.controlew(word); labelword.settext(""); (int = 0; < afterctrl.length(); i++) { labelword.settext(labelword.gettext() + "_ "); labelword.validate(); labelcompteur.repaint(); } //counter key on word, panel top/right string ...

reactive cocoa - Is there something similar to $scope.$watch for NSMutableArray -

i've been struggling day working correct. have nsmutablearray of items. during application lifecycle, app push , pop objects in there. can on angularjs side $scope.$watch. i've been using reactivecocoa in meantime of behavior essentially i'd block fire on these events. -(void)fetchallitems; -(void)push:(id)item; -(void)pop:(nsuinteger)index; i tried reactivecocoa never fires! [racobserve(singletonstore, items) subscribenext:^(nsarray *wholearray) { nsuinteger count = [wholearray count]; [self.offercirclebutton settitle:[nsstring stringwithformat:@"%d", count]] }]; the items property declared in singletonstore object as @property (nonatomic, copy) nsarray *items; the getter , setter nsmutablearray private variable @interface shsingletonstore() { nsmutablearray *_items; } @end -(nsarray *)items { return [_items copy]; } -(void)setitems:(nsarray *)items{ if([_items isequaltoarray:items] == no){ _items = [item...

ruby on rails - bundle exec rake assets:precompile issue with the generated application.js file -

i host fulcrum app on phusion going nuts configuration issue the application picking url http://example.com/projects/4 instead of http://example.com/fulcrum/projects/4 could point mistake. tried change assets.prefix in production.rb , recompile assets changes location of assets doesn't change root url in application.js the app hosted @ http://example.com/fulcrum and rest of site functional except jquery/ajax part. setting config.action_controller.asset_host = "http://example.com/fulcrum" in production.rb should trick. if you're sending emails should set config.action_mailer.asset_host too.

Laravel ClassLoader trying to load an old version of my model -

so while decided redo 1 of models in laravel completely, wanted hold on original copy of file in case. renamed mymodel (old).php , left there in models folder next new model. now understand laravel bit better, realize wasn't great idea, in case seemed work months. today, made minor update (modifying database query) 1 of functions in new model , laravel trying load old copy of model. moved old copy out of models folder , backup folder outside of laravel application, laravel throws error: include(pathtomymodels/mymodel (old).php): failed open stream: no such file or directory referring section of classloader.php /** * scope isolated include. * * prevents access $this/self included files. */ function includefile($file) { include $file; } i tried undoing modification model, changing route , controller function name, clearing laravel's cache, clearing browser cache, using different browsers, nothing seems work except manually include model's php file before calling...

jsf - includeViewParams=true converts null model value to empty string in query string -

given <p:selectonemenu> follows. <f:metadata> <f:viewparam name="id" value="#{testmanagedbean.id}" converter="javax.faces.long"/> </f:metadata> <p:selectonemenu value="#{localebean.language}" onchange="changelanguage();"> <f:selectitem itemvalue="en" itemlabel="english" /> <f:selectitem itemvalue="hi" itemlabel="hindi" /> </p:selectonemenu> <p:remotecommand action="#{testmanagedbean.submitaction}" name="changelanguage" process="@this" update="@none"/> the corresponding managed bean : @managedbean @requestscoped public final class testmanagedbean { private long id; //getter , setter. public testmanagedbean() {} public string submitaction() { return facescontext.getcurrentinstance().getviewroot().getviewid() +...

python - where flask-login must be placed -

i want try use flask-login , have issues import. maybe put in wrong place? so, installed pip install flask-login , put in python2.7/dist-packages . , there got following: python2.7/dist-packages - flask (python package) - flask-login.py - flask-login.pyc - flask_login-0.2.10.egg-info (folder) - flask-wtf (python package) - flask_wtf-0.9.5.egg-info (folder) - flask-0.10.1.egg-info - jinja2 (python package) - jinja2-2.7.2.egg-info (folder) , on so, can see content of dist-packages, modules have python package , *egg-info folder. flask-login not have python package, 2 .py files. , therefore got unresolved import from flask.ext.login import loginmanager . in flask package have ext package init .py in it. if knows might went wrong i`ll appreciate help. btw, modules (flask, jinja, wtforms) i`ve installed pip. update sorry silly question. appears should import this: from flask_login import loginmanager . module on libraries path....

sprite kit - How to set the location of a tap -

i want set game when user taps specific point on screen dispenses skspritenode location. i've set inside touches began method: for (uitouch *touch in touches) { score = score + 1; cat = [skspritenode spritenodewithtexture:[sktexture texturewithimagenamed:@"cat.png"] size:cgsizemake(35, 35)]; cat.position = cgpointmake(cgrectgetmidx(self.frame), cgrectgetmidy(self.frame)+120); [self addchild:cat]; } which works fine , adds node touch occurred. i want added when user touches specific location, tried setting up: for (touch locationinnode:cgpointmake(cgrectgetmidx(self.frame), cgrectgetmidy(self.frame)) { score = score + 1; cat = [skspritenode spritenodewithtexture:[sktexture texturewithimagenamed:@"cat.png"] size:cgsizemake(35, 35)]; cat.position = cgpointmake(cgrectgetmidx(self.frame), cgrectgetmidy(self.frame)+120); [self addchild:cat]; } but didn't work , told me needed square bracket ] reason. how can set...

MySQL LIKE/Full String Check -

i have table save user agents mozilla, google chrome, opera etc etc strucure following [ id , user_agent , exact_match ] i want block user if uses 1 of user agent blocked in table count value of exact_match. for example, if set exact_match 1 (true) ,i want perform full string check against user agent, if set 0 (false) ,i want use in mysql query. i can if select user agents , depending on exact_match, can perform stristr function or strcmp. can done using 1 sql query , not php code? edit : checks should done case insensitive search. thank you this lot easier might think. select id, user_agent, exact_match table (exact_match = 1 , user_agent = :user_agent_exact) or (exact_match = 0 , user_agent :user_agent_like) then prepare statement bind user_agent_exact , user_agent_like strings required , away go!

AngularJS filtering between a range -

i have set range slider ranges 0 - 2hr, times calculated in mins converted hh:mm this: 10min, 20min, 1hr 20min, 2hr. but trying filter bunch of items inside ng-repeat using range specified range slider , having hard time getting working. here have done http://cdpn.io/ldusa i using http://danielcrisp.github.io/angular-rangeslider/demo/ range slider. and here code: var app = angular.module('myapp', ['ui-rangeslider']); app.controller('myctrl', function ($scope) { $scope.sliderconfig = { min: 0, max: 120, step: 10, usermin: 0, usermax: 30 }; $scope.times = [ {"time": "20"}, {"time": "50"}, {"time": "30"}, {"time": "10"}, {"time": "85"}, {"time": "75"}, {"time": "95"}, {"time": "100"}, {...

c# - How to change Textbox text with each scanned barcode and fire ontextchange event -

i trying change text inside textbox everytime barcode scanned. program able take scanned barcode , fetch data database based on barcode text using ontextchange event, when scanned barcode on second time added barcode next first barcode input. example : 00111104 0011110400111105 i facing 2 error in here: first, barcode scanned added next first one. second, ontextchange event can't fire without taking focus outside textbox. using asp.net using vb code behind. here code far: private sub selectdata() sql = "select * tbl_take [badge id] = '" + txtscanid.text + "'" cmd = new sqlcommand(sql, con) drdatareader = cmd.executereader while (drdatareader.read()) 'taking data database' end while end sub protected sub txtscanid_textchanged(sender object, e eventargs) handles txtscanid.textchanged call selecteddata() end sub i set focus on txtscanid inside page load. can me how make current barcod...

r - How to customize values on x-axis in qplot()? -

Image
i using qplot following code. qplot(topn, f1score, data = evaluation.data, geom = c("point", "line"), color= recommender, main = "f1 score...") the x-axis topn , y-axis f1score . x-axis supposed contain integer values. there's decimals shown in figure. how can customize use integer values? you can use breaks argument in scale_x_continuous . qplot(topn, f1score, data = evaluation.data, geom = c("point", "line"), color= recommender, main = "f1 score...") + scale_x_continuous(breaks=c(5, 10, 15)) also color guide not seem useful. remove legend. + scale_color_discrete(guide="none")

wcf - Communicate between two .Net Applications running on terminal services -

i have inhouse erp developed in .net , in process of developing outlook add on. need send message outlook add on running instance of erp open file. there many instances of erp on same server (1 per user using terminal services) , cant use wcf result. i want outlook add on send message instance of erp running on user session. possible wcf? or other methods can use? you can use window terminal services api session id include part of uri. eg, [system.runtime.interopservices.dllimport("wtsapi32.dll")] internal static extern bool wtsquerysessioninformation( system.intptr hserver, int sessionid, wts_info_class wtsinfoclass, out system.intptr ppbuffer, out uint pbytesreturned); hserver = intptr.zero use local server (normally wanted unless you're managing client sessions remotely) sessionid can passed in -1 (wts_current_session) current session details if you're calling inside session. i trying same (single service, 1 client per session...

android - Espresso : how to click one of image in listview? -

help!!! i want test android ui in espresso, image every time change. listview ---framelayout ---imageview ---imageview ---framelayout ---imageview ---imageview i try way, still can't click: ondata(is(instanceof(imageview.class))) .inadapterview(withid(r.id.listview)) .atposition(3) .perform(viewactions.click()); error log: com.google.android.apps.common.testing.ui.espresso.performexception: error performing 'load adapter data' on view 'with id: <2131296725>'. @ com.google.android.apps.common.testing.ui.espresso.performexception$builder.build(performexception.java:67) :doubanmovie:connectedandroidtest failed i know late others. ondata(anything()) .inadapterview(withid(listviewid)) .atposition(0) .onchildview(withid(childviewid)) .perform(click()); this click on particular view inside listview cus...

asp.net mvc 3 - Why do I get 0 match from ElasticSearch query (C#)? -

i have code should return 5 matches search. if try query in browser, 5 results: http://localhost:9200/_search?q=testing if user sense editor shows 5 results: server=localhost:9200 post _search { "query": { "query_string": { "query": "testing" } } } but c# code in controller fails match. missing? uri localhost = new uri("http://localhost:9200"); var setting = new connectionsettings(localhost); setting.setdefaultindex("videos"); var client = new elasticclient(setting); var result = client.search<searchhint>( body => body.query( query => query.querystring( qs => qs.query(keys)))); var results = new searchresults() { results = result.documents.tolist() <-- has 0 items }; edit 1: public class searchh...

Add button to java code in Android / Eclipse -

is possible automatically add buttons , lists java code fragment layout in eclipse? i thinking it's done in c# / visual studio assign name listener , rest added automatically in code. i know how manually. it's cumbersome if have many controls. it not possible, assing same method views , example android:onclick="handleclick" , in code need declare method this: public void handleclick(view target){ switch(target.getid()){ case r.id.view1: /// handle click on view1 break; case r.id.view2: // handle click on view2 break; /// ,...... } } and need 1 method, , handle click event adding case switch

android - How to resize bitmap image programmatically with out missing the data -

i developing android application in want set banner image on top of screen come server, need resize dynamically according device size programmatically. try this, int iwidth=bmp.getwidth(); int iheight=bmp.getheight(); display display = getwindowmanager().getdefaultdisplay(); displaymetrics dm = new displaymetrics(); display.getmetrics(dm); int dwidth=dm.widthpixels; int dheight=dm.heightpixels; float swidth=((float) dwidth)/iwidth; float sheight=((float) dheight)/iheight; if(swidth>sheight) swidth=sheight; else sheight=swidth; matrix matrix=new matrix(); matrix.postscale(swidth,sheight); newimage=bitmap.createbitmap(bmp, 0, 0, iwidth, iheight, matrix, true); imageview.setimagebitmap(newimage);

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null ....