Posts

Showing posts from May, 2013

Android Custom Listview, Cannot change element in a single row -

Image
i'm creating facebook custom listview feed using volley. the listview on fragment , i'm using customlistadapter.java , searchitem.java classes load content listview. the problem when click button or save button in row, changes liked , saved not in row in other rows. in fragment final viewholder holder = new viewholder(); @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view v = inflater.inflate(r.layout.newsfeed_popular_frag, container, false); listview = (listview) v.findviewbyid(r.id.popular_list); adapter = new customlistadapter(getactivity(), popularlist); listview.setadapter(adapter); listview.setonitemclicklistener(this); in onitemclick of fragment holder.likes_layout = (linearlayout) parent.findviewbyid(r.id.likes_layout); holder.saves_layout = (linearlayout) parent.findviewbyid(r.id.saves_layout); holder.likes_layout.seton

php - Login form script change after introducing username and password -

Image
i have form: <div class="page3"> <form id="indexform" action="index.php" method="post"> <table class="datatable2" style="padding:20;" > <tr> <td><center>username </center><input type="text" name="name" value="" size="10" /></td> </tr> <tr> <td><center>password </center><input type="password" name="password" value="" size="10" /></td> </tr> <tr> <td colspan="2" class="datatable2" style="padding:55 0 0 38;"> <input type="submit" value="log in" name="admsubmit" class="subbtn" style="b

r - Constructing an area plot with outlines for discrete variable (i.e. with steps) -

Image
similar geom_area plot areas , outlines ggplot , i'm trying construct stacked area plot outlines. since variables discrete i'm using geom_bar() stacking them. code follows: require(ggplot2) require(reshape) x = 0:4 y1 = c(3,2,2,1,0) y2 = c(1,1,0,0,0) data = data.frame(x,y1,y2) data.plot <-melt(data, id.vars = "x") cols = c(y1="darkgrey",y2="lightgrey") p = ggplot(data.plot,aes(x=x,y=value,fill=variable)) p + geom_bar(aes(width=1),stat = "identity") + theme_bw() + scale_fill_manual(values=cols) which gives my problem adding outlines in example referred to. can use colour="black" in geom_bar() adds vertical lines between bars quite ugly. does have suggestion these outlines? solution doesn't have based on geom_bar . if possible, interested in solution dark grey part has outline, since outline has important interpretation. perhaps based on shifted version of geom_line() ? your plotting code

powershell - Issues automating printer driver update (printer settings) and printer preferences in Win7, using a PS,cmd,vbs,etc script? -

wmi can it, have issue, pcs on, logged off. if try run: wmic /node:%strip% printer deviceid="lp1" set drivername="lexmark universal v2" it fails message "generic failure". rdp in , run same command end, , works. powershell version using older, not have of printer cmdlets, , updating ps out of question. there way remotely log in, without having rdp in? via ps, cmd, psexec, etc? the other avenue i've taken using regedit, i'm hitting hicups that, namely cannot figure out copy. in regedit, can change drivername , setting enable duplex , tray2 (in printer settings), cannot figure how change settings in printer preferences printing double sided , doing along long edge. what did figure out change, did find on printer name in regedit data value , exported keys before changing settings. exported again after changing settings. used fc /c /a /u before.reg after.reg changes. chopped .reg include changed values. running .reg seems change ever

ios - Add image to view (background) -

i have added image viewcontroller in code. without use of imageview. how did it: uiimageview *backgroundimage =[[uiimageview alloc] initwithframe:cgrectmake(50,50,100,500)]; backgroundimage.image=[uiimage imagenamed:@"backgroundimage"]; [self.view addsubview:backgroundimage]; there 2 things need litte with. how can image of view, behind labels, buttons etc. , how image fit iphone screen sizes? hope can me. thanks as asked 2 questions- question 1 : how labels/ buttons other subviews visible on image? answer - just add image before other subview. and there 2 ways set background image uiview – you can set view background color color created uicolor’s colorwithpaternimage . can add uiimageview subview view . colorwithpaternimage created use small images create pattern image repeated. using large images wont wise decision. if want have patterned image background uses small images repeated fill background, should use colorwithpaternimage , , won

ruby - create a unique number using Rails 3 -

i need create random number each time page loaded. have view page below. index.html.erb : <th style="width: 30%; text-align:left; vertical-align: top;">date: <%= date.today.to_s %><br /> bill no.: </th> in file, want create new unique bill number each time page loaded. please me resolve error. <th style="width: 30%; text-align:left; vertical-align: top;">date: <%= date.today.to_s %><br /> bill no.: <%= rand(10000) %></th>

Android Snackbar NullPointerException in Fragment -

i want add basic snackbar application have received error couldn't figure out why. i added code in oncreateview() method in fragment. snackbar.make(view, "snackbar", snackbar.length_long) .setaction("action", null).show(); and received error: 06-01 10:26:09.955 1232-1232/? e/activitythread﹕ failed find provider info me.muraterdogan.watchme.metricacontentprovider 06-01 10:26:10.075 1232-1447/? e/activitythread﹕ failed find provider info me.muraterdogan.watchme.yplcontentprovider 06-01 10:33:55.044 6646-6646/? e/androidruntime﹕ fatal exception: main process: me.muraterdogan.watchme, pid: 6646 java.lang.nullpointerexception: attempt invoke virtual method 'android.content.context android.view.viewgroup.getcontext()' on null object reference @ android.support.design.widget.snackbar.<init>(snackbar.java:116) @ android.support.design.widget.snackbar.make(snackbar.java:140) @ me.muraterdogan.watchme

sockets - Is it possible to transfer a text file from server to client using python? -

i newbie in python , have written code server-client in python. code sends file o/p server client console. code: from thread import * import threading import time import psutil import itertools import ctypes import string import os import sys import socket exitflag = 0 #function returning list of valid partitions of system... def drives(): drive_bitmask = ctypes.cdll.kernel32.getlogicaldrives() return list(itertools.compress(string.ascii_uppercase,map(lambda x:ord(x) - ord('0'), bin(drive_bitmask)[:1:-1]))) def proc_info(conn,addr): # prints process's info match keyword....... server side f0=open('abc.txt','a+') conn.send('welcome server\n') name=[] c=drives() k=0 conn.send("enter key...\n") # authentication purposes...e.g.here key 1 t=conn.recv(8) if(t!='1'): #wrong key....invalid user conn.send("\ninvalid key..teminating connection.....abort\n") conn.clo

html - :checked selector not working -

i trying follow code work: html <div class = "col-md-4 video text-center wrapper-q1"> <p class = "no-padding"> <input class="question1" id = "vraag1" type="radio" name="q1" value="moon"> <br /> <label class = "pointer" = "vraag1">text</label> </p> </div> css input[type="radio"] { display:none; } label:before { content: ""; display: block; width: 33px; height:33px; margin:0 auto; background-image: url("../img/radio-btn.png"); } input[type=radio]:checked + label { content: ""; background-image: url("../img/radio-btn-checked.png"); font-size: 30px; text-align: center; line-height: 18px; } the radio button shown, when click it, won't change "checked" image. i appreciate help! you missed :before

how can i get successive camera frame in android? -

i want capture successive shooting android camera hdr image using 2 image. code not working. app shooting twice no sound(no shutter sound), , no save file have(there no file). first, think file name same. so, changed file file code this, // create media file name // add .sss identity string timestamp = new simpledateformat("yyyy-mm-dd hh:mm:ss.sss").format(new date()); file mediafile; if (type == media_type_image){ mediafile = new file(mediastoragedir.getpath() + file.separator + "img_"+ timestamp + ".jpg"); second, using synchronized , startpreview(). still not work. below capture code using "private camera mcamera". // add listener capture button capturebutton = (button) findviewbyid(r.id.button_capture); capturebutton.setonclicklistener( new view.onclicklistener() { @override public void onclick(view v) { synchronized (mpicture) { // image ca

process - C# Processes on Remote Machine -

i wrote monitoring service keeps track of set of processes, , notifies when service acting strange, running on high memory usage, exceeding cpu runtime etc. this working fine 1 local computer, need point remote machines , process information on these machines. my approach, working on local: process.getprocesses().tolist().foreach(p => myprocesses.add(p)); this gives me collection of processes on machine, there lot more logic (filtering processes name etc), comes down to. what need: process.getprocesses(machinename).tolist().foreach(p => myprocesses.add(p)); this complains access, question how can pass credentials somehow use functionality? note: have of machinenames , credentials needed access these processes, need supply in config file. can run service in specified username, still complains access. you need getprocesses(string) overload accepts target machine name, eg: process[] remoteall = process.getprocesses("mycomputer"); from docu

genetic algorithm - “can't find element ... of the list ... which is only of length” error in Netlogo -

i'm working on thesis solving traveling salesman problem genetic algorithm. use netlogo solve problem. got error : can't find element 62 of list [7400 5100 5000 5000 2100 4300 5200 1200 900 4300 6000 6000 7600 5900 7600 8600 7400 7100 6800 8100 3300 1400 1200 10400 8500 3700 11400 6900 2000 650 0 3000 4900 9800 10600 4000 5200 7700 8500 5900 5000 7100 6100 6800 1000 3200 2700 2900 1800 1300 9600 4800 4600 6700 7700 6100 4200 3200 9000 8200 10500 13400], which of length 62. error while turtle 2 running item called procedure calculate-distance called procedure setup_1 called button 'setup 1' and dont know why. can me this?

php - Issue in drop multiple pins in google map in coordinator -

i want drop multiple pin in google map dynamic value below code . view <html> <head><?php echo $map['js']; ?></head> <body><?php echo $map['html']; ?></body> controller function index(){ $address ="gondal road, dr. yagnik road corner, near malaviya petrol pump, rajkot, gujarat 360001";// google hq $prepaddr = str_replace(' ','+',$address); $geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepaddr.'&sensor=false'); $output= json_decode($geocode); $lat = $output->results[0]->geometry->location->lat; $long = $output->results[0]->geometry->location->lng; $this->load->library('googlemaps'); $config['center'] = '37.4419, -122.1419'; $config['zoom'] = 'auto'; $this->googlemaps->initialize($config); $marker = array(); $marker['position'] =

How to set cutoff while training the data in Random Forest in Spark -

i using spark mlib train data classification using random forest algorithm. mlib provides randomforest class has trainclassifier method required. can set threshold value while training data set, similar cutoff option provided in r's randomforest package. http://cran.r-project.org/web/packages/randomforest/randomforest.pdf i found randomforest class of mlib provides options pass number of trees, impurity, number of classes etc there nothing threshold or cut off option available. can done way. the short version no, if @ randomforestclassifier.scala can see selects max. override predict function if, not super clean. i've added jira track adding this.

When searching through emails in Gmail, how to always exclude hangouts (-in:chats) -

every time want search through email, it's slow can be, because it's searching through hangouts history.. receive hundreds of messages day, , searching through mail has become quite chore. every time i'll have append: -in:chats to search terms. there way gmail stop searching through hangouts, unless specify it? in:chats ? was struggling similar problem. asked myself, search function must found in search box itself. if click in search box, see arrow on right, click on it, , small box appears. "don't include chats" there go !

Convert mysql subquery to join because phalcon php framework query builder does not support subquery -

i stacking write query couple of days, appreciate if can advice me. have written query using sub query limitation using phalcon php framework query builder not support sub query yet. need advice convert joins. more details: i need fetch posts in order latest entry in post_notification table. well, building application have rearrange posts list based on latest notification user received. query written: select p.* , ( select creation_date uo_notifications n n.post_id = p.id , n.user_id = ".$user_id ." order n.id desc limit 1 ) cdate uo_posts p p.user_id = ".$user_id." , p.group_id = ".$group_id." order cdate desc posts table: id pk message group_id creation_date post_notifications id pk user_id notify_msg post_id creation_date thank in ad

javascript - Handsontable hyperlink redirect not working -

i have loaded handsontable , have added hyperlink. when click on hyperlink redirecting not working.please tell whether have missed out in code..i loading set of values java handsontable .. java code headbuild.append("<a href='#'onclick='alertmenu(this);'>" + cflowoutlist.get(i).getcsd_oper_group() + "-" + cflowoutlist.get(i).getfod_lvl_name() + "</a>" + ","); handsontable function headrenderer(instance, td, row, col, prop, value, cellproperties) { handsontable.textcell.renderer.apply(this, arguments); var escaped = handsontable.helper.stringify(value); escaped = strip_tags(escaped, '<em><b><strong><a><big>'); //be sure allow html tags avoid xss threats (you should remove unwanted html attributes) td.style.textalign="left" td.style.paddingleft="1%"; td.styl

c++ - Multiple recursive calls -

Image
i know recursive function , how can visualize every recursive call on top of stack. have no idea how think when function make multiple calls like float foo(int n){ int = 0; for(int = 0; < n; i++) += 1; if (n > 2) return foo(n/2) + foo(n/2); // happens here? return a; } shall think of 2 different stacks or best way visualize result? as other answers mentioned, there 1 stack , recursive calls evaluated strictly in given order. however, analysis purpose, can visualize entire call sequence tree.

drop down menu - Dropdownlist selected value not showing while updating the form -

Image
here explain problem i have dropdownlist called companytype, contains value 1+1, 1+2, 1+3, 1+4, 1+5, 1+6, 1+7 while creating form have select value eg:1+4 , store, same while updating value getting change select companytype [prompt] <?= $form->field($model, 'companytype')->dropdownlist([ '1' => '1+1', '2' => '1+2', '3' => '1+3', '4' => '1+4', '5' => '1+5', '6' => '1+6', '7' => '1+7', ], ['prompt' => 'select company type', ]) ?> here have added 2 images can understand question gridview of created form updating same form updated: mycontroller code: public function actioncreate() { if(yii::$app->user->can( 'create-company' ) ) { $model = new company(); if ($model->load(yii::$app->request->post()) ) { $model->createdat =

How to include two URL in json ajax -

currently, searchform hit, form submitted. fetch data specified url search/ajax2.php , return data here. all want add is, include url beside above mentioned one, 2 actions can performed @ same time. now, in search/ajax2.php runs select query. whereas in additional page want include, writedb.php inserts data taken jason database. doesn't have return ajax page though! how achieve this? $("#searchform").on("submit", function () { //$(this).find(':submit').attr('disabled','disabled'); var data = { "action": "test" }; data = $(this).serialize() + "&" + $.param(data); $.ajax({ type: "post", datatype: "json", url: "search/ajax2.php", data: data, success: function (data) { } }); try adding second url in sucess function : $.ajax({ type: 'post', url: 'some_ur

php - Mysql Case Syntax -

select * case_study order case when expiry_date_case > curdate() 1 end when expiry_date_case null 2 desc end when expire_date_case < curdate() 3 desc end; when trying run query getting error #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'when expiry_date_case null 2 desc end when expire_date_case < curdate() ' @ line 4 where doing wrong? try select * case_study order case when expiry_date_case > curdate() 1 when expiry_date_case null 2 when expire_date_case < curdate() 3 end desc you have many end 's , many desc 's

java - Is it possible to "synchronized if" statement? -

i'm trying find clean way write out method may, or may not wrapped in synchornized lock based on boolean. way can find ugly. boolean lock = true; void remove(object o) { if(lock) { synchornized(this) { // remove o } } else { // remove o } } however, i'm wondering if there's nicer way this, perhaps "synchronize if" type of statement? you can use atomicboolean : private final atomicboolean lock = new atomicboolean(false); ... // compare if false , set true, no synchronized needed if (lock.compareandset(false, true)) { statusmessage = "lock acquired"; } else { statusmessage = "i'm locked"; } or define method synchronized . your current check lock not in synchronized block: if(lock) { synchronized(this) { hence 2 threads may pass check before set false, real semaphore there synchronized(this)

android - Issue in GAPP not install in Genymotion emulator -

Image
i want install gapp zip in genymotion emulator follow steps given in docs in below link http://forum.xda-developers.com/showthread.php?t=2528952 but when install gapps zip version 4.2, 4.4 , 5.0 gave me error below image any idea how can solve problem ? suggestion s appreciable that's not error. have press ok install :).

angularjs - Adding a promise to browser.driver.wait not working in protractor -

i using node-resemble image comparison library compare 2 images in protractor test. node-resemble returns promise resolves comparison data. want protractor wait till results available. i have tried using browser.driver.wait achieve this, somehow not working. here's code using returning promise browser.driver.wait: var compareimage = function(path1, path2) { var deferred = protractor.promise.defer(); var img1 = fs.readfilesync(path1); var img3 = fs.readfilesync(path2); resemble(img1).compareto(img3).oncomplete(function(data) { console.log(data); deferred.fulfill(data); }); return deferred.promise; }; and how using it: var prom = compareimage(path1, path2); browser.driver.wait(prom, 3000).then(function(data) { console.log(data); expect(data.mismatchpercentage).tobe('0.00'); }); i have read documentation , have tried way described, somehow not working. none of 2 console.log logging data console. here documentatio

ruby on rails - Add new line using /n in text variable -

i have variable in view printed on screen <%= comment.comment %> but output has many new line characters ( \n ). how print new lines whenever have \n comment.comment output? try this: <%= comment.comment.gsub(/\n/, '<br />') %> else can use simple_format . here: <%= simple_format(comment.comment) %>

Cropping images with html5 canvas in a non-rectangular shape and transforming -

Image
i new html5 canvas creating html5 canvas based image cropper includes next features. it should crop image in polygon shape, doesn't have rectangular. after cropping image, should transform image rectangular shape. i tried search image croppers satisfies these features, couldn't find any. i think can manage make resize handlers , cropping stuff, have no idea of transformming cropped image. there nice examples or libraries this? i adding images make things clear. when crop first image, result should second image. added! i thought @marke 's solution work, after implementing , testing images, found out won't work non-parallelograms. as can see, since approach splits rectangle 2 triangles, warped angles , amount? ends different both triangles. thus, cropped images shown distorted. figuring other ways solve it. what asking similar photoshop's perspective crop tool . this allow take in un-straightened, skewed image , convert st

hadoop - Unable to create directory or file in WebHdfs -

hortonworks sandbox file browser shows webhdfsexception, , in cli i'm unable create directory or file. wrong? webhdfsexception @ /filebrowser/ <urlopen error [errno 111] connection refused> request method: request url: http://127.0.0.1:8000/filebrowser/ django version: 1.2.3 exception type: webhdfsexception exception value: <urlopen error [errno 111] connection refused> exception location: /usr/lib/hue/desktop/libs/hadoop/src/hadoop/fs/webhdfs.py in _stats, line 209 python executable: /usr/bin/python2.6 python version: 2.6.6 python path: ['', '/usr/lib/hue/build/env/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/usr/lib/hue/build/env/lib/python2.6/site-packages/pip-0.6.3-py2.6.egg', '/usr/lib/hue/build/env/lib/python2.6/site-packages/babel-0.9.6-py2.6.egg', '/usr/lib/hue/build/env/lib/python2.6/site-packages/babeldjango-0.2.2-py2.6.egg', '/usr/lib/hue/build/env/lib/pytho

Get unique values in List of Lists in python -

i want create list (or set) of unique values appearing in list of lists in python. have this: alist=[['a','b'], ['a', 'b','c'], ['a']] and following: unique_values=['a','b','c'] i know list of strings can use set(alist), can't figure how solve in list of lists, since set(alist) gets me error message unhashable type: 'list' how can solve it? array = [['a','b'], ['a', 'b','c'], ['a']] result = set(x l in array x in l)

Read from stdin in Python Process? -

i'm trying read sys.stdin inside of python process object, keep getting "valueerror: i/o operation on closed file" result. here's quick example: import sys multiprocessing import process def do_something(input_data): x in input_data: print x input=sys.stdin p = process(target=do_something, args=(input,)) p.start() p.join() #wait process complete the above script fails with: traceback (most recent call last): file "/usr/local/cellar/python/2.7.5/frameworks/python.framework/versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() file "/usr/local/cellar/python/2.7.5/frameworks/python.framework/versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) file "example.py", line 6, in do_something x in input_data: valueerror: i/o operation on closed file just calling do_something(input) works fine without us

Installing hasking via "install haskell-platform" on Linux - cabal isn't installed -

i installed haskell on ubuntu 14 by: sudo apt-get install haskell-platform but cabal hasn't been installed reason: $ cabal --version -bash: /home/me123/.cabal/bin/cabal: no such file or directory and there's no $ ls /home/alex/.cabal ls: cannot access /home/me123/.cabal: no such file or directory so how can install or can find if it's installed? p.s. installed reason deleted apt-get remove ghc , haskell-plathorm. want install on again.

ios - How to set a priority for a reminder - Objective-C -

while creating reminder, can set alarm reminder. not able find property or method set priority using objective-c. ekreminder *reminder = [ekreminder reminderwitheventstore:self.eventstore]; reminder.title = @"title"; reminder.calendar = self.calendar; reminder.duedatecomponents = [self datecomponentsfordefaultduedate]; ekalarm *alarm = [ekalarm alarmwithabsolutedate: reminderdate]; [reminder addalarm:alarm]; ekreminder has priority property. reminder.priority = 1; it's there, undocumented, since (it added in ios 7, but) ekreminder class reference documentation hasn't been updated since ios 6.

java - Read data from a text file and create an object -

i need help: i'm making supermarket simulation on java, i've got 1 problem, have text file (stock.txt) have supermarket stock on example: 0-bakery-chocolate cake-$12.5-250 1-meat-premium steak-$2.6-120 2-seafood-tuna - $1.2-14 ... where first number "id" product, next department product belongs, third name of product, next thing price, , last number how pieces of product stock has. have class: public class product { protected string name; protected double price; protected string department; protected int id; protected int stock; } so, need read each line text file , create product, i.e. first line make this: product product1 = new product(0,"bakery","chocolate cake", 12.5, 250); and add array product[0] = product1; for things in text file, then, when running simulation each costumer buy random quantity of random products in stock, stock number decrease. finally, when simulation ends, program must wr

Pass authentication error from factory to controller in AngularJS -

i trying implement firebase authentication via factory , pass error , authdata object controller factory. possible? can't seem figure out how. keep getting undefined variables. if print error upon failed login console.log should expected, rest of code works. can't pass error/obj controller. my controller: myapp.controller('logincontroller', ['$scope', '$location', 'authentication', function($scope, $location, authentication) { $scope.login = function() { authentication.login($scope.user); // error auth factory } }]); my factory: myapp.factory('authentication', ['$firebase', 'firebase_url', '$location', function($firebase, firebase_url, $location){ var ref = new firebase(firebase_url); var authobj = { login: function(user) { return ref.authwithpassword({ email : user.email, password : user.password }, function(error, authdata) { if

audio - How can I generate a random mp3 file? -

for personal project i'm trying write code generate mp3 file random noise. opened mp3 file in sublime text , saw there hexadecimal format of thousands of lines of 8 sets of 4 hexidecimal numbers in file. ex... 4944 3303 0000 0002 0c27 5459 4552 0000 0005 0000 0032 3031 3454 5055 4200 0000 1f00 0001 fffe 4800 6500 6c00 6c00 6f00 so wrote code randomly generate millions of lines of that. issue when try open in itunes or vlc says song 0 seconds long. makes me think there sort of metadata random generation botching up. there simple guide on how make mp3 file scratch or guide on how make sensible metadata? if the mp3 specification tell bits represent what, , perhaps bits need hardcoded specific values?

python - Tkinter Reddit scraper (Tkinter and Praw) returns error "TypeError" -

im relatively new python , trying create tkinter application collects information specific subreddit , returns user in tkinter window. however, when run code returns error: typeerror: 'nonetype' object has no attribute ' getitem ' there appears nothing else on web can fix this, therefore believe it's appropriate asked here. my apologies if there many other problems code here, remember, new coding. thanks, -jeff try: tkinter import * except importerror: tkinter import * webbrowser import open datetime import date import praw """ scraper (eventually able to) search user-defined subreddit , return top ten posts subreddit" """ class redditscraper(frame): def makewidgets(self): intro = "reddit client" label(self, text="what subreddit wish view?").pack() self.e = entry(self) self.e.pack(padx=5) b = button(self, text="search subreddit", command=se

ajax - nginx crawlable site facebook share -

my site following ajax crawlable specifications, , it's been indexing pages perfectly. currently trying integrate social sharing via facebook, twitter, etc. in not working.... my setup quite simple: - grunt task create static snapshots - nginx rewrite rule point snapshots when _escaped_fragment_ param used. the issue here facebook escapes characters, e.g. url mawla.io/#!/blog facebook substitute mawla.io/?_escaped_fragment_=%23blog, snapshot this: path/to/snapshots%23blog.html which result in 404... there way unescape %23 / in nginx?? thanks in advance the ajax crawlable spec seems hint unencoding done on the implementers side, means either using nginx lua plugin , unescapedencoding or perhaps run incoming traffic base urls through service. we created escaped_fragments encoded values lazy hack around this.

r - Understanding the "ymax not defined: adjusting position using y instead" error in ggplot2 -

ggplot(diamonds, aes(carat)) + stat_bin(binwidth=0.1, geom="bar") # no error ggplot(diamonds, aes(carat)) + stat_bin(binwidth=0.1, geom="point") # "ymax not defined" the error produced ggplot2 's position-collide.r ( link ): if (!is.null(data$ymax)) { ddply(data, "xmin", strategy, width = width) } else if (!is.null(data$y)) { message("ymax not defined: adjusting position using y instead") from source code above, seems message appears because ggplot2 checks , there no ymax in data. however, doesn't make sense why ymax exists in first plot not in second. both plots use stat_bin , which produces data frame ymax, ymin , , other things . so why message appear in second plot?

wordpress - WP_Query and Woocommerce -

i have function inside (*wordpress child theme) functions.php returns attached woocommerce product categories, using global $wp_query. get_posts() function return number of products first page of products. (*the post_per_page value - in case 16). i have tried temporarily set post_per_page -1, adding code below right before function call in archive-product.php template: $wp_query->set('posts_per_page', 999); $wp_query->query($wp_query->query_vars); and resetting value after function call inside archive-product.php template $wp_query->set('posts_per_page', 16); $wp_query->query($wp_query->query_vars); this works, messes pre_get_posts function (*which sorts products), , seems cause issues listing of product results if on 500 products? please suggestions appreciated. thanks. //build dynamic category select menu based on attached categories function dynamic_category_select() { global $wp_query;

java - How to convert this old api mapreduce job code to new mapreduce -

this code below comes alex holmes hadoop in practice ver - 2: link: https://github.com/alexholmes/hiped2/tree/master/src/main/java/hip/ch5/http this mapper of mapreduce code reads list of urls text file, sends http request , stores body content text file. this code written based in old mapreduce api , wanted convert new version of mapreduce api. might simple changing jobconf job + configuration , extend new mapper can't make work code reason. i rather wait post modified code avoid confusion original code mentioned below: mapper code: import org.apache.hadoop.conf.configuration; import org.apache.hadoop.fs.filesystem; import org.apache.hadoop.fs.path; import org.apache.hadoop.io.ioutils; import org.apache.hadoop.io.longwritable; import org.apache.hadoop.io.text; import org.apache.hadoop.mapred.jobconf; import org.apache.hadoop.mapred.mapper; import org.apache.hadoop.mapred.outputcollector; import org.apache.hadoop.mapred.reporter; import java.io.ioexception; import ja

python - Geopandas Spatial Joins - unable to import geopandas.tools -

i gis work in python using combination of pandas , arcpy. heard of geopandas , interested in learning use alternative arcpy basic geoprocessing operations (spatial joining points polygons, intersecting polygons, etc). i've installed geopandas , dependencies (gdal, shapely, fiona, , pyproj). i found geopandas tutorial on spatial joins ( http://nbviewer.ipython.org/github/geopandas/geopandas/blob/master/examples/spatial_joins.ipynb ), i've been trying follow under "spatial joins between 2 geodataframes". the first 4 lines import necessary modules: import os shapely.geometry import point geopandas import geodataframe, read_file geopandas.tools import overlay 3 of these lines run successfully, 4th not. receive following import error: "importerror: no module named tools" any suggestions going wrong? error installation of dependencies? thanks help! geopandas 0.1.0 latest documented release of geopandas released on 13 jul 2014 not conta

java - Using BCrypt with a char[] -

around few hours ago, enquired on stack overflow methods on how convert char[] md5 hash. solution provided, thought insecure - outlined couple of people: generating md5 hash char[] neil smithline recommended make use of bcrypt, unable use char[]'s. the reason using char[] storing retrieved password login form because .getpassword() supports char[]. char[] passwordchars = passwordinputfield.getpassword(); string hashed = bcrypt.hashpw(passwordchars, bcrypt.gensalt(12)); currently, trying use above code generate hash variable passwordcars of type char[], not supported bcrypt.haspw() now reason why not using regular string because cannot cleared memory. my question - possible somehow use char[]'s bcrypt? thanks in advance! both java impls of bcrypt found take string input. seem know, putting password string opens memory attack. you can use pbkdf2 bcrypt. both considered top-notch. there pbkdf2 java code samples here , here . both all

javascript showmodaldialog is not showing scrollbars -

i sorry if duplicate. please show me if duplicate. opening modal popup using javascript below. not showing scrollbars in ie 11. have grid/table inside long width popup window. expecting horizontal , vertical scrollbars not showing. function showmodalwindowpopup(popupurl, windowproperties, w, h) { try { var left = (screen.width / 2) - (w / 2); var top = (screen.height / 2) - (h / 2); var properties = windowproperties + "width=" + w + ", height=" + h + ", top=" + top + ", left=" + left + ", scrollbars=yes, resizable=yes"; var childwindow = window.showmodaldialog(popupurl, "", windowproperties); } catch (err) { alert("error occured while opening showmodalwindowpopup popup: " + err); } } [update] able fix it. simple typo error took 1 complete day , caused me lot of frustration function showcdeventswindow(popupurl, windowproperties, w, h) { try{ var left = (screen.width / 2) - (w / 2);

php - File Size Calculated but File Not Found -

i trying install "waiting time file download script using php , jquery" script found @ http://www.w3webtools.com/simple-page-download-file-using-php-and-jquery/ i have downloaded demo scripts , installed them in server @ /var/www/test/ . when try call demo files recognizes file size says file not found. http://4x4submods.tk/test/download.php?f=advance-security-login-system-using-php-mysql.zip any ideas? mod_rewrite enabled. this works: <?php header('content-type: text/html;charset=utf-8'); include 'include/config.php'; include 'include/function.php'; ?> <!-- edited point latest copy of jquery! --> <script src="http://code.jquery.com/jquery-2.0.0.js"></script><?php $fname='hello.txt'; $download=1; if(!file_exists(upload_dir.'/'.$fname)) { $download=0; } $downloadlink='download/'.makehash($fname).'/'.$fname; function file_size($url){ $size = filesiz

java - Using Jax-ws WebTarget how to get remote IP Address for the service invoked? -

i accessing remote service using jax-rs client webtarget, remote service using dns stub load balance 6 nodes, for eg: https://example.com/rest , service resolve 1 of 6 nodes during execution now how can determine ip address of node being resolved each call? 1st request may resolve ip1 2nd request may resolve ip2 i know ip's used example.com, want know ip being used given service invocation. thanks in advance

ios - List of images with their properties -

my problem: in app there lot of images. have list of categories user can choose filtering images chosen category. user can't delete/edit these images, , can't add smth in it, guess don't need core data. so question is: how , in project should store , manage images' names properties, use list files' names , properties viewcontroller? finally, if didn't it: should this: 1.name: "imagename.jpg", category: "somecategory") 2.name: "imagename2.jpg", category: "anothercategory") thank you. if want store images under nsdocuments susbfolder , think can without using database , core data . let's think scenerio based on model view controller(mvc) structure: you want store images special properties nsstring *categories , nsstring *filepath under nsfilemanager subfolder . encode object , convert nsdata . need model class(it's subclass of nsobject ) keeps properties. need learn how save file