Posts

Showing posts from April, 2015

ios - Xcode Beta 6.3 magically delegates tasks to other threads? -

ios - Xcode Beta 6.3 magically delegates tasks to other threads? - we've came onto strange bug in our project (i hope it's bug not our fault). let's jump straight problem. our application storyboard based, of course of study connects external api etc. we've faced unusual thing regular implementation of prepareforsegue: , things related segues automagically delegates things other threads. little illustration - when nslog(@"sample log") in viewdidload doesn't fired when should gets called in random time that's why guessed might delegated other-than-main thread. firstly thought networking layer may cause because of blocks , when set direc logs application called in random time! we've tried check thread in debugger , shows thet happens in main thread. strange, right? anyway, colleagues check against different versions of xcode because on machine there bothe 6.2 , 6.3 beta. when compile on computer 6.3 installed works properly! possible...

xss - magento - hackers or exploit -

xss - magento - hackers or exploit - i found these entries in magento log file. not sure if hackers attempting come in enter bad data, or evidence of exploit. log file: var/log/exception.log:4118:2014-10-30t22:46:39+00:00 debug (7): exception message: no date part in '<?import namespace="crosssitescripting" implementation="http://ha.ckers.org/crosssitescripting.htc">' found. var/log/exception.log:4131:exception 'zend_locale_exception' message 'no date part in '<?import namespace="crosssitescripting" implementation="http://ha.ckers.org/crosssitescripting.htc">' found.' in lib/zend/locale/format.php:869 var/log/exception.log:4352:2014-10-30t22:46:49+00:00 debug (7): exception message: no date part in '<script src=http://ha.ckers.org/xss.js></script>' found. var/log/exception.log:4365:exception 'zend_locale_exception' message 'no date part in '<script src=htt...

c - Macro Definition Changes Values? -

c - Macro Definition Changes Values? - i have macro definition in 1 file (we'll phone call file1.c): #define val_not_set -9999.9 in file, include file1, initialize different variable val_not_set : decimal value; value = val_not_set; later on, seek compare 2 values: if(value == val_not_set){ ... } but if statement fails. when print out contents of value , val_not_set , get: value == -9999.900000 val_not_set == 759.867067 however, if set macro -9999 , not -9999.9 , there no problem, , val_not_set keeps value. also, code trying transition aix machine linux, , there no problem of on aix. have thought why macro loses value, when it's float ? c linux macros definitions

python - django how to place variable in a raw string,such as for URL router -

python - django how to place variable in a raw string,such as for URL router - i want write url configured when needed,for example: url(r'^api/v1/books/',include('article.urls')) in settings.py set apiversion = 'api/v1' i want set apiversion url create configureable,how that,is there best way accomplish that? in urls.py: from django.conf import settings urlpattern = patterns('', url(settings.apiversion, include( url(r'/books/',include('article.urls'), ) ) in settings.py: apiversion = r'^api/v1' you can avoid nested include using variable. python django django-urls

c++ - How come only the first y and x are undeclared? -

c++ - How come only the first y and x are undeclared? - error c2143: syntax error : missing ';' before ')' error c2143: syntax error : missing ';' before '/' error c2065: 'y' : undeclared identifier error c2065: 'y' : undeclared identifier error c2143: syntax error : missing ';' before ')' error c2143: syntax error : missing ';' before '/' error c2065: 'x' : undeclared identifier error c2065: 'x' : undeclared identifier error c2065: 'x' : undeclared identifier error c2065: 'y' : undeclared identifier error c2065: 'x' : undeclared identifier error c2065: 'y' : undeclared identifier here's code : for (int y = scan->rcwindow.bottom - scan->rcwindow.top) / 4; y < ((scan->rcwindow.bottom - scan->rcwindow.top) - (scan->rcwindow.bottom - scan->rcwindow.top)) / 3.5; y++; (int x = scan->rcwindow.right - sc...

laravel - Return result set based on result from joined table -

laravel - Return result set based on result from joined table - i building webstore application on laravel 4 , i've run bit of difficulty when building query. want homecoming list of products, have active amount of stock. each item of stock listed own set of data, selling (tickets) have unique code attached , want know codes have been sold , have not. i want able calculate how many tickets have remained unsold , list ticket groups active if have tickets left sold. i going static query via products model returns each product , query homecoming codes have, seems long winded , i'm sure laravel has way homecoming result sets based upon internal query. i'm not sure how this.. hopefully makes sense, want quick , efficient way of checking products stock levels querying active products , querying active ticket stock. some code snippets // check if code active public function scopeactive($query) { homecoming $query->where('active', ...

jquery - Using Javascript replace on a element -

jquery - Using Javascript replace on a <td> element - i have done quite bit of searching on site (and web) in relation query cannot straight answer. need remove word "other" dynamically created table. code using follows: <td id="testclass">other option</td> class="snippet-code-js lang-js prettyprint-override"> var str = document.getelementbyid('test').innerhtml; var text = str.replace("other", ""); document.getelementbyid("test").innerhtml = text; class="snippet-code-html lang-html prettyprint-override"> <td id="test">other option</td> for reason though, not work element work p, span, div etc. can shine lite on this? have tried jquery options , still same thing. here on jsfiddle you're missing whole table: <table> <tr> <td id="test">other option</td> </tr>...

android - Changing SDK Platform cause R cannot be resolved -

android - Changing SDK Platform cause R cannot be resolved - i running android studio 1.0.1 , i'v download api 22 ,21 , 19 platforms , since android studio don't provide alternative while setting new projects take sdk platform want build project on,i tried alter manually (gradle.build file )and know project automatically built on latest api level have, so when alter compilesdkversion(platform sdk) 22 19 , sync project gradle , process completed fine , got (r) cannot resolved in mainactivity , , if press (ctrl+n) , search (r file) in project don't find this problem , i'll wait experience guys... android api android-studio sdk

php - Public form with URL params -

php - Public form with URL params - i'm trying create public form ('controller/create/1'). layout needs same whole page. looks administration page. function create($id){ $this->layout = 'inner'; } once set layout requests stuff within layout template. so how should pass required parameters of form? validations , on, assuming main missing parameter form html template file - rendered. there established convention controller action looks template file renderer. in case cakephp looks template file views/controller/create.ctp - , there should form code written. i suggest start nice blog tutorial here: http://book.cakephp.org/1.2/en/the-manual/tutorials-examples/blog.html#adding-posts you find illustration of how validation done there well. php cakephp cakephp-1.2

wordpress - Include a file after plugin loaded? -

wordpress - Include a file after plugin loaded? - i writing plugin , want include file when satisfied conditions or user take include them. after include, functions (in file include later) not run ? if ( isset( $registered[$add_on] ) && ! isset( $enabled_add_ons[$add_on] ) ) { include( $registered[$add_on]['file'] ); } these in file : function add_on( $meta_boxes ) { $feature_meta_box= array( ... ); array_unshift( $meta_boxes[1]['fields'], $feature_meta_box); homecoming $meta_boxes; } add_filter('add_metabox', 'add_on'); can tell me how can load file ? wordpress wordpress-plugin

javascript - Push my project into Git hub repository via another php application -

javascript - Push my project into Git hub repository via another php application - i have html5/javascript/php application ready. want force other projects github repository via existing application. so want create repo ( stage , commit , push , update ) steps existing application. how can that? since utilize php, php can phone call external commands via exec or system , utilize these functions phone call git commands arguments (e.g repository need) , fetch results (if failed example). i used similar create subversion web application client. for illustration have html/javascript create interface user can set repository parameters , arguments , pass (or post these) php. php utilize exec or system (with necessary validation , escaping of course) phone call git commands repository , homecoming results php php js app (via ajax example). further info: if git commands need take time finish (have timeout, or need communicate remote repositories , on), s...

php - Drupal custom modules and cache issue -

php - Drupal custom modules and cache issue - we created few custom custom modules drupal site , have next issue : each time create or update content (whatever is), content generated custom modules disappears. have clear caches content appear again. as our first experience drupal, missing don't know what. any help appreciated! below code of 1 of these custom modules: file website_actualites.module <?php /** * implements hook_block_info(). */ function website_actualites_block_info() { $blocks['website_actualites'] = array( 'info' => t('website_actualites'), 'cache' => drupal_cache_per_role, ); homecoming $blocks; } /** * implements hook_block_view(). */ function website_actualites_block_view($delta = '') { $adelta = explode('+', $delta); $nbactualite = 2; if (!empty($adelta[1])) { $nbactualite = $adelta[1]; } $block = null; switch ($adelta[0...

ios - Ajax does not work when the app is closed and opened again -

ios - Ajax does not work when the app is closed and opened again - i have problem phonegap build, version 3.6. have app loads content via ajax. works android emulator , compiled on android doesn't work on ios everything works fine firts time execute app, when close app , reopen it, app hanging on ios , not load ajax's content. alert message shown, see code below: the code is, //carga la lista con ajax $.ajax({ type: "get", url: localjson+'?cache='+nocache, datatype: 'json', cache : false, timeout: 5000, success: function(data, status) { cargarprogram(data); }, error: function(data) { alert ("ko carga programa"); } }); i tried prevent cache , doesnt' work, any idea, hard find going on, thanks, best regards, cristian ios ajax cordova

sql - Excel VBA Selecting Records from Access Database Not Pulling Correctly -

sql - Excel VBA Selecting Records from Access Database Not Pulling Correctly - i have macro pulls access db , writes recordset spreadsheet based upon dates entered userform. however, if come in in "3/2/2105" , "3/5/2015" returns records 3/2-3/5 , 3/20-3/31. cannot think of reason why this. if point me in right direction/make suggestions appreciated. sub pullfrommsaccess() queryform.show dim conn object dim rs object dim accessfile string dim sql string dim startdate string dim enddate string dim integer sheet2.cells.delete application.screenupdating = false accessfile = thisworkbook.path & "\" & "mdidatabase.accdb" on error resume next set conn = createobject("adodb.connection") if err.number <> 0 msgbox "connection not created!", vbcritical, "connection error" exit sub end if on error goto 0 conn.open ...

html5 - Javascript keypress event and e.keycode -

html5 - Javascript keypress event and e.keycode - i have code suppose update number of remaining characters left when user types in text input . code triggered using keypress event. problem code triggered after 2 keypress . why happen? i have code show key of ascii code character shows 8 , shows when press backspace. , how utilize string.fromcharcode(event.keycode} ; method. why event parameter added function ? how e.keycode know displaying keycode of user's input. code sample html <div id="page"> <h1>list king</h1> <form id="messageform"> <h2>my profile</h2> <textarea id="message"></textarea> <div id="charactersleft">180 characters</div> <div id="lastkey"></div> </form> </div> javascript var el; // declare variables function charcount(e) { ...

java - Split the string in to center -

java - Split the string in to center - i want split string: sun apr 12 17:56:00 gmt+05:00 2015. 17:56. tried this: string[] splitstr = str.split("\\s+"); you string parsing date: by string can like: string str = "sun apr 12 17:56:00 gmt+05:00 2015"; string time = str.split(" ")[3]; system.out.println(time.substring(0, time.lastindexof(':'))); by dateformat utilize pattern parse date , hr , minutes pattern below: string str = "sun apr 12 17:56:00 gmt+05:00 2015"; simpledateformat df = new simpledateformat("eee mmm d hh:mm:ss zzz yyyy"); java android

windows - Is there anyway to hardcode a character in Java so that when I run the program between different platforms it still show up the same way? -

windows - Is there anyway to hardcode a character in Java so that when I run the program between different platforms it still show up the same way? - i have been writing minesweeper programme uses square box character. according this website, character \u25a2 when test on macintosh eclipse. in mac, shows below half of picture, in windows (the above half), square shrinks! basically, want align box other characters use, in windows messed up. want inquire if there anyway bring these exact same characters macintosh , utilize on every platforms? java windows osx unicode character

excel - Assigning range to array in VBA -

excel - Assigning range to array in VBA - i excel info array in vba, following: dim arr() variant arr = activeworkbook.sheets("sheet1").range("c28:r29") as run this, type mismatch error 13. thought problem because 1st row (2 rows in total) represents string (header) , 2nd row represents numbers, tried 1 row this: arr= activeworkbook.sheets("sheet1").range("c28:r28") to no avail, still same problem. does know wrong? regards crouz it's pretty simple, add together .value (i discovered trick not long ago , i'm fan! :) ) arr= activeworkbook.sheets("sheet1").range("c28:r28").value2 excel vba excel-vba

What this exception means? C# winforms -

What this exception means? C# winforms - i'm trying display images database table datagridview control. other cells display image. doesn't , throws exception: what exception means? should prepare it? in likelihood, means image info invalid. seek extracting image info means, simple console app, , pass image.fromstream . or serialize out , seek open in external image editor. might more informative error message way. c#

What is the main difference in object creation between Java and C++? -

What is the main difference in object creation between Java and C++? - i'm preparing exam in java , 1 of questions on previous exam was:"what main difference in object creation between java , c++?" i think know basics of object creation illustration how constructors called , initialization blocks in java , happens when constructor of 1 class calls method of class isn't constructed yet , on, can't find obvious. reply supposed 1 or 2 sentences, don't think description of whole object creation process in java had in mind. any ideas? in add-on other first-class answers, 1 thing important, , ignored/forgotten, or misunderstood (which explains why detail process below): in java, methods virtual, when called constructor (which lead bugs) in c++, virtual methods not virtual when called constructor (which lead misunderstanding) what? let's imagine base of operations class, virtual method foo(). let's imagine derived class, inheriting...

php - .htaccess Rewrite an url with arguments in gif url -

php - .htaccess Rewrite an url with arguments in gif url - after research still not able find solution work fine me. now have url : --> http://www.localhost.com/images/values-lock/countdown-timer.php?time=201504051144 and want rewrite , create appear url in borwser possibility time param above : --> http://www.localhost.com/201504051144/timer.gif actually lastly seek : --- .htaccess --- rewriteengine on rewritebase /images/values-locked/ rewriterule ^([a-za-z])?([a-za-z])=([0-9]+)$ $1/timer.gif [qsa] i not utilize rewrite url way yet still looking doc , topic around. thanks consideration. you can utilize code in document_root/.htaccess file: rewriteengine on rewritebase / rewritecond %{the_request} /images/values-lock/countdown-timer\.php\?time=([^\s&]+) [nc] rewriterule ^ %1/timer.gif? [r=302,l,ne] rewriterule ^([^/]+)/timer\.gif$ images/values-lock/countdown-timer.php?time=$1 [l,qsa,nc] php .htaccess mod-rewrite ...

Udacity Web Crawler in Python 3? -

Udacity Web Crawler in Python 3? - am new world of programming, (apologies in advance mutual newbie mistakes)and completed udacity's first-class intro computer science course, building web crawler python. however, course of study taught programme in python 2, i'd own version running in python 3. can't figure out how get_page() function right, despite much searching around forums , discussions on there. the program: urllib.request import urlopen def compute_ranks(graph): d = 0.8 #damping factor numloops = 10 ranks = {} npages = len(graph) page in graph: ranks[page] = 1.0 / npages in range(0, numloops): newranks = {} page in graph: newrank = (1 - d) / npages node in graph: if page in graph[node]: newrank = newrank + d *(ranks[node] / len(graph[node])) newranks[page] = newrank ranks = newranks homecoming ranks def crawl_web(seed): #returns index, graph of outlinks tocrawl =...

Why can't I install pygame and livewires in python for the book 'Python Programming for the absolute beginner'? -

Why can't I install pygame and livewires in python for the book 'Python Programming for the absolute beginner'? - in python programming absolute beginner requires download 'pygame' , 'livewires'. book links page can download bundle of folders made book. in these folders setup wizard 'pygame' , '.bat' file 'livewires'. however, ran 'pygame' wizard , when utilize 'import pygame' @ start of python script nasty error: traceback (most recent phone call last): file "c:\python34\pygam test.py", line 1, in <module> import pygame file "c:\python34\lib\site-packages\pygame\__init__.py", line 95, in <module> pygame.base import * importerror: dll load failed: specified module not found. i don't know why! when launcher asked when set 'pygame' or something, entered this: c:\python34 which seems right me. '.bat' file 'livewires' doesn't work...

entity framework - EF 6 .Include() optimization -

entity framework - EF 6 .Include() optimization - i have big object needs of it's members loaded @ times. rtrn.list = context.days .include(x => x.inspections.select(y => y.type)) .include(x => x.inspections.select(y => y.subtype)) .include(x => x.inspections.select(y => y.inspector)) .include(x => x.inspections.select(y => y.approver)) .include(x => x.inspections.select(y => y.operatoraddress)) .include(x => x.inspections.select(y => y.unit)) .include(x => x.inspections.select(y => y.recordsaddress)) .include(x => x.inspections.select(y => y.inspectionaddress)) .include(x => x.inspections.select(y => y.people)) .include(x => x.inspections.select(y => y.customfields)) .include(x => x.inspections.select(y => y.codelinks.select(s => s.codesections.select(q => q.questions.select(a => a.answer))...

python - eval () Unexpected EOF while parsing -

python - eval () Unexpected EOF while parsing - so i'm trying 2 inputs separate usernames credit hours , every time after i've exited loop unexpected eof. fresh = [] soph = [] jun = [] sen = [] def classify(cr, un): if cr <= 27: fresh.append(un) print(un, 'is freshman.\n') elif 28 <= cr <= 56: soph.append(un) print(un, 'is sophomore.\n') elif 57 <= cr <= 84: jun.append(un) print(un, 'is junior.\n') elif cr >= 85: sen.append(un) print(un, 'is senior\n') def main(): united nations = input('student: ') cr = eval(input('credits: ')) while united nations , cr != '': united nations = input('student: ') cr = eval(input('credits: ')) classify(cr, un) specifically error is: file "./class.py", line 58, in <module> main() file ...

ios - Autolayout - Vertically center two views in a UITableViewCell when one view has dynamic height -

ios - Autolayout - Vertically center two views in a UITableViewCell when one view has dynamic height - this i'm trying achieve. within of uitableview cell, have uilabel populated dynamic content , separate uiview has set height. in cases when there lot of text, uilabel determines height of uitableview cell. in other cases when there 1 line of text populating uilabel, uiview sets height of cell. (this have.) self.mylabel.settranslatesautoresizingmaskintoconstraints(false) self.myview.settranslatesautoresizingmaskintoconstraints(false) allow viewsdictionary = [ "mylabel":mylabel, "myview":myview, ] allow mylabel_h:array = nslayoutconstraint.constraintswithvisualformat("h:|-15-[mylabel]-60-|", options: nslayoutformatoptions(0), metrics: nil, views: viewsdictionary) allow mylabel_v:array = nslayoutconstraint.constraintswithvisualformat("v:|-[mylabel]-|", options:nslayoutformatoptions(0),...

java - Not able to launch Robotium tests from my android activity -

java - Not able to launch Robotium tests from my android activity - i have 2 projects one android test project android robotium tests run eclipse. able run using eclipse , adb shell on command line. i trying launch test project using android app(activity), below error when trying so java.lang.runtimeexception: exception thrown in oncreate() of componentinfo{com.test.example/pl.polidea.instrumentation.polideainstrumentationtestrunner}: java.lang.nullpointerexception: effort invoke virtual method 'java.util.set android.os.bundle.keyset()' on null object reference does know, doing wrong here? java android android-studio robotium android-instrumentation

rest - AngularJS / Restful Smart Caching -

rest - AngularJS / Restful Smart Caching - i'm looking solution "smart" caching in restful spa (i'm using angularjs). example, if app wants list of widgets (e.g., /widgets ), later application wants specific widget (e.g., /widgets/<widgetid> ), want app find on response first request rather making sec request resource. this save request when user lands on listing view, navigates single item view. however, if user lands on single item view, app know still needed fetch /widgets/<widgetid> /widgets never called. i looked through $resource , $http, didn't see related sort of behavior. looks might able utilize hooks in restangular, it's not that's supported out of box. thanks! angularjs rest caching single-page-application restangular

php - How to make if some condition, checkbox to be checked -

php - How to make if some condition, checkbox to be checked - i have show students checkboxes , if definite teacher teaches these students, must ckeched. if these students not students, has not checked. have 2 queries copmare 2 values, in case when equal, students aren't checked in ckechboxes, written: checked="checked" > > . , how close checkbox, shown > > > before names of students. my view is: class="snippet-code-html lang-html prettyprint-override"> <?php foreach($select_students $student) { ?> <tr><td class='col-md-2'> <input type="checkbox" name="student[]" value="<?php echo $student->user_id; ?>" <?php foreach($select_teachers_students $select) { echo $student->user_id == $select->student_id ? 'checked="checked"' : '' ; ?> > <?php } echo $student...

asp.net 4.0 - When I create a custom control that inherits from HtmlContainerControl, I can't get it to show up in the VS Toolbox -

asp.net 4.0 - When I create a custom control that inherits from HtmlContainerControl, I can't get it to show up in the VS Toolbox - i've tried 2 methods include custom command in toolbox. first, tried drag dll onto toolbox, of controls appeared. again, when did "choose items" way, of controls appeared. any of custom controls inherit web.ui.htmlcontrols.htmlcontainercontrol don't show up. however, if alter controls' classes inherit web.ui.panel instead, show up. what missing? thanks did decorate attributes toolboxitem? asp.net asp.net-4.0

html - resize images using % in css -

html - resize images using % in css - i trying create liquid web layout using % many things can. have nail bump when resizing images. both: <img src="source" style="width: 20%; height: 20%;"/> and .wall_picture_block img{ width: 20%; height: 20%; } don't work height attribte. resize image width 20% of container height stays relative image size.(im trying create squares) the percentages in height , width attributes of image works container contained in. accomplish fluid effect trying putting in container around img , give image height , width: 100% . , should changing height , width of container in percentages. here's example <div style="width: 500px; height: 100px;"> <img src="your-image-link-here" style="height: 100%; width: 100%;"> </div> with image accomplish height , width of 500 * 100. update <div id="wrapper" style="border: 1px solid ...

asp.net - How to get session value into an ASP Parameter tag? -

asp.net - How to get session value into an ASP Parameter tag? - i have next code <asp:sqldatasource id="sqldatasource1" runat="server" updatecommand="update [gmeter] set ... [userid] = @userid ... i need parametr @userid assign session variable session["userid"] , ideas? tried [userid] = <%= session["userid"]%> but not works. try within asp:sqldatasource <asp:sessionparameter name="userid" sessionfield="userid" type="int32" /> asp.net

Google Analytics API - DataTable (JSON Response) doesn't work -

Google Analytics API - DataTable (JSON Response) doesn't work - direct url shows data: https://sonakowiki.appspot.com/query?id=agxzfnnvbmfrb3dpa2lyfqsscefwavf1zxj5gicagicagiakda but on info table format (json response) doesn't: https://sonakowiki.appspot.com/query?id=agxzfnnvbmfrb3dpa2lyfqsscefwavf1zxj5gicagicagiakda&format=data-table-response the page's blank!! i don't understand error made. sorry if made inconvenience. thank you json google-analytics

Highcharts : draw a chart with data from XMLHttpRequest () -

Highcharts : draw a chart with data from XMLHttpRequest () - i begin in javascript... i draw chart info xmlhttprequest () yaxis. receive info server this: function cgi_return_data_conso_elec() { var xhr = new xmlhttprequest(); xhr.open("get", "/cgi-bin/return_data_conso_elec?01/04/2015", true); xhr.send(null); xhr.onreadystatechange = function() { if (xhr.readystate == 4 && (xhr.status == 200 || xhr.status == 0)) { var array_reponse = xhr.responsetext.split("/"); var data1 = array_reponse[1]; alert(data1); } else { //document.getelementbyid("text_test").innerhtml = "wait..."; } } } the value of data1 = 333,2682,2823,1749,624,860,4450,2402,2552,2199,605,794,2433,4060,821,692,477,1005,2904,2438,2066,1652,1672,1544 draw graph this: $('#container').highcharts ({ chart: { type: 'column...

google maps - R code ggplot/googlemaps -

google maps - R code ggplot/googlemaps - i trying work (the links below same thing really) code included @ bottom of first link. looks google maps part doesn't work, know why? looks text overlay doesn't work, why? http://workfeed.baileyplex.com/2013/02/maps-in-r-choropleth-maps.html http://www.r-bloggers.com/maps-in-r-choropleth-maps/ http://www.milanor.net/blog/?p=634 originally, couldn't work found post on here reinstalling several packages , got me point. r google-maps ggplot2

Android. In case of turn of the screen throw exception -

Android. In case of turn of the screen throw exception - android. in case of turn of screen throw exception, in there can problem? used fragment: @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setretaininstance(true); } exception: e/androidruntime﹕ fatal exception: main java.lang.illegalstateexception: no activity @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1113) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1108) @ android.support.v4.app.fragmentmanagerimpl.dispatchresume(fragmentmanager.java:1927) @ android.support.v4.app.fragmentactivity.onresumefragments(fragmentactivity.java:444) @ android.support.v4.app.fragmentactivity$1.handlemessage(fragmentactivity.java:96) @ android.os.handler....

javascript - Standard pattern to redirect a submit form after checking the insert was successful, on Meteor with AutoForm & Iron Router? -

javascript - Standard pattern to redirect a submit form after checking the insert was successful, on Meteor with AutoForm & Iron Router? - i'm using meteor autoform & iron router. i have autoform inserting record, , want redirect page view record after successful insert. what's accepted way this? if utilize standard autoform insert like: {{#autoform collection="articles" id="articlesubmit" type="insert"}} i can't see how can redirect? if utilize 'method' type this: {{#autoform collection="articles" id="articlesubmit" type="method"}} then have write insert method not particularly dry. a form form, if utilize type="method" thats means using meteor.method this, , form handle you, meteor.call now if want router.go() , need write js code, can utilize hooks, wich come autoform package, example articles.hooks({ contactform: { onsubmit: function (i...

Returning value of one function in javascript to next javascript function in the same page -

Returning value of one function in javascript to next javascript function in the same page - i not able homecoming value of pos function loc next function initialize. function pos gives me current latitude , longitude , want utilize these values in next javascript function initialize. value of pos on running initialize function gives undefined. function loc() { navigator.geolocation.getcurrentposition(function(position) { pos = new google.maps.latlng(position.coords.latitude,position.coords.longitude); homecoming pos; }); } function initialize() { var x = loc(); alert(x); centrallocation = new google.maps.latlng(40.6940741,-73.9869325); var request = { location: centrallocation, types: ['clothing_store'], rankby: google.maps.places.rankby.distance }; google.maps.event.adddomlistener(window, 'load',initialize); how uti...

hadoop - How to store Avro format in HDFS using PIG? -

hadoop - How to store Avro format in HDFS using PIG? - after processing input data, i've java object. i've created avro schema storing object in avro file. i'm stuck @ writing object using schema hdfs. can walk me through process of writing object using pig script & corresponding udf? i suppose using udf if utilize java. so have homecoming result of udf pig tuple. then relation info ready store. finally can utilize store command using avrostorage. hadoop apache-pig avro

javascript - replacing the value of a variable in url -

javascript - replacing the value of a variable in url - so have url mentioned in next example; want alter value of pagetoken "baz"; next effort replacing pagetoken well; right way alter value of pagetoken? var url = "https://www.googleapis.com/youtube/v3/search?&pagetoken=cdiqaq&foo=bar" var res = url.replace(/pagetoken=\w*/g, "baz"); console.log(res); //res now: https://www.googleapis.com/youtube/v3/search?&baz&foo=bar, desired output https://www.googleapis.com/youtube/v3/search?&pagetoken=baz&foo=bar thanks this work also: var res = url.replace(/(pagetoken=)\w*/g, "$1baz"); javascript regex node.js

Yahoo Pipes - two RSS feeds - Compare item contents based on IMDB Link -

Yahoo Pipes - two RSS feeds - Compare item contents based on IMDB Link - i have 2 rss feeds. first 1 news site rss feed 1 imdb link in every "item.description". example: item.title: baymax - riesiges robowabohu item.description: release date...: 07.04.2015 imdb...........: http://www.imdb.com/title/tt2245084 second 1 imbd watchlist. example: <item> <pubdate>wed, 08 apr 2015 08:26:05 gmt</pubdate> <title>big hero 6 (2014)</title> <link>http://www.imdb.com/title/tt2245084/</link>; <guid>http://www.imdb.com/title/tt2245084/</guid>; <description></description> </item> as u can see can not compare/link title because 1 title in german, other 1 original title. thought compare based on imdb link. now want output when new film appears in first rss feed (news site) compares mit imdb watchlist rss feed based on imdb link. how can implement yahoo pipes? solved yql ...

ios - link containing arabic word does not open in safari or UIWebView -

ios - link containing arabic word does not open in safari or UIWebView - i trying open link using safari or uiwebview http://www.alsumaria.tv/press-releases/1142/الزاملي-لـخفايا-معلنة-لا-يمكن-تحرير-المن getting error code 101 if seek open in webview , if called using [[uiapplication sharedapplication]openurl:url]; safari dosen't open. tried phone call function before loading request [link stringbyreplacingpercentescapesusingencoding:nsutf8stringencoding]; still no response any help please. ios uiwebview safari

java - Formatting Text in JLabel, specifically scientific/mathematical units -

java - Formatting Text in JLabel, specifically scientific/mathematical units - this isn't overly critical question , marked duplicate since inquire has sort of been asked before( not using same characters trying do, , asked around 2011 - 2012, maybe there different answers now). ok, have have physics programme writing requires numerical input, values of constants, etc.... using jlabels of jtextfield labels. understand using html tagging super , subscript when trying create fractions. physics units not numerical fractions (i.e. meters per sec squared). below have done seek create this, , moderately successful (does job pretty ugly). import java.awt.borderlayout; import java.awt.color; import java.awt.eventqueue; import javax.swing.borderfactory; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; public class mathformattingtest extends jframe { private static final long serialversionuid = 1l; jpanel panel; jlabel gravitati...

deployment - Setup SSL keys when using roles-profiles pattern with Puppet -

deployment - Setup SSL keys when using roles-profiles pattern with Puppet - here scenario. have 2 web applications (lets phone call them webapp1 , webapp2) needs apache, php (with modules), , web app's code self. how set set (using roles-profiles pattern): modules/ apache/ php/ webapp1/ # responsible cloning repo , setting config files webapp2/ # responsible cloning repo , setting config files profiles/ manifests/ webapp1.pp # responsible putting stack webapp2.pp # responsible putting stack profiles/manifests/webapp1.pp looks this: class profiles::webapp1 { include ::apache include ::php include ::webapp1 } and profiles/manifests/webapp1.pp looks this: class profiles::webapp2 { include ::apache include ::php include ::webapp2 } now both applications have served on https , need same set of ssl certificates (imagine webapp1 , webapp2 served different subdomains of domain , have wildcard certificate both applications can u...

Cakephp Edit function is not working if($this->Category->save($this->request->data)) -

Cakephp Edit function is not working if($this->Category->save($this->request->data)) - i have 2 columns in database, id , name under table categories. edit function: public function edit($id = null){ if($this->category->exists($id)){ throw new notfoundexception (__('id not found ')); } if($this->auth->user('role')=='admin'){ if(!$id){ throw new notfoundexception(__('id not set')); } $data=$this->category->findbyid($id); if(!$data){ throw new notfoundexception(__('id not found in database')); } if($this->request->is(array('post','put')) ){ if($this->category->save($this->request->data)){ $this->session->setflash('the info has been edited successfully'); homecoming $this->redirect(array('action' => 'index')); //$this->redirect('...

firewall - Linux; How do I find logs if a program I'm running uses certain ports? -

firewall - Linux; How do I find logs if a program I'm running uses certain ports? - i running centos 5 csf firewall. i'm running programme can't connect server (using port blocked csf presume). log file 'ports'? netstat command utilize ports , network activity. diagonise server processes use: netstat -tln this yields port numbers in tcp mode listening. identify associated processes can utilize -p grab pid. here iana ports list. linux firewall ports

how to store heterogenous objects in matlab? -

how to store heterogenous objects in matlab? - i need create image pyramid in matlab 1 of assignments. though there inbuilt methods individual images in pyramid, confused how store handles images. (i don't have much experience matlab) arrays don't work, since images in pyramid of different size. looking list in .net, or arraylist in java. in http://stackoverflow.com/questions/1413860/matlab-linked-list, can utilize standard java classes, matlab hung when tried utilize java's arraylist. so, best way store collection of heterogeneous data(or handles?) in matlab? edit1 : code not working: im0 = imread('..\lenna-lg.jpg'); //im0 = 480*480*3 array im1 = impyramid(im0,'reduce'); //im1 = 240*240*3 array pyramid = [ im0, im1 ]; //error : error using ==> horzcat //cat arguments dimensions not consistent. so farther searching, have found out called cell, seems heterogeneous array. (http://stackoverflow.com/questions...

How to indicate I am looking for the minimum value using a Genetic Algorithm in Matlab Optimization Toolbox -

How to indicate I am looking for the minimum value using a Genetic Algorithm in Matlab Optimization Toolbox - i using optmization toolbox in matlab multi objective solver using genetic algorithms , need know how specify looking 2 values create function minimum: function y = gamultiobjectivefunction(x) q=x(1); d=x(2); y(1) = -(rev(q) - cost(q, d)); %by minimizing create -(profit) minimum, %meaning +(profit) maximum y(2) = 3*(power(q, 1.4))*((log(power(q,3)*d))/(d+10))+(rand*30); end when run it, gives me results create sense, not know how tell toolbox lower 2 functions are, better. i appreciate help, give thanks you algorithm matlab optimization genetic-algorithm

javascript - How to create input form which opens an alert box? -

javascript - How to create input form which opens an alert box? - in html have created form input text, using javascript validation, should able see below. i want create when submit button clicked alert box appears thanking user inputting data. i can't seem without ruining js validation. does know how accomplish this? any help appreciated. thank you. class="snippet-code-js lang-js prettyprint-override"> function validateform() { var x = document.forms["myform"]["name"].value; if (x == null || x == "") { alert("please come in name"); homecoming false; } var x = document.forms["myform"]["email"].value; if (x == null || x == "") { alert("please come in valid email address"); homecoming false; } var x = document.forms["myform"]["confirm"].value; if (x =...

c++ - C program works on my Ubuntu VM terminal but not on school Linux server? -

c++ - C program works on my Ubuntu VM terminal but not on school Linux server? - i have c programme runs on ubuntu virtual machine not run @ all(doesn't prompt user input, finishes) on school linux server. school linux version: linux 2.6.18-371.9.1.e15 x86_64 my ubuntu vm version: linux 3.16.0-33-generic x86_64 here program: #include <stdio.h> #include <string.h> int main() { char value[50]; char *end; int sum = 0; long conv; while(conv != 0 ) { printf("enter measurement , unit(ex: 4' or 3\";0' or 0\" when done): "); fgets(value, 50, stdin); conv = strtol(value, &end, 10); if(strstr(value, "\'") != null) { conv = strtol(value, &end, 10); sum = sum + (conv*12); } else if(strstr(value, "\"") != null) { conv = str...

python - iPython lprun not printing output -

python - iPython lprun not printing output - i don't know what's going on here, thought inquire guys. i installed ipython 3.1 on mac osx 10.10.2 in ipython tried function no results, here example: in [21]: def rn(): ....: ix in range(0,100): print ix ....: in [22]: %lprun rn() 0 1 2 3 4 .... 98 99 timer unit: 1e-06 s in type of situation i'm expecting normal cprofile type output, showing lines ran , how long each 1 took. doing wrong?! thanks! use -f flag line line output: %lprun -f rn rn() output: in [13]: %lprun -f rn rn() 0 1 2 3 4 5 ... 94 95 96 97 98 99 timer unit: 1e-06 s total time: 0.000933 s file: <ipython-input-4-00cddd5336b9> function: rn @ line 1 line # hits time per nail % time line contents ============================================================== 1 def rn(): 2 101 933 9.2 100.0 ix in range(0,100): pri...

html - Javascript Text_Node via GetElementsByClassName -

html - Javascript Text_Node via GetElementsByClassName - basically trying function working classes or ids, right works ids: function textnodesunder(node){ var = []; (node=node.firstchild;node;node=node.nextsibling){ if (node.nodetype==3) all.push(node); else = all.concat(textnodesunder(node)); } homecoming all; } i want homecoming array of text nodes within of given element whether specify element class or id, (or info attribute cool too!) javascript html textnode

laravel - Elixir versioning public path -

laravel - Elixir versioning public path - i'm trying utilize elixir's version() method 'public' folder beingness public_html (instead of default 'public' method). i version css file, produces build folder manifest within public_html elixir.config.cssoutput = 'public_html/css'; elixir.config.jsoutput = 'public_html/js'; elixir(function(mix) { mix.styles([ 'vendor/normalize.css', 'app.css' ], null, 'public_html/css'); mix.version('public_html/css/all.css'); }); in blade template utilize <link href="{{ elixir("css/all.css") }}" rel="stylesheet"> problem elixir function searches in 'public/build' folder. how can alter searches public_html folder? thank in advance you forgot overwrite publicdir folder in gulpfile.js file, points build folder right location used elixir determine version hash. elixir.config.p...

symfony2 - Symony2 asset - app/Resources -

symfony2 - Symony2 asset - app/Resources - maybe don't understand it. main template is: app/resources/view... should css/js/img ? in sentiment in: app/resources/view/public/... because isn't files bundles , project in production environment. in case "frontend page". of course, when files(css/js/img) belongs bundle in appropriate bundle. now have: {% stylesheets '../app/resources/views/public/css/*' %} <link href="{{ asset_url }}" type="text/css" rel="stylesheet" /> {% endstylesheets %} assetic add together file located in app/resources/js but don't see images files. how according standard symony2, should store , manage "main" template files? i safely , well. larn symfony2. all "web assets resources" should place web folder (that made files "reachable" www). you need run php app/consolle assets:install (*) allow symfony place of assets in right pl...

Visual Studio 2013 - Reuse current document window, if saved -

Visual Studio 2013 - Reuse current document window, if saved - i'm looking alternative 'reuse current document window, if saved' described here: https://msdn.microsoft.com/en-us/library/4z4b7zzx.aspx my options menu shows every alternative featured on msdn page except one. i'm using high german version of visual studio ultimate 2013 update 4. tried using different development settings still doesn't show up. looks feature removed in vs 2012 , not supported in vs 2013 well. due preview tab introduced in vs 2012+. visual-studio-2013

Decoding LATIN1 character to ASCII in python 2.7 -

Decoding LATIN1 character to ASCII in python 2.7 - i getting string website, not sure on encoding. first character in string letter "Î". i utilize code: import lxml.html lh import urllib2 import unicodedata url = 'http://www.example.com/' doc = lh.parse(urllib2.urlopen(url)) stoc = doc.xpath('xpath.example') print unicodedata.normalize('nfkd', stoc[0]).encode('ascii', 'ignore') the problem don't "i" out of "Î", "a". utilize .replace('a','i'), improve method ? thank you. python-2.7 character-encoding