Posts

Showing posts from March, 2014

javascript - Get Audio Blob from AWS S3 -

i'm using ajax retrieve wav file aws s3 uploaded using cors/formdata method found here . seem getting data fine, when try create blob body of object returned s3's getobject , link audio tag via createobjecturl , file doesn't play. any pointers on bridging gap buffer response getobject playing audio in audio tag? i figured out. solution get signed url audio file.

Count words in each line of text file in c++ -

i open txt file using argc, argv, , getline. did properly, have number of words per line (the number of lines not known before) , must output them in reverse. meaning bottom line top line. appreciated. code outputs number of words in file: #include <iostream> #include <fstream> #include <cstring> using namespace std; int main(int argc, char *argv[]) { if(argc < 1){ cerr << "usage: " << argv[0] << "filename.txt" << endl; } ifstream ifile(argv[1]); if(ifile.fail()){ cerr << "could not open file." << endl; return 1; } int n; ifile >> n; cout << n; int numberofwords = 0; string line; for(int = 0; <= n; i++){ getline(ifile, line); cout << line << endl; } size_t i

database - A Client Walks Into a Server And Asks "What's New?" – Problems With Timestamps -

i'm looking solution edge case scenario client continually asking server what's new fail due timestamps. in example, i'm not using sequence numbers because of edge case problem. can see problem here: a client walks server , asks "what's new?" – problems sequence numbers assume we're using timestamps. every row update adds timestamp of server time. clients continually ask what's new since timestamp of last item received. simple? yes, but... failure scenario: the times below arbitrary readability. assume milliseconds in real world. 2:50 client c checks updates. 2:59 client starts update on row. (sets lastmodified 2:59) 2:59 client b starts update on row. (sets lastmodified 2:59) 3:00 client row update becomes visible on db. (lastmodified still @ 2:59) 3:00 client c checks updates >2:50. get’s a’s update. good. 3:01 client b row update becomes visible on db. (lastmodified still @ 2:59) 3:10 client c checks updates >2:59. gets nothing

Convert in SQL Server -

this in sql server 2012 environment have following problem , have table field type datetime . this field yyyy-mm-dd hh:mm:ss:msmsms - "2013-12-12 00:00:00.000" and need extract yyyy 1 field. mm 1 , dd last one. i tried select distinct convert(char (10), data, 120) dia, convert(char (7), data, 120) mes, convert(char (4), data, 120) ano vendas but output day 12-12-2013 month 12-2013 year 2013 the year correct can't find way cut right part day , month. somebody me please ? select year(data), month(data), day(data) dbo.vendas; or select datepart(year, data), datepart(month, data), datepart(day, data) dbo.vendas; sqlfiddle

ios - UIPageViewController programmatically tell what page is showing -

is there way programmatically tell when page showing in pageviewcontroller? example, instantiated following: if (index == 0) { pagecontentviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"oncampustable"]; } else if (index == 1) { pagecontentviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"offcampustable"]; } else if (index == 2) { pagecontentviewcontroller = [storyboard instantiateviewcontrollerwithidentifier:@"myeventstable"]; } i want write if (current page "oncampustable") { method 1 } else if (current page "offcampustable") { method 2 } else if (current page "myeventstable") { method 3 } i've tried using index, because of way pages load , stuff, doesn't work properly. thinking of trying access page indicator thing (the little circle things)

Printing doubles of fixed size in Java -

i have matrix follows (e.g): 1 2 1000000000000 3.15 i want print string in way tabulated, each entry taking 8 places: 1.000000 2.000000 1.00e006 3.150000 i have been researching decimalformat, numberformat , figured out way of doing specific function coded myself, fails when number written using decimal notation. way of printing double string taking specified number of spaces no matter how written (regular or scientific notation)? why not this? can uses regex remove sign if want. may need more work. public static string formatscientific(double val) { // default case. string out = string.format("%1.6f", val); // use scientific notation on values greater 10. if (val >= 10) out = string.format("%1.2e", val).replaceall("\\+", "").concat("0"); return out; } output: 1.000000 2.000000 1.00e120 3.150000 edit : should have check val >= 10 , not val >= 10^2 oops...

mysql - Export each array item into a separate variable PHP -

is possible gather each array variable , place own variable. sort of this: $array = array('music', 'video_games', 'photos', 'movies'); $count = count($array); $i = 0; while ($i < $count) { $array_val_1 = $array[0]; $i++ } $array_val_1 , $array[0] have increment each time while loop goes around $array_val_2 , $array[1] how this. because have array of checkboxes, won't know how variables there in array. sounds looking extract . example docs: $var_array = array("color" => "blue", "size" => "medium", "shape" => "sphere"); extract($var_array); echo "$color, $size, $shape";

cookies - REGEX HELP to insert string in header -

i'd insert safety preference pref=f2=8000000 in outgoing cookie youtube. can please regex required. please see cookie header without , below: original: sid=dqaaaoyaaabor9h2kgqmkq1kw7rbrguqb6dnjpqxtp0zn4grw27qbtf_vzbkkixpce6jof7kvtt8rry72g8tv6lyolxu5rqnqwytujunhz__7uew4lkiz89vmnlouhw3nsrkrg4qqidvmhhys4ubr2yjwwqq6syk4yl0lnq2hrp3ud5cgzda_cq_vxn9g1tadrzpcn5aqcoctwlrrv-cg23rz3a6ch-2fvfqt_vdx1qqbio5hiy6bd5slfkzqr9hsgpq61py_ba2hgszphpa8ui0l4wdru-zg2jwlj3tbtj3dq3qidovhnmfvxt8rics0gbun3iltvy; hsid=aniiq2v5699ch1ogg; apisid=xxqluldsz9yv9cwf/ax_rce3i9fzrh0bda; visitor_info1_live=m46yoeobrtu; login_info=9f010d0f2ad7425d84ae06a16d0aa294c34aaab7ijgioiaxmzc0ndk3njuxodksici3ijogmtm5mtuxmza4mcwgijyioibmywxzzswgijuioiawlcainci6icjhqulbiiwgijmioiazmzaxndc1odusiciyijogilk0ctlxy2ppauo1rzn4vthgwel1dhc9psisicixijogmx0=; pref=fv=12.0.0&f1=10000000&al=en-gb; ysc=qf6d6pkhmtq; activity=1391513121453 (see pref=f2=8000000 included @ end.) desired sid=dqaaaoyaaabor9h2kgqmkq1kw7rbrguqb6dnj

c++ - C++98/C++03 STL set bug? -

all, one weird thing happens when i'm using set: let's say: struct { int num; bool operator<(const a& x) const { return num < x.num; } }; struct b { set<a> aset; }; struct c { list<b> blist; list<b>::iterator blistiter; c() { blist.push_back(b()); blistiter = --(blist.end()); } }; somewhere can have code: list<c> clist; clist.push_back(c()); list<c>::iterator clistiter = --(clist.end()); (...) { a = ...; ... clistiter->blistiter->aset.insert(a); this end segmentation fault after few iterations. when happens, found invalid item referenced , compared (its address 0x0000001b, wrong) during insertion. funny thing when turn on -std=c++0x option use c++11 problem goes aways! wonder if bug of stl set in c++98/c++03? thanks, kevin in c++03 or earlier, copies of temporary objects put on clist , blist inside clist object. when c::blist member copied, new list<b>

jquery - offset().top - (something) repeats -

i'm trying dynamically open tab bootstrap , smoothly scroll down @ same time. have functional, except offset().top-280 i'm using causes screen shift 280px every time it's touched. i'd scroll div on first button , afterward, stay put when clicking other handles. thanks in advance. here's html: <ul id="tabs" class="join-options" data-tabs="tabs"> <li><a href="#donate" data-toggle="tab">donate</a></li> <li><a href="#join-new" data-toggle="tab">join</a></li> <li><a href="#renew" data-toggle="tab">renew</a></li> </ul> those handles. content: <div id="my-tab-content" class="tab-content"> <div class="tab-pane active" id="donate"> <h1>donate</h1> <p>donate donate donate donate donate donate</p> </div&

ios - Create pins for all items in a JSON file -

i trying plot pin in mkmapview every coffee shop. wondering if there way data mkmapview. say, add point every result "coffee shop" in apple maps app. other way thinking of doing through json file, don't have experience using json. tell me way use json file or way listed first.

html - Content goes out of div -

really can't figure out what's wrong it, content add div, goes out of it, it's not in it. check here: jsfiddle ! html___ <div id="wrapper"> <div id="container"> <div id="header"> <div id="logo"> text goes outside of div :'(( </div> </div> </div> </div> css___ #container { width: 960px; margin: 20px auto 0 auto; background: yellow; } #header { position: relative; width: 100%; background: yellow; border: 1px solid black; padding: 2px; /*just see div*/ } #logo { float: left; } you need clear floats: <div id="wrapper"> <div id="container"> <div id="header"> <div id="logo"> text appears inside div :) </div> <div style="clear

cookies - advertising.com display ad on my site 400 error -

there rtb advertising.com placement on site passing hundreds of cookies adserver in request header causing 400 error: ], "cookies": [ { "name": "10059038", "value": "_52f06e17,2536076788,125^1647715^1183^0,0_", "expires": null, "httponly": false, "secure": false }, { "name": "1011656", "value": "_52f1ac49,5585423647,840586^1654834^1183^0,1_", "expires": null, "httponly": false, "secure": false }, { "name": "13130976", "value": "_52f1b1dd,6460543143,892975^1580686^1183^0,1_", "expires": null, "httponly": false,

Adding HTML to iOS I get expected '[' error -

i getting weird error on xcode: expected '[' error , build fails. code [descweb loadhtmlstring:[nsstring stringwithformat:@"<html><body p style='color:black' text="#000000" face="helveticaneue" size="5">%</body></html>",strtemp] baseurl: nil]; this whole code block [descweb removefromsuperview]; descweb = [[uiwebview alloc]init]; descweb.delegate = self; descweb.tag = 1; [descweb setopaque:no]; [descweb setbackgroundcolor:[uicolor clearcolor]]; descweb.frame = cgrectmake(3, 7, 314, 350); [descweb loadhtmlstring:[nsstring stringwithformat:@"<html><body p style='color:black' text="#000000" face="helveticaneue" size="5">%</body></html>",strtemp] baseurl: nil]; [scrollview addsubview:descweb]; thank looking , help you need add slashes quotation marks. nsstring *string = @"a quotation mark: \""; nslog(@&

javascript - Kendo UI Web - DropDownList: Select event doesn't return selected value properly -

i binding dropdownlist widget select event so: var items = [ { text: 'item 3', value: '3' }, { text: 'item 4', value: '4' } ]; var dropdownlistel = $('#dropdownlist'); dropdownlistel.kendodropdownlist({ datatextfield: 'text', datavaluefield: 'value', index: 0 }); var kdropdownlist = dropdownlistel.data('kendodropdownlist'), ds = kdropdownlist.datasource; items.foreach(function (item) { ds.add(item); }); kdropdownlist.bind('select', function (e) { console.log('this.value(): ' + this.value()); }); but, doesn't return correct value when selection. i have been trying every possibility there is, none working. http://jsfiddle.net/glenn/gxj3s/ it's driving me insane! binding select event of kendo dropdownlist follow correct selected item kdropdownlist.bind('select', function (e) { var dataitem = this.dataitem(e.item.index(

asp.net - searching an aspx database -

the database scraping located here: https://www2.cslb.ca.gov/onlineservices/checklicenseii/checklicense.aspx what is: use wildcard search find companies "roof" or "roofing" in name. i can perform search "roof%". however, "%roof" or "* roof%" doesn't work. more interested in figuring out how make later query work. example: xyz roofing co cal roofers inc can me this? there's no such thing aspx database. there's no way derive substring search, attempting do, if site doesn't support it. 'search tips' page tells valid: https://www2.cslb.ca.gov/onlineservices/checklicenseii/checklicense.aspx we have no 'magical' way of making site more designed do.

ios - How to do a local search autocomplete as Apple's native map app does? -

Image
i have done implementation adopting of concept apple's sample code of mklocalsearch here currently auto complete, every time user typing inside search bar, sending new request specified: mklocalsearchrequest.naturallanguagequery = searchbar.text mklocalsearchrequest.region = userlocation.region but totally different set of response sever comparing apple's default map app shown in image below then capture traffic , find request goes https://gsp-ssl.ls.apple.com/search.arpc while apple's goes https://gsp-ssl.ls.apple.com/auto_complete.arpc is there way tune mklocalsearchrequest same set of response objects? mklocalsearchrequest not perform auto complete on search string, perhaps because apple wants limit number of requests 3rd party apps. in theory reverse-engineer requests , responses https://gsp-ssl.ls.apple.com/auto_complete.arpc , perform requests yourself, not using mklocalsearchrequest @ all. lead app being rejected on app store.

javascript - Mongoose.js: force always populate -

is there way instruct model populate field? something like, have "field" populated in find query: {field: schema.objectid, ref: 'ref', populate: true} ? with mongoose 4.0, can use query hooks in order autopopulate whatever want. below example introduction document valeri karpov. definition of schemas: var personschema = new mongoose.schema({ name: string }); var bandschema = new mongoose.schema({ name: string, lead: { type: mongoose.schema.types.objectid, ref: 'person' } }); var person = mongoose.model('person', personschema, 'people'); var band = mongoose.model('band', bandschema, 'bands'); var axl = new person({ name: 'axl rose' }); var gnr = new band({ name: "guns n' roses", lead: axl._id }); query hook autopopulate: var autopopulatelead = function(next) { this.populate('lead'); next(); }; bandschema. pre('findone', autopopulatelead). pre(&#

javascript - jquery select2 plugin regex for allowed characters? -

is there anyway define set of "allowed" characters user input? e.g. alphanumeric input only. can't seem find within official documentation you can accomplish using createsearchchoice option, allows define custom function create tags user input. not allow tags containing other alphanumeric characters, select2 should initialized as: $("#myselect").select2({ createsearchchoice: function(term) { if(term.match(/^[a-za-z0-9]+$/g)) return { id: term, text: term }; }, formatnomatches: "enter valid format text"}) if user typing text contains non-alphanumeric characters, dropdown below select2 show no matches. it's not necessary specify custom formatnomatches more helpful user default "no matches found" figure out why input isn't being accepted. update: as of select2 version ~ 4.0 function called createtag

c++ - How to use an STL container to hold template based shared_ptr? -

i want construct container hold shared_ptrs template based. example, have: template <class t> class data { .... }; template <class t> struct dataptr { typedef boost::shared_ptr<data<t> > type; }; template <class t> struct mapdata { typedef typename std::map<std::string, dataptr<t>::type > type; }; mapdata<int>::type data; void func(const std::string& str, dataptr<int>::type& sth) { if (sth) { data[str] = sth; } } now have few issues. compiler not allow me use dataptr::type when define mapdata, error message "expected type, got ‘dataptr::type". if drop type , use template <class t> struct mapdata { typedef typename std::map<std::string, dataptr<t> > type; }; then "data[str] = sth" not pass ("no match ‘operator=’"). what should correct way? many thanks. you've misplaced positioning of typename keyword: typedef

ios - CGContextDrawPath for two inner and outer Rect of different colors -

Image
i using below code in drawrect cgcontextsavegstate(context); cgmutablepathref outerpath=[self createpath:rect]; cgmutablepathref innnerpath=[self createpath:uiedgeinsetsinsetrect(rect, uiedgeinsetsmake(10.0, 10.0, 10.0, 10.0)]; cgpathclosesubpath(outerpath); cgcontextaddpath(context, outerpath); cgcontextsetfillcolorwithcolor(context, [uicolor colorwithred:249.0/255.0 green:38.0/255.0 blue:1.0/255.0 alpha:1.0].cgcolor); cgcontexteofillpath(context); cgcontextdrawpath(context, kcgpathfill); cgcontextaddpath(context, innnerpath); cgcontextsetfillcolorwithcolor(context, [uicolor colorwithred:50.0/255.0 green:213.0/255.0 blue:1.0 alpha:0.4].cgcolor); cgcontextdrawpath(context, kcgpathfill); cgcontextrestoregstate(context); but, since using 0.4 alpha inner colour , inner colour becomes brown. how can have show in below? i make single rectangle, fill cyan color, , stroke red color. make sure set stroke width size need.

python - How do you use timeit to time how long it takes a function to run? -

trying figure out how long takes piece of code run: import timeit t def fib_recursive(n): if n==0: return 0 elif n == 1: return 1 else: return fib_recursive(n-1) + fib_recursive(n-2) print fib_recursive(29) print t.timer("fib_recursive(29)") output following: 514229 timeit.timer instance @ 0xda28c0 to expand on thefourtheye's comment (which correct), want isolate steps necessary define function setup parameter timeit . given setup, following: import timeit t def fib_recursive(n): if n==0: return 0 elif n == 1: return 1 else: return fib_recursive(n-1) + fib_recursive(n-2) setup = 'from __main__ import fib_recursive' t.timeit('fib_recursive(29)', setup=setup) i'll assume you're aware of various techniques improve algorithm , choosing measure speed establish baseline only. can experiment number keyword parameter timeit control number of repetitions.

Why does Geocode API not find this address when Google Maps does? -

having trouble getting proper coordinates address. can see, returning generic coordinates "u.s. 287": http://maps.googleapis.com/maps/api/geocode/json?address=7500+u.s.+287,+ennis,+tx+75119&sensor=false when typing address google maps comes fine "texas motorplex". any ideas on doing wrong here? thanks! according me address not complete. search query on google map returns latitude longitude 287 only. try this

ios - UITableView ScrollView not going to top of frame -

Image
i setting uitableview frame below view on y-axis. not want uitableview go under view higher on y axis, uinavigationbar. in image scroll indicators @ top. but can see inset not @ top of tableview. assuming because uitableview used @ top of uinavigationbar , scrollview insets adjusted accordingly, don't want that. i've tried setting following to uiedgeinsetmake(0,0,0,0), nothing. tableview.scrollindicatorinsets tableview.contentinset tableview.contentoffset (to cgpointmake(0,0)) i remember seeing in ios 7 tech talks this, i've searched through them past little bit , haven't found it. thanks!! tableview = [[uitableview alloc] initwithframe:cgrectmake(0, 0, 0, 0) style:uitableviewstylegrouped]; tableview.translatesautoresizingmaskintoconstraints = no; tableview.delegate = self; tableview.datasource = self; @"v:|-(navbarheight)-[otherview]-(0)-[tableview]-(0)-|" could try uncheck properties of viewcontroller mention

ios - UIWebView inside Navigation Controller crashes when typing -

i've spent few hours searching solution problem can't seem find who's experienced it, let alone solution. in project, have main view controller pushes second view controller containing uiwebview. both view controllers embedded in navigation controller. push segue , webview both hooked using ib. the segue happens expected , web page loads , works fine until try type. tapping on text field brings keyboard, first key press crashes app , gives error: -[nsnull length]: unrecognized selector sent instance 0x1899068 2014-02-06 04:37:19.550 *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsnull length]: unrecognized selector sent instance 0x1899068' *** first throw call stack: ( 0 corefoundation 0x0174d5e4 __exceptionpreprocess + 180 1 libobjc.a.dylib 0x014d08b6 objc_exception_throw + 44 ... this happens both in simulator , on device. i'm particularly confused be

javascript - error: Uncaught TypeError: Cannot set property 'innerHTML' of null after adding and deleting an Event -

i have unfinished tic-tac-toe game , i'm having trouble when finish first game, press "iniciar" play again. innerhtml error, can't figure out why happening , appreciate help. it works this: "iniciar" start playing when game finishes if it's tie "iniciar" again if there winner scoreboard changes. "iniciar" (here when error occurs) "reiniciar" resets score , start new game. gives error too. it's weird because when it's tie, there's no problem #errorenturno when there's winner , start over, error there. <html> <head> <link href='http://fonts.googleapis.com/css?family=peralta' rel='stylesheet' type='text/css'> </head> <body> <script type="text/javascript"> var turno = 1, puntosx = 0, puntoscero = 0; // globals window.addeventlistener('load', start, false); function

opengl - Is it possible to have face culling before the geometry shader stage? -

is possible front facing triangles sent geometry shader? believe culling happens emitted triangles after geometry shader default. yes is, in ancient days of quake, face culling done on cpu using simple dot product per-triangle. triangle failed test not included in list of indices drawn. this not viable optimization on hardware these days, still see employed time time in specialized applications. 1 such application have seen lot of using ps3's cell spes cull out triangles during batching save vertex transform workload on ps3's rsx gpu - keep in mind, ps3 still uses basic shader architecture there fixed number of specialized vertex shader units , fragment shader units. balancing shader workload important on gpu. i may missing point of question though; benefit expect/want out of culling primitives early? update: what trying on modern hardware , software, vertex transform / primitive assembly not bottleneck. fragment processing more expensive these days, havi

python - error: each element of 'ext_modules' option must be an Extension instance or 2-tuple -

i trying use setuptools in python create egg package, weird error: error: each element of 'ext_modules' option must extension instance or 2-tuple how can fix this? assuming have setuptools installed, edit setup.py of egg package target , replace import setup, extension in order them setuptools. from setuptools import setup, extension, command rational: setuptools redefines extension it's possible not recognize object have in ext_modules argument valid extension object. hence error message. ext_modules 1 of arguments of setup() method describe extension of module, , it's specified in setup.py. setup(name='foo', version='1.0', ext_modules=[extension('foo', ['foo.c'])], ) more info available in python documentation

In Drupal 7 views how to give external link (another website) to a title? -

iam new drupal 7 views. have content type contains title, description fields. want content title's scroll @ top of page, created view , works fine.what question is, want link content (eg: 1st content (title) in scroll) website instead of content page, remaining contents linked content page. possible?.if possible how can done?.. thanks in advance, a.john melchior. yes, it's possible. 1 way it, use link module create link field in node. use link field input external link value. in views add link field, before title ( order important ) , exclude display add node title field in views , in rewrite field output option, use 1 link field token path. i'm not looking @ views ui right , should find @ least couple of ways redirect content when node title clicked. should have rewrite field output , output field link.

php - Wordpress permalink is not working -

once create new page in wordpress, change permalink settings 'default' 'post name'. trying visit page, page lost. im getting error - not found requested url /anonymous/sample-page/ not found on server. plz help, thnkz. if working localhost , want set permalinks sure activate rewrite_module in "httpd.conf" file locate in "c:\wamp\bin\apache\apache2.4.4\conf" or "c:\wamp\bin\apache\apache2.4.4\conf\original" find line "#loadmodule rewrite_module modules/mod_rewrite.so" , remove "#" mean enabling functionality , save file , restart server enable permalink work

listview - Android delete selected item using contextual actionbar -

so far, have managed follow this tutorial , run successfully. wanna delete selected items on listview. code i'm using: private string[] data = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine","ten"}; private selectionadapter madapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); madapter = new selectionadapter(this, r.layout.row_list_item, r.id.textview1, data); setlistadapter(madapter); getlistview().setchoicemode(listview.choice_mode_multiple_modal); getlistview().setmultichoicemodelistener(new multichoicemodelistener() { private int nr = 0; @override public boolean onprepareactionmode(actionmode mode, menu menu) { // todo auto-generated method stub return false;

windows - ld linker's output executable is bigger than the golink output executable, why? -

i've assembled simple code nasm , linked output obj file both ld , golink issue golink output executable 2kb of size ld output executable 85kb of size i'm using mingw32 , both using library kernel32.dll . linking commands are: golink /entry _start /console test.obj kernel32.dll & gcc test.obj-l kernel32.dll so why huge difference in sizes? am doing wrong? enlighten me please.

cordova - How to use external jar in phonegap application? -

i created jar file consist of java code. want use jar phonegap application. added jar libs folder of working copy. you have create plugin that. you'll need class extends cordovaplugin class. in class add code call code jar in execute method. and you'll have create javascript file able call java code javascript. you can follow following guides or have @ code of phonegap api plugins. http://docs.phonegap.com/en/3.3.0/guide_hybrid_plugins_index.md.html#plugin%20development%20guide http://docs.phonegap.com/en/3.3.0/guide_platforms_android_plugin.md.html#android%20plugins

css - CSS3 Simultaneous Image Rotation, Scaling, animating and Opacity reduction -

i wanted create metro style website , want add buttons in following : http://themeforest.net/item/metro-lab-responsive-metro-dashboard-template/full_screen_preview/5359122 when hover on 'new user', 'sales' etc tabs, icons/images in tabs rotates, increases size , looses opacity. but not able exact output. 2 outputs @ time : --> opacity , scaling --> opacity , rotation but not of them simultaneously. you can see had reached @ : http://developer.nuevothoughts.com/jiteen/attendance/docs/# my current css : .icon-rocket{ -webkit-transition-duration: 0.8s; -moz-transition-duration: 0.8s; -o-transition-duration: 0.8s; transition-duration: 0.8s; -webkit-transition-property: -webkit-transform; -moz-transition-property: -moz-transform; -o-transition-property: -o-transform; transition-property: transform; overflow:hidden; } .icon-rocket:hover { -webkit-transform:rotate(360deg); -moz-transform:rotate(360deg); -o-transform:rotate(360deg);

javascript - differences between binding and not binding parameter at function call -

what differences between followings: method 1: (function( $, window, document, undefined ) { ....... })( jquery, window, document ); method 2: (function( $, window, document, undefined ) { ....... })(); in both functions, there local variables $ , window , document , undefined inside first function have passed in values (except undefined , undefined). inside second function, undefined (and still mask global variables same name).

python - Strange reg output -

i using regular expression identify days of week , have following regular expression (?:mon(?:(?:.)?|(?:day)?)|tue(?:(?:.)?|(?:sday)?)) my test file contains monday mon mon. when run code recognizes mond , mon , , mon. . why not recognizes monday ? appreciated. i'm using python 2.7.6 your regex fauly actually. try simplified regex: (?:mon|tue(?:s)?)[.]?(?:day)? online demo: http://regex101.com/r/jc2iw3

objective c - iOS Sprite Kit: How to make Sprite follow Touches -

i'm new sprite kit , i'm wondering how can make sprite follow touches. example, player sprite on bottom of screen. when tap on top of screen, player sprite should move touch point speed - , if move finger should pointing towards touch point. how tried implement it: -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { (uitouch *touch in touches) { cgpoint location = [touch locationinnode:self]; cgpoint diff = rwsub(location, self.player.position); cgpoint norm = rwnormalize(diff); skaction *act = [skaction movebyx:norm.x * 10 y:norm.y * 10 duration:0.1]; [self.player runaction:[skaction repeatactionforever:act] withkey:@"move"]; } } - (void)touchesmoved:(nsset*)touches withevent:(uievent*)event { (uitouch *touch in touches) { cgpoint location = [touch locationinnode:self]; cgpoint diff = rwsub(location, self.player.position); cgpoint norm = rwnormalize(diff);

c# - Application requires Microsoft.TeamFoundation. Controls Version 11.0.0.0. be installed in the Global Assembly Cache -

i've develop application using visual studio 2012 , published it. when client tries install it, says cannot install application requires assembly microsoft.teamfoundation. controls version 11.0.0.0. installed in global assembly cache. realise need add dependency when installing, one? is you're looking ? microsoft.teamfoundation.controls.dll in c:\program files (x86)\microsoft visual studio 12.0\common7\ide\referenceassemblies\v4.5

c# - Invalid expression term ':' in MVC application -

just got started asp.net mvc. created first controller public actionresult index() { viewdata["currenttime"] = datetime.now.tostring(); return view(); } and tried set show currenttime in view like <%: viewdata["currenttime"] %> but giving below error: compiler error message: cs1525: invalid expression term ':' update : i'm using framework 3.5 the syntax wrong. try <%= viewdata["currenttime"] %> instead of <%: viewdata["currenttime"] %>

html - Float items either way -

Image
i'm working on image page can't figure out how fill gaps. i'm using float:left leaves spaces blank. you can find image page here: http://ianbauters.no-ip.org/kinno/pages/images.html are talking blank space? it normal behaviour of css floating. if want fill gap should use javascript library masonry or similar.

c# - Gridview is not displaying footer? -

here had given "showfooter"=true property still it's not displaying while debug value(sumofamount) assign label.text my gridview code: <asp:gridview id="gvgrossdetails" runat="server" allowpaging="true" autogeneratecolumns="false" cellpadding="0" cellspacing="1" cssclass="grid_bg" gridlines="none" datakeynames="code" onrowediting="gvpayeegross_rowediting" onrowdeleting="gvgrossdetails_rowdeleting" onrowupdating="gvgrossdetails_rowupdating" onrowcancelingedit="gvgrossdetails_rowcancelingedit" pagerstyle-width="0px" pagesize="10" showfooter="true" width="112%" style="margin-top: 0px"> <pagerstyle cssclass="hide" /> <selectedrowstyle cssclass="tble_hdr_not_sltd" /> <headerstyle cssclass="tble_hdr_

ios - Get all vertices of a UIBezierPath -

i have uibezierpath made 6 vertices. want vertices uibezierpath. there possible way it? you using cgpathapply , cgpathapplierfunction . nsmutablearray *thepoints = [[nsmutablearray alloc] init]; uibezierpath *apath; cgpath thecgpath = apath.cgpath; cgpathapply(thecgpath, thepoints, mycgpathapplierfunc); what pass on applier function each of path's elements. can list of points each element inside function , add them thepoints . your applier function like void mycgpathapplierfunc (void *info, const cgpathelement *element) { nsmutablearray *thepoints = (nsmutablearray *)info; cgpoint *points = element->points; [thepoints addobject:[nsvalue valuewithcgpoint:points[0]]]; \\only 1 point assuming line \\curves may have more 1 point in points array. handle accordingly. }

python - Pybluez installation in Linux -

i trying install pybluez-0.18 on linux mint 15 machine, got error message during installation process. tried searching online see if others might have encountered problem, not find any. i list command tried execute, along error message received. tell me doing wrong, , need reso tri108354@prtgc004-latitude-e6320 ~/downloads/pybluez-0.18 $ python setup.py install running install running build running build_py running build_ext building 'bluetooth._bluetooth' extension gcc -pthread -fno-strict-aliasing -g -o2 -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -fpic -i/home/tri108354/anaconda/include/python2.7 -c bluez/btmodule.c -o build/temp.linux-i686-2.7/bluez/btmodule.o in file included bluez/btmodule.c:20:0: bluez/btmodule.h:5:33: fatal error: bluetooth/bluetooth.h: no such file or directory compilation terminated. error: command 'gcc' failed exit status 1 you need install libbluetooth-dev package compiling code sudo apt-get install libbluetooth-dev

javascript - speech buble html5 canvas js -

Image
i'm trying draw speech buble dragable handler. that's have: (x,y) - coordinates of lowest left corner of buble length of buble width of buble (x1,y1) coorinates of handler end here picture better understanding: i know how draw in canvas when coordinates known. it's pretty simple. tutorial function drawbubble(ctx, x, y, w, h, radius) { var r = x + w; var b = y + h; ctx.beginpath(); ctx.strokestyle="black"; ctx.linewidth="2"; ctx.moveto(x+radius, y); ctx.lineto(x+radius/2, y-10); ctx.lineto(x+radius * 2, y); ctx.lineto(r-radius, y); ctx.quadraticcurveto(r, y, r, y+radius); ctx.lineto(r, y+h-radius); ctx.quadraticcurveto(r, b, r-radius, b); ctx.lineto(x+radius, b); ctx.quadraticcurveto(x, b, x, b-radius); ctx.lineto(x, y+radius); ctx.quadraticcurveto(x, y, x+radius, y); ctx.stroke(); } example in jsfiddle but trouble - how find coordinates of red dots shown on picture. both (x,y) , (x1,y1) known change

c# - reading a file into stream in windows store App without using async/await -

i want read file assets stream, use following: public async void loadwidthofunicodesdata() { string datafile = @"assets\qurandata\data_font1.xml"; storagefolder installationfolder = windows.applicationmodel.package.current.installedlocation; storagefile file = await installationfolder.getfileasync(datafile); stream readstream = await file.openstreamforreadasync(); datacontractserializer ser = new datacontractserializer(typeof(list<unicodewidth>)); widthofunicodes = (list<unicodewidth>)ser.readobject(readstream); (int = 0; < widthofunicodes.count; i++) { widthofunicodesdict.add(widthofunicodes[i].unicode, widthofunicodes[i].width); } } the problem that, part in viewmodel, , it's non-blocking operation, when vm initializes view datacontext, constructor it's supposed fill view exception @ using widthofunicodesdict because it's not yet filled data. what want do, either make reading stre

javascript - Start function after content generated -

loadjson(url, callback) - function callback load json data. data callback , generate page (function onclick): function getform(some, param) { loadjson('tables.json', function (response) { var list = json.parse(response); result += - clever - code; document.getelementbyid('ol').innerhtml = result; document.getelementbyid('hidediv').classname = ''; }); } my question how start other function, after form generated? , function must active till form change again (it's radio buttons listener). don't want add onclick= element of form. is possible? you can add click handler radio buttons in loaded part: $("input:radio").click(function() { alert("click handled!"); });

javascript function closure working -

i going through javascript book , have encountered following code on closure function constfunc() { var funcs = []; (var = 0; < 10; i++) { funcs[i] = function () { return i; } } return funcs; } var f = constfunc(); f[5](); the output not 5. explanation given "nested functions not make private copies of scope". grateful if explain above statement. when call constfunc loop runs , assigns function each element of funcs array. functions each return value of i , changes on each iteration of loop 0 9 . that means once constfunc has finished executing i have value of 9 . when call 1 of functions in array returns value of i we've seen 9 . value of i not captured on each iteration of loop. you can force captured via closure in loop: for (var = 0; < 10; i++) { (function (i) { funcs[i] = function () { return i; }; }(i)); } in case creating new variable same value i

I want to create label in gmail using google-api but i get error Token invalid - AuthSub token has wrong scope -

my client_id, secret_id, developer_key , redirect_uri auth request set in config file included. use following code create label in gmail account using google-api-php-client :- <?php error_reporting(e_all); ini_set('display_errors', 1); // set include path google php client library set_include_path( get_include_path() . path_separator . 'google-api-php-client-master/src' ); require_once 'google-api-php-client-master/src/google/client.php'; $client = new google_client(); // call when redirect after callback google oauth if (isset($_get['code'])) { $client->authenticate($_get['code']); $_session['access_token'] = $client->getaccesstoken(); if (isset($_session['access_token']) && $_session['access_token']) { $client->setaccesstoken($_session['access_token']); } $data = '<?xml version=&qu

javascript - Is it possible to get shorter labels in Highcharts pie chart? -

Image
what i'm trying make pie chart: look more designed pie chart: making pie chart bigger cause labels fall out of div instead of shorten or repositioning. in documentation of highchart found options can set on label "style" , "items". apperently didn't well. there's difference between label , datalabel. options datalabel can found under pie settings. there can set distance; right here

php - mysqli fetch_object returning non-object in the first element of the result set array -

i have particular mysqli query returns empty element @ 0th position in result set array. empty non-object element seems cause problems when try loop through result set display screen $projareas[] = array(); $projectid = $_get['projectid']; $sql = "select * `areas` , `project_area_junc` `areas`.`areaid` = `project_area_junc`.`areaid` , `project_area_junc`.`projectid` = $projectid"; $results = $conn->query($sql); while($row = $results->fetch_object()) { $projareas[] = $row; } the result gives unwanted array element @ position 0) i.e. when print_r($projareas) this: array ( [0] => array ( ) [1] => stdclass object ( [areaid] => 56 [propertyid] => 14 [areaname] => living room [areainfo] => lots of windows - colonial style [proj_area_juncid] => 10 [projectid] => 4 ) [2] => stdc

shell - How to grep http request and response for specific MSISDN in logs -

i want grep http request , response log file , use following criteria first grep msisdn in logs less service.log check pattern /msisdn 1234567 above commands give me place received request in logs then id of http request logs on base of id response of request above steps done on 1 file available in 1 file. now want automate above steps, use following commands sample request , response following present in 1 file id: 10814276 address: http://1.1.1.1:80/myws?wsdl encoding: utf-8 http-method: post content-type: text/xml; charset=utf-8 headers: {accept=[application/soap+xml, application/dime, multipart/related, text/*], cache-control=[no-cache], content-length=[1363], content-type=[text/xml; charset=utf-8], host=[x.x.x.x:80], p ragma=[no-cache], soapaction=["cancel"], user-agent=[axis/1.4], x-forwarded-for=[1.1.1.1]} payload: <?xml version="1.0" encoding="utf-8"?><soapenv:envelope xmlns:soapenv=&quo