Posts

Showing posts from July, 2014

ember.js - Router and DS model with belongsTo throws confusing exception -

ember.js - Router and DS model with belongsTo throws confusing exception - my router keeps throwing next exception: error while processing route: study assertion failed: can add together 'location' record relationship error: assertion failed: can add together 'location' record relationship ds models: app.location = ds.model.extend({ street: ds.attr('string'), city: ds.attr('string'), area: ds.attr('string'), lat: ds.attr('string'), lng: ds.attr('string'), report: ds.belongsto('report', {embedded: 'load'}) }); app.report = ds.model.extend({ title: ds.attr('string'), description: ds.attr('string'), reg_num: ds.attr('string'), location_str: ds.attr('string'), location: ds.belongsto('location', {embedded: 'load'}) }); and router: app.reportroute = ember.route.extend({ model: function () { ho...

memory - Is there any way to inspect kernel space in GDB? -

memory - Is there any way to inspect kernel space in GDB? - i may have more fundamental misunderstanding here, outline everything: i wanted gain improve understanding of how programs laid out in memory. starting here went , made simple programs , opened them in gdb see things laid in more practical sense: 0x0 - 0x08048000 = ?? 0x08048000 = start .text section 0x08048000 = plt 0x08048300 = _start 0x08048400 = main 0x08048480 = other functions 0x0804a000 = got 0x0804a020 = start .data section 0x0804a028 = start .bss section (random offset) 0x0804b008 = start heap ... 0xf7?????? = start memory mapping section 0xf7e50000 = #included library function definitions 0xf7ff0000 = linux dynamic loader (random offset) 0xffffd010 = top of stack (grows negatively) (random offset) i understand lot of these addresses subject change, helped me visualize assigning numbers things. anyway, in next image presented in source above, there's block dedicated kernel space @ top of program...

c++ - Why does this recursive function crash? -

c++ - Why does this recursive function crash? - int g(int n) { int x = g(n - 1); if (x > 0) { homecoming x + 1; } else { homecoming 1; } } my guess has first line of function... i'm not sure why case. if function said this: int g(int n) { homecoming g(n - 1); } then not expect work, instead maintain recursing until run out of stack space , programme crashes. putting recursion before exit status in function, doing this. you should rewrite function performs exit test before calling g() again. c++ crash segmentation-fault

javascript - Angularjs - data binding not working with controller -

javascript - Angularjs - data binding not working with controller - i developing app uses bootstrap (v3.2.0) angularjs (v1.2.26), want create set of columns changable via dropdown. i have got dropdown info binding ok, failing alter bootstrap responsive column classes when user selects different number of columns in dropdown. this fiddle shows code far. the html... <div data-ng-app=""> <div class="container-fluid"> <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <!-- brand , toggle grouped improve mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">toggle navigation...

css3 - jquery to change image and show captions on mouse-hover -

css3 - jquery to change image and show captions on mouse-hover - below codes: class="snippet-code-css lang-css prettyprint-override"> * { font-family: arial; } .slide-container { /*border: solid 1px;*/ width: 500px; height: 360px; } .slide-jumbo { /*border: solid 1px;*/ width: 500px; height: 300px; overflow: hidden; } .jumbo { position: relative; display: inline-block; width: 500px; height: 300px; float: left; } .jumbo img, .thumb img { position: absolute; left: 0; } .jumbo img { top: 0; } .thumb img { bottom: 0; } .jumbo-capt, .thumb-capt { width: 100%; background-color: rgba(0,0,0,0.8); position: absolute; color: #fff; z-index: 100; /* -webkit-transition: 300ms ease-out; ...

iphone - uiwebview detect youtube video is loaded completeley -

iphone - uiwebview detect youtube video is loaded completeley - i playing youtube video in uiwebview using next code nsstring *embedhtml = @"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: transparent;\ color: white;\ }\ </style>\ </head><body style=\"margin:0\">\ <embed id=\"yt\" src=\"http://www.youtube.com/embed/%@?autoplay=0&showinfo=0&controls=0\" type=\"application/x-shockwave-flash\" \ width=\"%0.0f\" height=\"%0.0f\"></embed>\ </body></html>"; nsstring *html = [nsstring stringwithformat:embedhtml, videotoken, videoview.frame.size.width, videoview.frame.size.height]; [videoview load...

embedded - can I change "delay until" granularity on cortex-m4? -

embedded - can I change "delay until" granularity on cortex-m4? - i'm scheduling loop "delay until" clause on stm32f4 discovery board, , when increment frequency, thing stop respecting time constraint. after digging, under impression it's scheduler granularity not task. 1 of signs when go slow time respected, , faster go, more bonkers go. tardiness seems discrete, falling on scheduling frequency limit. here test code: task body pwm onperiod : time_span; offperiod : time_span; period : time_span; next_start : time := clock; pwm_on : boolean := true; begin loop period := microseconds (1_000_000) / pwmfrequency; onperiod := period / 3; offperiod := 2 * period / 3; if (pwm_on) off (pattern (next_led)); pwm_on := false; next_start := next_start + offperiod; else on (pattern (next_led)); ...

Array index out of bounds java heap -

Array index out of bounds java heap - i know amaetuer error, understand means dont understand why cant prepare it. ive been trying everything. im trying take array of type t , switch values around correctly corresponds rules of heap, parent greater 2 children. error in while loop please dont harsh if fixable. ive been struggling heavily , cant seem find answer. public class myheap<t extends comparable<t>> extends heap<t> { // constructors of subclass should written way: public myheap(int max) { super(max); } public myheap(t[] a) {super(a);} public void buildheap(t[] arr){ int size = arr.length; int startsize = (size-1)/2; for(int i=startsize;i>0;i--){ int l = left(i); int r = right(i); t temp = null; while((arr[r]!=null) && arr[i].compareto(arr[r])<0){ if (arr[l].compareto(arr[r])>0){ temp = arr[l]; ...

javascript running an object method inside objects constructor -

javascript running an object method inside objects constructor - this question has reply here: how access right `this` / context within callback? 4 answers i trying implement own object in javascript. using protype method add together the objects , it's methods. following function mycustomobject(){ this.attr1 = value; //more atributes here. works fine this.options = { imagefilenames: ['image1.png', 'image2.png',...], baseurl:'url;' }; this.objectmethod(); } mycustomobject.prototype.objectmethod = function (){ //..... method's body here. var url = this.options.url; this.options.imagefilenames.foreach(function (filename, index){ var src = url+'/'+filename; imageobj = new image(); imageobj.src = src; imageobj.load = function (){ i...

jquery - Prevent Gravity Forms Submission With Confirmation Box -

jquery - Prevent Gravity Forms Submission With Confirmation Box - i'm using next code output confirmation box when submit button of wordpress gravity form clicked: $(".gform_wrapper.form-01 form").submit(function(event) { confirm('ut in nulla enim. phasellus molestie magna non est bibendum non venenatis nisl tempor. suspendisse.'); }); the popup works fine, need prevent form submitting if if user clicks 'cancel' button. regardless of button clicked in confirmation, form submitted anyway. managed prepare myself (for once!) $('.gform_wrapper.form-01 form input[type="submit"]').click(function(event) { event.preventdefault(); var c = confirm('ut in nulla enim. phasellus molestie magna non est bibendum non venenatis nisl tempor. suspendisse.'); if (c == true) { $(this).closest('form').submit(); } else { alert('no'); } })...

ios - Amending UINavigationController viewControllers stack before animation -

ios - Amending UINavigationController viewControllers stack before animation - i have app can customize products varying degrees. in cases options split 2 views, while in other cases first step isn't necessary. what treat products same , force first customization step view controller navigation controller stack, allow view controller decide whether or not step necessary. if not necessary want apply default options product , skip (before transition animation) step 2 while not allowing user first step. the normal uinavigationcontroller.viewcontrollers stack may when @ step 2: [listview (root)] -> [customizestep1] -> [customizestep2] but want apply default values product , amend view controller stack that: [listview (root)] -> [customizestep1] ----- becomes ----- [listview (root)] -> [customizestep2] what i've tried utilize code in customizestep1 view controller: - (void)viewwillappear:(bool)animated { [super viewwillappear:an...

c# - WebGrid - Sorting by navigation property's field when null reference -

c# - WebGrid - Sorting by navigation property's field when null reference - i'm using system.web.helpers.webgrid display ienumerable<request> . requests have navigation properties. whenever sort clicking in title of those's field, exception object reference not set instance of object. rises. i code type of columns way: grid = new webgrid(model.requests); // things @grid.gethtml(columns: new[]{ //[...] columns sdms.column("user.name", "user", format: p => p.user != null ? p.user.name : ""), //[...] more columns }) note i'm using format parameter set custom result on grid loading. i think happens because of rows don't have user associated, don't know how customize behaviour on these cases. i found out this on web, don't seem have method in version of assembly. don't know how either. tryed installing nuget packages didn't help. any ideas? add extension method/ partial c...

ios - No objects fetched from Parse Array column when Edited in Data Browser -

ios - No objects fetched from Parse Array column when Edited in Data Browser - i'm storing date array column in parse.com command expiration date of app's subscription. 1 - store date app parse's server. ex: [{"__type":"date","iso":"2014-10-23t02:23:55.730z"}] 2 - can read server. ok. 3 - edit value info browser. ex: [{"__type":"date","iso":"2015-10-23t02:23:55.730z"}] 4 - can no longer read it. nil when fetching on app. parse not back upwards changing arrays info browser ? happening ? update: code i'm using fetch , set date: [[pfuser currentuser] fetch]; // pfuser *user = [pfuser currentuser]; // if date has been changed info browser, serverdate above homecoming 0 objects. nsdate *serverdate = [user[ksubscriptionexpirationdatekey] lastobject]; nsdate *localdate = [[nsuserdefaults standarduserdefaults] objectforkey:ksubscriptionexpirationdatekey]; // if ([serve...

javascript - Disable any sort of redirection from the server -

javascript - Disable any sort of redirection from the server - on website have using free hosting service 1 forms, after form submitted, redirects me somewhere else. if set whole form in div, there way give properties div prevent sort of client/server side redirection div? <div id="disableredirect">here goes form</div> as per comment above can't create form can't redirected. when form posted it'll redirect self or page. javascript html

java - Finding average of row of 2D array -

java - Finding average of row of 2D array - i'm creating method finds average of doubles in row of 2d array. method takes in char describes grade category row. that, need find average of of items in row. how can find row , calculate average? here's have far: import java.util.arrays; public class gradebook { private string name; private char[] categorycodes; private string[] categories; private double[] categoryweights; private double[][] gradetable; public gradebook(string namein, char[] categorycodesin, string[] categoriesin, double[] categoryweightsin) { name = namein; categorycodes = categorycodesin; categories = categoriesin; categoryweights = categoryweightsin; gradetable = new double[5][0]; } public double categoryavg (char gradecategory) { double sum = 0.0; double count = 0.0; int index = 0; if (gradecategory == 'a') index = 0; else if (gradecategory == 'q') index = 1; else if (gradec...

performance - How to profile set of process in freeBSD? -

performance - How to profile set of process in freeBSD? - i trying debug service respect performance. service trying debug, internally spawns instances of same binary. improve through-put, planning increment number of instances of binary. after point in number of processes of binary, through-put not increasing. trying reason-out why happening. i need help on start, tools available process level profiling. using freebsd platform. if using more processes doesn't improve output, service isn't cpu bound. might constrained e.g. disk or network throughput instead. start systat . systat -vmstat . see man systat . whill show several aspects (like memory usage, interrupts, processot usage , disk activity) of how busy scheme is. if programme lot of network activity, using systat -tcp might give insight well. if service http server, might want @ varnish. performance process profiling freebsd throughput

select - subquery in mysql case when clause -

select - subquery in mysql case when clause - the next query works in oracle, in mysql produces error: select id_propuestas, titulo, descripcion, id_usuario, votos, case when(select true votospropuestos id_propuesta = propuestas.id_propuesta , id_usuario = 1) true else false end votada propuestas error message: error code: 1054. unknown column 'propuestas.id_propuesta' in 'where clause' can explain problem and/or suggest solution? you can't set subquery within case , query can reworked accomplish intention using exists() function: select id_propuestas, titulo, descripcion, id_usuario, votos, exists(select * votospropuestos id_propuesta = propuestas.id_propuesta , id_usuario = 1) votada propuestas the exists() function returns true if rows returned subquery, false otherwise. it far more efficient utilize join: select p.id_propuestas, p.titulo, ...

c# - Enabling Server Filtering, Sorting, Paging breaks SignalR Client Updates for MVC Kendo UI Grid -

c# - Enabling Server Filtering, Sorting, Paging breaks SignalR Client Updates for MVC Kendo UI Grid - i created application using teleirk mvc wrapper kendo ui grid signalr datasouce. an update of grid transmitted , reflected on clients running application (with client side filtering, sorting, paging). datasource using rather big (which caused performance issues filtering, sorting, paging operations). re-configured grid utilize server filtering, sorting, paging did fixed performance issue , drastically improved usability of application. after reconfigured move actions server-side noticed alter making not beingness reflected on client machines. switched , forth between client-side , server-side filtering, sorting, , paging verify that alter cause of issue sure. has experiences before themselves? , can provide me steps/advice on how prepare this? thank you telerik provided me solution. here thread answer: [http://www.telerik.com/forums/enabling-server-filtering...

svg - work-flow related rather than programming -

svg - work-flow related rather than programming - i have bunch of line drawings done decades ago republic of india ink. know recommendations on best way convert curves intersect in paradoxical ways (sorta escher without limiting attachment physics). i'd curves minimalist in sense of having few command points in stitch-wise continuous chunks of cubic beziers. if 1 uses illustrator or inkscape convert line fine art vectors resultant paths have far many command points able, later, animate, via smil or javascript. looking canonical curves accomplish topology envisioned... sorta http://cs.sru.edu/~ddailey/svg/trefoil.svg svg vectorization bezier

javascript - How to set a callback that end users can listen to for my lib? -

javascript - How to set a callback that end users can listen to for my lib? - here's calling code looks like: <script type='text/javascript'> $('body').on('click', 'button', function() { var import_url = $('#import_url').val(); var detected_services = [] detected_services = plugintest.analyze(import_url); console.log(detected_services); // returns [] immediately. }); </script> here's lib code looks like: plugintest.detected_services = []; plugintest.analyzewebsite = { start: function(import_url) { // long, async heavy lifting sets value of plugintest.detected_services. settimeout(function() { homecoming plugintest.detected_services; }, 10000); }, }; how can allow me user hear event fire plugin can immedately in calling code? javascript jquery function asynchronous callback

php - Don't get any response by Instagram API -

php - Don't get any response by Instagram API - here code : <?php function fetchdata($url){ $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_timeout, 20); $result = curl_exec($ch); curl_close($ch); homecoming $result; } $result = fetchdata("https://api.instagram.com/v1/users/search?q=majoe_47&access_token=[hidden]"); var_dump($result); $result = json_decode($result); foreach ($result->data $post) { // data. } ?> output: bool(false) output on direct url : {"meta":{"code":200},"data":[{"username":"majoe_47","bio":"breiter als der t\u00fcrsteher","website":"http:\/\/www.facebook.com\/majoeduisburg","profile_picture":"http:\/\/photos-a.ak.instagram.com\/hphotos-ak-xfa1\/10584773_1460870534165160_603268483_a.jpg...

Javascript program - deleting an element from an array -

Javascript program - deleting an element from an array - the programme wrote how sports equipment company monitor trampoline use; records client name, , status (child or adult) on trampoline. there 5 functions, can add together customer, display client , delete lastly customer. stuck on lastly function have utilize object constructor identify , delete customer. ps: can't utilize predefined javascript array element-deleting or manipulating methods such delete() , concat() , join() , pop() , push() class="lang-js prettyprint-override"> const max_customers = 5; //maximum client on trampoline 5 var customerlist = new array();//create new array function addcustomer () { if (customerlist.length >= max_customers) alert('sorry, no more ' + string(max_customers) + ' customers allowed on trampoline.') else { var newindex = customerlist.length; customerlist[newindex] = new object; customerl...

javascript - I'm trying to use a jquery but getting two errors: -

javascript - I'm trying to use a jquery but getting two errors: - in netbeans created php code , did this: <!doctype html> <html> <head> <link rel="stylesheet" href="flexslider.css" type="text/css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script src="jquery.flexslider.js"></script> <script type="text/javascript" charset="utf-8"> $(window).load(function() { $('.flexslider').flexslider(); }); </script> <meta charset="utf-8"> <title></title> </head> <body> <div id="slideshow"> <?php error_reporting(e_all); ini_set('display_errors', '1'); //$allowed_types="(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$) |(\.gif$)"; $allowed_type...

c++ - Ostream << operator overloading and it's return type -

c++ - Ostream << operator overloading and it's return type - i learnt how operator overloading of stream insertion operator. 1 uncertainty remains. #include<iostream> class int { int i; friend std::ostream& operator<<(std::ostream&,int&); public: int():i(100){} }; std::ostream& operator<<(std::ostream& obj,int & data) { obj<<data.i; homecoming obj; } int main() { int obj; std::cout<<obj; } what significance return obj; has? do return have utilize further? are forced return because of syntax of operator<< without usefulness? remember how can write code this: cout << "the info is: " << somedata << endl; this same as: ((cout << "the info is: ") << somedata) << endl; for work, << operator has homecoming stream. c++ operator-overloading

R: column binding with unequal number of rows -

R: column binding with unequal number of rows - i have 2 info sets. each of them has variables id, block, , rt (reaction time). want merge/column bind 2 sets have 1 info set variables: id, block, rt1, rt2. problem there unequal number of rows in 2 sets. also, of import id , block number match. missing values should replaced na. have: head(blok1, 10) id blok rt1 1 1 1 592 2 1 1 468 3 1 1 530 4 1 1 546 5 1 1 452 6 1 1 483 7 1 2 499 8 1 2 452 9 1 2 608 10 1 2 530 head(blok2, 10) id blok rt2 1 1 1 592 2 1 1 920 3 1 1 686 4 1 1 561 5 1 1 561 6 1 2 327 7 1 2 686 8 1 2 670 9 1 2 702 10 1 3 920 what want have: id blok rt1 rt2 1 1 1 592 592 2 1 1 468 920 3 1 1 530 686 4 1 1 546 561 5 1 1 452 561 6 1 1 483 na 7 1 2 499 327 8 1 2 452 686 9 1 2 608 670 10 1 2 530 702 etc. here's solution using dplyr, utilizing index or unique id: blok1 <- data.frame(id = c(1, 1, 2), rt1 = c(11, 12, 13)) blok2 <- data.frame(id = c(1, 2, 2),...

algorithm - Outlier dectection Using ELKI -

algorithm - Outlier dectection Using ELKI - i utilize elki info mining software outlier detection. have many outliers detection techniques provides same results(same outliers techniques difference in size of circle around points shown in figures below). uses mouse head dataset provided on elki website. in data-set points labeled respective cluster name, whether ear_left or ear_right or head or noise. if alter label of noise ear_right, shows outlier point ear_right. have alter 5 out of 10 noise label ear_right. here result of using knn , ldof outlier detection technique modified data-set , in elki: is problem software or doing wrong? have tried using outlier detection? there software can perform outlier detection using different algorithms lof, ldof , knn or find algorithm source code these techniques? this simplistic info set. it not surprising methods all work more or less good. because toy info set, not real data... on real data, outlier detection much, m...

How to retrieve tasks by section using asana api -

How to retrieve tasks by section using asana api - if project contains multiple sections, how retrieve tasks section if know section name/id? or there way know section task belongs to? there not-yet-fully-supported way sections of task - if utilize ?opt_fields=projects.section.name instance, response contain section task. there not way query tasks in section. api asana

c# - How can i use foreach in Container.DataItem? -

c# - How can i use foreach in Container.DataItem? - how can utilize in repeater itemtemplate ? foreach(string tag in eval("etiketler")) { response.write("<a href='#'>"+tag+"</a"); } there no way in format. should send dataitem static method , should homecoming string contains markup.. public static string getmarkup(object dataitem) { var tags = databinder.eval(dataitem, "etiketler"); // depend on etiketler type stringbuilder sb = new stringbuilder(); foreach(string tag in tags) { sb.append("<a href='#'>"+tag+"</a"); } homecoming sb.tostring(); } use method this: <%# getmarkup(container.dataitem) %> c# asp.net

html - Is it possible to tell browsers (chrome?) the correct URL for a language? -

html - Is it possible to tell browsers (chrome?) the correct URL for a language? - i have website has various translations available via: http://example.com/en/... http://example.com/de/... http://example.com/es/... etc... whenever go 1 of non-english sites, chrome pops it's "would translate page?" bar. if click "translate english", runs page through it's translation backend and, of course, spits out broken english. i'd prefer redirect http://example.com/en/... . there way flag browser? have language selector in page, people might not notice / may unable read it, , google translate bar in face. ok, think got it. https://productforums.google.com/forum/#!topic/chrome/dwewxpx1tle: if prefer webpage not translated google translate, insert next meta tag html files: <meta name="google" value="notranslate"> this @ to the lowest degree suppress translate bar. won't handle desired redirect. h...

Efficient way to check collision on a list of objects for Java/Android -

Efficient way to check collision on a list of objects for Java/Android - so, i'm developing game android in mobile development class , want know if there more efficient way check collision have. right have 3 lists contain row of bricks each (total of 3 rows, equal in length). calling checkcollision() each brick in each list (depending on few conditions [see code]) every time ondraw() method called. works fine, sense if isn't efficient way of doing , don't want utilize rects. can offer suggestion? here code: this called in ondraw(): public void checkbrickcollision() { // row 1 // checks collision if first 2 rows missing // elements (meaning player has nail elements) // , if list not empty if (bricklistthree.size() < 6 && bricklisttwo.size() < 6) { if (!bricklistone.isempty()) { (brick b1 : bricklistone) { ...

sql - extracting total days of a month and then use it to get average sales per day -

sql - extracting total days of a month and then use it to get average sales per day - hi i've been working on project , need this. select sf.order_qnt, dd.actual_date, dd.month_number sales_fact sf, date_dim dd dd.date_id = sf.date_id , dd.month_number = 1; the result following: order_qnt actual_date month_number ---------- ----------- ------------ 1100 05/01/13 1 100 05/01/13 1 140 06/01/13 1 110 07/01/13 1 200 08/01/13 1 500 08/01/13 1 230 08/01/13 1 500 08/01/13 1 200 08/01/13 1 53 15/01/13 1 53 22/01/13 1 now, want average month (average per day). select sum(sf.order_qnt)/31 avgperday sales_fact sf, date_dim dd dd.date_id = sf.date_id , dd.month_number = 1; the question is, instead o...

java - NullPointerException on onPostExecute method -

java - NullPointerException on onPostExecute method - i’m having navigation drawer app contains menu can navigate between fragments. first fragment after app lunch home contains listview , footer attached in bottom (is test). problem when lunch home fragment first time nil happen , work well, when alter fragments navigation drawer , trying home fragment app crash. error log show me null pointer exception. thes code detail oncreateview method @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { if (v != null) { viewgroup parent = (viewgroup) v.getparent(); if (parent != null) parent.removeview(v); } seek { v = inflater.inflate(r.layout.fragment_homes, container, false); listview = (listview) v.findviewbyid(r.id.homelist); l = new homelistadapter(this, homelist); if(l...

c++ - QPrinter resolution is wrong in Linux -

c++ - QPrinter resolution is wrong in Linux - i trying image printing programme work in qt. trying print custom printer have ppd. there calculations based on device information, create image sent printer. when looking @ printer properties, see resolution 300 dpi x 300 dpi . in windows, works fine - in linux, calculated image info becomes large, making files explode... looking through info found in linux, physicaldpix , physicaldpiy (used in code calculation) 1200 instead of 300. so blame on qprinter::printermode qprinter::highresolution 2 on windows, sets printer resolution defined printer in use. postscript printing, sets resolution of postscript driver 1200 dpi. i changed constructor take care of - in case defaults wrong... didn't work: printer::printer(const qprinterinfo& printerinfo, mainwindow* pwnd) : #if defined(q_os_win32) || defined (q_mac_osx) qprinter(qprinter::highresolution) #else qprinter(qprinter::screenresolution) #en...

android - How to extract data from website? -

android - How to extract data from website? - i want create android app in pupil can see attendance. attendance updated daily in website database. in website homepage pupil must come in log in details such username, password , captcha. profile displayed in attendance can seen. want extract info lone (that attendance percentage). think website uses .asp database. give me idea! sorry if question doesn't sounds good... when say, saving in db , mean saving in sql server db or other db , web app reads db displays data. can develop android app interact db , show values in app. android database jsp web-scraping

rest - Batching API requests with flask-restful -

rest - Batching API requests with flask-restful - i'm building rest api flask-restful , 1 thing i'd enable ability batch request resources, similar how facebook graph api works: curl \ -f 'access_token=…' \ -f 'batch=[{"method":"get", "relative_url":"me"},{"method":"get", "relative_url":"me/friends?limit=50"}]' \ https://graph.facebook.com which returns array each request resolved status code , result: [ { "code": 200, "headers":[ { "name": "content-type", "value": "text/javascript; charset=utf-8" } ], "body": "{\"id\":\"…\"}"}, { "code": 200, "headers":[ { "name":"content-type", "value":"text/javascript; charset=utf-8"} ...

group by - MySQL order by number of substring occurrences -

group by - MySQL order by number of substring occurrences - example table: id name 1 apple: color: yellowish 2 apple: color: reddish 3 grapes: color: greenish 4 grapes: color: greenish 5 oranges: color: orange 6 apple: color: yellowish 7 apple: color: yellowish i need order number of fruits descending, without looking @ colors. know table have been divided on fruits , colors, thats story. result should this, ordered count of substring, "everything before first :" id name 1 apple: color: yellowish 2 apple: color: reddish 6 apple: color: yellowish 7 apple: color: yellowish 3 grapes: color: greenish 4 grapes: color: greenish 5 oranges: color: orange is possible in mysql, or need sorting in php f.ex? mysql> select e.* illustration e bring together ( select substring_index(name, ':', 1) fruit, count(*) count illustration grouping fruit) x on substring_index(e.name, ':', 1) = x.fruit order x.c...

xcode - Must header files be created separately now in Yosemite? -

xcode - Must header files be created separately now in Yosemite? - when used add together new objective-c file project, add together implementation , header files. now, in yosemite , xcode 6.0.1, adding new file adds implementation file. there way create add together both header , implementation automatically used to? you need xcode 6.1 develop yosemite. 6.0.x has 10.9 , ios 8 sdks—the 10.10 sdk in 6.1. choose "cocoa class" in new file sheet , you'll still alternative create both .h , .m files together, new alternative take objc or swift. xcode osx-yosemite

how to get the selected values of all radio buttons on submit in php? -

how to get the selected values of all radio buttons on submit in php? - i developing online test application,dispalying question in 1 page options.how can selected value of radio buttons on submit question id. <?php include_once('connect.php'); $sql="select * testquestions testid='126'"; $result=mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result)>0) { $data = array(); // create variable hold info while (($row = mysql_fetch_array($result, mysql_assoc)) !== false) { $data[] = $row; // add together row in results (data) array } //shift off first value array_shift($data[0]); $merge = call_user_func_array('array_merge', $data); $size=sizeof($merge); $newdata=array(); $num=1; echo "<form action='fetchquestion.php' method='post'>"; foreach ($merge $key => $value ) { $sql2="select qid, question,option1,option2,option3,option4 question qid='$value' "; $resul...

javascript - Add overlay on click, for existing elements -

javascript - Add overlay on click, for existing elements - i have ultra-basic layout based on ratchet <div id="view1"> <header class="bar bar-nav" id="header1"> <h1 class="title">my application</h1> </header> <div class="content" id="content1"> <nav class="bar bar-tab" id="nav1"> <a class="tab-item active" href="#" id="navitem1"> <span class="icon icon-home"></span> <span class="tab-label">home</span> </a> <a class="tab-item " href="#" id="navitem2"> <span class="icon icon-info"></span> <span class="tab-label">about</span> </a> <...

javascript - Understanding the changes in angular.copy() between 1.0.7 to 1.2.26 -

javascript - Understanding the changes in angular.copy() between 1.0.7 to 1.2.26 - hey angularjs wizards! i'm trying implement similar next plnkr. original post. http://plnkr.co/edit/mzqhgg?p=info var projectsapp = angular.module('projects', ['ngresource']); projectsapp.config(function($routeprovider) { $routeprovider .when('/', { controller: 'projectlistctrl', templateurl: 'projectlist.html'}) .when('/project/:id', { controller: 'projectdetailctrl', templateurl: 'projectdetail.html' }) .otherwise('/'); }); projectsapp.factory('project', function($http) { var json = $http.get('project.json').then(function(response) { homecoming response.data; }); var project = function(data) { if (data) angular.copy(data, this); }; project.query = function() { homecoming json.then(function(data) { homecoming data.ma...

c# - Refresh EF context after synchronize with SyncFramework -

c# - Refresh EF context after synchronize with SyncFramework - i'm developing wpf application ef6 , syncframework 2.1 synchronize info , sqlserver. don't know if practice or how should refresh ef context after download sync finished... i don't know info has been synchronized, so.. should refresh context? you can subscribe changes applied event , can access changes has been synched. or refresh entire context rather looping thru each alter , refreshing. c# wpf entity-framework microsoft-sync-framework

php - Phalcon Model not accepting variable -

php - Phalcon Model not accepting variable - i have problem when seek verify if user exists in database. $login = $this->cookies->get('login'); $loggedinas = $login->getvalue(); $user = users::findfirstbyusername($loggedinas) this returns: php notice: trying property of non-object in /public_html/app/views/charactersheets/create.phtml on line 27, referer: localhost/charactersheets however if utilize this: $user = users::findfirstbyusername("pentacore") it works, , i've checked cookie contains right username var_dump($loggedinas) (returns string(32) "pentacore", give thanks silkfire) returned pentacore so... problem? from phalcon @ phalcon framework forum: it cookie's decryption adds trailing spaces have do: $login = $this->cookies->get('login'); $loggedinas = trim($login->getvalue()); $user = users::findfirstbyusername($loggedinas) php mysql cookies models phalcon

android - DrawerLayout with AppCompat library Illegal Argument Exception -

android - DrawerLayout with AppCompat library Illegal Argument Exception - i having unusual issue drawer layout , new appcompat in trying create app material designed. i've done similar activity no problem 1 maintain getting next exception: java.lang.illegalargumentexception: drawerlayout must measured measurespec.exactly. below xml layout <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="wrap_content"> <include layout="@layout/toolbar"/> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height=...