Posts

Showing posts from July, 2013

html - CSS - Style the title from the image tag -

i'm trying style title image tag. i have search other question can´t put working in project. but can´t make changes. someone can give me hand pls? my code: table.tablesorter tbody tr td a:hover img[title]:after { content: attr(title); padding: 4px 8px; color: #fff; background-color:black; } <table class="tablesorter" style="width:98% !important"> <thead> <tr> <th> ..... </th> </tr> </thead> <tbody> <tr> <td> .......... </td> <td> <a href="@url.action("edit","account", new { id=item.userid })"> <img src="~/content/images/icon_edit.png" title="edit"/> </a>

excel - IF statement using TIME -

i trying write if statement @ range time , return either shift or shift b. this formula isn't working: =if(f2>time(6,0,0),if(f2<time(16,0,0)),"a","b") use =and both (or more) conditions have met result in true. second if not required. with: =if(and(f2>time(6,0,0),f2<time(16,0,0)),"a","b") shift applies after 06:00 hrs through before 16:00 hrs , shift b otherwise. if , f intermingled in same formula little unfortunate!

mongodb - Salat Dao - not acessible via JUnit -

i have following class: package backend.link import org.bson.types.objectid import com.novus.salat.annotations.raw.salat import com.novus.salat.dao.modelcompanion import com.novus.salat.dao.salatdao import model.hybrid.hybridentity import play.api.play.current import se.radley.plugin.salat.mongocollection import com.novus.salat.annotations.raw.key import backend.data.mongodblayer import com.mongodb.casbah.commons.mongodbobject import backend.data.spacedao import backend.data.pagedao import backend.data.userdao import se.radley.plugin.salat._ import org.bson.types.objectid import com.novus.salat.{ typehintfrequency, stringtypehintstrategy, context } import play.api.play import play.api.play.current /* adding custom salat context work play's classloader using example from: https://github.com/leon/play-salat/blob/master/sample/app/models/mongocontext.scala */ package object mongocontext { implicit val context = { val context = new context { val name = "g

bash - Split file based on text inside file -

i'm trying have file split other files. take of lines "data.pdf" in input file , make text file called data.pdf.txt the data trying have split in column 5 below. input: /mnt/hector/data/benign/binary/benign-pete/ d16feafae3adf1ee0f77e6a84a476b18 0 s043guiv02 code.bin.pe32.gui pe32 executable ms windows (gui) intel 80386 32-bit /mnt/hector/data/benign/binary/benign-pete/ e9f6b4a413ed42987e1bfff13954faaa 0 s043guiv02 code.bin.pe32.gui pe32 executable ms windows (gui) intel 80386 32-bit /mnt/hector/data/benign/binary/benign-pete/ 01d0cd964020a1f498c601f9801742c1 19 s040pdfv02 data.pdf pdf document /mnt/hector/data/benign/binary/benign-pete/ 0299a1771587043b232f760cbedbb5b7 0 s040pdfv02 data.pdf pdf document thanks have been stuck on , cannot correctly awk '{ print >> $5.txt }' < input.txt

javascript - can a style sheet obtain a class or id to dynamically change it? -

i use cors pull down pages , css. store css in style tag , append head. each time load page want wipe out css. is there easy way this? thinking giving id or class, wasnt sure if allowed. neither of them optional attributes of under definition of class, can go on element, , figured technically element. does know how done? the way populating is: var css = "....."; var $style = $("<style type='text/css' />").append(css); $("head").append($style); style elements elements other, , if remove element, css styles defines removed. so if have specific style element you've added, code in question, can remove doing this: $style.remove(); ...since have reference in $style variable. alternately, give specific style element want remove id or class, , use remove it: // adding ... var css = "....."; var $style = $("<style type='text/css' />").append(css).addclass("dynamic&quo

android - Animating bitmap ball - hit the wall and change direction effect -

i trying animate bitmap. have ball, , move it. when reaches boundaries of screen, want change direction mirror effect, mean this, think of ball dots below, comes down, hits wall , changes direction. . . . . . . ____._._______ here code: public class drawshapes extends view{ bitmap ball; int x,y; public drawshapes(context context) { super(context); ball=bitmapfactory.decoderesource(getresources(),r.drawable.ball); x=0; y=0; } @override protected void ondraw(canvas canvas) { super.ondraw(canvas); if(x<canvas.getwidth()) x+=5; else x-=5; if(y<canvas.getheight()) y+=5; else y-=5; canvas.drawbitmap(ball, x, y, new paint()); invalidate(); } the problem is, after ball reaches boundary, keeps going , goes out of screen , never comes back. can me this? thanks hmmm...if canvas larger screen, explain why "goes out of screen." and wouldn't

JQuery pass a variable from function to function -

i have variable retrieved via .click function , want pass function i"m having trouble passing correctly because when call other function nothing happens. var classname; var flavor; (function ($) { drupal.mytest = drupal.mytest|| {}; drupal.behaviors.mytest= { attach: function (context, settings) { drupal.mytest.myfunction= function (classname) { var passedvar= classname; alert(passedvar); }; $('.buttons').on('click', function(event) { classname = $(this).attr('class'); }); $('#test').on('click, function(event) { drupal.mytest.myfunction(); }); } }; }(jquery)); try (function ($) { var classname; var flavor; drupal.mytest = drupal.mytest|| {}; drupal.behaviors.mytest = { attach: function (context, settings) { drupal.mytest.myfunction= function (classname) {

PHP/MYSQL - "ORDER BY" Doesn't work -

i have table bunch of users have amount of points. arrange users highest points first lowest. order pts desc doesn't work. <tr> <th id="users_th1"><img src="<?php echo mysql_result($r_teams, $i, 'logo'); ?>"/> <p><?php echo mysql_result($r_teams, $i, 'name'); ?></p></th> <th id="users_th2">points value</th> </tr> <?php $q_users = 'select * points left join users on users.uid = points.uid tid = '.mysql_result($r_teams, $i, 'tid'); $r_users = mysql_query($q_users, $connection) or die(mysql_error()); $n_users = mysql_num_rows($r_users); for($k = 0; $k <$n_users; $k++){ ?> <tr>

iphone - Popup dialog with round corners -

i want create popup dialog show in center of screen. use uiview load manually nib , add sub view onto main view. there better proper way? i need fade out ground main view , have round corners on popup dialog. target ios 6 , later how do this? no way use uialertview here if want super special visuals. if you're not wanting fancy might give try. by prefer subclassing uiview , doing want , how want it. it's cool , gives countless possibilities. may bit harder it's 100% worth it. i'd go uiview .

jsf - Combine Faces Flow feature with Ajax -

is possible combine new jsf 2.2 faces flow feature ajax? use case: there wizard embedded in panel on page. user steps through wizard, panel shall updated, not entire page. i looking down route myself , did research. short answer yes can use ajax both partial view processing , partial view rendering. here working example: flow definition @applicationscoped public class myflow implements serializable { @produces @flowdefinition public flow defineflow(@flowbuilderparameter flowbuilder flowbuilder) { flowbuilder.id("", "myflow"); flowbuilder.viewnode("flowp1", "/flowpage1.xhtml").markasstartnode(); return flowbuilder.getflow(); } } flowpage1.xhtml (first , view in flow): <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head> <title>view within flow ajax test</

Facebook OAuth login workflow -

my facebook app flixstreet used client side authentication on https://www.flixstreet.in . off late problem has occurred. if user logged out of both facebook , https://www.flixstreet.in , tries login website(using login button fires oauth dialog auth uri, client callback uri , perms) app falls infinite loop , never logs user in. app runs on ror , use omniauth authentication. strangely, when user logged facebook not site auto login flow( same piece of code login button) works fine. please me in debugging issues crucial our web application.

java - Powermock tests pass when run seperate but fail in suite -

i using powermock + easymock + testng <!doctype suite system "http://testng.org/testng-1.0.dtd"> <suite name="my module" suite-preserve-order="true" verbose="10" object-factory="org.powermock.modules.testng.powermockobjectfactory"> <test verbose="2" name="module1" annotations="jdk"> <classes> <class name="com.mymodule.testclass1" /> <class name="com.mymodule.testclass2" /> <class name="com.mymodule.testclass3" /> </classes> </test> </suite> test1 & 2 works together. when added test3, started failing sorts of errors java.lang.illegalstateexception: no last call on mock available i fixed test1 adding annotation @prepareeverythingfortest but not able fix test 2 & 3 has started failing. test 3 works fine individually. worth mentioning the

java - How to serialize ANY Object into a URI? -

my basic question: there built automatically (doesn't have part of popular library/package)? main things i'm working spring (mvc) , jackson2. i understand there few manual ways this: create method in each class serializes specific properties property=value& form (kind of stinks because it's bunch of logic duplication, feel). create function accepts object, , uses reflection dynamically read properties (i guess getters), , build string getting each. i'm assuming how jackson works serialization/deserialization in general, don't know. use feature of jackson customly serialize object. i've researched custom serializers, seems specific class (so i'd have create 1 each class i'm trying serialize), while hoping generic way. i'm having trouble understanding how apply 1 universally objects. few of links: http://techtraits.com/programming/2011/11/20/using-custom-serializers-with-jackson/ http://wiki.fasterxml.com/jacksonhowtocustomserializer

multi touch - Detect X and Y of Each Multitouch Event in Corona SDK -

after activating multitouch in corona sdk, there way can track x , y coordinates of each simultaneous touch? ideal function this: local function detectmultitouch(touches) = 0, #touches do print(touches[i].x .. " ".. touches[i].y) end end you can try this system.activate("multitouch") local touches = {} local touchids = {} local function detectmultitouch() = 1, #touchids print("#"..i.." "..tostring(touchids[i]) .." = "..touches[touchids[i]].x..","..touches[touchids[i]].y) end end runtime:addeventlistener("touch",function(event) if event.phase == "began" touches[event.id] = {} touches[event.id].x = event.x touches[event.id].y = event.y touches[event

How to give a PHP-include its own namespace (like "from a import MyClass" in Python)? -

i've got little experience in php, come python. thing adore python way modules handled. if have file called a.py in directory, containing class called myclass can import class this. from import myclass from php however, know can do: include somefile.php this imports , runs code file, makes similar following in python from import * doing wildcard import however, leaves me clueless importing , causes namespace pollution. question; there way can import classes in php naming them? the practice in php 1 class per file, not classes in same file module ex: classes/mynamespace/mypackage/io.php classes/mynamespace/mypackage/db.php classes/mynamespace/mypackage/log.php ... then use autoloader, every time need class in code, autoloader kicks in , loads it. if not using framework comes built-in autoloader, solution use autoloader provided composer, depedncy manager php: http://getcomposer.org/

lisp - Efficient evaluation of spliced lists with a recurring argument -

i want recur through list of slot names of classes, same slot names 2 classes ( (current-trial *exp*) & (previous *exp*) refer instances of same class). on each recursion, want evaluate slot name value of slot of instance may got , set. code below meets expectation, worry relying upon eval because it's slow , doesn't allow lexical context (graham, 1996). alternative formulations efficient , allow lexical context? (dolist (a '(letter number font color height)) (eval `(when (eq (,a (current-trial *exp*)) (,a (previous *exp*))) (setf (,a (current-trial *exp*)) (random-not-item (,a (current-trial *exp*)) (,a *exp*)))))) since these slot names, can use slot-value : (dolist (a '(letter number font color height)) (when (eq (slot-value (current-trial *exp*) a) (slot-value (previous *exp*) a)) (setf (slot-value (current-trial *exp*) a) (random-not-item

Issue trying to use Datasource Template in Sitecore sublayout; getting empty Sublayout.Datasource -

Image
we've been trying "componentize" our sitecore solution move forward, in prep transitioning page editor usage (woot! finally!), we're still practically working page templates may inheritance-based composites of page specific fields, plus 1:many of these componentized templates. example of how looks in our solution below -- banner feature carousel , featured cartoon of these new components we're creating: in interest of trying move away using sitecore.context.item (as reminded this post ) i've started filling in datasource template field on sublayouts new components, , seems i've got appropriate connections made between presentation details, sitecore sublayout , .net code file (as far can tell; again, we're newer working way). i've tried setting base class these components per this post nick allen , here's i'm running problem: when execute code, base class finding component sublayout appropriately (the whole "this.parent sublay

Why does this query refuse to finish on my master MySQL server? -

so, @ work have master , slave going in replication, , have tracking table gets hammered, lots of inserts 'on duplicate key update' clause. table innodb, locks on row level. have 1 query selects data stuff being written to, behaves differently on master vs slave, namely on master it'll never finish , on slave it'll finish instantly, , want know why. i can understand query have issues dealing volatile rows being updated, that's happening on slave, albeit @ more regular intervals. select sum(hits) hits, date(`when`) thedate tracking tr tr.geo_country in('fr') , tr.`when` between '2013-08-23 00:00:00' , '2013-08-23 23:59:59' group thedate no locking happening on either server, none other on single row basis can't seen show processlist.

Run VBScript on server from javascript/php -

i have single page application written in javascript , php, trying run external .vbs file on server? i have tried using php com class exec() no avail. has achieved this? possible? found gem: http://technet.microsoft.com/en-us/library/ee156587.aspx by that, should try similar in php: exec('wscript "c:/path/to/script.vbs"');

api - Scheduling ruby script based on Variable time -

i have general question scheduling scripts. i'm faced challenge need schedule reminder email x days in advance via api using ruby. however, there no scheduling functionality built api call. so, idea run ruby script sends first email , @ end schedules separate ruby script run x days in advance. make sense? the logic like: email.send(test@test.com) rubyscript.schedule(time.now + x days) does make sense? i'm wondering how can schedule ruby script ruby script. maybe using delayed::job ? might overkill, it's super easy... altering code accordingly: email.delay(:run_at => 7.days.from_now).send('test@test.com') there's whenever , , other cron-like scheduling gems .

php - Setting up localhost receiving error "You don't have permission to access /C: on this server" -

i can reach localhost , phpmyadmin cant reach directory projects. localhost/c:/wamp/www ===> don't have permission access /c: on server. look @ apache config file http.conf inside file should find line similar to: documentroot "c:/program files/apache group/apache/htdocs" the documentroot of apache server looks when request "localhost." make sure projects in documentroot. example copy projects to, "c:/program files/apache group/apache/htdocs/projects" query server @ //localhost/projects/yourproject.php

javascript - Update Meteor Leaderboard with own data -

i've changed meteor example leaderboard voting app. have documents array , in array there 6 values. sum of 6 values works fine, not updating , showing values in app. the values updating, if click on them. problem is, booknames (it's voting app books) "selected_books" variable (previously selected_players), don't know how can book names. by way: _id book names. give code snippets , hope, have solution. this document database: { _id: "a dance dragons: part 1", isbn: 9780007466061, flag: 20130901, score20130714: [1,2,3,4,5,0], } parts of html file: <template name="voting"> ... <div class="span5"> {{#each books}} {{> book}} {{/each}} </div> ... </template> <template name="book"> <div class="book {{selected}}"> <span class="name">{{_id}}</span> <span class=&q

javascript - How to Enable scroll for specific div and disable scroll for page -

is possible disable scroll page, , enable specific div inside page? to disable use: css .disablescroll{ overflow-y:hidden; overflow-x:hidden; } just add <body class="disablescroll"> disable inline style <body style="overflow:hidden"> for div use, leave scrolling enabled <div style="overflow:auto;"> keep in mind can use overflow-y vertical scroll , overflow-x horizontal scroll properties

postgresql - How to convert code from Postgres to Oracle -

i have source table (t1): id1 | id2 ---------- 1 | 2 1 | 5 4 | 7 7 | 8 9 | 1 i want convert data (t2): id1 | id2 | label ------------------ 1 | 2 | 1 1 | 5 | 1 4 | 7 | 2 7 | 8 | 2 9 | 1 | 1 i found solution in postgresql: with recursive cte(id1, id2) ( select id1, id2, 1 level t union select t.id1, cte.id2, cte.level + 1 t join cte on t.id2 = cte.id1 ) select id1, id2, dense_rank() on (order grp) label (select id1, id2, least(min(id2) on (partition id1), min(id1) on (partition id2)) grp, level cte ) t level = 1; i want convert code oracle. how can convert code postgres oracle? oracle 11.2 supports recursive ctes. deviates standard in recursive keyword not required (actually: must not used). if remove recursive keyword , definition of cte columns right following should work. need use different level reserved word either. with cte (id1, id2, lvl) ( select id1, id2, 1 lvl t union se

php - phpDocumentor does not override docs of parent class -

so, have following setup: class { /** * documentation */ public function foo() {} } class b extends { /** * documentation way more specific in class */ public function foo() {} } when try document phpdocumentor2 displays @ method foo() class b "this documentation", i'd " documentation way more specific in class a". in phpdocumenter 1, looks expected. so, going on here? new default behavior of phpdocumentor2? , if so, there way change it? or bug? note: while doing research, bumped {@inheritdoc}, i'd have exact opposite behavior. what expecting see in example should happening -- a::foo() should show "this documentation" while b::foo() should show "this documentation way more specific in class a". if that's not happening, bug. please open issue @ https://github.com/phpdocumentor/phpdocumentor2 on it. as aside, intent of {@inheritdoc} embed a::foo()'s long description so

ruby on rails - Rspec/FactoryGirl: NoMethodError: undefined method 'description' for true:TrueClass -

exchange communidad . trying write feature test ror program, getting following error when run rspec : failure/error: page.should have_content entry.description nomethoderror: undefined method `description' true:trueclass here context in error being thrown: entries.each |entry| page.should have_content entry.description end where entries defined earlier in same test follows: entries = 5.times.map factorygirl.create(:entry, project_id: proj.id, :date => 9/10/13, :type_of_work => 'chump', :description => 'chumpin', :phase => 'draft', :status => 'draft' , :on_off_site => 'off', :user_id => 1, :start_time => now, :end_time => later).should be_valid end entry model has attribute of type string called description testing against , returning true:trueclass nonsense. any leads? thank kindly! while creating entry records

iphone - How do I get a UIButton to change its color by clicking it? -

i want make app iphone. nonogram similar this: http://www.puzzle-nonograms.com/ how can make uibuttons changes color white black , reverse? .h file uibutton *button; bool clicked; .m file - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. clicked=yes; button = [uibutton buttonwithtype:uibuttontyperoundedrect]; [button addtarget:self action:@selector(changebtncolor) forcontrolevents:uicontroleventtouchdown]; [button settitle:@" 1 " forstate:uicontrolstatenormal]; button.frame = cgrectmake(80.0, 210.0, 160.0, 40.0); [button settitlecolor:[uicolor graycolor] forstate:uicontrolstatenormal]; [self.view addsubview:button]; } -(void)changebtncolor{ if (clicked) { [button settitlecolor:[uicolor redcolor] forstate:uicontrolstatenormal]; clicked=no; } else{ [button settitlecolor:[uicolor graycolor] forstate:uicontrolsta

iphone - FPS Lag scheduler? -

i've been getting fps lag. i've looked around , people use [self schedule:@selector(gameloop:) interval: 1/60.0f]; when use choppy lag. when use [self schedule:@selector(gameloop:)]; it's lot smoother. here snippet of movement code. - (void)gameloop :(cctime)dt { [self managecannon:dt]; [self managebullets:dt]; [self manageenemies:dt]; [self manageallies:dt]; } - (void) manageenemies :(cctime)dt { enemyclass *tempenemy; for(int = 0; < [enemies count]; i++) { tempenemy = [enemyclass new]; tempenemy = [enemies objectatindex:i]; tempenemy.position = ccp(tempenemy.position.x-tempenemy.speed*dt,tempenemy.position.y); if((tempenemy.position.x - tempenemy.range) < [wall getwally]) { tempenemy.speed = 0; } if(tempenemy.health < 1) { tempenemy.alive = false; } if(tempenemy.alive == false) { [enemies removeob

sql - PHP today / yesterday in forum -

i'm showing latest activity on forum, , i'm extracting "$mytime" sql. , can't seem figure 1 out: $dates = date(" d-m-y",$mytime)); if($dates == date('d-m-y')) { $day_name = 'this day'; } else if(); $day_name = 'another day'; } echo "$day_name"; i can't figure out one: } else if(); { is there more problems in code? yes there problem code. should this: $dates = date(" d-m-y",$mytime)); if ($dates == date('d-m-y')) { $day_name = 'this day'; } elseif (you-can-compare else again in here) { $day_name = 'another day'; } echo "$day_name"; or if not willing compare second time, use this: $dates = date(" d-m-y",$mytime)); if ($dates == date('d-m-y')) { $day_name = 'this day'; } else { $day_name = 'another day'; } echo "$day_name";

SQL Server Management Studio 2012 Pivot/Cross Tab Query -

i'm using sql server management studio 2012 , create pivot/cross tab query table on 2300 rows. the table has 5 columns: - name - group - status - date - count there 580 distinct names. each name associated 4 different groups (a, b, c, , d). each group has complete status of yes or no. a date associated each status when completed. otherwise, status null. the count column applicable group b , d , integer value. sample a: name group status date count a.a.1 yes 5/23 null a.a.1 b yes 5/27 112 a.a.1 c yes 6/4 null a.a.1 d yes 6/15 122 a.b.2 yes 5/25 null a.b.2 b yes 6/1 119 a.b.2 c no null null a.b.2 d no null null i trying display status of each name field values across 11 columns : - name - group - group date - group b - group b date - group b count - group c - group c date - group d - group d date - group d count

How to create a "loop" statement within an {expect} script? -

assumption is, script #!/usr/bin/expect set "__test__" i create loop inside script can print value for $a with number infront of based on loop. so if wanted loop 3 times.. end product become: 1:__test__ 2:__test__ 3:__test__ you can use for #!/usr/bin/expect set "__test__" {set x 0} {$x<3} {incr x} { puts "$x:$a" } see more info in tcl commands because expect extension tcl language.

visual studio 2012 - Send C# App Via Email -

i need send c# app in email job interview exercise. says save exercise zip file , email it. have thought wanted see code, looking now, looks way zip .exe file , send it. code not visible them? way show code? add .cs file email? why don't zip whole project directory? include code files , compiled .exe file. include solution or project visual studio can open on end. you may still need change extension of executable file .exe1 before zipping, otherwise email service might not let through.

java - Setting up Jax-rs 2.2 with Jetty -

i'm trying set rest services on jetty using jersey jaxrs. can't json data through rest service class though. ajax requests keep getting "unsupported media type" error , status. regardless of @produces , @consumes annotations add methods though should both mediatype.application_json . i can't find decent documentation on jersey , loads of questions, blogs, , other resources seem out of date. looks jersey has undergone lot of changes , i'm @ loss should looking. set following based on jersey webapp archetype: web.xml: <servlet> <servlet-name>jersey web application</servlet-name> <servlet-class>org.glassfish.jersey.servlet.servletcontainer</servlet-class> <init-param> <param-name>jersey.config.server.provider.packages</param-name> <param-value>com.my.package.rest</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet

java - Android Filter searchView Widget for scala " got ClassCastException" -

i want create "searchview widget" android in scala plugin eclipse, here code, override def getfilter(): filter = { new filter() { protected override def publishresults(constraint: charsequence, results: filterresults) { var books = results.values.asinstanceof[list[bookmetadata]] itemadapter.this.notifydatasetchanged() } protected override def performfiltering(constraint: charsequence): filterresults = { val filteredresults = listbuffer(books.asscala.tolist.filter(b => b.tostring.startswith(constraint.tostring)): _*) .asinstanceof[list[bookmetadata]] val results = new filterresults() results.values = filteredresults results } } } i don't have error when run program have classcastexception here log: 08-23 13:37:06.986: v/bookfragment(25407): query : modern 08-23 13:37:06.996: w/filter(25407): exception occured during performfiltering()! 08-23 13:37:06.996: w/filter(25407): java.lang.class

ios - Storing in Plist? -

i wondering how 1 store data in plist, same output.right using nsobject. store these in separate dictionary's? how can call them fill tabledata array. exercises *exercise1 = [exercises new]; exercise1.name = @"barbell rollouts"; exercise1.materials = @"30 min"; exercise1.imagefile = @"barbellrollouts.jpg"; exercise1.sets = @"2"; exercise1.reps = @"10"; exercise1.instructions = @"hello"; exercise1.status = @"dynamic"; exercises *exercise2 = [exercises new]; exercise2.name = @"barbell trunk rotation"; exercise2.materials = @"30 min"; exercise2.imagefile = @"barbelltrunkrotation.jpg"; exercise2.sets = @"2"; exercise2.reps = @"10"; exercise2.instructions = @""; exercise2.status = @"dynamic"; exercises *exercise3 = [exercises new]; exercise3.name = @"bent knee leg raises"; exercise3.materials = @"30 min"; exercise3.imag

how do i decode/encode the url parameters for the new google maps? -

im trying figure out how extract lat/long of start/end in google maps directions link looks this: https://www.google.com/maps/preview#!data=!1m4!1m3!1d189334!2d-96.03687!3d36.1250439!4m21!3m20!1m4!3m2!3d36.0748342!4d-95.8040972!6e2!1m5!1s1331-1399+e+14th+st%2c+tulsa%2c+ok+74120!2s0x87b6ec9a1679f9e5%3a0x6e70df70feebbb5e!3m2!3d36.1424613!4d-95.9736986!3m8!1m3!1d189334!2d-96.03687!3d36.1250439!3m2!1i1366!2i705!4f13.1&fid=0 im guessing "!" separator between variables followed xy x number , y lower case letter, can not quite figure out how reliably extract coordinates number/order of variables changes xy prefixes. ideas? thanks well, old, hey. i've been working on bit myself, here's i've figured out: the data encoded javascript array, trick when trying generate own data string ensure formatting keeps structure of array intact. this, let's @ each step represents. as you're correctly figured out, each exclamation point defines start of

Insert data into REDIS (node.js + redis) -

how, can insert (store) data (node.js + redis): var timestamp = new date().gettime(); client.hmset('room:'+room, { 'enabled' : true, timestamp : { 'g1' : 0, 'g2' : 0 } }); and how affter can increment g1 or g2 ? p.s. when insert timestamp way, redis-cli show timestamp instead unix time you're looking combination of hmget , hmset . according the docs : hmget key field [field ...] returns values associated specified fields in hash stored @ key. for every field not exist in hash, nil value returned. because non-existing keys treated empty hashes, running hmget against non-existing key return list of nil values. hmset key field value [field value ...] sets specified fields respective values in hash stored @ key. this command overwrites existing fields in hash . if key not exist, new key holding hash created. what want do, then, re

Handling Session Cookie in Android Volley -

for unfamilar volley networking library and,it switch http request client httpurlconnection or httpclient depending on android version, 1 thing need know how add cookie support each of these client types. how opt in session management both types of clients? i have seen solution: using cookies android volley library which step in right direction. has found way push logic level down library without using preferences? or references volley application. don't mind rewriting volley helper class apply support not sure if both types of http clients support cookies , need turn on cookie support? also there way use volley cookiemanager perhaps? take @ my answer on other question linked. specifying httpclient volley use, ever use 1 connections. obviating need set cookies on both.

executing within java a commandline bash command with no output is not executed like -

using code: private string executecommand(string cmd ) { process p; try { p = runtime.getruntime().exec(cmd); bufferedreader br = new bufferedreader( new inputstreamreader(p.getinputstream())); while ((commandlineoutput = br.readline()) != null){ system.out.println("line:" + commandlineoutput); } p.waitfor(); system.out.println (p.exitvalue()); p.destroy(); } catch (exception e) {} } return commandlineoutput; } i run following problem: commands generate output executed normal, commands not generating output not executed instance : rm *.jpg not working mkdir is, can not see difference i quite newbie, googled quite time particular problem never mentioned please me out thanks when run rm * on linux, shell interprets , takes care of * . in java, same shell isn't running, * isn't being interpreted wildcard. as pointed here , try ext

java - Synchronizing directories over FTP -

i'm working on app (android) instances of application share data each other via ftp server. ftp has been used because router i'm working can ftp server using plugged in usb flash drive. one function app perform sync data other instances. @ moment syncing additive. data on server isn't on phone gets transferred phone. data on phone isn't on server gets transferred server. idea data created on phones can mutually shared. i've looked @ java rsync libraries. however, of ones have seen either unmaintained, poorly documented, or both. also, rsync isn't going work given hardware i'm operating @ moment. i have been using apache commons net ftpclient. made class builds on top of offers methods push , pull data server. however, if there exists library (or approach) out there has been tested thoroughly or offers more functionality, use it. there? what attempting beyond scope of ftp protocol. not impossible, in order need parse (implementation specif

html - Firefox Issue: Relative-positioned Table-cell Fails to Serve as Parent -

Image
i've discovered interesting layout issue seemingly present in firefox. elements display:table-cell; fail serve positional parent descendants position:absolute; . that is, i've been surprised learn firefox has issues absolutely positioning little icon critter corner of table-cell'd element other browsers.      jsfiddle demonstration desired result (chrome) : firefox result: interestingly, ie8 produces desired result.    what's favorite workaround? so far, i've found lame-and-obvious solution. the desired result can achieved in firefox adding lame wrapper <div> display:block; , position:relative applied within table-cell. wrapper solution jsfiddle hoping can find solution doesn't require me meddle dom firefox.

java - Ternary operator usages? -

i know ternary operator used of doing variable assignment after evaluating logical condition. so: string s = (logicalvariable) ? "hello" : "bye, bye"; or, int x = (5<3) ? 10 : 100; would usage examples, right? but if idon't want variable assignment set sentence or piece of code, example: if (inventario.containskey(item)) return inventario.get(item); else return integer.min_value; can these lines writen in one line expression , using ternary operator? this should work: return inventario.containskey(item)? inventario.get(item); integer.min_value; the first part need evaluate boolean

image - flash to html5, How to -

i have knowladge in web development , in situation, i'm trying find best way convert flash site html5 supports in modern browsers , compatible iphones , tablets, http://www.undergroundcathedral.com/ please visit above link, works in flash, want convert html5, glad if 1 can suggest me way of doing it, complete guidance tutorials, , links, i drew lines in html5 canvas but, couldn't find way make them anchors. hope add onmouseover event play sound , pop image, suggest me best way, thanks in advance :) google has service use called swiffy . availible plugin adobe flash studio, if use it.

where - MySQL - Is it possible to use LIKE on all columns in a table? -

i'm trying make simple search bar searches through database words. possible use attribute without using where? want search columns keywords, not one. have this: mysql_query("select * shoutbox name '%$search%' ") which searches names search input. tried both of these: mysql_query("select * shoutbox '%$search%' ") mysql_query("select * shoutbox * '%$search%' ") and neither worked. possible or there way go it? you might want @ match() function eg: select * shoutbox match(`name`, `foo`, `bar`) against ('$search') you can add boolean mode this: select * shoutbox match(`name`, `foo`, `bar`) against ('$search') in boolean mode you can relevance scores , add fulltext keys speed queries.

java - Open Gallery App in Android -

i trying open inbuilt gallery app pressing button in app. i trying out on android 2.3 , above phones. phones/tablet have samsung s (android 2.3.5) lg phone (android 2.3.3) nexus 1 (android 2.3.6) android tablet (android 4.0.3) galaxy nexus (android 4.3) i tried following: intent intent = new intent(intent.action_view, null); intent.settype("image/*"); startactivity(intent); above code works fine on android tablet (4.0.3) , nexus phone too.. if run same app on phone below 3.0 (gives me error) 08-24 11:47:53.628: e/androidruntime(787): @ android.app.activitythread.performlaunchactivity(activitythread.java:1651) 08-24 11:47:53.628: e/androidruntime(787): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1667) 08-24 11:47:53.628: e/androidruntime(787): @ android.app.activitythread.access$1500(activitythread.java:117) 08-24 11:47:53.628: e/androidruntime(787): @ android.app.activitythread$h.handlemessage(activitythread.java:935) 08-24 11:47

How to obtain months in right order from different years from DateField in django? -

i have django model datefield. can list of months of objects in such way: months = [i.month in mymodel.objects.values_list('date', flat=true)] and after delete duplicates receive such list (example): [1, 2, 5, 6, 7, 9] . but if have different years, want receive months in right date order. example: date1=31.08.2012, date2=31.12.2012, date3=05.05.2013. so want receive not [5, 8, 12 ] [8, 12, 5] . how can it? you're trying months in order of when first appear chronologically? list(set(date.month date in mymodel.objects.order_by("date").values_list('date', flat=true))) sorting year same sorting date. yay!

javascript - calling HTML using webViewShow in sl4a -

trying out basic html scripts sl4a , python application can't seem call html... trying send data small form in html on python side here's html <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>html form</title> <link rel="stylesheet" href="style.css"/> </head> <body> <div id="body"> <h1>my settings</h1> <script type="text/javascript"> var droid = new android(); function post_data(){ var values = [ ['airplane', document.getelementbyid('airplane_mode').value], ['wifi', document.getelementbyid('wifi_on').value], ['brightness', document.getelementbyid('brightness').value], ['volume', document.getelementbyid('volume').value], ]; var q = '?'; (i=0;i<values.length;i++){ var k = val

When iOS shrinks an image, does it clip/pixelate it? -

i have 2 relatively small pngs images inside uibutton s. once our app finished, might want resize buttons , make them smaller. now, can resizing button frame; system automatically re-sizes images smaller. would system's autoresize cause image ugly after shrinking image? (i.e., clip pixels , make less smooth if shrink in photo editor myself?) or better make image sizes intended be? it best make images of correct size beginning. resize-functions have negative impact on end result. if scale larger image big different, if scale down smaller creating visible noise in image. let's have line of 1 pixel in image. scale down 90% of original size, line use 90% of pixel wide , other parts of images influence colors of same pixels.

android - Getting View from RelativeLayout -

programatically have relativelayout , textview (called title) within defined follows: relativelayout layout = new relativelayout(this); final relativelayout.layoutparams parameters_title = new relativelayout.layoutparams(relativelayout.layoutparams.wrap_content, relativelayout.layoutparams.wrap_content); title.setlayoutparams(parameters_title); layout.addview(title,parameters_title); i intend add more textviews , buttons later. now, want "convert" (i not sure how put words) relativelayout view in order put windowmanager . trying use layoutinflater wouldn't work layoutinflater layoutinflater = (layoutinflater)this.getsystemservice(context.layout_inflater_service); myview = layoutinflater.inflate(layout, null ); then goal put myview windowmanger through addview . how can view relativelayout ? relativelayout extends viewgroup has getchildcount() , getchildat(int index) methods. try :

c++ - fstream skips the first character -

i trying read first 121 bytes text file onto structure. here code. #include <fstream.h> #include <iostream.h> #include <conio.h> #include <sys/stat.h> int main() { struct { char map[121]; } map_data; struct stat results; fstream myfile("input.txt", ios::in); myfile.read((char *)&map_data,121); if(!myfile) { cout<<"unable open file"; } if(!myfile.read((char *)&map_data,121)) { cout<<"second error occurred"; } myfile.close(); cout<<"\n here read contents of size "<<sizeof(map_data)<<"\n"; fstream outfile("output.txt", ios::out); for(int i=0;i<121;i++) { cout<<map_data.map[i]<<" "; } outfile.write((char *)&map_data,121); outfile.close(); stat("input.txt",&results); cout<<"\n s

python - stacking sparse and dense matrices -

is possible stack sparse , dense numpy array in python? know can done dense numpy arrays using vstack/hstack. have columns add sparse matrix in order increase number of feature vectors yes, can use scipy.sparse.vstack , scipy.sparse.hstack , in same way use numpy.vstack , numpy.hstack dense arrays. example: from scipy.sparse import coo_matrix m = coo_matrix(np.array([[0,0,1],[1,0,0],[1,0,0]])) = np.ones(m.shape) with np.vstack : np.vstack((a,m)) #valueerror: input array dimensions except concatenation axis must match with scipy.sparse.vstack : scipy.sparse.vstack((a,m)) #<6x3 sparse matrix of type '<type 'numpy.float64'>' # 12 stored elements in coordinate format>

jquery - Change individual button state -

i have following uses clicks , jquery fade display div when button clicked , change state of button.... http://jsfiddle.net/ttj9j/5/ html <a class="link" href="#" data-rel="content1"><img src="http://i.imgur.com/vi1klp9.png"></a> <a class="link" href="#" data-rel="content2"><img src="http://i.imgur.com/u1sbure.png"></a> <a class="link" href="#" data-rel="content3"><img src="http://i.imgur.com/u1sbure.png"></a> <a class="link" href="#" data-rel="content4"><img src="http://i.imgur.com/u1sbure.png"></a> <a class="link" href="#" data-rel="content5"><img src="http://i.imgur.com/u1sbure.png"></a> <div class="content-container"> <div id="content1">this test cont