Posts

Showing posts from April, 2013

html - External style not picked by div element -

Image
i relatively new css please let me know if there silly mistake on below. while trying out 1 of examples on w3cschools used below code <!doctype html> <html> <head> <style> div { background-color: lightgrey; width: 300px; border: 25px solid green; padding: 25px; margin: 25px; } </style> </head> <body> <h2>demonstrating box model</h2> <p>the css box model box wraps around every html element. consists of: borders, padding, margins, , actual content.</p> <div>this text actual content of box. have added 25px padding, 25px margin , 25px green border. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div> </body...

ios - Image data Shows nil while retrieving image from JSON Array in objective c -

i new in ios. , trying load images custom uitableviewcell unfortunately not getting desired results. in didfinishlaunching method imagearray=[[nsmutablearray alloc] init]; imagearray=[responsedict valueforkey:@"empimg"]; nslog(@"image array =%@",imagearray); table view cellforrowatindexpath method - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *sti=@"sti"; newjoineecell *cell = (newjoineecell *)[tableview dequeuereusableheaderfooterviewwithidentifier:sti]; if (cell == nil) { nsarray *nib = [[nsbundle mainbundle] loadnibnamed:@"newjoineecell" owner:self options:nil]; cell = [nib objectatindex:0]; cell.accessorytype=uitableviewcellaccessorynone; } nsdata *imagedata=[[nsdata alloc]initwithcontentsofurl:[nsurl urlwithstring:[imagearray objectatindex:indexpath.row]] ]; uiimage *image11=[[uiimage allo...

database - Wondering what the default post date PHP string for Wordpress is? -

i'm trying add column csv exported using php file. down bottom in post_date part need know correct string when submission/ wordpress post made. i've got default date request in there that's current time , not post time. how can date post made? appreciate help! $surveyarray = array( 'id' => $survey_id, 'title' => $survey_title, 'airline' => $airlinename, 'meal' => $mealname, 'test_great' => $get_test_great[0], 'fair_price' => $get_fair_price[0], 'friendly_host' => $get_friendly_host[0], 'right_temp' => $get_right_temp[0], 'looked_good' => $get_looked_good[0], 'would_reorder' => $get_would_reorder[0], 'comment' => $get_comment[0], 'airlane_race_number' =...

c# - android.support.v7.widget.Toolbar element is not declared -

hi i'm new android dev , start using xamarin last week, i'm trying build app test , learn how use material design using android support library v7 appcompat . encounter problem saying element not declared though added component. i'm using xamarin visual studio . first problem then separate toolbar happens kindly enlighten me whats causing this.

user interface - Plotting in GUI of Matlab -

until had 1 axis in gui used plot directly using plot command. plus need plot these in loop. for = 1:length(sig) plot(sig(i).time,sig(i).signal,sig(i).time,updated(i).filter,) hold on end now have 2 axes in gui, how can make plot appear in 1st axis , in 2nd axis now example need plot below in 2nd axis = 1:length(sig) plot(sig(i).time,sig(i).fil,sig(i).time,updated(i).sig,) hold on end any appriciated you specify axes hold , plot functions. considering have 2 axes, h1 , h2 inside figure, following: hold(h1, 'on') hold(h2, 'on') = 1:length(sig) plot(h1, sig(i).time,sig(i).signal,sig(i).time,updated(i).filter) plot(h2, sig(i).time,sig(i).fil,sig(i).time,updated(i).sig) end

javascript - checkbox checked id and name value push array angularjs -

i proper , name values checkbox parent ng repeat. problem is, when checked check box need push id , name values in 1 array. if uncheck remove id , name values. <tr ng-repeat="user in partylist | filter:{ 'partyrole': 4}:true | filter:searchusers | myslice:start:end"> <td> <input type="checkbox" class="tablebox" value="{{user.partyid}}" name="{{user.first_name}}" ng-checked="userbox" ng-model="usermodel" ng-change="getindex(user.partyid,user.first_name,usermodel)" /> </td> <td>{{user.first_name}}</td> <td>{{user.email}}</td> <td>{{user.phone_number}}</td> </tr>

xml - "Your site has no hreflang tags." [Google Webmastertools - International Targeting]. How to fix this error? -

i don't know if it's right place ask, on google forum there no reaction. i'm getting error though made sitemap.xml should be. or wrong? the domain is: www.szerelemguru.ro , sitemap.xml following: <?xml version="1.0" encoding="utf-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <url> <loc>http://szerelemguru.ro/de/</loc> <xhtml:link rel="x-default" hreflang="de-de" href="http://szerelemguru.ro/de/" /> <xhtml:link rel="alternate" hreflang="ro-ro" href="http://szerelemguru.ro/ro/" /> <xhtml:link rel="alternate" hreflang="en-gb" href="http://szerelemguru.ro/en/" /> <xhtml:link rel="alternate" hreflang="en-us" href="http://szerelemguru.ro/en/" /> <xhtml:link rel="...

javascript - D3: Click on map and trace the closest path until the coast -

Image
for application build, user can click on point of map, , nearest river path identified , animated until reaches coast. used d3 draw bunch of paths (rivers) geojson file, each path feature geometry type linestring. figured use d3's voronoi identify closest path when user clicks on point. biggest problem is, identify closest river segment, not sure how automatically trace rest of paths until reaches coast. example, can see in image attached, 1 path highlighted, paths after highlighted. idea create new geojson file possible stream paths (as whole, not individual segments), how create file file each individual segment path? provided 3 features geojson file @ end give idea of how current data organized {"type": "featurecollection","crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:ogc:1.3:crs84" } },"features": [{ "type": "feature", "properties"...

php - String inside function -

i have written program in have create function. function expect 3 parameters $string, $start, $end. inside function, have write logic inside function automatically print string depending upon value of $start , $end. i tried whole function working correctly array length 55 when specify $end=55 returns error ending value exceeded string length: function string_function($string,$start,$end){ $length= strlen($string); if($start<0 || $end<0){ echo "start or end of string cannot in negative"; }else if($start>$length || $end>$length){ echo "entered values exceed more string's length"; }else if($start>$end){ echo "start point greater end point, invalid"; }else if($end<$length){ $length <= ($end+1); for($i=$start; $i<=$end; $i++){ echo "[$i] => ".$string[$i]."<br>"; } }else{ echo "ending val...

Sub aggregations in elasticsearch -

i trying work out elasticsearch aggregations! want fetch users have same operations id anf each id match 2 other fields! it's aggregations upon aggregations! not understanding how go it! can structuring it?? from official documentation : bucketing aggregations can have sub-aggregations (bucketing or metric). sub-aggregations computed buckets parent aggregation generates. there no hard limit on level/depth of nested aggregations (one can nest aggregation under "parent" aggregation, sub-aggregation of higher-level aggregation). you should check out more verbose elasticsearch: definitive guide . there can find complete examples, such following provided in chapter "aggregations » aggregation test-drive » adding metric mix" : get /cars/transactions/_search { "size" : 0, "aggs": { "colors": { "terms": { "field": "color" }, "aggs...

if statement - Python - Applying multiple conditions output in list comprehension -

i have been trying code rgb hex function in python when faced problem wasn't able figure out how do. here function itself: def rgb(r, g, b): return ''.join([format("{0:x}".format(x).rjust(2, "0").upper()) if int(x) >= 0 else "00" if int(x) <= 255 else "ff" x in [r,g,b]]) the important part: if int(x) >= 0 else "00" if int(x) <= 255 else "ff" what want able apply different output if number lower 0 or higher 255. first if works, second ignored. how can multiple conditions in list comprehension? you current ... if ... else ... clause doesn't make sense: format("{0:x}".format(x).rjust(2, "0").upper()) if int(x) >= 0 else "00" if int(x) <= 255 else "ff" means: format(...) if int(x) >= 0 else, if int(x) < 0 , 00 if int(x) <= 255 ( but less 0 must less 255 ); else ff presumably meant have: "ff" if...

Invalid SDK settings. Configure app.server.parent.dir property in build.xxx.properties to point to Liferay home -

Image
i have following directory structure the circled directories paths of liferay tomcat server , sdk respectively. and have file build.osama.properties following settings : app.server.parent.dir=d:\sources\lr_bundles\liferay_tomcat\liferay-ce-portal-7.0-ga3 app.server.tomcat.dir=${app.server.parent.dir}/tomcat-8.0.32 and when try create liferay plugin project keeps saying : i using lr 7 ga3 tomcat 8 , sdk 7 ga3 if you, i'd reinstall liferay 1 more time brief step-by-step instruction. in few words, should install: database (if want use custom one) liferay portal liferay ide plugins sdk. in plugins sdk folder should copy build.properties file, , change copied build.propertis file name build.osama.properties. (check step 1 more time, may profile named o sama instead of o sama). should open newly created build.osama.properties file , uncomment following lines: app.server.type=tomcat app.server.parent.dir=${sdk.dir}/../bundles app.server.tomcat.dir=$...

swift - How do I completely hide this UIImageView -

Image
i have uitableview list of items can filtered. when user chooses filter, uiview exposed using height nslayoutconstraint changes 0 40 pixels: the circle x clear button clears filter , closes uiview changing height constraint 0. the problem when uiview closes, clear button doesn't go away: here's relevant code: class liftlogviewcontroller: uiviewcontroller, uitableviewdatasource, uitableviewdelegate, nsfetchedresultscontrollerdelegate { let coredatastack = coredatastack() var liftevents = [liftevent]() //mark: ib outlets @iboutlet var tableview: uitableview! @iboutlet weak var navitem: uinavigationitem! @iboutlet weak var filterviewheightconstraint: nslayoutconstraint! @iboutlet weak var clearfilterbutton: uiimageview! @iboutlet weak var selectedfilter: uilabel! @iboutlet weak var clearbuttonheightconstraint: nslayoutconstraint! @iboutlet weak var clearbuttonview: uiimageview! var isfilterviewopen = false override func viewdidload()...

php - Update two models using yii x-editable -

so, i'm using extension: x-editable yii . and i'm trying update 2 models in update() function. i have 2 models: realisasi.php realisasideadline.php . so when cell updated on table realisasi.php (one value in column t1701 in case), want function update corresponding value in column t1701 of table realisasideadline , using column no foreign key. since haven't found example on google, made myself: public function actionsimpanedit($kode) { yii::import('editable.editablesaver'); $es = new editablesaver($_get['model']); // 'modelname' classname of model updated $es->update(); $es2 = realisasideadline::model()->findbypk($kode);//this i'm stuck $es2['t1701'] = '1991-11-19';//this $es->update();//and } this view.php: array( 'name' => 't1701', 'value' => 'chtml::value($data,"hubtarget.t1701")=== "0"?...

linux - how to calculate percentage in shell -

i calculate percentage in shell. can't it. script is #!/bin/bash #n1=$(wc -l < input.txt) #input.txt text file 10000 lines n1=10000 n2=$(awk '{printf "%.2f", $n1*0.05/100}') echo 0.05% of $n1 $n2 it neither showing value nor terminating when executing script. awk give n1 illegal field name if that, it's inside single quotes. also, avoid awk keep reading stdin should pass /dev/null file. then: n2=$(awk -v n1="$n1" 'begin {printf "%.2f", n1*0.05/100}' /dev/null)

php - Call to undefined method Illuminate\Database\Query\Builder::lists() when seeding after updating to Laravel 5.3 -

i'm updating laravel 5.3, , message: [2016-08-23 23:12:39] local.error: badmethodcallexception: call undefined method illuminate\database\query\builder::lists() in /home/vagrant/code/vendor/laravel/framework/src/illuminate/database/query/builder.php:2431 stack trace: #0 [internal function]: illuminate\database\query\builder->__call('lists', array) #1 /home/vagrant/code/vendor/laravel/framework/src/illuminate/database/eloquent/builder.php(1423): call_user_func_array(array, array) #2 /home/vagrant/code/vendor/cviebrock/eloquent-sluggable/src/sluggabletrait.php(254): illuminate\database\eloquent\builder->__call('lists', array) #3 /home/vagrant/code/vendor/cviebrock/eloquent-sluggable/src/sluggabletrait.php(170): app\user->getexistingslugs('nouseratnouser-...') #4 /home/vagrant/code/vendor/cviebrock/eloquent-sluggable/src/sluggabletrait.php(312): app\user->makeslugunique('nouseratnouser-...') #5 /home/vagrant/code/vendor/cviebrock/eloqu...

mysql - PHP checklist get ID and value and store it -

Image
so have form add new item database checkbox follows so difficulty checkbox. can enough create array items checked need id them along it. i've tried think of many ways , searched lot can't think of way id in way useable me along name of feature (checklist). since have each feature item , add table houses_has_features. <?php $title = 'add new house'; require_once 'header.php'; require_once 'nav.php'; require_once 'mysqli-con.php'; $conn = new mysqli($hn, $un, $pw, $db); // if house name , type set add them database if( !empty($_post['h_name']) && !empty($_post['h_type']) ) { $house_name = $conn->real_escape_string($_post['h_name']); $house_type = $conn->real_escape_string($_post['h_type']); //show names added echo '<b>house name: </b>'.$house_name . '<br><b> house type:</b> ' . $house_type; $query = "insert `hous...

embedded - how much THD do I expect on a 32 bits float sine waveform? -

i'm using stm32f411 uc generate sine wave using cmsis dsp libary sine waveform used feed audiocodec i2s inteface notice harmonics on analog output f codec thiking on how thd waveform have thank edit sine wave form 1 on cmsis dsp library https://github.com/mikeferguson/stm32/blob/master/libraries/cmsis/dsp_lib/fastmathfunctions/arm_sin_f32.c need harmonics added digital sine waveform i'm thinking on create array of sine values created function , analize on matlab how quantization noise , thd given tone generator adds, depends entirely on it's implementation details , not straight forward derive. suggest, analyzing output in matlab or similar 1 way it. alternatively, if care whether or not generator or analog parts blamed, easier approach might generate simple sine fraction of sample frequency. can done without fancy cmsis library pre-calculating array of e.g 8 samples in matlab sine frequency of fs/8. thd measurements again. if thd still big, cmsis generator ...

javascript - How do I maintain the aspect ratio of side-by-side images, keep the images the same height AND have fixed padding between images? -

i’m using accepted table layout answer question: scale different width images fit row , maintain equal height place 2 images next each other, maintain aspect ratios, , keep them same height when scaling. there left padding of 8px on each image. padding stay 8px no matter how wide ul/table is. here jsfiddle i’m working on: https://jsfiddle.net/maryjames0/u1o5lkmf/ here's html: <ul> <li><img src="http://walops.com/wp-content/uploads/puppy-awesome-wallpaper-100x100.jpg" /></li> <li><img src="http://photos.the-scientist.com/legacyarticleimages/2011/08/panda-200x100.jpg" /></li> </ul> and css: body { margin: 0; } ul { list-style: none; padding: 0; margin: 0; display: table; border-collapse: collapse; width: 100%; } li { display: table-cell; } img { display: block; width: 100%; height: auto; } so far, i’ve tried following no success: adding padding-left of 8px images adding padd...

scope - Why can't I access the variables set in a php file -

this question has answer here: reference: variable scope, variables accessible , “undefined variable” errors? 3 answers i have 2 php files, action.php require_once 'action_helper.php'; storedatatodb($data); //function action_helper.php logpersistisperformed(); //function action_helper echo $success; //variable set in action_helper.php action_helper.php $success = "success"; function storedatatodb($data) { // persist data } function logpersistisperformed() { inserttodb($success); } i'm not sure if scope issue encounter when action.php calls functions , variables declared in action_helper.php there no issues. but when call function in action_helper.php action.php, calls variable declared in action_helper.php, doesn't seem see success variable. during debugging, once loaded page, see variables both action , a...

scala - java.lang.ClassNotFoundException occurs when I use map function of DataFrame on Spark -

i have dataframe "ordereddf" , schema below: root |-- schoolid: string (nullable = true) |-- count(studentid): long (nullable = false) |-- count(teacherid): long (nullable = false) |-- sum(size): long (nullable = true) |-- sum(documentcount): long (nullable = true) |-- avg_totalscore: double (nullable = true) here data of dataframe "ordereddf": +--------+----------------+----------------+---------+------------------+--------------+ |schoolid|count(studentid)|count(teacherid)|sum(size)|sum(documentcount)|avg_totalscore| +--------+----------------+----------------+---------+------------------+--------------+ |school03| 2| 2| 195| 314| 100.0| |school02| 2| 2| 193| 330| 94.5| |school01| 2| 2| 294| 285| 83.4| |school04| 2| 2| 263| 415| 72.5| ...

swift - Cannot find '.xcworkspace' after pod install -

Image
i'm new ios developing, appreciated! so installed cocoapods, installed pod stripe , had issues going forward. ended deleting files project, .xcworkspace, pods folder, original project, etc. wanted start on make easier , not complicate things more. i created new .xcodeproj parse starter project. got set on heroku , went install pod stripe. did 'pod install' , said , use '.xcworkspace' going forward. figured fine. went '.xcworkspace' file , it's found on computer. then went terminal , did 'pod install' again, i'm getting new message doesn't include 'use .xcworkspace file going forward'. attached screenshots of any can stripe , running appreciated!! thank you!! algorithm: add podfile project folder podfile example: use_frameworks! target 'stackoverflow-39113331' pod 'stripe' pod 'paymentkit' end in terminal go project folder then make pod install your resul...

css - Language choice affects text overflow in html(bootstrap) (Django) -

Image
i'm using bootstrap implement post detail page. it works , fit tho format when using korean. but, if wrote english contents, overflow format. what's wrong it? here code : models.py from django.db import models django.core.urlresolvers import reverse django.conf import settings def upload_location(instance, file_name): return "{}/{}".format(instance.author.username, file_name) class post(models.model): author = models.foreignkey(settings.auth_user_model, on_delete=models.cascade) title = models.charfield(max_length=100) content = models.textfield() image = models.imagefield(upload_to=upload_location, blank=true, null=true) created_at = models.datetimefield(auto_now_add=true) updated_at = models.datetimefield(auto_now=true) class meta: ordering = ('-created_at',) def __str__(self): return self.title def get_absolute_url(self): return reverse( "posts:detail...

jquery - How to get JSON object values for a Particular key -

i using jqgrid grid data in json object format. result : {"key":"value1"},{"key":"value2", "id":"id"} i need values array "key". var arr = [{"key":"value1"},{"key":"value2", "id":"id"}]; var anarrayofkeyvalues = []; arr.foreach(function(ob, i) { if("key" in ob) anarrayofkeyvalues.push(ob.key); }); console.log(anarrayofkeyvalues); // ["value1", "value2"]

statistics - How to get dnorm curve using R -

Image
x1000 <- rep(na, 1000) n = 10 for(i in 1:1000){ x1000[i] <- mean(rpois(1000, 0.3)) } hist(x1000, freq = f) curve(dnorm(x1000, mean = 0.3, sd = sqrt(0.3))) i'm trying overlaid curve. however, gives me: error in curve(dnorm(x1000, mean = 0.3, sd = sqrt(0.3))) : 'expr' must function, or call or expression containing 'x' you close, asked (technically): hist(x1000, col="red", freq=f) curve( dnorm(x, mean=.3,sd=sqrt(.3)), col="blue", add=t) # expression containing 'x' but think really want is: curve( dnorm(x, mean=mean(x1000),sd=sd(x1000)), col="blue", add=t) or: curve( dnorm(x, mean=mean(x1000),sd=sqrt(mean(x1000)/length(x1000)), col="blue", add=t)

How to print pass arguments to code object via exec and print in python? -

how print pass arguments code object via exec , print in python? below few examples see how things work in generic case. def foo(x, y): return x * y exec(foo.func_code {'x': 1, 'y': 5}) # didn't work def bar(): return 3*5 exec(bar.func_code) # got executed couldn't print it? i don't think you'll able pass arguments code object without using "black magic". why not use exec("print foo(1, 5)") ? in both examples, nothing printed because exec executes xxx.func_code , function foo , bar contain no print statements.

photoshop - How does e commerce Websites edit their product pic for showing on front -

i wounding how these e commerce website edit product pic front page example this product image flipkart.com online store this photo taken camera in picture 1: there blur effect how did it there's no effect used. simple process. the object photographed against white background. the image 'masked' isolate object on it's own layer, either hand or photoshop plugin. manually, can draw around edge of object using lasso tool, add layer mask remove background. noise reduction, colour correction , other retouches applied object layer. blur effect think referring to. may or may not required, depending on image quality. shadows tend redrawn hand using simple shapes various blurs applied on layer below object. simplest shadow black ellipse gaussian blur applied , layer opacity set 20%. a background colour applied, depending on how place image. images e-commerce tends white background. the process masking varied , depends on preferred tools, complexity o...

oracle - Find max number of open tasks -

what attempting find out max number of tasks may receive on day during next 6 months. for example task 1 runs 1-jan-16 , ends 10-jan-16 task 2 runs 3-jan-16 , ends 15-jan-16 task 3 runs 6-jan-16 , ends 10-jan-16 task 4 runs 9-jan-16 , ends 20-jan-16 so in example there 4 tasks open between 1-jan , 10th jan want outcome 4 in scenario. reason being i'm displaying them in gantt chart they'll underneath each other. all have work far is: select schedule_start_date,am.ac,count(wo) ac_master left outer join wo on wo.ac = am.ac , ac_type = '190' wo.status = 'open' group am.ac,schedule_start_date this show count per day of these may overlap. is there anyway trying accomplish? if want count each scheduled group @ given point in time, can use between start , end dates: select schedule_start_date, am.ac, count(*) thecount ac_master left outer join wo on wo.ac = am.ac , ac_type = '190' wo.status = 'open...

python - SQLAlchemy - override orm.Query.count for a database without subselect -

i using sqlalchemy database doesn't support subselects. means wouldn't work (where calendar model inheriting declarative base): calendar.query.filter(uuid=uuid).count() i trying override count method this: def count(self): col = func.count(literal_column("'uuid'")) return self.from_self(col).scalar() however, from_self bit still subselect. can't this: session.query(sql.func.count(calendar.uuid)).scalar() because want filter information query . there way can filter arguments current query without doing subselect? thanks~ from sqlalchemy documentation: for fine grained control on specific columns count, skip usage of subquery or otherwise control of clause, or use other aggregate functions, use func expressions in conjunction query(), i.e.: from sqlalchemy import func # count user records, without # using subquery. session.query(func.count(user.id)) # return count of user "id" grouped # "nam...

ios - Ambiguous reference to member upload alamofire -

i receiving error when trying upload picture web server. copied , pasted alamofire sample github , receive error right away. code follows: let data = uiimagejpegrepresentation(picoutlet.image, 0.5) alamofire.upload(.post, "phpurlhere", file: photo) .progress { byteswritten, totalbyteswritten, totalbytesexpectedtowrite in print(totalbyteswritten) // closure not called on main queue performance // reasons. update ui, dispatch main queue. dispatch_async(dispatch_get_main_queue()) { print("total bytes written on main queue: \(totalbyteswritten)") } } .validate() .responsejson { response in debugprint(response) } update : added jpeg representation pass alamofire function still getting same error. the issue upload function: alamofire.upload(.post, "phpurlhere", file: photo) is expecting object of type nsurl f...

ios - Animate background when entering foreground -

i working on stopwatch app begins flashing when approaching limit , again when overtime. works great except when app pushed background , brought foreground again. @ time animation not start. i have tried moving code applicationwillenterforeground , applicationdidbecomeactive produces fatal error: unexpectedly found nil while unwrapping optional value am missing basic here? there more code of course (calculations, etc.), relevant section. (edit: i've expanded provide better view of i'm doing.) @ibaction func start(_ sender: anyobject) { if timeron == 0 { mytimer = timer.scheduledtimer(timeinterval: 0.1, target:self, selector: #selector(viewcontroller.updatecounter), userinfo: nil, repeats: true) starttime = nsdate.timeintervalsincereferencedate timeron = 1 redoryellow = "white" startbutton.superview?.sendsubview(toback: startbutton) background.superview?.sendsubview(toback: background) pick...

Firebase "symlink" to another node -

in relation other question modelling real user-facing tree structure ( using firebase tree structure represent "document outline" structure directly ), thinking of putting in place generic approach "symlinking", @ nesting levels, overcome 32 nesting levels limitation , need fetch sub-nodes @ once. are there "best-practices" "symlinking" in firebase? e.g.: syntax (contents, key-value structure) firebase node symbolise link node should symlink contain path target node (absolute or relative?) or kind of globally unique id? api callback triggered when symlink content finishes loading asynchronously i envisioning little wrapper api abstract difference of whether node there or accessed indirectly via "symlink". there api method "now fetch me this/more" user wants more details on displayed data (e.g. drilling down deeper in tree), , fetch e.g. next level of nesting (via callback), abstracting away whether children...

cabal - Haskell reexport linker errors -

i want have function in foo.internal module used other things in there, should exposed foo module. when reexport function foo use elsewhere linker errors. using stack build code, might issue there, or cabal, not sure. minimal working example: module foo.internal secrets = "stuff" module foo(secrets) import foo.internal (secrets) module main import foo main = putstrln secrets when compile stack build get package-0.1.0.0: build preprocessing library package-0.1.0.0... [1 of 2] compiling foo.internal ( src/foo/internal.hs, .stack-work/dist/x86_64-linux/cabal-1.22.5.0/build/foo/internal.o ) [2 of 2] compiling foo ( src/foo.hs, .stack-work/dist/x86_64-linux/cabal-1.22.5.0/build/foo.o ) in-place registering package-0.1.0.0... preprocessing executable 'package-exe' package-0.1.0.0... linking .stack-work/dist/x86_64-linux/cabal-1.22.5.0/build/package-exe/package-exe ... .stack-work/dist/x86_64-linux/cabal-1.22.5.0/build/package-exe/package-e...

javascript - Relay.js is not resolving composed fragment correctly -

i'm working on converting flux app relay.js , i'm running issues. can't seem component fragment composition work properly. correct data comes server, composed data never passed props of parent component reason. here's code far: librarylongdescription.js import react, {component, proptypes} 'react'; import relay 'react-relay'; import documenttitle 'react-document-title'; import address '../components/address'; import orders '../pages/orders'; export default class librarylongdescription extends component { constructor(props) { super(props); this.state = { library: {} }; console.log(props); if(props.library){ this.state.library = props.library; } } render() { return ( <documenttitle title="libraries"> <div> {this.state.library.name} ...

Finding LinkedIn Username from LinkedIn ID -

i have database of linkedin ids, need find linkedin usernames. welcome if can advise how can that. that information not available via linkedin api calls. member id retrieve should sufficient needs.

python - cybin.ProtocolError: No protocol version header -

i installed python 2.7 , tried use happybase communicate hbase thrift server. python2.7 test.py traceback (most recent call last): file "test.py", line 5, in <module> key, data in table.rows([b'row01']): file "/home/qa/happybase/happybase/table.py", line 162, in rows self.name, rows, columns, {}) file "/usr/local/lib/python2.7/site-packages/thriftpy-0.3.8-py2.7-linux-x86_64.egg/thriftpy/thrift.py", line 160, in _req return self._recv(_api) file "/usr/local/lib/python2.7/site-packages/thriftpy-0.3.8-py2.7-linux-x86_64.egg/thriftpy/thrift.py", line 172, in _recv fname, mtype, rseqid = self._iprot.read_message_begin() file "thriftpy/protocol/cybin/cybin.pyx", line 439, in cybin.tcybinaryprotocol.read_message_begin (thriftpy/protocol/cybin/cybin.c:6457) cybin.protocolerror: no protocol version header there no cybin.c under /usr/local/lib/python2.7/site-packages/thriftpy-0.3.8-py2.7-linux-x86...

HTTP 500 error using Azure Easytables with Node.js backend -

having created mobile app in azure using easytables node.js backend, http 500 error trying post new item. log in azure console , in project backend run: npm sqlite3 that fixes it. (answering own question because couldn't find anywhere on stackoverflow. props @benjamintam readify solution)

python - How do I pass a scalar via a TensorFlow feed dictionary -

my tensorflow model uses tf.random_uniform initialize variable. specify range when begin training, created placeholder initialization value. init = tf.placeholder(tf.float32, name="init") v = tf.variable(tf.random_uniform((100, 300), -init, init), dtype=tf.float32) initialize = tf.initialize_all_variables() i initialize variables @ start of training so. session.run(initialize, feed_dict={init: 0.5}) this gives me following error: valueerror: initial_value must have shape specified: tensor("embedding/random_uniform:0", dtype=float32) i cannot figure out correct shape parameter pass tf.placeholder . think scalar should init = tf.placeholder(tf.float32, shape=0, name="init") gives following error: valueerror: incompatible shapes broadcasting: (100, 300) , (0,) if replace init literal value 0.5 in call tf.random_uniform works. how pass scalar initial value via feed dictionary? tl;dr: define init scalar shape follows: in...

c# - Reusing Fluent NHibernate Mappings/Configuration -

i'm trying reduce startup time of apps use fluent nhibernate , have found building configuration 1 of largest costs. i've googled around , tried serializing underlying nhibernate configuration just answer question . however, don't want save database connection information, have 2 different db technologies , many possible databases. hoping create configurations mappings , save it, doesn't work. so i'm not sure how go saving mappings. have couple of questions: do save configuration database info , call fluent.configure(cfg).database(newdbinfo).buildsessionfactory() overwriting database info? doesn't work i see there's exportto() function write out hbm.xml files don't know nhibernate itself, how subsequent creations of configuration know these files? is there option? thanks in advance replies.

rx java - How do you unsubscribe from a live stream -

i trying understand how unsubscribe observable created live feed. here more or less code: somefeed feed = new somefeed(); observable<pricetick> observable = observable.create(s -> feed.register(new somelistener() { @override public void pricetick(pricetick event) { s.onnext(event); } @override public void error(throwable throwable) { s.onerror(throwable); } }) ); subscription subscription = observable.subscribe(system.out::println); subscription.unsubscribe(); system.out.println("is unsubscribed:" + subscription.isunsubscribed()); // prints true i finding after subscription unsubscribed, subscriber still outputting event stream. how can unsubscribe remove subscriber receiving further notifications? the observable creating doesn't obey observable contract. not handling unsubscribtion , backpreasure. observable.create makes easy create such observables. instead can use other techniques create observable...

python - How do I convert a MultiIndex to type string -

consider multiindex idx idx = pd.multiindex.from_product([range(2013, 2016), range(1, 5)]) when do idx.to_series().str.join(' ') i get 2013 1 nan 2 nan 3 nan 4 nan 2014 1 nan 2 nan 3 nan 4 nan 2015 1 nan 2 nan 3 nan 4 nan dtype: float64 this happens because dtypes of different levels int , not str . join expects str . how convert whole idx str ? i've done join = lambda x, delim=' ': delim.join([str(y) y in x]) idx.to_series().apply(join, delim=' ') 2013 1 2013 1 2 2013 2 3 2013 3 4 2013 4 2014 1 2014 1 2 2014 2 3 2014 3 4 2014 4 2015 1 2015 1 2 2015 2 3 2015 3 4 2015 4 dtype: object i expect there simpler way i'm overlooking. i'm not sure it's elegant way, should work: idx.get_level_values(0).astype(str).values + ' ' + idx.get_le...

How to ensure dependencies on host are removed when we remove a docker container -

i created docker container , have application running inside it. created second docker container (on same host) same application running inside it. need create few more containers way. however, when remove container, need ensure dependencies creates on host removed. how achieved ? thanks, checkout documentation of docker rm command: usage: docker rm [options] container [container...] remove 1 or more containers options: -f, --force force removal of running container (uses sigkill) --help print usage -l, --link remove specified link -v, --volumes remove volumes associated container so use "-v" option update you can use command cleanup volumes no associated containers. docker volume rm $(docker volume ls -qf dangling=true) credit: sceada

html - JQuery click method not working -

i trying have button press in center make elements in div slide up. $(document).ready(function() { $("#imgs").click(function() { $("#start").animate({ bottom: "+=250px" }, "slow"); }); }); #imgs { display: block; margin: 0 auto; opacity: 1.0; filter: alpha(opacity=100); -webkit-transition: 1s ease; -moz-transition: 1s ease; -ms-transition: 1s ease; -o-transition: 1s ease; transition: 1s ease; bottom: 0px; } #imgs:hover { opacity: 1; filter: alpha(opacity=100); transform: scale(1.2); -webkit-transform: scale(1.2); -moz-transform: scale(1.2); -ms-transform: scale(1.2); -o-transform: scale(1.2); } html { width: 100%; height: 100%; clip: auto; position: absolute; overflow-x: hidden; overflow-y: hidden; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <body style="mar...

signInWithCustomToken() with Firebase's own tokens -

i want authenticate users on multiple websites via sharing jwt token. token generated firebase, assume , valid token (tested on jwt.io , seems fine). user.gettoken() . as call signinwithcustomtoken(token) error auth/invalid-custom-token message "the custom token format incorrect. please check documentation." . what strange, http post request https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifycustomtoken... returns http 400. have tried on both localhost , on https live website... same result. i'm using firebase 3.3. any ideas, wrong? using feature old firebase. you don't provide code snippets gonna speculate here. i assuming using node.js generate custom token. try in node script: var firebase = require("firebase"); var adminconfig = { serviceaccount: "serviceaccountcredentials.json" }; var adminapp = firebase.initializeapp(adminconfig, 'admin'); var token = adminapp.auth().createcustomtoken('12345...