Posts

Showing posts from April, 2011

Select meta tag using c#? -

this xml want select meta tag <meta charset="utf-8"> <title>gmail: email google</title> <meta name="description" content="10+ gb of storage, less spam, , mobile access. gmail email that&#39;s intuitive, efficient, , useful. , maybe fun."> <link rel="icon" type="image/ico" href="//mail.google.com/favicon.ico"> i doing this string texturl = textbox2.text; string url = "http://" + texturl; htmlweb web = new htmlweb(); htmlagilitypack.htmldocument doc = web.load(url); var spannodes = doc.documentnode.selectnodes("//meta"); if (spannodes != null) { foreach (htmlnode sn in spannodes) { string text = sn.innertext;

Laravel 4 Javascript Link using {{Html}} -

is there laravel4 html() function or way add disabled link. of course create <a> tag directly, though i'd prefer consistent. ie: {{ html::link('javascript:;','delete',array('id'=>"deletebt")) }} you must use link_to , example : link_to('link', 'title', array('id' => 'myid'));

jquery - How do I get the Full URL from SPListItem (curren item)? -

this code, don't know field url. can url different way? var f = "<viewfields>"+ '<fieldref name="title"/>'+ '<fieldref name="linkfilenamenomenu"/>'+ '<fieldref name="created"/>'+ "</viewfields>"; it easy, hard find. var f = "<viewfields>"+ '<fieldref name="id"/>'+ '<fieldref name="title"/>'+ '<fieldref name="linkfilenamenomenu"/>'+ '<fieldref name="created"/>'+ '<fieldref name="encodedabsurl"/>'+ "</viewfields>"; $().spservices({ operation: "getlistitems", async: false, listname: list, camlviewfields: f, camllimit: l, camlquery: q, completefunc: funct

java - Trouble sorting numbers from smallest to largest in an array -

this 1 of first posts on here not sure if posting correctly. need trying put population of states in order smallest largest comes separate file. program outputting states in alphabetical order. file set below. expected input: alabama,4779736 alaska,710231 arizona,6392017 class attempts sort: public class inorder { /** * @param args * @throws ioexception */ public static void main(string[] args) throws ioexception { // todo auto-generated method stub printwriter prw = new printwriter("outfile.txt"); file f = new file("census2010.txt"); if (!f.exists()) { system.out.println("f not exist "); } scanner infile = new scanner(f); infile.usedelimiter("[\t|,|\n|\r]+"); final int max = 50; int[] myarray = new int[max]; string[] statearray = new string[max]; int fillsize; fillsize = fillarray(myarray, statearray,

jquery - Combining promises with Q -

in jquery, can combine promises follows: var promise = $.when(func1.execute(), func2.execute()); promise.done(function (data1, data2) { // code here } how rewrite using q? also. benefits of using q in scenario on jquery? simple answer: var promise = q.all([func1.execute(), func2.execute()]); promise.spread(function (data1, data2) { // code here }) .done(); annotated: //make `promise` promise array var promise = q.all([func1.execute(), func2.execute()]); //use spread spread array across arguments of function promise.spread(function (data1, data2) { // code here }) //use done errors thrown .done(); the concepts in q more defined. promise represents single value may not available yet. parallels synchronous code precisely. to represent multiple values then, use array. q.all helper method takes array of promises, , returns promise array containing fulfilled values. if promise in array rejected, resulting promise rejected. because in case know how l

c# - How to Use a Compare Validator with DateTime.Today against TextBox.Text? -

goal: have 'enddate' textbox updates upon user changing it. want able check/validate date in enddatetextbox.text , make sure less today's date (in format ex: 4/19/2013). i've tried 2 methods: method one <asp:textbox id="hiddentodaydate" visible = "false" runat="server" /> <asp:comparevalidator id="compareendtodayvalidator" operator="greaterthan" type="date" controltovalidate="hiddentodaydate" controltocompare="enddatetextbox" errormessage="'end date' must before today's date" runat="server" /> and following in page_load method: hiddentodaydate.text = datetime.today.toshortdatestring(); method two <asp:hiddenfield id="hiddentodaydate" runat="server" /> <asp:comparevalidator id="compareendtodayvalidator" operator="greaterthan" type="date" controltovalidate

arrays - Bash: Save and restore trap state? Easy way to manage multiple handlers for traps? -

what way override bash trap handlers don't permanently trample existing ones may or may not set? dynamically managing arbitrary chains of trap routines? is there way save current state of trap handlers can restored later? save , restore trap handler state in bash i submit following stack implementation track , restore trap state. using method, able push trap changes , pop them away when i'm done them. used chain many trap routines together. see following source file (.trap_stack.sh) #!/bin/bash trap_stack_name() { local sig=${1//[^a-za-z0-9]/_} echo "__trap_stack_$sig" } extract_trap() { echo ${@:3:$(($#-3))} } get_trap() { eval echo $(extract_trap `trap -p $1`) } trap_push() { local new_trap=$1 shift local sigs=$* sig in $sigs; local stack_name=`trap_stack_name "$sig"` local old_trap=$(get_trap $sig) eval "${stack_name}"'[${#'"${stack_name}"'[@]}]=$old_trap' trap

php - How to avoid to display duplicates from random images script? -

the following script perfect needs unfortunately displays duplicate images. how can modify fix issue? or in place of there similar script allowing display random images in 1 column , each of them own link? thanks. <?php function display_random_img($array) { $key = rand(0 , count($array) -1); $link_url = $array[$key]['url']; $alt_tag = $array[$key]['alt']; $random_img_url = $array[$key]['img_url']; list($img_width, $img_height) = getimagesize($random_img_url); return "<a href=\"$link_url\"><img src=\"$random_img_url\" width=\"$img_width\" height=\"$img_height\" alt=\"$alt_tag\" /></a>"; } //----------------------- $ads_array = array( array( 'url' => 'http://www.mysite.com/', 'alt' => 'image1', 'img_url' => 'http://www.mysite.com/pic1.jpg' ), array( 'url' => 'http://www.yoursite.com/&#

include - PHP: A working file doesn't find other files after inclusion? -

first of all: sorry title. if can make replace it, please since didn't know how name problem in first place. said, there possibly duplicates around, figured need on thing , didn't know search for... the base site wasn't made me. written in html, inclusions done php , don't way made. getting irrelevant question i'm trying ask here. the files described here contain more stuff what's written here, problem here that when requiring file requires file b requires many files, file b can't find files it's looking for. so let's got directory tree like: | - project +--- lower.txt | -- stuff | ---- case +------ index.php +------ upper.php | -- gallery +---- main.php +---- config.php +---- miscfunc.php +---- css.php project\stuff\case\index.php: <?php include("./upper.php");?> ... <?php include("../../lower.txt");?> project\stuff\case\upper.php: <?php require_once("../../gallery/main.php"); ?>

css - Using the firefox-addon SDK panel module without the boxed look -

i use panel module (i.e. attach not script html , css , not have addon css , javascript potentially interact of main page) not have restraints of boxed look. seems ought simple, way see use low lying apis lack of simplicity, security , documentation of high level apis. use 1 of following: stylesheet service userchrome.css userchrome.js userchrome.js extension resource aliases

javascript - HTML String in Html2Canvas -

how pass valid html string html2canvas? e.g var html = "<html><head></head><body><p>hi</p></body></html> the way done on http://html2canvas.hertzen.com/screenshots.html html2canvas great , it's poorly documented. you can following var iframe=document.createelement('iframe'); $('body').append($(iframe)); settimeout(function(){ var iframedoc=iframe.contentdocument||iframe.contentwindow.document; $('body',$(iframedoc)).html('<html><head></head><body><p>hi</p></body></html>'); html2canvas(iframedoc.body, { onrendered: function(canvas) { $('body',$(document)).append(canvas); $('body',$(document)).remove(iframe); } }); }, 10); see whole code here : demo

Why switch and if statement in Javascript treat boolean different, confused -

i've got switch , if problem in javascript, code following. var a=0; if(a){ console.log("a true"); } else if(!a) { console.log("a false"); } else { console.log("a not true or false"); } switch(a){ case true: console.log("switch... true"); break; case false: console.log("switch... false"); break; default: console.log("switch... not true or false"); } when ran code above, got result in console confused me lot: a false switch... not true or false i think should this: a false switch... false anyone knows why happens? appreciate answers. if (!0) evalutes true. there rule non 0 in if evaluate true vie versa. but switch 0 explicitly checked against case values , 0 neither true or false , hence default statement gets executed.

jquery - Progress Bar is not working -

can tell me how progress bar work? in html <html> <head> <link rel="stylesheet" type="text/css" href="mystyle.css"> <script type="javascript/text"> var progress = setinterval(function() { var $bar = $('.bar'); if ($bar.width()==400) { clearinterval(progress); $('.progress').removeclass('active'); } else { $bar.width($bar.width()+40); } $bar.text($bar.width()/4 + "%"); }, 800); </script> </head> <body> <div class="container"> <div class="progress progress-striped active"> <div class="bar" style="width: 0%;"></div> </div> </div> </body> in css: @import url('http://twitter.github.com/bootstrap/assets/c

r - What is the value of assortativity for k-regular graphs? -

i want know value of assortativity special kinds of graphs. tools exist analyzing graph structures , calculation of measures on them (these measures used in social networks , in general complex networks field). generated undirected k-regular graphs , running igraph library of r calculating assortativity result of library nan (not number) of generated graphs. don't know in theory value not defined or correct value 1 or 0 , there limitation situations in implementation , programming of library. i use code using igraph package of r assortativity.degree(sg, directed=false) sg k-regular graphs generated snap project ( http://snap.stanford.edu/ ) loads file , entire of process done other kinds of networks , assortativity calculated correctly k-regular graphs problem exist. see page mentioned same problem ring graphs , notes on value of assortativity @ last can't solve question completely! the definition of assortativity implies any graph degrees equal will und

fedora - port mapper failure in NIS configuaration -

i working on fedora 17 , trying configure nis server , installed ypser, rpcbind, ypbind packages ' yum ' command, fine, @ last step, when hostname has store in database, after pressing ctrl+d , ' y ' receive port mapper failure, host added database. i receive following error.. at point, have construct list of hosts run nis servers. dlp in list of nis server hosts. please continue add names other hosts, 1 per line. when done list, type control d. next host add: vinita next host add: # ctrl + d key current list of nis servers looks this: vinita correct? [y/n: y] y # answer yes need few minutes build databases... building /var/yp/server.world/ypservers... running /var/yp/makefile... gmake[1]: entering directory `/var/yp/server.world' updating passwd.byname... failure send 'clear' loca ypserv : rpc : port mapper failureupdating passwd.byid. failure send 'clear' loca ypserv : rpc : port mapper failureupdati

sql server 2008 - Different Items in single row to get the total amount of that order -

i have order table in insert items customer placed in order in single row.like table_order ( od_id primary key auto incrementd) od_id cust_name quantity of 101(int) quantity of 102 quantity of 103 ----- ------- -------------------- --------------- -------------- 1 john 5 4 7 2 kim 4 3 2 another table of price like table_ price prod_id price (money) ------- ------ 101 5.2 102 2.5 103 3.5 now want total amount of specific order placed customer. problem if use differnt rows different item order id changed , if use single row how calculate total price can put jst single prod_id colum. kindly guide me , send solutions regards i see table design violates of design values starting no foreign key between tables. but worst case solution problem here: select ( q101*pri

iphone - Video Editing using AVFoundation in objective c -

is possible add time stamp on video screen while recording video using camera? can add timestamp on existing video's screen , remove audio existing video? i have searched on internet, couldn't find clue, guidance reference tutorials please ? thanks apple has provided sample video editing. can check that. aveditdemo sample in wwdc 2010 sample code pack thanks,

Small Java exception that I can't understand -

Image
can me resolve this? exception in thread "main" com.jme3.asset.assetnotfoundexception: interface/splash.png @ com.jme3.system.jmedesktopsystem.showsettingsdialog(jmedesktopsystem.java:112) @ com.jme3.system.jmesystem.showsettingsdialog(jmesystem.java:128) @ com.jme3.app.simpleapplication.start(simpleapplication.java:125) @ adventure.q3world.main(q3world.java:85) it used work, had repackage , might've forgotten setting or likewise in eclipse. splash file there not on path. what i'm trying to this, works in previous build: settings.setsettingsdialogimage("interface/splash.png"); i've tried adding path resource panel no other effect: and in java build path, resource listed it's still not working: the larger code block want work , working in built jar not within eclipse juno is: public static void main(string[] args) { file file = new file("quake3level.zip"); if (!file.exists()) {

java - Sparql Query results in Tamil using Eclipse -

we trying execute sparql query our owl ontology created in tamil using protege in eclipse ide. code works fine results don't seem appear in tamil. following code , output. import java.lang.*; import java.util.regex.*; import java.io.*; import com.hp.hpl.jena.sparql.*; import com.hp.hpl.jena.*; import com.hp.hpl.jena.rdf.model.model; import com.hp.hpl.jena.rdf.model.modelfactory; import com.hp.hpl.jena.query.*; import java.io.file; import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import java.util.iterator; import com.hp.hpl.jena.ontology.ontclass; import com.hp.hpl.jena.ontology.ontmodel; import com.hp.hpl.jena.ontology.ontmodelspec; import com.hp.hpl.jena.query.query; import com.hp.hpl.jena.query.queryexecution; import com.hp.hpl.jena.query.queryexecutionfactory; import com.hp.hpl.jena.query.queryfactory; import com.hp.hpl.jena.query.resu

asp.net mvc - AJAX POST to MVC Controller showing 302 error -

i want ajax post in mvc view. i've written following: script code in view $('#media-search').click(function () { var data = { key: $('#search-query').val() }; $.ajax({ type: 'post', url: '/builder/search', data: json.stringify(data), datatype: 'json', contenttype: 'application/json; charset=utf-8', success: function (data) { $('.builder').empty(); alert("key passed successfully!!!"); } }); }); controller code [httppost] public actionresult search(string key) { return redirecttoaction("simple", new { key=key }); } but on ajax post getting 302 found error the '302' response code redirect. controller action explicitly returns redirecttoaction , returns 302. since redirect instruction consumed ajax call , not directly browser, if want browser redirected, need following: $.ajax({

python - multiprocessing.pool context and load balancing -

i've encountered unexpected behaviour of python multiprocessing pool class. here questions: 1) when pool creates context, later used serialization? the example below runs fine long pool object created after container definition. if swap pool initializations, serialization error occurs. in production code initialize pool way before defining container class. possible refresh pool "context" or achieve in way. 2) pool have own load balancing mechanism , if how work? if run similar example on i7 machine pool of 8 processes following results: - light evaluation function pool favours using 1 process computation. creates 8 processes requested of time 1 used (i printed pid inside , see in htop). - heavy evaluation function behaviour expected. uses 8 processes equally. 3) when using pool see 4 more processes requested (i.e. pool(processes=2) see 6 new processes). role? i use linux python 2.7.2 from multiprocessing import pool datetime import datetime power = 10 d

java - Sending parameter input type hidden value to another jsf page -

<h:commandlink action="http://192.168.2.66:8084/tekirmobile2/customerlistdetailed.xhtml" value="#{item.code}" > <h:inputhidden value="#{item.address}" /> <h:inputhidden value="#{item.name}" /> </h:commandlink> i have above code. code in customerlist.xhtml , after user click commandlink button want send input hidden value customerlistdetailed.xhtml. how can that? to this, can write hidden tag after commandlink tag. note should add above codes h:form tag example: <h:form> <h:commandlink action="http://192.168.2.66:8084/tekirmobile2/customerlistdetailed.xhtml" value="#{item.code}" > </h:commandlink> <h:inputhidden value="#{item.name}" name="name" id="name" /> <h:inputh

java - Automatically adding every Class object constructed into an ArrayList -

i'm still new in learning java , i'm in need of way put every object constructed class arraylist can access later. here item class: import java.util.arraylist; import java.util.*; public class item { private string name; private int quantity; private arraylist<item> allitems = new arraylist<item>(); //the arraylist i'm trying fill every item object /** * constructs item of given name , quantity * @param name item name * @param quantity how of item player has */ public item(string name, int quantity) { this.name = name; this.quantity = quantity; } /** * @return item name */ public string getitemname() { return name; } /** * @return quantity of item */ public int getquantity() { return quantity; } /** * @return list of items have quantity > 0 */ public arraylist<item> getinventory() {

interface - Why does C# tease with structural typing when it absolutely knows it doesn't have it? -

i surprised see today possible, worry must discussed before. public interface icanadd { int add(int x, int y); } // note myadder not implement icanadd, // define add method 1 in icanadd: public class myadder { public int add(int x, int y) { return x + y; } } public class program { void main() { var myadder = new myadder(); var icanadd = (icanadd)myadder; //compiles, sake? int sum = icanadd.add(2, 2); //na, not game it, cast had failed } } the compiler (rightly?) tell me explicit cast exists in above situation. thrilled sense structural typing in there, no run time fails. when c# being ever helpful here? scenarios such casting work? whatever is, i'm sure compiler beforehand knows myadder not icanadd , technically. c# allows explicit conversion class interface (even if class doesn't implement interface), because compiler knows, reference type might (the uncertainty why it's explicit rather implic

ios - NSString sizeWithFont forWidth returning wrong values -

i have weird problem. sizewithfont: forwidth: linebreakmode:nslinebreakbywordwrapping returning wrong values. have array of strings need placed in neat "table". cells uiview s uilabel s in them. in order alloc-init cell view , label right frame need pre-compute desired height of cell , total height of wrapper view since cells placed in view. code looks this: #define kstandardfontofsize(x) [uifont fontwithname:@"helveticaneue-ultralight" size:x] cgfloat size = 0.0f; //for computing total size cells placed in view items = [nsarray arraywithobjects:@"you have 23 new followers", @"1125 new likes", @"successful week 24 new twitter followers , 60 new email subscribers", @"1125 new tickets", nil]; (nsstring *item in items) { if ([item sizewithfont:kstandardfontofsize(16) forwidth:100 linebreakmode:nslinebreakbywordwrapping].height < 25) size += 70; //either cell 70 (140) pixels tall or 105 (210)pixels els

jquery hide() not working in chrome -

i use jquery popup dialog, , in dialog have input , select box, want hide options in select box, worked in ff, not worked in chrome . <input type="text" onkeyup="search(this.value)" > <select id="cl_sel_l" multiple="multiple"> <option value='2' id='c_2'>aa</option> <option value='3' id='c_3'>bb</option> <option value='4' id='c_4'>cc</option> <option value='5' id='c_5'>dd</option> </select> var clients = new array(); clients[2] ='aa'; clients[3] ='bb'; clients[4] ='cc'; clients[5] ='dd'; function search(val) { ( var in clients) { if (clients[i].tolowercase().search(val.tolowercase()) == -1) { $("#cl_sel_l").find("#c_" + i).hide(); } else { $("#cl_sel_l").find("#c_" + i).show();

Edge Detection, Matlab Vision System Toolbox -

i have several images need find edge. have tried following vision.edgedetector system object in matlab, , example give here: http://www.mathworks.com/help/vision/ref/vision.edgedetectorclass.html they give example hedge = vision.edgedetector; hcsc = vision.colorspaceconverter('conversion','rbg intensity') hidtypeconv = vision.imagedatatypeconverter('outputdatatype',single'); img = step(hcsc, imread('picture.png')) img1 = step(hidtypeconv, ing); edge = step(hedge,img1); imshow(edges); which have followed in code. however code doesn't produce edges like, seems though matlab can pick on half of edges in entire image. there different approach can take finding edges, or way improve upon vision.edgedetector object in matlab? by default hedge = vision.edgedetector has threshold value of 20. try changing hedge = vision.edgedetector('threshold', value ) , play value see value works out best you.

javascript - addthis share facebook and google+ url -

i attempting use addthis create simple url shares whichever current page user on when click share button. of right now, have twitter working. when user clicks, able see url populated in tweet box. when user clicks facebook or google+, url doesn't seem show in share box. <ul class="addthis_toolbox addthis_default_style "> <li><a class="addthis_button_facebook"><img src="/img/facebook-social.png" width="20" height="20" border="0" alt="share" /></a></li> <li><a class="addthis_button_twitter"><img src="/img/twitter-social.png" width="20" height="20" border="0" alt="share" /></a></li> <li><a class="addthis_button_google_plusone_share"><img src="/img/google-social.png" width="20" height="20" border="0" alt="s

version control - Sharing workspace files between two machines - perforce -

i have set client workspace in windows machine [machine 1]. have pointed directory c:\somedir to map remote branch //branch/component/... and sync files local directory. i, then, copy on workspace files windows machine [machine 2]. create new workspace in [machine 2] , point directory have copied on [machine 1] again maps same remote branch. i use workspace created on [machine 2] check-in , work. perforce not recognize files. is there way me above? don't copy files machine machine yourself. instead, issue 'p4 sync' command on each machine, , let perforce software copy files each machine. perforce keep track of files have on each machine, , copy necessary files machine each time sync workspace. here's place start: http://www.perforce.com/perforce/doc.current/manuals/intro/index.html

c++ - "error LINK2019: unresolved..." -

i'm trying compile test program using visual studio 2012 written in c++, program computes inverse of arbitrary matrix using armadillo linear algebra library. requires enable lapack in armadillo's config.h file , link libraries/dlls in project's properties (which i've done). i'm compiling 64bit release i've downloaded suitable blas/lapack libraries here , have linked vs project against them. having done i'm still getting link errors whilst trying use armadillo's inv(...) method follows: 1>matrix.obj : error lnk2019: unresolved external symbol dgetrf_ referenced in function "public: static double __cdecl arma::auxlib::det_lapack<double>(class arma::mat<double> const &,bool)" (??$det_lapack@n@auxlib@arma@@sanaebv?$mat@n@1@_n@z) 1>matrix.obj : error lnk2019: unresolved external symbol dgetri_ referenced in function "void __cdecl arma::lapack::getri<double>(long *,double *,long *,long *,double *,long *,lo

c# - Web API action parameter is intermittently null -

related question: web api apicontroller put , post methods receive null parameters intermittently background while load testing existing web api project noticed lot of null reference exceptions result of parameter being null when posting action. the cause seems custom message handler registered log requests while running in dev environments. removing handler resolves issue. i understand in web api can read request body once , reading cause parameter null model binding wouldn't able take place. reason i'm using readasstringasync() method continuewith read body. looks behaving oddly in ~0.2% of requests (during local debugging using apache bench). code at basic level have following: model public class user { public string name { get; set; } } api controller public class userscontroller : apicontroller { [httppost] public void foo(user user) { if (user == null) { throw new nullreferenceexception(); } }

c++ - Why is iterating a list of objects slower than iterating a list of object pointers? -

after reading blog post how unfriendly list cache: http://www.baptiste-wicht.com/2012/11/cpp-benchmark-vector-vs-list/ ... tried make std::list of pointers objects more cache friendly putting actual object each node (thereby removing 1 indirection operation) in hope when current node cached, object too. however, performance decreased. here's code used: source , binaries: http://wilcobrouwer.nl/bestanden/listtest%202013-8-15%20%233.7z #include <list> using std::list; list<object*> case1; list<object> case2; class object { public: object(char i); ~object(); char dump[256]; }; // should not notice of difference here, equal amounts of memory // allocated void insertion(test* test) { // create object, copy pointer float start1 = clock->gettimesec(); for(int = 0;i < test->size;i++) { case1.push_back(new object(i)); } test->insertion1 = clock->gettimesec()-start1; // create obje

swing - Java - ZUI (Zoomable User Interface) -

i'm doing small personal project needs display extremely large amount of data, , thought implementing form of zoomable user interface allow user navigate around large amounts of data. i'm aware of existing projects such zvtm , piccolo2d i'll end using job, i'm quite tempted embark upon writing own. however, i'm little unsure how start. from i've been reading, seems projects piccolo2d developed due lack of 'scene graph' management within java, , piccolo2d developed based on work of older projects such 'pad', 'pad++' , 'jazz'. after quick bit of googling around, can see scene graph management available in javafx, i'm wondering if swing in java 7 has functionality. i've had bit of think, , i'm wondering if possible implement basic zooming interface using jlayer api, decorating object different layers dependant upon current zoom level. so example, let's can see directory @ furthest zoom level, zooming

Window.open of JavaScript is acting before it gets to the Rails controller -

in rails controller have this: def index provider_id = params[:provider] ||= 'all' thera_class = params[:therapeutic_class] ||= 'all' med_name = params[:medication_name] ||= 'all' in javascript side passing these params url query params when gets called goes index action method: window.open("http://localhost:3000/pharmacy/patients?provider="+provider_id+"&"+"therapeutic_class="+thera_class+"&"+"medication_name="+medication_name); the problem javascript values passing if don't have value , undefined passed undefined. i more concerned know architecturally wrong doing this? "rails way" of doing it? specially routing javascript rails controller , passing params need architectural input. when fetch infos on client side javascript, guess initialize variables provider_id, therapeutic_class, etc. this: var provider_id = $('#provider').val(); var thera_class = $

css - jQuery Masonry mobile 2 column layout fix -

Image
i'm trying "mobile" layout of page display 2-column layout, either masonry, or css forcing down 1-column. demo: http://jsfiddle.net/ecuu7/ this i'm trying accomplish: html ` <li class="item w3 stamp stamp-here"> <img src="http://placekitten.com/746/428" alt=""> </li> <li class="item"> <img src="http://placekitten.com/245/300" alt=""> </li> <li class="item"> <img src="http://placekitten.com/245/150" alt=""> </li> <li class="item"> <img src="http://placekitten.com/245/400" alt=""> </li> <li class="item w2"> <img src="http://placekitten.com/495/400" alt=

excel - How to insert row when finding a match in a column? -

hopefully issue described below simple one. still new vba , can't seem past current wall...good , bad days respect learning. unfortunately week has me @ loss how move on. the macro shown below run on spreadsheet 2 sheets (mpl & cad). mpl sheet = simple table of information cad sheet contains 3 tables of varying width (i.e. first table spans column c ae, 2nd , 3rd tables span column c m). 3 tables contain project name in column c. when macro run, starts in mpl sheet, prompts user new project name adds on new row in alphabetical order. works well. the next step cad sheet. stated, there 3 tables. able insert new project, inserts 1 of tables new name shows in column c. @ loss. believe must find way put values of column c sort of array, count add row on each instance. does sound logical plan? have searched endlessly way , can't seem gain ground. "irow = worksheetfunction.match(strnewproject, range("c:c")) + 1" method seems suffice

css3 - How can I rotate different cards using CSS? -

what trying have lot of cards displayed on screen. when click them, should rotate , change color. problem have no matter card click, first 1 changes, instead of 1 being clicked. here fiddle: http://jsfiddle.net/gz8zr/2/ html: <body> <div class="pane"> <input type="checkbox" id="button"> <label class="card" for="button"></label> <input type="checkbox" id="button"> <label class="card" for="button"></label> <input type="checkbox" id="button"> <label class="card" for="button"></label> <input type="checkbox" id="button"> <label class="card" for="button"></label> </div> </body> css: input { width:100px; height:100px; display:none } .card { wid

android - How to check Internet connection and spawn a Dialog if not connected -

my app internet based , when device has not got internet crashes due trying download files no success. have realised while typing if data requires goes offline crash. have tried reading documentation , trying add app appears need different have been reading. add 'no internet connection' dialog preferably on activity , not via toast. add 'data unavailable' dialog fragment within toast i use mainactivity load fragments doubt put kind of code in show dialog on fragment's used area. either way add mainactivity , internet loading fragment. mainactivity.class: public class mainactivity extends sherlockfragmentactivity { private viewpager mviewpager; private tabswipe mtabswipe; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); new firstlauncheula(this).show(); mviewpager = new viewpager(this); mviewpager.setid(r.id.pager); mviewpager.setoffscreenpa