Posts

Showing posts from February, 2012

r - Vertical boxplot using chart.Boxplot -

i'm not able horizontal=false in chart.boxplot() produce vertical plot: require(performanceanalytics) z <- runif(1:100) chart.boxplot(z) chart.boxplot(z, horizontal=false) the 2 plots same. this performanceanalytics version 1.1.0 , r version 3.0.0. it small bug. should contact maintainer. should replace line ( in 2 places in code) boxplot(r[, column.order], horizontal = true,.. by boxplot(r[, column.order], horizontal = horizontal,...

node.js - Express JS and SocketIO Using -

sorry guys, here ask how using express js , socket io. new kind of tech. the 1st question is, necessary install express every project? mean, when want create new project,i create new folder, should run new command prompt, point directory , install express? if so, tell me offline please? because cant connect internet. the 2nd question is, if use express js, shall place client file such html / javascript(front end) in same directory server file? how can run example express project external source, such github? 3rd question is, have seen lot tutorial express js + socketio. 2 things framework,right? how can use them in project / folder? really appreciate , big if guys help, thank :) question 01: answer: don't have install express on each of project in order use it. can run command , install globally , can have offline. npm install -g express the above command install express globally, can use offline well. question 02: answer: recommendation of placing st

html - Grow floated elements to fit inside -

i use full width of ul-element floated li-elements. somehow possible using %-values padding of li-elements? can't use fixed width lis, since content not same lenght. this html code: <ul> <li>january</li> <li>february</li> <li>march</li> <li>april</li> <li>may</li> <li>june</li> <li>...</li> </ul> and here comes css: ul { overflow: auto; list-style: none; margin: 0; padding: 0; width: 600px; background-color: blue; } li { float: left; padding-left: 3%; padding-right: 3%; background-color: #dd0000; border-left: 1px solid #ffffff; } li:hover { background-color: #ff0000; } find example @ jsfiddle: http://jsfiddle.net/6uy4y/ red li-elements should end, blue ul ends, when changing width of ul. thanks pointing me right direction! it looks start of tabular data. i'd use <table> . if

Importing Alexa data into Amazon RedShift -

i have taken daily dump file , unzipped , placed onto s3. when try , copy statement in postgresql receiving following error missing newline: unexpected character 0x14 found @ location 4 query: copy temp 's3://bucket/top-1m.csv' credentials 'blah blah blah'; do have add kinda character each line? raw data: 1,facebook.com 2,google.com 3,youtube.com 4,yahoo.com 5,amazon.com 6,baidu.com 7,wikipedia.org 8,live.com the redshift copy command uses pipe '|' default delimiter character. if files delimited character (comma in case), need add delimiter keyword copy command. copy temp 's3://bucket/top-1m.csv' credentials 'blah blah blah' delimiter ','; or comma separated files: copy temp 's3://bucket/top-1m.csv' credentials 'blah blah blah' csv;

FileWriter using netbeans not working -

here code print current time in file using netbeans not working. private void jbutton2actionperformed(java.awt.event.actionevent evt) { // todo add handling code here: // l1.settext(randomint+"cleaned files"); l1.settext("all viruses cleaned"); string timestamp = new simpledateformat("yyyymmdd_hhmmss").format(calendar.getinstance().gettime()); filewriter filewriter = null; try { string content = "hello! java-buddy :)"; filewriter f1=new filewriter("filename.txt"); f1.write(timestamp); f1.close(); } catch (ioexception ex) { system.out.println(ex.getmessage()); // logger.getlogger(writestringtofile.class.getname()).log(level.severe, null, ex); } }

3-Level Nested Array in PHP & MYSQL -

i trying create nested array, in order produce nested list within webpage. so far have managed following: array ( [2012] => array ( [show 1] => array ( [0] => class 1 ) [show 2] => array ( [0] => class 1 ) ) [2009] => array ( [show 1] => array ( [0] => class 1 ) ) [2008] => array ( [show 1] => array ( [0] => class 1 ) ) ) however actual results have more 1 class per show, should like: [2012] => array ( [show 1] => array ( [0] => class 1 [1] => class 2 [2] => class 3 ) etc etc etc. i've managed far, haven't clue how continue, in order more 1 class per show. my code follows: $handlerresults = $db->query(&qu

php - What is the right choice of XML encoding for Latin extended -

ok, need creat db interaction latin extended caracters such as: ŠšĐđČčĆ掞 etc.. now 1 way set encoding utf (which result db data caracters converted Å¡Å¡Å¡ (using latin1_swedish_ci colation).. this works fine while fetching data, unless need limit length of th field, problem when split occures in middle of Å¡, result caracter ?? instead of Ć.. so simple question, encoding use in html, , colation use inside db retain original caracters. thank you ` <!doctype html> <head><meta charset="utf-8"> </head> <body> <?php $dbx = new mysqli('localhost','root','pass','dbtester') or die ('error connection'); $query = $dbx->prepare ("select id, cont dbtester"); $query->execute(); $query->bind_result($id, $cont); while($query->fetch()): echo $id; echo $cont; endwhile; ?> </body> </html>` change storage

jquery - Fix width and sticky navigation and top bar in Zurb Foundation 4 -

Image
i encountering issue of not being able make left hand side navigation bar have fixed width , @ same time make not top-bar, side navigation bar sticky. i tried google results , stackoverflow hints find , still no luck. my html: <!-- navigation bar --> <div class="sticky"> <nav class="top-bar"> <ul class="title-area"> <!-- title area --> <li class="name"><h1><a href="#"><img src="img/logo.png"> </a></h1></li> <!-- remove class "menu-icon" rid of menu icon. take out "menu" have icon alone --> <li class="toggle-topbar menu-icon"><a href="#"><span>menu</span></a></li> </ul> <section class="top-bar-section"> <ul class="left"></ul> &

C Programming Issues: Passing, creating, and returning structures in functions. -

this function doesn't work , can't figure out why. compiles fine , program seems run, upon close examination , debugging i'm discovering that: newimg->x = b; newimg->y = a; isn't working , it's causing problems. tried copying newimg=img doesn't let me change values of newimg later. remain exact same. tried modifying values of img, doing newimg, debugging shows newimg getting extreme values. here structure: typedef struct { unsigned char grayscale; } pgmpixel; typedef struct { int x, y; pgmpixel *data; } pgmimage; here function: static pgmimage *rotatepgm(pgmimage *img) { pgmimage *newimg; // memory allocation pgm newimg = (pgmimage *)malloc(sizeof(pgmimage)); if (!newimg) { fprintf(stderr, "unable allocate memory\n"); exit(1); } //memory allocation pixel data newimg->data = (pgmpixel*)malloc(newimg->x * newimg->y * sizeof(pgmpixel)); if (!newimg)

Better way to find value in comma separated string (Java/Android) -

assuming string defined: string list = "apples,orange,bears,1,100,20,apple"; without separating list out collection or array, there better way find string in list? instance, if search "bear", there should no result, since there no exact match ( bears doesn't count). can't " ,bear," since there's no guarantee word bear not appear @ beginning or end of file. you still use like: (^|,)bears(,|$) it commas, or beginning or end of line, believe you're looking for. edit: addendum since denomales mentioned it, above regex search consume commas (if any) can find, overlapping matches in case of lists apples,orange,bears,honey,bears,bears,bears,bears,9999,bees , count 3 bears out of 5 present. can in case use lookarounds. might take bit head around them, gist of behind, or ahead of characters without consuming them. makes possible find 5 bears, , how use them: (?<=^|,)bears(?=,|$) a breakdown of characters... ^ m

c++ - Intel Inspector reports std::mutex memory leaks -

intel inspector reports internal memory leak simplest std::mutex examples: // std_mutex_test.cpp : defines entry point console application. // #include "stdafx.h" #include <iostream> #include "testmutex.h" int _tmain(int argc, _tchar* argv[]) { std::cout << "starting\n"; ctestmutex testmutex; (int = 0; < 10; i++) testmutex.dostuff(); std::cout << "done\npress key...\n"; getchar(); return 0; } // testmutex.h : class testing mutex // #include "stdafx.h" #include "testmutex.h" class ctestmutex { private: std::mutex mtx1; long sharedstuff; // example testing mutex, otherwise use atomic here public: ctestmutex() { sharedstuff = 0; } ~ctestmutex(); void ctestmutex::dostuff() { mtx1.lock(); sharedstuff++; mtx1.unlock(); } }; intel inspector xe 2013 report follows: id type sources modules object size stat

xcode - can't setup ruby environment - installing fii gem error -

Image
i'm trying setup environtment ruby project. when run 'bundle', have error during installing 'fii' gem: installing ffi (1.8.1) gem::installer::extensionbuilderror: error: failed build gem native extension. /users/bmalets/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb checking ffi.h... *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. /users/bmalets/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': compiler failed generate executable file. (runtimeerror) have install development tools first. gem files remain installed in /users/bmalets/.rvm/gems/ruby-1.9.3-p448@api2/gems/ffi-1.8.1 inspection. results logged /users/bmalets/.rvm/gems/ruby-1.9.3-p448@api2/gems/ffi-1.8.1/ext/ffi_c/gem_make.out error occurred while installing ffi (1.8.1), , bundler cannot continue.

ios - How to position a container view so it's the same distance from top of screen on iPhone 4 & iPhone 5? -

i have uiviewcontroller scrollview , containerview subview. have positioned containerview iphone 5 screen when load on iphone 4, of content should on screen cut off. how ensure container view shows same amount of content bottom on both iphone 4 , iphone5 - i'm sorry if broad question if there's other information can provide let me know thank you if you're using layout constraints, give container view fixed constraint top , bottom of main view, , no fixed height. cause view expand , contract depending on screen size. depending scroll view is, 1 of constraints might have to it, rather top or bottom of screen (so, if scroll view on top, have constraint top, fixed height, , spacing constraint container view below it. container view need 1 bottom of superview).

How to calculate the last Thursday of previous month from current month in MySQL? -

i have 1 problem. have 1 table contains columns id , price , date . every day, entry made in table, if there holiday no entry made. need calculate price on last thursday of previous month date in current month. if day holiday, should iterate next day , find close price day. id price date 145 120 01-05-2013 (dd-mm-yyyy) 145 130 02-05-2013 145 140 03-05-2013 145 150 04-05-2013 145 154 06-05-2013 145 125 30-05-2013 145 124 31-05-2013 145 1236 01-06-2013 145 415 02-06-2013 145 124 03-06-2013 145 124 04-06-2013 145 122 05-06-2013 145 124 06-06-2013 145 125 29-06-2013 145 458 30-06-2013 i've tried: select case weekday(last_day(curdate()-interval 1 month)) when 6 date_sub(last_day(curdate()-interval 1 month),interval 3 day) when 5 date_sub(last_day(curdate()-interval 1 month),interval 2 day) when 4 date_sub(last_day(curdate()-interval 1 month),interval 1 day) when 3 date_sub(last_day(curdate()-interval 1 month),interval 0 day) when 2 date_sub(l

How can I create an Eclipse plugin that extends Java syntax coloring in certain files? -

i working system uses regular java code snippets of new code syntax inside of it. system compile regular java files, , these special files different extension. @ moment, these special files edited eclipse's regular text editor. how can add editor use regular java syntax coloring small addition? you should develop eclipse plugin extending eclipse editor. the comment of @elist right place go.

php - How to prevent Pagespeed from caching images from remote server? -

i have enabled pagespeed (apache's module) on website http://frendsdom.com . 1) there images loaded different host. real url of remote image this- cf2.imgobject.com/t/p/w500/o1nfdxkfpe9efp6lsween2mx1oi.jpg 2) pagespeed converts url - cf2.imgobject.com/t/p/w500/250x300xo1nfdxkfpe9efp6lsween2mx1oi.jpg.pagespeed.ic.pvxt1aut2o.jpg consequently image doesn't load browser no such url (2) exists. how solve this? sounds need modpagespeeddisallow [1]. i find little worrying though, mod_pagespeed trying optimize cf2.imgobject.com when html being served frendsdom.com. mod_pagespeed doesn't allow optimisation of resources hosted on other domains out of box security reasons, need check configuration that. there faulty modpagespeedallow line in there? [1] https://developers.google.com/speed/pagespeed/module/restricting_urls

oauth 2.0 - OAuth2 Login on Android and iOS -

i have built web application allows users login google , facebook through oauth 2.0. used simpleauth project on google app engine. in database storing oauth id, google looks like: https://www.google.com/accounts/o8/id?id=aitoawnrcueakdy_emesk8fdefngp-cckjbmvf0 and facebook looks like: facebook:1494270173 and wondering if can use same method on ios or android app. know need different implementation id constant if using facebook or google login on mobile? the google identifier show openid2 identifier, not oauth 2 one. openid2 not work on ios nor android. not familiar simpleauth, if can configure use oauth 2 or openid connect (which based on oauth 2, not confused openid2), using oauth 2 protocol on ios or android give same identifier same user.

javascript - Jquery returns NaN with price -

hi trying work out total price in jquery i have try full jquery this jquery changing price in get_price have select statement echoing price echo $row2['price']; the way works when every change length price change so in pricetag example 40.00 without £ " #pricetag somelike £40.00 " need rid of £ in #pricetag before executing parseint() . this: var price = '\u00a3' + (parseint($('#pricetag').text().replace(/\u00a3/, ''), 10) * qty); parseint() searches digits starting beginning of string, , cuts search @ first non-digit found. in case first character £ , parsefloat() returns nan , produces nan when used * . edit what ever have (or don't have anything) in front of numbers in #pricetag , can use remove it: var price = '\u00a3' + parseint($('#pricetag').text().replace(/^\d/, ''), 10) * qty; also notice, have validate qty before using within calculations. a live demo @ jsfid

javascript - menu always on top and horizontal scroll -

i have trouble - http://pickup.eurocargo.fi/last500.php need top menu on top, , menu width can 2x more width of monitor. how possbile top menu horizontal scrolling? here top menu css: .visiblediv, #topmenu { position: fixed; overflow: auto ; width: 100%; border: solid 1px #e1e1e1; vertical-align: middle; background: #fff; text-align: center; top: 0px; left: 0px; padding-bottom:10px; } with overflow tag scrolls, 1 of page , 1 of menu, need combine 1. if use css without overflow, cutted topmenu. thank you!! have fiddle : http://jsfiddle.net/lulu3030/3stwf/ the css : html { height: 300%; } #menu-container { position: fixed; top: 0; left: 0; right: 0; overflow: auto; border: solid 1px #e1e1e1; background: #eee; text-align: center; padding:10px; } #menu { width: 200%; } the html : <div id="menu-container"> <div id="menu">my menu here</div>

No image strip file and no single request with gwts ClientBundle ImageResource -

the purpose of gwts clientbundle + imageresource reduce number of http request 1 , minimize amount of transfered bytes while clientbundle creates single jpg strip file contains jpg-pics. example have ten pics, clientbundle put these ten pics single jpg-strip-file , if app call these images there 1 http request single-jpg-strip file. thats understand. thing clientbundle not creating single strip file. creates ten cacheable files when enabling caching still not create single stripfile. iam understanding wrong purpose of clientbundle is? there 2 small misunderstandings in question: clientbundle generate sprited image ie6/7; other browsers it'll use data: urls (at least that's default configuration) until threshold on size of image , directly reference image external 1 (not sprited). clientbundle won't generate sprited images (for ie6/7) images lossy compression (such jpegs), lossless 1 (such png or gif), , if they're not animated, , if they're not bi

django - Sending standard output from command line function to python StringIO object -

wow, hard encapsulate issue here succinct headline. hope managed. i've got simple thumbnail feature causing me issues when try retrieve url amazon s3, convert using imagemagick. use pil read in image file , convert it, pil doesn't read in pdf formats, i'm resorting convert through subprocess call. here's code django views.py. idea here file url s3, open convert , process png, send stdout, , use outputted buffer load stringio object, gets passed default_storages save thumbnail file s3. quite faff such simple job, there go. please note: cannot reliably save file disk using convert on production set-up heroku, otherwise, i'd doing already. def _large_thumbnail_s3(p): # url s3, trimming off expiry info etc. far good. url = default_storage.url(p+'.pdf').split('?') url = url[0] # opens pdf file fine, , proceeds convert , send # new png buffer via standard output. subprocess import call call("convert -thu

mapreduce - How complex can a Hadoop Map Reduce program be? -

two basic general questions, hope can clarify: does every program executed via hadoop has written in map/reduce format? how complex can programs be? (is theoretically possible run program via hadoop?) your first question:yes because hadoop uses map/reduce model,but can use map function in problem,for example sorting! your second question:no hadoop can not everything,because use map/reduce model,some program can not resolved map/reduce,like nested program,so companies developed many other program models pregel, dremel , on!

Issue in rendering circles in javascript -

Image
i trying make tooltip like: http://jsfiddle.net/6cj5c/10/ graph , result on realtime graph: http://jsfiddle.net/qbdgb/52/ wondering why there gap between circles , graph , why @ beginning there vertical line of circles? when starts circles close curve suddendly start jump , down !! want circles move smooothly , stick on surface of curve. think problem not moving "path1" , not recognize circles , thats why moving separetly or maybe value of tooltipis different of value of curve not overlap!. how data generated ( value , time) , tooltip: var data1 = initialise(); var data1s = data1; function initialise() { var arr = []; (var = 0; < n; i++) { var obj = { time: date.now(), value: math.floor(math.random() * 90) }; arr.push(obj); } return arr; } // push new element on given array function updatedata(a) { var obj = { time: date.now(), value: math.floor(math.random() * 90) }; a.push(obj); } var formattime = d3.time.format("%h:%m:%

json - How to send hastag access_token posted by url to server inorder to use it further -

i explain in detail, trying authorize youtube webapp. post below https://accounts.google.com/o/oauth2/auth? client_id=1084945748469-eg34p0an9fut6urp5.apps.googleusercontent.com& redirect_uri=http://www.abc.com/site/video& scope=https://gdata.youtube.com& response_type=token and youtube respond request json object http://www.abc.com/site/video#access_token=ya29.ah6rkxrg81f7h9vzlca4wmzzzgjlmbsduk-odxom5w&token_type=bearer&expires_in=3600 now want send access_token since hastag data can't access anyway using php on server side, know have send server using ajax or json somehow. using yii framework if there yii method happy use. if no choice use

java - can't find source of inadvertent loop -

i started refactoring program working on , hit major road block... have 1 class acts nucleus, 6 other smaller (but still important) classes working run program... took 1 method [called 'populate()'] out nucleus class , made entirely new class [called 'populationgenerator'], when try create object of newly created class anywhere in nucleus class stuck in never ending loop of new class i've never had issue when trying create objects before... here's nucleus class before refactoring: public class simulator { // constants representing configuration information simulation. // default width grid. private static final int default_width = 120; // default depth of grid. private static final int default_depth = 80; // probability fox created in given grid position. private static final double fox_creation_probability = 0.02; // probability rabbit created in given grid position. private static final double rabbit_creation_pro

linux - tmux: confusing behavior with redirection and piping -

here trying - copy tmux buffer contents file. first attempt: $ tmux show-buffer > myfile this "hangs", in never completes. however, can like: $ tmux show-buffer | cat > myfile then try else, use 'tee' command instead: $ tmux show-buffer | tee myfile .. .. tee: write error it displays "tee: write error" @ end, .. indicating part of buffer prints, not (as should) print whole buffer. file has entire contents, however. i believe has how tmux show-buffer works , it's relation redirection , piping behavior. know more this? this seems have been issue older tmux version (1.5). 1.8, works fine. related link

ios - Is Apple Push notification using APNS free of cost? -

we planning develop push notification service telecom operator. haven't got information whether apns push service free of cost or should make payment? my questions are, should pay using apns push service? if operator want sent push notification millions of subscribers, should pay apple or absolutely free? if not free, please share url payment details available. is there limit number of notification sent or number of subscribers? please answer these questions. apple not charge separate fee utilizing push notification service. your cost server sending push notifications apple. there third-parties provide servers , there fee that.

No Such Column Error In Android SQLite -

i created database. gives me "no such column error". i'm sure database have coloumn because used sqlite manager add data. don't understand why getting such error. i've searched question here, answers never helped me. most of answers says if there no space between column name while writing code, gives error. think writed correctly. public void oncreate(sqlitedatabase sqlitedatabase) { sqlitedatabase.execsql( "create table " + table_name + " (" + bnum_col + " text, " + pname_col + " text, " + author_col + " text, " + type_col + " text, " + pyear_col + "integer );"); } my logcat showed me : cursor c = db.query("btable", select, null, null, null, null, null, null); please me. the last field has no space between column name , keyword integer . need change line: + pyear_col + "integer );&

multithreading - Objective C - Offloading to separate threads & optimizing speed of app -

so once again have issue , i'm not quite sure how go dealing it. have uicollectionview contents updated such: user slides settings panel (uicollectionview dimmed out translucent view overlay). user pushes various buttons change object(s) uicollectionview displays. object updated simultaneously (some settings take longer others update). user slides settings panel down. uicollectionview updated based off of new object. the problem program comes halt (for 3-4 seconds) every action performed above. understand offloading of these tasks other threads somehow involved here. i'm bit confused tasks offload other threads , how assure have been completed before next actions occur on main thread. so that, question - (and how) go offloading any/all of above tasks other threads keep app running smoothly? also, how check offloaded task has been completed main thread can complete next task? thank you, in advance.

Custom Querysets using Multiple Models in Django -

i trying findout way in can use multiple models in queryset. instance, in case have 2 tables - photo , user. class photo(models.model): username = models.foreignkey(user) image = models.imagefield(upload_to='photos') alt_text = models.charfield(max_length=255) class dr_user(models.model): userid = models.foreignkey(user) follows = models.manytomanyfield('self', related_name='followed_by', symmetrical=false, blank=true) objects = dr_user_manager() class dr_user_query_set(queryset): def profile_pic(self): # uid = self.userid photo = photo.objects.get(username=uid) if photo.exists(): return photo.image.url else: return 'http://d12df125d01b8a258a3a-8112fdc02f7d385b44f56eb9e899d81c.r88.cf2.rackcdn.com/default.png' def userinfo(self): uid = self.userid obj = user.objects.get(id=uid) userinfo = obj.first_name + ' ' + obj.last_name return user

c# - How does samachar.com use google news rss? -

how website www.samachar.com use google news rss? i looking functionality coded in asp.net. have code not working google news rss. code: public void createrss(string path, int maxitem1, string opennewwindow,string lengthoof_decs) { xmldocument doc = null; xmltextreader rssreader = null; label doclbl = null; label snolbl = null; try { try { rssreader = new xmltextreader(path); } catch (exception) { return; } if (rssreader == null) { return; } doc = new xmldocument(); try { doc.load(rssreader); } catch (exception) { return; } if (doc == null) { return; } readdoc(doc, maxitem1, opennewwindow, lengthoof_decs); } catch (exception) { throw; } { doc = null; rssreader = null;

c - How can I cancel a blocked read/recvfrom system call on vxworks or linux -

in task i : ... while (1) { if (running == false) break; ret = read(fd, buf, size); /* or: ret = recvfrom(sock, buf, size, 0, null, null); */ ... } in task ii : ... running = true; /* ioctl(fd, fiocancel, 0); */ close(fd); /* or: close(sock);*/ what should in task ii cancel blocked task i , in vxworks , there function, ioctl(fd, fiocancel, 0) cancel blocked read or write can not work. because driver can not support "fiocancel" . how write task ii in vxworks , linux? or there other way task? cancelling read/recvfrom call impossible on linux. cannot write these tasks using same api. on linux can use epoll , o_nonblock create semantics of canceling read/recvfrom. it impossible using same code both linux , vxworks.

Why can I not use the jar generated by Android Maven apklib in my assembly? -

i use maven build android library projects, results in apklib. less ideal since contains source code, have distribution module (using maven-assembly plugin) should package library project jar containing compiled source code in libs directory , empty src directory. i have included jar mygroupid:myartifactid:jar using module set include when run find nothing present in libs folder. if change above mygroupid:myartifactid:apklib apklib is included. distribution module has library module dependency, both apklib type , jar type. when building following warning message: [warning] following patterns never triggered in artifact inclusion filter: o 'mygroupid:myartifactid:jar' the android maven plugin attaches jar: can see created during compile , installed local repository on mvn install . so why can not include normally? ps: know can include specifying file location; if possible i'd not have specify myself , through module set.

Search in Black Navbar with Bootstrap -

i'm trying include black navbar search box using bootstrap shown here: http://jsfiddle.net/hyaeq/410/ . codes of css below. i don't how color of search box changes when receives focus. how can keep color of box same when doesn't have focus? thank you. html, body { padding: 0; margin: 0;} body { padding: 20px; } .navbar-search { position: relative; } .navbar-search .search-query { padding-left: 29px !important; } .navbar-search .icon-search { position: absolute; top: 7px; left: 11px; background-image: url("http://twitter.github.com/bootstrap/assets/img/glyphicons-halflings.png"); } you add these css rules, may pretty heavy-handed approach. hope doesn't break else in design : input[type="text"] { background-color: #ffffff !important; color: #555555 !important; } fiddle .

php - Enable - Disable Table Result -

Image
i making phone directory school project , yet work far. want hide table header (last name, first name, etc) view after got result. this images before , after search names , here codes: <table class="gridtable"> <th>last name</th> <th>first name</th> <th>address</th> <th>telephone number</th> <th>network</th> <th>something wrong?</th> this table header include 'database.php'; $lname = ""; $fname = ""; if(isset($_post['lname']) || (isset($_post['fname']))){ $fname = $_post['fname']; $lname = $_post['lname']; } if(!isset($_post['fname']) || ($_post['lname'])) ; $vars = array('lname'); $verified = true; foreach($vars $v) { if(!isset($_post[$v]) || empty($_post[$v])) { $verified = false; } } if(!$verified) { exit(); } $result = mysql_query("select * sheet1 ln

nslayoutconstraint - Where are the NSLayoutPriority constants in MonoTouch/Xamarin.iOS -

i'm trying find these constants in xamarin.ios - can't find them. enum { nslayoutpriorityrequired = 1000, nslayoutprioritydefaulthigh = 750, nslayoutprioritydragthatcanresizewindow = 510, nslayoutprioritywindowsizestayput = 500, nslayoutprioritydragthatcannotresizewindow = 490, nslayoutprioritydefaultlow = 250, nslayoutpriorityfittingsizecompression = 50, }; typedef float nslayoutpriority; which c# object provided in? that's because it's named uilayoutpriority in ios. nslayoutconstraint.h file of ios 6.1 sdk: @property uilayoutpriority priority; uilayoutpriority enum inside monotouch.uikit namespace.

c - Splitting Linklist in two parts -

given list, split 2 sublists — 1 front half, , 1 half. if number of elements odd, element should go in front list. frontbacksplit() on list {2, 3, 5, 7, 11} should yield 2 lists {2, 3, 5} , {7, 11} . code this. void frontbacksplit(node *head, node **front, node **back) { if (!head) return; // handle empty list node *front_last_node; node *slow = head; node *fast = head; while (fast) { front_last_node = slow; slow = slow->next; fast = (fast->next) ? fast->next->next : null; } front_last_node->next = null; // ends front sublist *front = head; *back = slow; } problem not getting best run-time , expected output. generally, code works even-sized lists. consider list of 4 elements -> b -> c -> d -> null , take @ algorithm trace. a slow, fast, head b c d null front_last_node, head b slow c fast d null head b front_last_node c slow d null fast then erase link b->c , return 2 lists: -&

android - How change default white background WebView Flex -

my problem is, app has black background. inserted webview showing html page, when page loading, background of webview white. need have black background because app , page has black background. possible? found answers android, no flash builder mobile. i tried set in additional compiler arguments -default-background-color #000000 , nothing happened. thank advices <?xml version="1.0" encoding="utf-8"?> <s:view xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" title="example" creationcomplete="webexample(event)"> <fx:declarations> <!-- place non-visual elements (e.g., services, value objects) here --> </fx:declarations> <fx:script> <![cdata[ import mx.events.flexevent; protected var webview:stagewebview = new stagewebview(); protected var counter:int = 0;

image - Changing the name of a picture makes the picture looks small -

i have picture. call publictransportation. it looks smaller should be. looks fine on simulator. looks small on iphone. i clean build. delete application. no luck. then change pic publictransportation1 now looks normal. when change looks small again. there has false cache. where? may there 2 images 1 publictransportation.png present in resources , 1 reference of publictransportation.png, might me there on machine. search publictransportation.png in project , check duplication.

documentation - PHP: How to document array when they are method parameters -

what's best way document elements of array when parameter method? example, using phpdoc headers, might have like: @param array $data what doesn't tell me elements mandatory in array, , optional elements. imagine should go in explanation of method. like: array: $data ============ int $id required name $string required town $string optional if have such complex array constraints every single member, wouldn't use anonymous array rather defined object. array, can never sure holds, that's passing "object" in e.g. java, consider choice. however, there possibility of little hinting, when array contains objects of type explained here , that's not answer question. if need parameter array, might document way proposed in method's description; however, if use object parameter, you'd have additional support in modern ides (intellisense , on). edit: mean, me question "why want use anonymous array instead of s

iphone - recreating uiimage smaller or not in bounds of the containing view -

i'm trying enable resizing , moving of image within view. doing so, challenge not lose image quality. have uiimageview placed inside uiview (i'm not using uiscrollview implementing it, found not suitable case) , i'm following uipangesturerecognizer , uipinchgesturerecognizer dragging , zooming. the problem when i'm trying recreate new image in boundaries of uiview : if uiimageview in boundaries of uiview it's fine, taking visible rect scaling according cgimagecreatewithimageinrect . however, if inner uiimageview smaller uiview (zoom-out) or moved doesn't cover whole uiview , creates image in original size, or not in position intending. the solution works renderincontext , makes image of visible in uiview - image quality drastically reduced. is there way without losing image quality? maybe add edges 0 alpha, suit frames of uiview , yet suits memory demands? if change frame of uiimageview should handle scaling based on content mode,

Why is ajax request working cross-domain in the google extension sample without jsonp? -

i going through tutorial making simple chrome extension gets images flicker api , loads them extension popup. making simple chrome extension i cant understand 1 thing. ajax request made here simple request. why working cross-domain . not jsonp. script file popup.js follows // copyright (c) 2012 chromium authors. rights reserved. // use of source code governed bsd-style license can // found in license file. /** * global variable containing query we'd pass flickr. in * case, kittens! * * @type {string} */ var query = 'kittens'; var kittengenerator = { /** * flickr url give lots , lots of whatever we're looking for. * * see http://www.flickr.com/services/api/flickr.photos.search.html * details construction of url. * * @type {string} * @private */ searchonflickr_: 'https://secure.flickr.com/services/rest/?' + 'method=flickr.photos.search&' + 'api_key=90485e931f687a9b9c2a66bf58a3861a&am

asp.net - I am required to structure the C# coding better by organizing code into functions. I am not sure how to go about this: -

i using videogames database (sql) , coding asp project (visual studio). page has coding not organised , functionality called repeating coding. required structure c# coding better organizing code functions. can please give me guideline on how go it. using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; namespace asplinqtosql { public partial class : page { protected void page_load(object sender, eventargs e) { var ctx = new videogamesdatacontext(); var products = p in ctx.products select new { p.productid, p.productname, p.productdescription, p.listprice }; gridview1.datasource = products; gridview1.databind(); }