Posts

Showing posts from January, 2015

android - Can I style the text in the overflow menu on devices that have hardware key -

i have been looking problem , can't find solution, nor recent response. question year ago ( how style text in action overflow menu ) said there no way handle text color, hope appcompat has addressed sherlock failed. i have tried changing android:textcolor android:paneltextappearance no avail. gone through source looking style might addressing no luck. know of possible solution? or still not possible? i'd cares hardware menus supposed 6 feet under, since samsung keeps on using them forced this. thank responses have did try this? stackoverflow.com/a/19008769/1139784 assume since there similar answer on question linked. @override public void oncreateoptionsmenu(menu menu, menuinflater inflater) { inflater.inflate(r.menu.your_menu, menu); int positionofmenuitem = 0; // or whatever... menuitem item = menu.getitem(positionofmenuitem); spannablestring s = new spannablestring("my red menuitem"); s.setspan(new foregroundcolorspan(color.

mysql - Cant retrieve data from an SQL database using PHP and session variables -

i have website following code in header - php echos in body returning anything: <?php session_start(); print_r($_session); $user = $_session['email']; $query = "select * first_page_data email_address= '$user' "; $result = mysql_query($query); $row_buyerdetails = mysql_fetch_assoc($result); ?> the following returns nothing: <?php echo $row_buyerdetails['phone_number'] ?> i know session variable named 'email' receiving value previous page print_r function on line 3. variable $user getting correct email address. the database set correctly (ive been able access in other ways, im trying modify access data related particular email address shown). if point me in right direction id apprectiate it! side, how people suggest debugging php other littering code echos , print_r functions? there way put breakpoints in example? edited in answer below as requested, code alterations requested: <?php $hostname_first_dat

sqlite3 - I think I need to change the format of how the date is stored -

i have field in sqlite3 database stored date field. not thinking, entered date in format mm/dd/yyyy , none of date functions work. is there simple way can convert dates proper format can perform searches work correctly? if fields have fixed length, can extract them few simple substr calls: update mytable set datecolumn = substr(datecolumn, 7, 4) || '-' || substr(datecolumn, 1, 2) || '-' || substr(datecolumn, 4, 2);

php - Error With doctrine/commons 1.2 -

i use symfony 2.3 , have problems doctrine/commons 1.2 this code $criteria = criteria::create() ->orderby(array("createdat" => criteria::desc,'id' => criteria::desc)) ; return $this->my_array_collection->matching($criteria); in doctrine/commons 1.1 it's works in doctrine/commons 1.2 dosen't works... error is syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right... update entity/profile.php /** * * @orm\onetomany(targetentity="..\entity\notifybase", mappedby="dest") */ protected $my_array_collection; entity/notifybase ... /** * notifybase * * @orm\table(name="my_table") * @orm\inheritancetype("joined") * @orm\discriminatorcolumn(name="discr", type="string") * @orm\discriminatormap({ * "s" = "..\entity\notifys", *

node.js - nodejs npm install socket.io error -

i new node.js developer. trying simple chat project. want install socket.io npm error. i use ubuntu 12.04 ubuntu@ubuntu-1210:~/masaüstü/blog$ npm install socket.io npm http https://registry.npmjs.org/socket.io npm err! error: failed fetch registry: socket.io npm err! @ /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12 npm err! @ cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9) npm err! @ request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18) npm err! @ request.callback (/usr/lib/nodejs/request/main.js:119:22) npm err! @ request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58) npm err! @ request.emit (events.js:88:20) npm err! @ clientrequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12) npm err! @ clientrequest.emit (events.js:67:17) npm err! @ httpparser.onincoming (http.js:1261:11) npm err! @ httpparser.onheaderscomplete (http.js:102:31) npm err! may report lo

ios - Multiple service call issue with iOS7 -

i dealing strange network issue. on ios 7 server call randomly reaching twice on sever. not happen ios 6. from server logs appears same request (i sending unique id in each server request) coming twice client sending 1 request. is known issue ios 7? or missing on client? or on server? please suggest. below code making server call: self.urlrequest = [nsmutableurlrequest requestwithurl:self.url cachepolicy:nsurlrequestreloadignoringcachedata timeoutinterval:999]; [self.urlrequest sethttpmethod:[self methodstringformethod:self.requestmethod]]; [self.urlrequest setvalue:[self.requestheader valueforkey:aheaderkey] forhttpheaderfield:aheaderkey]; [self.urlrequest setvalue:@"gzip" forhttpheaderfield:@"accept-encoding"]; [self.urlrequest sethttpbody:[self keyvaluepostdatafromdictionary:self.body]]; if (self.connection) { [self.connection cancel]; self.connection = nil; } self.connection = [[nsurlconnection alloc] initwithrequest:self.urlrequest deleg

Rails: Can't access questions associated with answers? -

i error undefined method `question_answers_path' line of code @question.answers i have answers belong_to question, questions has_many answers, , have added migration answers rails g migration add_question_id_to_answers question_id: integer i've ran db:migrate, can't figure out why method undefined. code i render <%= @question.answers % , in answer file <%= answer.answer %> my answer migration add_question_id looks this class addquestionidtoanswer < activerecord::migration def change add_column :answers, :question_id, :integer add_index :answers, :question_id end end my question looks class question < activerecord::base has_many :answers attr_accessible :query, :text validates :query, presence: true end my answer looks this class answer < activerecord::base has_many :comments, dependent: :destroy belongs_to :question attr_accessible :anonymous, :answer, :commenter, :votes end hav

Cakephp Containable not working at all -

i have been banging head on wall on this. have model sku belongs model purchase. appmodel has $actas=array('containable') , $recursive=-1 inside skucontroller, when $this->sku->find('all', array('contain' => 'purchase')); don't purchase. have searched many old questions here , elsewhere on internet can't seem resolve this. check if containable behavior being loaded, edited containablebehavior.php in lib\cake\model\behavior make invalid php file didn't produce errors. heck wrong!! here's sql debug: select sku . id , sku . purchase_id , sku . item_id , sku . upc , sku . quantity_avail , sku . per_unit_price_amt , sku . do_not_delete , sku . created , sku . modified , (concat('sk',lpad( sku . id ,8,'0'))) sku__idformatted sellble . skus sku 1 = 1 order sku . id desc cakephp ver: 2.4.4 not sure if different across versions have specified contain within array , works fine me. $th

jquery - How to make a clear x icon within top right of textarea on focus -

i using bootstrap 3 , know how make textarea clear x icon appear when user on focus youtube comment textarea. use jquery focus/focusout show/hide icon. use background image that. http://api.jquery.com/focus/ and attach click event, checks in box user clicked. example, if between 0 , 10px right, assume clicked icon. code should this: $('#element').focus(function() { $(this).css('background', 'red'); }); $('#element').focusout(function() { $(this).css('background', 'white'); }); $('#element').click(function(e) { if (($(this).width()-(e.pagex - $(this).position().left)) < 10){ alert('clear textbox'); } }); or better, chained code: $('#element').focus(function() { $(this).css('background', 'red'); }).focusout(function() { $(this).css('background', 'white'); }).click(function(e) { if (($(this).width()-(e.pagex - $(this)

google maps - Updating Fusion Table through Javascript -

so i've been trying update fusion table through google fusion table api specified here: https://developers.google.com/fusiontables/docs/v1/using#updaterow and i've run snag authentication believe. i've been trying authenticate using oauth 2.0. so first problem stands. how i'm building thing. first populate array of items want update information fusion table: $(document).ready(function () { $.ajax({ cache: false, async: true, type: "get", datatype: "json", url: "https://www.googleapis.com/fusiontables/v1/query?sql=select rowid, threepartaddress, latitude, longitude <table name> latitude != '0' , longitude != '0' limit 100&key=<key name>", contenttype: "application/json;charset=utf-8", success: function (m) { if (m != null) { meetings = m; } }, error: function (e) { console.log(e.statust

linux - get size of many files at once -

i've found can print list directories total size du -sb mydirectory is there anyway can apply same command array of directories du -sb (mydirectory yourdirectory hisdirectory)? just list dirs du -sb mydirectory yourdirectory hisdirectory note how man page says: du [option]... [file]... that's [file]... means. if want examine directories in current directory du -sb */

css3 - CSS simplify giant > list? -

i have bunch of css code, , want try , simplify can't seem figure out how it. simplify i'd have maybe 1 or 2 "statements" rather 15. browser support need latest chrome. there anyway it? body.app .tree ul li li { padding-left: 25px; } body.app .tree ul li li li { padding-left: 50px; } body.app .tree ul li li li li { padding-left: 75px; } body.app .tree ul li li li li li { padding-left: 100px; } body.app .tree ul li li li li li li { padding-left: 125px; } body.app .tree ul li li li li li li li { padding-left: 150px; } body.app .tree ul li li li li li li li li li { padding-left: 175px; } body.app .tree ul li li li li li li li li li li { padding-left: 200px; } the display type of <li> ignore padding or margin because you're supposed create new sub-levels in list using <ul> inside <li> . <ul> <li> item 1-1 <ul> <li> item 2-1

Best way to manage SQL Server on developer, test, staging, and production environments through Visual Studio 2013 -

i've read article on ms blog , on here on stackoverflow , this article they shed light on scenario, feel may missing something... the third article above nicely explains possible way deploy database versions including schema , data... oriented deploying production. i looking streamline deploying dbproj's developer db instances , test, staging , production.(all sql2012 std. edition) on developer instances, may few versions off... have contractors leave , may couple of dev cycles before new contractor tries deploy. also, how schema on target clean itself? know can turn off restrictions remove schema objects, on developer workstation instances logins different other environments , not want deleted!!! second article has clues not work when tried it. have 1 application role across environments , depending on environment right login placed in there. i have sense may have propose changing our schema, may not fly the other leads. i appreciate hearing has tried , tru

c - Includes in libclang headers -

i looking through libclang headers here( http://llvm.org/svn/llvm-project/cfe/trunk/include/clang-c/ ) in noticed of headers have imports in #include "clang-c/platform.h" // in cxstring.h // in index.h #include "clang-c/platform.h" #include "clang-c/cxstring.h" i'm unable understand why headers prefixed clang-c/ since of them in same directory shouldn't rather have been ./platform.h ./cxstring.h , likewise. if headers end installed in /usr/local/include/clang-c directory, sake of argument, command line option -i /usr/local/include ensure #include "clang-c/platform.h" found. if subdirectory not specified, you'd have have -i /usr/local/include/clang-c on command line. provides partitioning , separation; clang-c/platform.h separate file platform.h other package. note headers such <sys/wait.h> use scheme, sys in question o/s , headers found in /usr/include/sys (but not have specify -i /usr/include/s

java - How to maintain a single property file for multiple web server instances running on different node on WAS Cell NW deployment -

i maintaining/developing web application deployed in multiple nodes of websphere cell. there 2 nodes in cell. each node has web server in web application deployed. there 2 instances of web application. i can use url provider read property file web application. ( reference ) but have maintain identical property file on each server. when need change have change on both servers. is there anyway can maintain single property file , access web application deployed on different places? or other better way this? if read property files using url resource (a practice), can host property file on single internal web server. url resource reference in each of web containers point internal web server. have change property file in internal web server document root. this practice has several drawbacks. security - externalizing configuration, have attack vector. apply mutual-auth ssl scenario, gets more complicated maintaining 2 property files. availability - internal web s

python - parse a csv file into a text file -

i second year ee student. started learning python project. i intend parse csv file format 3520005,"toronto (ont.)",c ,f,2503281,2481494,f,f,0.9,1040597,979330,630.1763,3972.4,1 2466023,"montréal (que.)",v ,f,1620693,1583590,t,f,2.3,787060,743204,365.1303,4438.7,2 5915022,"vancouver (b.c.)",cy ,f,578041,545671,f,f,5.9,273804,253212,114.7133,5039.0,8 3519038,"richmond hill (ont.)",t ,f,162704,132030,f,f,23.2,53028,51000,100.8917,1612.7,28 into text file following toronto 2503281 montreal 1620693 vancouver 578041 i extracting 1st , 5th column , save text file. this have far. import csv file = open('raw.csv') reader = csv.reader(file) f = open('nicelydone.text','w') line in reader: f.write("%s %s"%line[1],%line[5]) this not working me, able extract data csv file line[1],line[5]. (i able print out) dont know how write .text file in format wanted. also, have process first column eg, "

issues running chef-client under "sudo" command vs "su" -

two scenarios. installing mysql on node using chef-client: 1) in first scenario run "sudo": sudo chef-client [2/5/14 6:30:31 pm] xxxx : : xxx: * execute[ldconfig] action run ================================================================================ error executing action `run` on resource 'execute[ldconfig]' ================================================================================ [2/5/14 6:30:41 pm] xxxx : : xxx: when run again "chef-client" works [2/5/14 6:30:48 pm] xxxx : : xxx: running as: sudo chef-client [2/5/14 6:31:15 pm] xxxx : : xxx: errno::enoent ------------- no such file or directory - ldconfig 2) on second scenario, recreating vm above same starting point, succeeds without errors: sudo su - chef-client the later scenario successfull, no errors related ldconfig. therefore, confused why sudo command chef-client not work, whereas second 1 has no issues ? it's in environment of shell. manual page su:

javascript - Padding between articles in css and jquery -

as of right code generating random number of new articles in div within body. trying make each article tile of different color able do. issue having padding. new web development , trying make vertical , horizontal spacing 15px. here have right , not giving me correct result also, have used "padding" , going border of articles rather each individual one. is looking for? fiddle by "article", mean long text lots of paragraphs/titles/subtitle? js var randomcolor = ['#73eff1','#d6c8f7','#f2c4df', '#c4f2cd', '#f2eec4', '#c4f2ef']; $('div').each(function(){ var random = math.floor( math.random() * ( (randomcolor.length - 0) + 1) ) + 0; var newcolor = randomcolor[random]; $(this).css('background-color', newcolor); });

c - Linked List in Contiguous Memory Space -

i have been looking code measuring latencies , 1 of methods came across deals iterating through linked list confined dynamically allocated memory space. understand traditional linked lists pretty , understand dynamically allocated arrays, putting 2 throwing me through loop. may seem relatively basic question not great c , whatever reason having hard time constructing it. i wanted make strides of 128 bytes tried doing following (i know way off base needed start somewhere) char** randomarray = malloc(accesssize); //allocate space linked list char** start=randomarray; //header base adress char** iterate; //iterator char** end =randomarray+accesssize; //end address for(iterate=start; iterate < end; iterate+=128){ *iterate = iterate+128; //step through in strides of 128 bytes, assign next addr current value } *iterate=start; //linked list circular, assign last element first i had no idea data type point to, a

angularjs - How to get URL parameters from a static URL address? -

i'm new angularjs. i've created simple test angularjs app retrieves test data $resource , binds data web page (no ng-view directives). test url http://localhost/member . while good, i'm trying url parameters in controller can pass $resource provider. for example, want query member of id 1234 - http://localhost/member/1234 . how retrieve id parameter of 1234 in controller? thanks help. if use angular routing $routeprovider , ng-view, access $routeparams . in case, don't use angular routing, suppose you're using html5 mode $location service. try: $location.path() angular.module('app', []). config(function($locationprovider){ $locationprovider.html5mode(true); }) .controller("testctrl",function($scope,$location){ alert($location.path()); }); demo

php - Only displays one item from array -

i trying echo list of items gather array displays 1 item when use code $sqli = mysqli_query($db_conx, "select url_name provtour order created desc limit 10"); while($row = mysqli_fetch_array($sqli)) { $urlname = $row['url_name']; } <div><center><?php echo '<a href="etournament.php?n=' . $urlname . '">' . $urlname . '</a>'; ?></center></div> ?> i know <center> should in css using here test purposes before move echoed array main style of website. above code echos out 1 input when there 7 inside database. $sqli = mysqli_query($db_conx, "select tourname , url_name provtour order created desc limit 10"); while($row = mysqli_fetch_array($sqli)) { $tourname = $row['tourname']; $urlname = $row['url_name']; } <div><center><?php echo '<a href="etournament.php?n=' . $urlname . '">' . $tourname . '</a>

java - How to test a project using wifi connection on Genymotion emulator? -

i try test project wifi connection : use genymotion emulator 4.2.2 emulator detect wifi/3g connection in project can't connect localhost it necessary change code or configuration on emulator? code : public class connectiondetector { private context _context; public connectiondetector(context context){ this._context = context; } /** * checking possible internet providers * **/ public boolean isconnectingtointernet(){ connectivitymanager connectivity = (connectivitymanager) _context.getsystemservice(context.connectivity_service); if (connectivity != null) { networkinfo[] info = connectivity.getallnetworkinfo(); if (info != null) (int = 0; < info.length; i++) if (info[i].getstate() == networkinfo.state.connected) { return true; } } return false; } }

Android kernel compile in ubuntu 12.04 LTS -

i trying compile kernel module android tab nexus 7 in ubuntu 12.04 lts using arm-linux-gnueabi-gcc. facing problem in locating kernel header files android. please me compile android source in ubuntu 12.04 lts correct header files loaded.

oracle11g - How can i add extra columns to my select statement using with clause -

how can add v_sp_cdra_weekly_update.indication column following sql statement. of displaying str_out column. appreciated. transformation(str_in,flag,str_out) (select substr(s,instr(s,'href=') + 5),1,cast(substr(s,1,instr(s,'href=') + 4) varchar2(4000)) (select key_documents s v_sp_cdra_weekly_update key_documents '%%https:%%') union select substr(str_in,2), case when flag = 1 , substr(str_in,1,1) != '>' 1 when substr(str_in,1,1) = '>' 0 when substr(str_in,1,5) = 'href=' 1 else 0 end, str_out || case when substr(str_in,1,1) = ' ' , flag = 1 '%20' else substr(str_in,1,1) end transformation length(str_in) > 0 )

asp.net - Coloring dynamically created table row without Javascript -

dim table1 new htmltable table1.border = "1" table1.bordercolor = "blue" j integer = 0 2 dim row new htmltablerow() dim cell1 new htmltablecell() dim cell2 new htmltablecell() dim rbl new radiobuttonlist() rowindex integer = 0 2 rbl.id = rowindex rbl.items.add("hi") dim lbl1 new label() lbl1.id = "hi" + rowindex.tostring lbl1.text = "hello" lbl1.height = "25" cell2.controls.add(lbl1) cell2.controls.add(new literalcontrol("<br />")) next cell1.controls.add(rbl) row.cells.add(cell1) row.cells.add(cell2) table1.rows.add(row) next placeholder1.controls.add(table1) in above code border appears rows , cell , whole table, need border should

csv - How to select columns conditionally in a data frame in R -

how can find mean/median (any other such thing) of women? have tried few piece of code access women data in particular unsuccessful. appreciated. > jalal <- read.csv("jalal.csv", header=true,sep=",") > which(jalal$sex==f) integer(0) > jalal age sex weight eye.color hair.color 1 23 f 93.8 blue black 2 21 m 180.8 amber gray 3 22 f 196.5 hazel gray 4 22 m 256.2 amber black 5 21 m 219.6 blue gray 6 16 f 152.1 blue gray 7 21 f 183.3 gray chestnut 8 18 m 179.1 brown blond 9 15 m 206.1 blue white 10 19 m 211.6 brown blond 11 20 f 209.4 blue white 12 21 m 194.0 brown auburn 13 22 f 204.1 green black 14 21 f 157.4 hazel red 15 15 f 238.0 green gray 16 20 f 154.8 gray gray 17 16 f 245.8 gray gray 18 23 m 198.2

excel - Find the next visible row -

i trying write function return next visible row in autofiltered list. in sheet autofiltered range code below returns #value error: function findnextvisible(s range) range dim l range dim r range dim counter integer counter = 1 set l = range(s, s.end(xldown)).cells.specialcells(xlcelltypevisible) each r in l counter = counter + 1 if counter = 2 findnextvisible = r next end function i suspect beginners error... update 1: ok great advice. can't use specialcells. unfortunately vba not strong in me , i'm having trouble sub version. perhaps there way. want compare text between non-contiguous (due filtering) rows, don't know how provide formula reference next visible row. tthe following should accomplish looking for. public function nextvisiblecell(range range) range application.volatile dim long set range = range.cells(range.rows.count, range.columns.count) = 1 rows.count - range.row if not range.offset(i).entirerow.hidden set nextvi

ruby - Rails 4 use link_to or button_to to run method? -

i implementing simple voting system , clicking on button +1 added. example, if question has 5 votes, increase. have written method already, not sure how execute clicking on link_to. need reconfigure routes? questions_controller.rb def self.ping @question = question.find(params[:id]) @question.increment!(:amplify) render_to |format| if @question.save format.html { redirect_to @question } end end end routes.rb resources :questions post '/ping' => 'questions#ping', as: 'ping' your routes need support id : post '/ping/:id' => 'questions#ping', as: 'ping' or better yet, if want scoped within question: resources :questions post '/ping' => 'questions#ping', as: ping end however, don't think want class method ping in questions_controller. think want instance method: def ping @question = question.find(params[:id]) @question.increment!(:ampl

android - Socket.IO receive callback value -

is possible receive value or listen event on client server without server emitting? if server has socket.on('get_name', function(data, callback) { try { var name = nameservice.getnamebyid(data.refid); if (!name) return callback({error:true,code:801,message:'name not exist!'}); callback(name.format()); } catch (err) { callback({error:true,code:999,message:err.message}); } } how can return data client? can see, doesnt have emit client cannot listen via event? i found solution, check link: androidasync socket.io receive callback value . consists on using emitevent method.

javascript - How do I force HighCharts to label every column? -

Image
i have basic column chart, numbers each year. works fine, if make window small, swallows half years there's plenty of room fit odd years in, how tell high charts that? var allspending = [ [2002, 591856], [2003, 839446], [2004, 848463], [2005, 1034755], [2006, 1569442], [2007, 1484477], [2008, 2280282], [2009, 3261702], [2010, 4132972], [2011, 5321516] ]; $(function () { $('#container').highcharts({ chart: { type: 'column' }, legend: { enabled: false }, series: [{ name: 'dollars', data: allspending }] }); }); i've played steps , staggering, want stagger when absolutely has to. see yourself! you can set tickinterval , min value. xaxis:{ min:2002, tickinterval:1 }, http://jsfiddle.net/xfv4a/9/

Java - dynamically instantiate abstract subclass -

i have following abstract class public abstract class document { private file file; public document(file f) { this.file = f; } ... public abstract string parse(); } currently, have 2 classes extend document , jsondocument , xmldocument . in class, documentcontent, have function iterates through collection of json , xml files , calls parse() function extract content. how can dynamically instantiate document object based on file extension detected without using conditional statement? there other file extensions added in future, want avoid need update documentcontent every time new document class type created. you can choose use reflection or not, without reflection need design builder, like: abstract class documentbuilder { public abstract document build(file file); } hashmap<string, builder> builders = new hashmap<string, builder>(); builders.put("xml", new builder(){ public build(file file) { return new xmldocument(fi

changing css after the page is rendered to cater RTL or LTR text -

mine single page js website gets text web request in json format. text format (rtl or ltr) known when response received. there way can re render page once response received? ie.., once response recieved either change css files or set html tag dir , styles re applied? you like document.getelementbyid('div id here').style.color='red' or soemthing like $("div id here").css("color","red"); just example once response recieved, add there changes style of div.

python - Why does this code work only with *args in something()? -

would mind taking minute explain why code works when give something() parameter *args? seems though should work without because being called without arguments... stumped.. from tkinter import * mgui = tk() mgui.geometry('570x130+700+200') mgui.resizable(width = false, height = false) mgui.title('title') def something(*args): if somevalue.get() == 'tom': mlabel2.lift() else: mlabel2.lower() mylist = ['henry', 'tom', 'phil'] somevalue = stringvar() somevalue.trace('w', something) mlabel = label(text = ' name:') mlabel.grid(row = 0, column = 0, sticky = e) mlabel2 = label(text = 'success') mlabel2.grid(row = 0, column = 0, sticky = e) mlabel2.lower() somemenu = optionmenu(mgui, somevalue, *mylist) somemenu.grid(row = 0, column = 1, sticky = w) somemenu.config(width = 14, anchor = w) mgui.mainloop() **edit, program initialize, select value somemenu throws out typ

css - Android webview: difference between Samsung Note 2 and Nexus 5 ? -

i loading html file webview with: webview.loadurl("file:///android_asset/webviewcontent/extrahelp/help.html"); this works fine on samsung note 2, not work on nexus 5. on nexus 5 error message related fonts. unable open asset url: file:///android_asset/webviewcontent/extrahelp/opensans-regular-webfont.woff unable open asset url: file:///android_asset/webviewcontent/extrahelp/opensans-regular-webfont.ttf i expect 2 devices able find these fonts in browser. relevant css code is: @font-face { font-family: 'opensansregular'; src: url(opensans-regular-webfont.eot); src: url(opensans-regular-webfont.eot?#iefix) format('embedded-opentype'), url(opensans-regular-webfont.woff) format('woff'), url(opensans-regular-webfont.ttf) format('truetype'), url(opensans-regular-webfont.svg#opensansregular) format('svg'); font-weight: normal; font-style: normal; } from http://developer.andr

css - rails bootstrap missing classes -

i use rails 4 , bootstrap 3 , has basic classes many of them missing. gemfile ... gem "therubyracer" gem "less-rails" #sprockets (what rails 3.1 uses asset pipeline) supports less gem "twitter-bootstrap-rails" ... my application.css *= require bootstrap_and_overrides *= require_self *= require_tree my application has basic styles forms , buttons there no many classes col-xs-6 col-md-4 can't build grid layout. when put example code bootstrap site view <div class="row"> <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> </div> <!-- columns start @ 50% wide on mobile , bump 33.3% wide on desktop --> <div class="row"> <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> <div class="col-xs-6 col-md-4">.col-xs-6 .col-m

ios - How to pop to previous scene? -

i created 2 scenes in storyboard , 1 xib file.i have put 2 buttons in xib file( button1 go first scene , button2 go 2nd scene).from first scene if move second scene , there third scene(xib file) , if click on button1,it navigates properly(i.e.,to first scene) , if click on button2,it comes second scene.it works properly.but instead first scene if move directly third scene(xib file) , if click button2,it comes first scene only.but wanted come second scene.button1 works properly,but not button2.so can me out in this?i want button2 work said. my code is: @implementation xyzgreenviewcontroller -(ibaction)goredscreen:(id)sender { [self.navigationcontroller poptorootviewcontrolleranimated:true]; } -(ibaction)gobluescreen:(id)sender { [self.navigationcontroller popviewcontrolleranimated:yes]; } think of uinavigationcontroller stack, every time navigate new scene/viewcontroller, pushing new view controller stack. in first scenario, have following in stacks once arrived @ th

css - Is it possible to have an effect of flowing flame around a div border -

i happen recall graphic effect saw many years ago in windows mobile phone. it list of items, when select 1 of them, there flame flowing around selected item. i have done quick research animation effects in css3 , found properties might useful e.g. keyframes, transition, animation-* etc. but still have no idea how use them present effect. cool, if me out , show me effect in jsfiddle. thank in advance. old post, in case runs across need in future, here pure css solution: http://pag.es/fire/ and http://pag.es/fire/test.html just peek @ source code see how works.

jquery - Using ruby, Sinatra and Mandrill how can I access individal elements from an api call and print as HTML? -

i want print, html, elements returned json object. ruby code is: get '/get_template_info' mandrill = mandrill::api.new name = "blah" result = mandrill.templates.info name end the jquery is: $(document).ready(function(){ $( ".result" ).on( "click", "#edit_template", function() { $.getjson("/get_template_info?name=blah", function(data) { $.each( data, function( key, value ) { var template_txt = '<p>' + this["code"] + '</p>'; $(".edit_div").append(template_txt); });//end each });//end json });//end click });//end doc in firebug console, get: {"slug":"blah","name":"blah","code":"blah message\r\n\r\n<p>and blah how is</p>\r\n<p> hope gets better </p>","publish_code":"blah message\r\n\r\n<p>and

r - creating id for each observation in panel data -

i have data set person names think id misrepresented (the ids not unique per person right in data set). create new id vector, wondering how. instance if have following list of names: name john john john tom tom david david sonia sonia ben how can create unique id per person? id name 1 john 1 john 1 john 2 tom 2 tom 3 david 3 david 4 sonia 4 sonia 5 ben seems simple process, i'm not sure how can use loop! suggestions help. i came loop looks close error: > (i in 1:5){ + a<-unique(dat$name) + a<-as.vector(a) + dat$id[a[i]]<-i + dat$id[a[i+1]]<-i+1 + } error in `$<-.data.frame`(`*tmp*`, "id", value = c(5l, 5l, 5l, 5l, 5l, : replacement has 11 rows, data has 10 use , may dat$id <- as.numeric(as.factor(dat$name)) where "id" new column , "name" name column, dat original data frame

php - How use the Pear installed packages in windows -

i have installed pear , package needed. (example php_codesniffer, phpdocumentor). confirmed package has installed using c:\wamp\www>pear list but when try use comment on windows comment prompt getting error 'phpcs' not recognized internal or external command please give me suggestion. you have issue path environnent variable (sometimes it's reboot force environment refresh) but in case, cvan specify complete path each exe : c:\>path\to\php\bin\php.exe path\to\phpcs path\to\file.php

c# - File Download Using Ajax and iframe -

i have read doing file download using ajax , iframes. can give me step step explanation of how or know of tutorials seeing using ajax on project seems best way this. edit: okay view code: <div class="buttons"> <input type="button" value="download file" class="button" id="downloadfile"> <script type="text/javascript"> $(function () { $('#downloadfile').click(function (e) { $('#downloadiframe').attr('src', '@url.action("downloadfile","invoice")' + '/report/invoices'); }); }); </script> this controller: public fileresult downloadfile(int id) { byte[] filebytes = system.io.file.readallbytes(server.mappath("~/reports/invoices/" + table.first(x => x.id == id).id + ".pdf")); string filename = table.first(x => x.id == id).id.tostring(); return file(filebytes,

ios - passing data from didSelectRowAtIndexPath to another view controller ios7 -

i trying implement slide menu, when select option, sends variable value second view controller, has query parse, updated based on selected value slide menu. how pass variable didselectrowatindexpath view controller menuviewcontroller.h @property (strong, nonatomic)nsstring *passvariable; menuviewcontroller.m - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { nsstring *identifier = [nsstring stringwithformat:@"%@", [self.menu objectatindex:indexpath.row]]; uiviewcontroller *newtopviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:identifier]; _passvariable = @"fieldname"; [self.slidingviewcontroller anchortopviewoffscreento:ecright animations:nil oncomplete:^{ cgrect frame = self.slidingviewcontroller.topviewcontroller.view.frame; self.slidingviewcontroller.topviewcontroller = newtopviewcontroller; self.slidingviewcontroller.topviewcontroller.view.frame = frame;

jquery - Is it possible to pass data from li elements to the database using forms? -

i have jsfiddle http://jsfiddle.net/w3vvl/157/ as can see have selected dvd's , unselected dvd's. i pass unselected dvd's database how should it? how request.getparamter("id"); where id=id of li... for li elements within form? not directly. instead of fading element, should move between parents have single li element on whole page. add hidden input field inside of , set name , value accordingly (name should allow locate dvd in database , value should tell in set is). these invisible form fields transmitted server when submit form.

c# - "Loading of the ImageList did not succeed" exception occured -

i having issue on statement below while loading imagestream. this.imagelist1.imagestream = ((system.windows.forms.imageliststreamer)(resources.getobject("imagelist1.images‌​tream"))); exception: system.reflection.targetinvocationexception: exception has been thrown target of invocation. ---> system.invalidoperationexception: loading of imagelist did not succeed when browsed , saw imagestream object null. has thrown exception above relating "mscorelib" too. any suggestions , comments appreciated i dont understand why using imagestream i prefer use himagelist imagelist_create( int cx, int cy, uint flags, int cinitial, int cgrow ); and can allocate images right before load.

backbone.js - Nested CompositeViews with different sources instantiate multiple parent views instead of child -

i have 3 views in application. 1 itemview (item) child of compositeview (category) child of compositeview (parentcategory). i waterfall instantiate views based on api hits data (in case i'm using local data give impression of live data). here application in js form: var app = new backbone.marionette.application(); app.addregions({ mainregion: "#main" }); var todoarray = []; // single row var todorow = backbone.marionette.itemview.extend({ template: "#todo-template", tagname: "li", events: { 'click span': 'clickspan' }, clickspan: function() { console.log(this); } }); // grid view var categoryview = backbone.marionette.compositeview.extend({ tagname: "li", template: "#category-template", itemview: todorow, itemviewoptions: function(model, index) { return { parent: model.get('parent') } }, appendhtml:

How to access multiple html file elements from same external javascript file -

this want know if can access multiple html file elements same external javascript file. scenario: one.html <div id="one" onclick="onediv"></div> two.html <div id="two" onclick="twodiv"></div> script.js function onediv(){ var instance = document.getelementbyid("one"); } function twodiv(){ var instance = document.getelementbyid("two"); } the question more specific if ask one js file multiple pages if understood question correctly, want have single function clicked div. you can achieve this keyword. this references dom object event triggered in case. for example if want alert div's content can this: <div id='one' onclick='shout()'>foo</div> <div id='two' onclick='shout()'>bar</div> <script type='text/javascript'> function shout(){ alert(this.innerhtml()); } </scrip

asp.net - not able to resolve java.net.UnknownHostException -

am trying connect server using telnetwrapper apache.commons.net jar before days working file giving java.net.unknownhostexception am not able figure out why can please give me possible reason behind because working fine before started giving exceptions thanks in advance complete exception wrapper: java.net.unknownhostexception: cmsrv3 java.lang.exception: error connecting telnet server. @ com.honeywell.corept.util.telnetclient.<init>(telnetclient.java:25) @ com.honeywell.corept.cm21.telnetclient.<init>(telnetclient.java:18) @ cm21.build.cm21build.main(build.java:576)

string formatting - How to force exponential number to be print with leading dot in python? -

i trying print exponential number in python need number start dot. : >>>print( "{:+???}".format(1.2345678) ) +.1234e+01 if multiply number 10 , format number scientific notation, have correct exponent coma misplaced. fortunately, know there 1 character sign , 1 digit before coma. can do def format_exponential_with_leading_dot(n): = "{:+e}".format(n * 10) return a[0] + '.' + a[1] + a[3:] >>> print format_exponential_with_leading_dot(1.2345678) +.1234568e+01

Error in MDX Query for ASO calc scripts -

i have calculation script aso cube copies data 1 version . in pov section of code using crossjoin function of mdx create set of tuples pov "crossjoin({filter([accounts].members, isleaf([accounts].currentmember))}, crossjoin ({[d100]}, crossjoin ({[2014]},{[usd]})))" sourceregion "crossjoin({[actl]}, {[eop]})" ; but on execution mdx using maxl getting following error maxl shell completed error error - 1300033 - upper-level members, example [ac0001], not allowed in argument [pov]. select level-0 member. error - 1241190 - custom calculation terminated essbase error 1300033 in pov. i using filter function filter out lev 0 members account dimension in pov section, somehow still returning parent level members. tried [accounts].levels(0).members but faced same problem. can me out going wrong ? calculation scripts typically used calculate accounts derived input accounts in 1 application.database. calculation script uses consolidation operators

java - Get data between Activity and fragment with googleMaps -

introduction well, have main activity has: 1 button starts googlemaps api 2 edittext show latitude , longitude coordinates i mannage use of smartphone or tablet, i'm using fragment map. when use tablet, shows map @ right side of main acitivity (i use framelayout on xml file), , when use smartphone, throws intent show new activity map. but, mapsfragment isn't activity, can't call intent, i've created intermediate activity. the structure this: mainactivity(geocodingactivity) -> googlemapsactivity-> googlemapsfragment functionality the use of app simple. when click on map button, starts googlemaps. there, click on position of map , must return position's coordinates main activity , show them in edittexts. code this code use start googlemaps: /**on button click in main activity*/ intent intent = new intent(); intent.setclass(geocodingactivity.this, googlemapsactivity.class); startactivityforresult(intent, request_code_map_location); /**

mysql - Can I combine ten similar SQL queries to one? -

this mysql query: select round(sum(cfv.numbervalue),0) mysum jissue ji join customfieldvalue cfv on ji.id=cfv.issue ji.pkey '%pb-%' , cfv.customfield=11381 , ji.issuestatus=10127; there 2 possible cfv.customfield (11381 , 11382) , 5 possible ji.issuestatus (10127 -> 10131), run query ten times changing 2 fields each time. is possible compress 1 query return ten sums? edit: result include empty values. currently, 8 rows returned because ji.issuestatus=10128 has no numbervalue 11381 , 11382. result include 10128 empty values 11381/2. as said wumpz , anthony grist, use group by return 2*5 sums without sums missing entries . to return sums missing entries, use left join. difference between tableexpr1 join tableexpr2 on ... , tableexpr1 left join tableexpr2 on ... left join entries tableexpr1 output when there no corresponding entries in tableexpr2. select ji.issuestatus, cf.id customfield_id, round(sum(cfv.numbervalue),0) mysum jissue ji cross j

apache - Retaining protocol and port number from reverse proxy request -

case: user requests https://api.abc.com this reverse proxied (apache 2.2) internal server server @ http://internal.abc.com:123 as per retain original request url on mod_proxy redirect , adding: proxypreservehost on to httpd.conf, internal.abc.com recognizes original request url as: http://api.abc.com:123 is there way me recover original url of https://api.abc.com ? is, retain original protocol (http) , port (80, or empty fine) the way have got around adding header in virtual host file. requestheader set original-protocol-ssl true early you need check header in code determine came from.

parsing - Java reading information from a website using Jsoup -

i've gone through multiple posts parsing , such. of responses saw recommending person use library or else. problem right creating algorithm fetch exact information want. purpose fetch 2 statuses weather website school closings. started using jsoup recommended need it. webpage: click here image: click here example of webpage source: click here i figure out how line of text within webpage since know name of school im looking for, 2 lines down status need. easy if each school had status either closed or two-hour delay can't make search that. want ideas or answers on how can apporach this. going 2 times because wanting 2 schools. have names can use them need status. here example of want do. (sudo code) document doc = connect(to url); element schoolname1 = doc.lookfortext(htmllinehere/schoolname); string status1 = schoolname.getnext().text();//suppose gets line right after should status , cleans off html. this have right now public static schoolclosing lookupdeb