Posts

Showing posts from June, 2014

Matlab: How to activate autocomplete without Tab? -

Matlab: How to activate autocomplete without Tab? - from how enable auto word completion @ matlab editor? know can tab inquire autocomplete. however, kind tedious. in ides rubymine, there no need inquire autocomplete, suggestion jumps out itself. and working on mobile device: http://www.mathworks.cn/cn/help/matlabmobile_android/ug/autocomplete.html. is possile on desktop? so how can create autocomplete autoly ? without need of tab? i've searched on net before. no results:( seems tab way accomplish finish on matlab desktop till now. autocomplete available on mobile version because of inconvenience 1 type on mobile phone maybe. matlab autocomplete

android - Javascript on mobile, can you detect when the display switches on? -

android - Javascript on mobile, can you detect when the display switches on? - as title says. someone looking @ web page on mobile, switches display off, switches on, there mutual or proprietary javascript events fire when switches on? thanks javascript android ios

Highlighting maximum value in Shiny DataTables -

Highlighting maximum value in Shiny DataTables - i'm using latest version of shiny including version 1.10.2 of datatables highlight maximum value in selected columns. example options = list(rowcallback = i( 'function(row, data) { // bold cells >= 5 in first column if (parsefloat(data[0]) >=5) $("td:eq(0)", row).css("font-weight", "bold"); }' ) if necessary, calculate prior values in variable e.g maxcol0 not sure how substitute in hardcoded value, 5 in above code tia you utilize paste add together value of max in rowcallback : example, using first 20 lines of mtcars dataset: library(shiny) df<-mtcars[1:20,] runapp(list( ui = basicpage( datatableoutput('mytable') ), server = function(input, output) { output$mytable = renderdatatable({ df },options = list(rowcallback = i( paste0('function(row, data) { // bold cells max in first column if ...

php - sort Array in specific filename order -

php - sort Array in specific filename order - how sort next info in order want it? the array: array(4) { [21]=> string(7) "2-2.pdf" [22]=> string(7) "2-3.pdf" [23]=> string(7) "2-4.pdf" [24]=> string(5) "2.pdf" } i want sort: 2.pdf 2-2.pdf 2-3.pdf 2-4.pdf yes utilize usort in case: $array = [21=> "2-2.pdf", 22=> "2-3.pdf", 23=> "2-4.pdf",24=> "2.pdf", ]; usort($array, function($a, $b){ $a = str_replace('-', '', $a); $b = str_replace('-', '', $b); homecoming $a - $b; }); php arrays sorting

php - Sanitize a value from select, radio, checkbox? -

php - Sanitize a value from select, radio, checkbox? - does select input (or checkbox or radio) need sanitized , / or escaped, assuming value used in query? , if yes, why? mean, how value altered someone? yes, should sanitize input. because you're giving user selection select, radio, or checkbox, doesn't mean can't utilize web inspector alter values can take from. also, can manufacture own or post request send whatever values want. php html

javascript - Chrome Extension Replace word in current textarea -

javascript - Chrome Extension Replace word in current textarea - i'm trying create chrome extension replaces lastly word typed in current <textarea> when user makes keydown event fire. i've tried doesn't work. here files of extension: my extension's manifest.json : { "name": "test", "description": "test", "version": "0.0.1", "permissions": [ "activetab" ], "background": { "scripts": ["background.js"], "persistent": false }, "browser_action": { "default_title": "replace test" }, "manifest_version": 2 } its background.js : chrome.tabs.executescript(null, {file: "content_script.js"}); and content_script.js : document.onkeydown = replaceprevword; // azerty: ctrl + ² // qwerty: ctrl + ' function keypress(e) { var evtobj = wi...

android - Google Map Drag Concern -

android - Google Map Drag Concern - i have next concern regarding googlemap : when user drag map after drag finish nail web-service new set of results on map. working fine regardless of wired thing, when user drag new location map goes new location , nail api new location meanwhile map goes previous location , after getting results comes new location. my concern only: map shouldn't go previous location if user dragged it. want should stick new location. please help! without code hard help you. implemented code checks new position after drag (using camerachangelistener) , have no problems position going , forth. how handle that? android google-maps

ios - CGPointMake Accuracy -

ios - CGPointMake Accuracy - i have created scene have character image move throughout circle have created. the character image view , box containing circle image view. as of right have image moving throughout entire scene. how limit motion within circle? here code have far: .h @interface finalprojectviewcontroller : uiviewcontroller { iboutlet uiimageview *romo; cgpoint pos; nstimer *romomove; } -(void)romomoving; .m - (void)viewdidload { romomove = [nstimer scheduledtimerwithtimeinterval:0.09 target:self selector:@selector(romomoving) userinfo:nil repeats:yes]; pos = cgpointmake(5.0, 4.0); } -(void)romomoving { romo.center = cgpointmake(romo.center.x+pos.x, romo.center.y+pos.y); if (romo.center.x>170||romo.center.x<0) { pos.x = -pos.x; } if (romo.center.y>180||romo.center.y<0) { pos.y = -pos.y; } } i thinking best way go find points of circle character nail set points should move to. not sure if best w...

javascript - submit regular form using angular -

javascript - submit regular form using angular - i have normal html form inputs, action, etc. defined within angular controller. however, form doesn't have submit button. instead has button elsewhere on page outside form, when clicked should trigger normal form submission process. in other words, have external button work normal submit button. for illustration (with simplified version of have), <div ng-controller='sendformcontroller"> <form name='my_form' action='/path/to/form_handler.php' method="post"> <input type="text" name="form_data" /> </form> <button ng-click='submitform()">send data</button> </div> i've been looking solution problem solutions i've been able find (which bit hackish way of thinking) include, having hidden submit button , trigger press of external button. having code executes $http.post(), etc. when external ...

Transmitting data from Python to C++ -

Transmitting data from Python to C++ - so have 2 processing units, 1 runs on python , other runs of c++. first 1 generate set of info of around 3 - 5 values, either list of ints or string. want value passed c++, best method? have create file in python load in c++? or there way? process repeat every second, wish transmission fast enough. i'd suggest using python's struct pack values in python viewed 'struct' in c++, send python c++ using zeromq. python c++

AngularJS google maps infoWindow is not compiled -

AngularJS google maps infoWindow is not compiled - i tried implement google maps infowindow using angularjs. i have template <div>{{foo}}<br/> , $scope.foo="bar" i want see info window value "bar" instead of seeing "{{foo}}". thus, compiled , set contents it, no luck yet. some may think duplicate angularjs ng-include within of google maps infowindow?, want compile contents dynamically. here code have now, http://plnkr.co/edit/rldacagz5ffmjezi87ah?p=preview angular.module('myapp', []).controller('myctrl', function($scope, $compile) { var mylatlng = new google.maps.latlng(-25.363882,131.044922); var mapoptions = { zoom: 4, center: mylatlng }; var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var infowindow = new google.maps.infowindow({position: mylatlng}); var x = "<div>{{foo}}<br/>{{foo}}"; $scope.foo="bar"; ...

mysql - Predicting rate of inventory depletion based on previous sales -

mysql - Predicting rate of inventory depletion based on previous sales - suppose have order_items table tracks sales of items : create table `items` ( `id` int(10) unsigned not null auto_increment, `stock` int(11) not null, `price` decimal(8,2) not null, `created_at` timestamp not null default '0000-00-00 00:00:00', primary key (`id`) ) engine=innodb auto_increment=1 default charset=utf8 collate=utf8_unicode_ci; create table `order_items` ( `id` int(10) unsigned not null auto_increment, `order_id` int(10) unsigned not null, `item_id` int(10) unsigned default null, `quantity` int(11) not null, `price` decimal(8,2) not null, `created_at` timestamp not null default '0000-00-00 00:00:00', primary key (`id`), key `order_items_order_id_index` (`order_id`), key `order_items_item_id_index` (`item_id`) ) engine=innodb auto_increment=1 default charset=utf8 collate=utf8_unicode_ci; how create query can homecoming estimated rate of inventor...

multithreading - Java multithreaded rendering, how to optimize -

multithreading - Java multithreaded rendering, how to optimize - i working on fractal rendering software. basic setup have big 2-dimensional array (picture), values incremented. the simple rendering process while( iteration < maxiteration ) { update pixel in array; } this stupidly simple parallellize; have several threads simultaneously, since each thread (very likely) work different pixels @ same time, , if there update collision in array, fine. the array shared among threads! however, maintain track of total number of iteratins done, need iteration volatile, suspect slows downwards code little. what baffels me virtually same speed 4 threads , 16 threads, , run on 64-core machine, verified runtime.getruntime().availableprocessors() . one issue have no command on in array threads work, hence, issue might big case cache misses? array of size of fullhd-image: 1920x1080x4 longs. thus, seek possible issues, , solutions them, since think might mutual type of...

jasper reports - JasperReports Library used in Java Code and Exporting to PDF generates Exception -

jasper reports - JasperReports Library used in Java Code and Exporting to PDF generates Exception - i working on web application , using jasperreports library (jasperreports-4.8.0.jar). in application, have function export generated info (from database) pdf format. in particular, net.sf.jasperreports.engine.export.jrpdfexporter.exportreport() function called. got know, ОК library internally uses itext pdf generation. have itext-2.1.7.jar in classpath, hope used in pdf generation. the trace of exception (partially): java.lang.arrayindexoutofboundsexception [10/21/14 19:13:09:366 sgt] 00000030 systemerr r @ com.lowagie.text.pdf.truetypefontsubset.checkglyphcomposite(unknown source) [10/21/14 19:13:09:366 sgt] 00000030 systemerr r @ com.lowagie.text.pdf.truetypefontsubset.flatglyphs(unknown source) [10/21/14 19:13:09:366 sgt] 00000030 systemerr r @ com.lowagie.text.pdf.truetypefontsubset.process(unknown source) [10/21/14 19:13:09:366 sgt] 00000030 s...

imagemagick - Imagick: Issues reading file on Windows 64bit EasyPHP -

imagemagick - Imagick: Issues reading file on Windows 64bit EasyPHP - i'm having lot of difficulty working php's imagick class, doesn't seem want read images regardless method use. method 1 $handle = fopen('http://ima.gs/placeholder-400x200.png', 'rb'); // sample image $img = new imagick(); $img->readimagefile($handle); $img->resizeimage(128, 128, 0, 0); $img->writeimage(root . ds . 'foo.png'); this gives me internal error "unable read image filehandle" method 2 (ideal method) $img = new imagick(root . ds . '00053141.jpg'); // image exist $img->resizeimage(128, 128, 0, 0); $img->writeimage(root . ds . 'foo.jpg'); this gives me internal error "no decode delegate image format `d:\work\dittocake\00053141.jpg' @ error/constitute.c/readimage/550" configure list results you can see delegates , configuration details here: http://cl.ly/image/1j2z1h072k41/image%202014-10-22%20at%209....

Clean nested lists in Python -

Clean nested lists in Python - say have list in python: l = [1, 2, 3, [a, [[9, 10, 11]], c, d], 5, [e, f, [6, 7, [8]]]] i clean nested lists that, if of length 1 (just 1 item), "pulled up" out of list, such revised list like: l = [1, 2, 3, [a, [9, 10, 11], c, d], 5, [e, f, [6, 7, 8]]] naturally can check if len == 1 , replace index contents, but... there built-in way this? you utilize recursive function: def expand_singles(item): if isinstance(item, list): if len(item) == 1: homecoming expand_singles(item[0]) homecoming [expand_singles(i) in item] homecoming item demo: >>> def expand_singles(item): ... if isinstance(item, list): ... if len(item) == 1: ... homecoming expand_singles(item[0]) ... homecoming [expand_singles(i) in item] ... homecoming item ... >>> l = [1, 2, 3, ['a', [[9, 10, 11]], 'c', 'd'], 5, ['e', ...

Apache Storm Worker Process dies -

Apache Storm Worker Process dies - i have installed storm-0.9.2 in 5-node cluster. have simple topology 1 spout , varying number of bolts (4, 9, 22, 31). each configuration have configured (#bolts + 1) workers. 4 bolts, have 5 workers, 22 bolts 23 workers, etc. have observed failed worker processes in worker log files corresponding endofstream exception in zookeeper.out log file. when clean test run number of tuples processed each bolt evenly distributed on each worker. on non-clean test run, workers failed effort reconnect, since number of tuples finite there no more tuples process. possible causes worker process die? excerpt zookeeper.out log file: 2014-10-27 17:40:33,198 [myid:] - warn [nioservercxn.factory:0.0.0.0/0.0.0.0:2181:nioservercnxn@357] - caught end of stream exception endofstreamexception: unable read additional info client sessionid 0x1495431347c001e, client has closed socket @ org.apache.zookeeper.server.nioservercnxn.doio(nioservercnxn.java:228) ...

c# - Visual Studio package - EnvDTE Solution.SolutionBuild locks DLL when Build is called -

c# - Visual Studio package - EnvDTE Solution.SolutionBuild locks DLL when Build is called - i using (dte) getservice(typeof (dte)) info opened solution in visual studio package. when code builds solution (see code below) locks dll file, after menuitemcallback method has finished can't build solution either using usual menu option, or selecting bundle menu alternative again. method called when select menu alternative in experimental instance of visual studio: private void menuitemcallback(object sender, eventargs e) { var solutionbuild = ((dte) getservice(typeof (dte))).solution.solutionbuild; solutionbuild.build(true); if (solutionbuild.lastbuildinfo == 0) { showmessage("the solution built"); } } how can create release dll can go on edit solution after running bundle option? turned out wasn't happening after all, programme appeared work @ odd times confused me. turned out else in code using dll file , lockin...

eval - Patch base::library with wrapper in R -

eval - Patch base::library with wrapper in R - inside r package, i'm trying patch base::library() function in r set position of loaded packages in search path. haveve defined several environments (all named env:<something> ) , want create sure libraries placed below these environments in search path. # wrap around library function. library = function(..., pos = null) { print("new library function!") if (is.null(pos)) { pos <- grep("env:", search()) pos <- if (length(pos) == 0) 2 else max(pos) + 1 } base::library(..., pos=pos) } when assign function in console, runs fine: > library(stats) [1] "new library function!" > eval(parse(text = "library(stats)")) [1] "new library function!" > eval(parse(text = "library(stats)"), envir = globalenv()) [1] "new library function!" when define above wrapper function within package, build , load in new r session, next exe...

php - How to update stock table after making a sale -

php - How to update stock table after making a sale - i'm creating inventory management scheme , can't figure out how link inventory table sales table products in inventory table updated when sale made. i'm using mysql here's sold.php, when sell product page save record in sale table want update manuf table qtyleft row. <?php require_once('../connections/bidco.php'); ?> <?php mysql_select_db($database_bidco, $bidco); $query_rssaletype = "select * saletype order type asc"; $rssaletype = mysql_query($query_rssaletype, $bidco) or die(mysql_error()); $row_rssaletype = mysql_fetch_assoc($rssaletype); $totalrows_rssaletype = mysql_num_rows($rssaletype); mysql_select_db($database_bidco, $bidco); $query_rscustomercategory = "select * buyertype order type asc"; $rscustomercategory = mysql_query($query_rscustomercategory, $bidco) or die(mysql_error()); $row_rscustomercategory = mysql_fetch_assoc($rscustomercategory); $totalrow...

ios - UIButton with IB_DESIGNABLE throws runtime attribute warning and does not render in Interface Builder -

ios - UIButton with IB_DESIGNABLE throws runtime attribute warning and does not render in Interface Builder - i'm running xcode 6.1 , have been using ib_designable ibinspectable quite few projects of sudden doesn't work anymore. have created subclassed buttons arrange image , title vertically centred above each other , enable user set border width , color through ib ibinspectable. the next warning logged , there no preview available of code in drawrect: warning: ib designables: ignoring user defined runtime attribute key path "spacingbetweenlabelandimage" on instance of "uibutton". nail exception when attempting set value: [<uibutton 0x7f9278591260> setvalue:forundefinedkey:]: class not key value coding-compliant key spacingbetweenlabelandimage. still, runtime renders intended render , honours same custom spacing i've added through ib. here's code of menubutton rearranges button , title: #import "hamburgerbutton.h...

mysql - #1064 - You have an error in your SQL syntax: What is wrong with this query? -

mysql - #1064 - You have an error in your SQL syntax: What is wrong with this query? - please have @ below query. select sub_words.idwords, words_inc.idarticle ( select sub0.idwords, substring_index(group_concat(sub1.idwords), ',', 10) excl_words, count(sub1.idwords) older_words_cnt words_learned sub0 left outer bring together words_learned sub1 on sub0.userid = sub1.userid , sub0.order < sub1.order sub0.userid = 1 grouping sub0.idwords ) sub_words inner bring together words words_inc on sub_words.idwords = words_inc.idwords left outer bring together words words_exc on words_inc.idarticle = words_exc.idarticle , find_in_set(words_exc.idwords, sub_words.excl_words) words_exc.idwords null order older_words_cnt limit 100 this gives error #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'select sub0.idwords, substring_index(group_concat(sub1.idwords), ','...

php - Unable to Update the Data using Inline Editing -

php - Unable to Update the Data using Inline Editing - i'm working application in php need update contents has been added in db, not able update info using inline editing. here sample code: viewpage.php function savelesson(id,pid,content) { alert(document.getelementbyid('content'+id).value); $("#edit"+id).show(); $("#save"+id).hide(); body=document.getelementbyid('content'+id).value; $.ajax({ type: "post", url: 'editpagehtml1.php', data: {id: id,pid : pid, text:body}, success: function(data) { window.location.reload(); }, error: function() { alert("error"); } }); editpagehtml1.php <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> </head> <body> <?php includ...

Asp.Net Identity 2 duplicate username check -

Asp.Net Identity 2 duplicate username check - usermanager in asp.net identity 2 prevents creation user duplicate username through additional request database find possible duplicate. think error prone , can cause concurrency errors. right mechanism should rely on on unique constraints or indexes. wrong , miss something? links source: createasync , validateusername no, not wrong. , identity adds unique index on username column: and migration code table is: createtable( "dbo.aspnetusers", c => new { id = c.string(nullable: false, maxlength: 128), /* .... snip .... */ username = c.string(nullable: false, maxlength: 256), }) .primarykey(t => t.id) .index(t => t.username, unique: true, name: "usernameindex"); unique index set on column. p.s. looking on identity v3 - not released. current...

python - Specifying rules in the Linkextractors in scrapy -

python - Specifying rules in the Linkextractors in scrapy - is there format specify rules in linkextractor in scrapy? have read documentation not clear me.in case url links values maintain increasing after first page (something &pg=2 , on). illustration see below: start_urls = ['http://www.examples.com'] rules= [rule (linkextractor(allow=['www.examples.com/sports/companies?searchterm=news+sports&pg=2']), 'parse_torrent')] let me know if there right way specify url in rules can scrape page 1, page 2...page 100. thanks v if want extract links starting page. (for case http://www.examples.com) you should create spider inheriting crawlspider , , utilize next regular expression. rules = ( rule(linkextractor(allow=[r'www.examples.com/sports/companies?searchterm=news+sports&pg=\d+'], callback='parse_torrent'), ) but seems know url rules, suggest generate url yourself. from scrapy.http.request import r...

Concatenate subcells through one dimension of a cell array without using loops in MATLAB -

Concatenate subcells through one dimension of a cell array without using loops in MATLAB - i have cell array. each cell contains vector of variable length. example: example_cell_array=cellfun(@(x)x.*rand([length(x),1]),cellfun(@(x)ones(x,1), num2cell(ceil(10.*rand([7,4]))), 'uniformoutput', false), 'uniformoutput', false) i need concatenate contents of cells downwards through 1 dimension perform operation on each concatenated vector generating scalar each column in cell array (like sum() illustration - actual operation complex, time consuming, , not naturally vectorisable - diffent length vecotrs). i can loops (for concatenated vector sum example) follows: [m n]=size(example_cell_array); result=zeros(1,n); cat_cell_array=cell(1,n); n=1:n cat_cell_array{n}=[]; m=1:m cat_cell_array{n}=[cat_cell_array{n};example_cell_array{m,n}]; end end result=cell2mat(cellfun(@(x)sum(x), cat_cell_array, 'uniformoutput', false)) unfortunate...

javascript - How to add active class to navigation items after the page url has changed -

javascript - How to add active class to navigation items after the page url has changed - how can accomplish having navigation menu automatically observe append class of active next construction have is... <ul class="navigation-list"> <li><a href="<?php echo $url; ?>">home</a></li> <li><a href="<?php echo $url; ?>">how works</a></li> <li><a href="<?php echo $url; ?>">hire your...</a></li> <li><a href="<?php echo $url; ?>">pricing</a></li> <li><a href="<?php echo $url; ?>">themes</a></li> <li><a href="<?php echo $url; ?>">features</a></li> <li><a href="<?php echo $url; ?>">why us</a></li> <li><a href="<?php echo $url.'/blog/'; ?...

Rasbian, java and gstreamer -

Rasbian, java and gstreamer - i have generate jar eclipse on mac, , utilize on raspberry pi (with raspbian) i utilize webcam-capture take snapshoot usb webcam, driver-gstreamer. but, after installations on raspberry, have error when launch jar. exception in thread main java.lang.unsatisfiedlinkerror: unable load library 'gstreamer-0.10': native library (linux-arm/libgstreamer-0.10.so) not found in resource path ([file:/home/pi/desktop/test.jar]) @ com.sun.jna.nativelibrary.loadlibrary(nativelibrary.java:271) @ com.sun.jna.nativelibrary.getinstance(nativelibrary.java:398) @ com.sun.jna.library.<init>(library.java:147) @ com.sun.jna.native.loadlibrary(native.java:412) @ org.gstreamer.lowlevel.gnative.loadnativelibrary(gnative.java:48) @ org.gstreamer.lowlevel.gnative.loadlibrary(gnative.java:45) @ org.gstreamer.lowlevel.gstnative.load(gstnative.java:42) @ org.gstreamer.lowlevel.gstnative.load(gstnative.java:39) @ org.gstreamer.gst.<clinit>(gst.java:59) @ c...

algorithm - Find points given distances between them -

algorithm - Find points given distances between them - here example: suppose there 4 points: a, b, c, , d given point @ (0,0): , distances: b: 7 c: 5 d: 9 b c: 6 b d: 5 c d: 7 goal find solution points b(x,y), c(x,y) , d(x,y) what algorithm find points ( 50 of them ) given distances between them? algorithm geometry distance point euclidean-distance

jquery - changing select_tag to f.select in implementing dependent dropdowns in Rails 4 -

jquery - changing select_tag to f.select in implementing dependent dropdowns in Rails 4 - i trying create dropdown list subcategories depend on initial category picked. utilized this link. works here <p><%= f.select :category_id, options_from_collection_for_select(category.parent_categories.all, "id", "title"), :prompt => "select category" %></p> <p><%= select_tag :subcat_id, options_from_collection_for_select([], "id", "title"), "data-option-dependent" => true, "data-option-observed" => "product_category_id", "data-option-url" => "/categories/:category_id:/subcategories.json", "data-option-key-method" => :id, "data-option-value-method" => :title %></p> here jquery code- $jquery(document).ready(function () {...

html5 - I cant access html files from my document root -

html5 - I cant access html files from my document root - i have index.html in /var/www, root document directory. have relevantskills.html in same directory. first link on index.html leads me relevantskills.html. when go website @ http://brianhotopp.cf/ can see index.html, , when click on first link, displays relevantskills.html. however, when seek access relevantskills.html http://brianhotopp.cf/relevantskills.html, brings me index.html. cannot view images in root document directory. example, have png called favicon, when go mywebsite/favicon.png, displays default favicon domain name provider, not 1 have in /var/www. problem configuration? permissions? help appreciated, thanks. your website running within iframe, that's why not working. when you're clicking on link, browser not "redirected" website in iframe is. that's why don't see changes in url bar on top of browser. i suppose don't want see website within iframe. if case, improve cont...

Can ivy install and retrieve configurations from Maven repository? -

Can ivy install and retrieve configurations from Maven repository? - i have local filesystem ivy repository , need install (publish) artifacts remote maven repository nexus or artifactory. wrote ant script ivy install task along next lines: class="lang-xml prettyprint-override"> <ivy:install organisation="apache" module="commons-lang" revision="2.0" from="ivyfilesys" to="remotemaven"/> now, there multiple configurations in local ivy repository ( test , compile ), these declared in ivy.xml files nowadays there. local repository consists of 2 folders per artifact, jars , ivys. jars folder contains jars , ivys folder contains ivy.xml configurations declared inside. sha , md5 checksum files nowadays nil else. i expected ivy tell maven repository available configurations seems not. after switch newly created repository resolution, ivy cannot find artifacts has installed there itself, c...

ios - Using SDWebImage in my TableViewController -

ios - Using SDWebImage in my TableViewController - good afternoon, i'm trying utilize sdwebimage in project first time , @ origin though going easy it's not. that's why i'm asking help because it's not working in website , i'm lost that. first of all, need sdwebimage because need load asynchronously images tableviewcontroller. that's uitableview within tableviewcontroller: #import "sdwebimage/uiimageview+webcache.h" ... - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cartablecell"; cartableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[cartableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; } ...

c - print all files and subdirectories in a give path -

c - print all files and subdirectories in a give path - so, im writing programme recursively print directories/sub-directories , files in given path. im able go in first sub-directory , print files in it. problem right need find way step 1 directory level , go on left off reading. until status occurs @ original directory level. #include "everything.h" #include "strsafe.h" win32_find_data ffd; handle hfind = invalid_handle_value; large_integer filesize; dword dwerror; void showdir(tchar *szdir); int _tmain(int argc, lpctstr argv[]) { tchar szdir[max_path]; size_t lengthofarg; // verify number of parameters if (argc != 2) { reporterror(_t("error: wrong number of arguments"), 1, false); } // length of entered directory stringcchlength(argv[1], max_path, &lengthofarg); // verify directory path not long if (lengthofarg > max_path - 2) { ...

Android ActionBar overflow menu style -

Android ActionBar overflow menu style - i've set simple menu 1 position this: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".mainactivity"> <item android:id="@+id/action_language" android:title="@string/language" android:orderincategory="100" /> </menu> using theme.appcompat.light.darkactionbar style. when click 3 dots menu position appears instead of icon, not below it? there way create appear under icon, not 'on' it? actually can't icon, can create menu item android:actionlayout="@layout/custom_lauout" . can create popup window, allows such positioning. in popupwindow show items must show under "three dots item". here rea few links can help you: http://developer.android.com/reference/android/w...

android - Opening url in the last open tab in chrome -

android - Opening url in the last open tab in chrome - i getting issue while opening url in default browser (chrome) my requirement opening url in lastly open tab in chrome browser 4.4.4 (chrome default browser). not in new tab. below code opening url in new tab: intent mbrowserintent = new intent(intent.action_view); mbrowserintent.addflags(intent.flag_activity_clear_task); mbrowserintent.putextra(browser.extra_application_id,mcontext.getpackagename()); mbrowserintent.addcategory(intent.category_browsable); mbrowserintent.addflags(intent.flag_activity_new_task); mbrowserintent.setdata(uri.parse(murl)); mcontext.startactivity(mbrowserintent); please help in resolving issue. thanks, this works me, note should not utilize getpackagename(): intent intent = new intent(intent.action_view, uri.parse("http://yahoo.com")); intent.putextra(browser.extra_application_id, "com.andr...

android - Replace ListView with RecyclerView -

android - Replace ListView with RecyclerView - how can replace old listview recylerview? changes should maintain in mind when replacing listview recyclerview? i wrote blog post not long ago on subject, step step guide on how migrate listview (or adapter-based view) recyclerview. can read here. android recyclerview

ANDROID-JAVA - HTML Parsing - Hidden Input -

ANDROID-JAVA - HTML Parsing - Hidden Input - i'm tryin parse document have code: <form action="/login/" method="post" name="loginform" id="loginform" > <input type='hidden' name='csrfmiddlewaretoken' value='hcwavsxhrc40giq5gbzm0mtklzbtqic1' /> <p> <label for="username">nome utente<br /> <input type="text" name="username" id="username" class="inputfields" value="" size="20" tabindex="1" /> </label> </p> [...] </form> and need extract here csrfmiddlewaretoken, using jsoup not able it... sorry english, hope understand problem. have @ css selectors. starting point mozilla i tried simple 1 1 here: http://try.jsoup.org/~gt7k5vyodnu16shl...

asp.net - Azure hosted website - FormsAuthentication not routing to defaultUrl -

asp.net - Azure hosted website - FormsAuthentication not routing to defaultUrl - i have next setup in web.config : <authentication mode="forms"> <forms loginurl="landing/login.aspx" defaulturl="~/member/dashboard.aspx"> <credentials passwordformat="sha1"></credentials> </forms> </authentication> <authorization> <deny users="?" /> </authorization> this correctly redirects when testing on locahost, when published azure, logging in redirects http://mysite.azurewebsites.net/ , not http://mysite.azurewebsites.net/member/dashboard.aspx described in web.config. interestingly enough, however, trying navigate page without logging in correctly redirects defined loginurl="landing/login.aspx" . should using fqdn in case defaulturl ? forms authentication not setup on iis of azure server? please advise. asp.net azure forms-authentication

java - Filling Color in polygon while points intersecting in Android -

java - Filling Color in polygon while points intersecting in Android - i trying draw polygon using hand on google map , filling color polygon. normally color filling fine , working expected if polygon has intercepting point fill color not working. i using below code draw polygon , fill color polygon polygonoptions drawshapeoptions = new polygonoptions(); drawshapeoptions.addall(mlatlnglist); drawshapeoptions.strokecolor(color.black); drawshapeoptions.strokewidth(5); drawshapeoptions.fillcolor(color.gray); mdrawshape = mgooglemap.addpolygon(drawshapeoptions); the result below how can fill color in polygon intersecting points? java android google-maps polygon google-maps-api-2

can we use loop functions in tableau -

can we use loop functions in tableau - can utilize loop functions(for,while,do while) in tableau calculated fields? if can, how can utilize these functions in calculated fields , how can initialise variables declared in these functions? no can't. there hacks calculations that, using previous_value , other table calculations, there no loop functions in tableau. why? because tableau isn't meant info processing tool, rather info visualization tool. don't me wrong, tableau engine process data, perform "query-like" operations. so why don't post trying accomplish , can think if it's possible accomplished tableau, or require pre-processing in data tableau

How to use extract a list of keys with specific pattern from dict in python? -

How to use extract a list of keys with specific pattern from dict in python? - i need can extract list of keys have type name: carro_x , x number. yielding: lista = ['carro_1','carro_2','carro_50'] from: diccionario = { 'carro_1':'renault', 'carro_2':'audi', 'carro_50':'sprint', 'camioneta':'tucson' } how using str.startswith : using list comprehension (no need utilize iterkeys or keys method; iterating dictionary yeidls keys): >>> diccionario={ ... 'carro_1':'renault', ... 'carro_2':'audi', ... 'carro_50':'sprint', ... 'camioneta':'tucson', ... } >>> [key key in diccionario if key.startswith('carro_')] ['carro_1', 'carro_50', 'carro_2'] note dictionary has no order. need sort result if want ordered result. >>>...

xcode - how to push objective c view controller to swift view controller -

xcode - how to push objective c view controller to swift view controller - in objective-c view controller need force next swift view controller, basic project - obj c, after add together swift file, xcode generate bridging-header.h, not see -swift.h file hot force in swift view obj-c view ? -(void)longtapindaclub:(uilongpressgesturerecognizer *)longtap { uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mail" bundle:nil]; nextview *view = (nextview *) [stb instantiateviewcontrollerwithidentifier:"next"]; [nextview getidsample: _idsample]; [self.navigationcontroller pushviewcontroller:view animated:yes]; } nextview - swift view controller it same - using storyboard define transitions , force segue connected swift view controller. long 'next' pointing right place doesn't matter if it's swift or not. objective-c xcode uiviewcontroller swift

oracle - SQL - Combining two queries -

oracle - SQL - Combining two queries - in sql have wrote these 2 queries: query 1: select hotelid, hotelname, email hotel hotelid in (select branch.hotelid branch branchaddress '%london%'); query 2: select branch.hotelid, count(*) branch grouping hotelid having count(*) > 5; i ideally combine these 2 queries together, results generated based on either of these two. how go doing this? thought union used not sure if right method use. select a.hotelid, a.hotelname, a.email, count(*) hotel bring together branch b on a.hotelid = b.hotelid b.branchaddress '%london%' grouping a.hotelid, a.hotelname, a.email having count(*) > 5 sql oracle

ask for regex in java -

ask for regex in java - i want write regex observe double2 example: "(no1,no2,double1)(no3,no4,double2)(no5,no6,double3)(no7,no8,double4)" note: want utilize variables in first , sec numbers. i.e.: int nb1 = something1 int nb2 = something2 i seek not work: "\\("+ nb1 +"\\,"+ nb2 +"\\,(\\d)*\\)" please, help? try regex: "\\("+ nb1 +","+ nb2 +",([^)]*)\\)" you need quantifier ( * ) within capture grouping parentheses. also, want match decimal point, can't utilize \\d ; utilize [\\d,] or suggest (everything closing parentheses). java regex

assembly - where is the C language global array located in its disassembly code -

assembly - where is the C language global array located in its disassembly code - i wrote simple c code follow: int data_items[] = {3,67,32,4,89,6,34,2,9,0}; int max(int* pt) { int val = *pt; while(*pt != 0) { if (*pt > val) { val = *pt; } ++pt; } homecoming val; } int main() { max(data_items); homecoming 0; } then compiled gcc: gcc main.c and disassembled with: objdump -d a.out at lastly assemble code: a.out: file format elf64-x86-64 disassembly of section .init: 00000000004003a8 <_init>: 4003a8: 48 83 ec 08 sub $0x8,%rsp 4003ac: 48 8b 05 45 0c 20 00 mov 0x200c45(%rip),%rax # 600ff8 <_dynamic+0x1d0> 4003b3: 48 85 c0 test %rax,%rax 4003b6: 74 05 je 4003bd <_init+0x15> 4003b8: e8 33 00 00 00 callq 4003f0 <__gmon_start__@plt> 4003bd: 48 83 c4 08 add together $0x8,%rsp...

python - Two different submit buttons in same form in Django -

python - Two different submit buttons in same form in Django - i have updateview in django. i have normal submit button. when object updated correctly redirects object list via success_url . can create 2 different submit buttons: 1 button submits , redirects objects list page (listview) , button submits , redirects object detail page (detailview)? i don't know how in smart way. since you're submitting same place, , want alter redirect destination after save, simple. submit buttons other input controls in have name , value, , receive these in post data. so, in template can have: <input type="submit" name="list" value="submit , go list"> <input type="submit" name="detail" value="submit , go detail"> and in view: if form.is_valid(): form.save() if 'list' in request.post: homecoming redirect('list_url') else: homecoming redirect('det...

mysql - Magento importing customers(700k) using csv dataflow is too slow -

mysql - Magento importing customers(700k) using csv dataflow is too slow - i building magento ecommerce website, , importing client profiles old one. using csv importer, , process way slower can imagine. takes 4 seconds 1 customer. far process has been running 6+ hours , 30k customers imported. csv file chunked several ~10m smaller ones. for now, using amazon web services ec2 instance (micro) development server. has 1 vcpu (2.5ghz) , 1gib memory. don't think can issue. increased php memory limit 1g. i've read article saying speed issues of importing products mutual because of magento's eav database scheme , heavy php api modules [speeding magento imports]. says magento sends 450 mysql queries in order import 1 single product. have seen workaround using [magmi] tries bypass magento's api , insert info straight mysql tables. afaik doesn't seem import customers, products , categories. don't know if (products , customers) using same mechanism. i dis...