Posts

Showing posts from September, 2012

SailsJS deployment to Heroku, connect to Mongolabs MongoDB -

i right attempting first heroku deployment of sailsjs api. app uses sailsjs v0.11 and sails-mongo 0.11.2. i have updated config/connections.js include connection information mongodb database have hosted free @ mongolab . mongodb: { adapter: 'sails-mongo', url: "mongodb://db-user:password123@ds047812.mongolab.com:47812/testing-db" } also updated config/models.js point adapter. module.exports.models = { connection: 'mongodb', migrate: 'safe' }; this have changed running code locally, when deploy heroku app crashes , error... /home/zacharyhustles/smallchangeapi/node_modules/connect-mongo/lib/connect-mongo.js:186 throw err; ^ @ socket.emit (events.js:107:17) 2015-07-08t19:37:00.778316+00:00 app[web.1]: @ socket.<anonymous> (/app/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10) error: error connecting database: failed connect [localhost:27017] how ...

Convert UTC time to local time java Android -

im retrieving values json service , retrieved datetime values stored in utc format. i've tried lot of sample codes convert datetime values user local timezone im still getting same value after conversion. this have actually: (copied other posts) string sjsondate = "2015-07-08t12:08:13.0625+00:00"; simpledateformat simpledateformat = new simpledateformat("yyyy-mm-dd't'hh:mm:ss"); simpledateformat.settimezone(timezone.gettimezone("utc")); try { date localdatetime = simpledateformat.parse(sjsondate); } catch (parseexception e) { e.printstacktrace(); } the result value (localdatetime) same original value. in paraguay (gmt-4) , resulting values needs minus 1 hour diference, this: ("2015-07-08 07:13:25") (the values stored in argentina) help please! i've found solution, using day light savings had disccount 1 hour resulting datetime. so, share code else: public date getdateintimezone(date currentdate, ...

python - How to install pystring on mac -

i've got noob question. knows how can install pystring on mac? need library , header. tried installing via brew not seem available there. http://code.google.com/p/pystring/ any thoughts?

android - Double values for Longitude and Latitude not passing to googlemap Marker -

i have dataobject contains longs latitude , longitude. passing these method in fragment, calls parent activity method show googlemap. the problem is, longitude , latitude keep resulting (0,0). have checked object setting , getting correct figures. the figures correct in fragment , in call showmap, marker keeps showing default 0,0. i have map in activity xml, within framelayout, change visibility. (i think problem, it's blank map) i have spent hours on this, , have come here, cap in hand. this relevant parts of code: my fragment code: /** * latitude , longitude dataobject , pass * showmap method of activity. */ public void showmap() { double lat = dataobject.getlatitude(); double long_ = dataobject.getlongitude(); string name = dataobject.getname(); ((myactivity) getactivity()).showmap(lat, long_, name); } my activity code: public void showmap(double lat, double _long, string _title) { googlemap googlemap = ((mapfragment) getfragmentm...

java - Android Read Text File from URI -

i've got uri pointing text file intent , i'm trying read file parse string inside it. i've tried it's failing filenotfoundexception . tostring() method appears lose / java.io.filenotfoundexception: content:/com.google.android.apps.bigtop/attachments/downloads/528c4088144d1515d933ca406b7bc273/attachments/d_0_0_b562310a_52b6ec1c_c4d5f0d3_73f7489a_711e4cf2/untitled%20text.txt: open failed: enoent (no such file or directory) uri data = getintent().getdata(); string text = data.tostring(); if(data != null) { try { file f = new file(text); fileinputstream = new fileinputstream(f); // fails on line int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); text = new string(buffer); log.d("attachment: ", text); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } the value of data is: content://com.goo...

html - string in Ruby on rails questions: 1. <code> 2. how to recognize "put"? -

i'm developing web application ruby on rails. when command <h4>wow webpage <code>loving each other</code> good</h3> , "loving each other" part highlighted ( , meant because learned code can work through getbootstrap! ) : "code" "code" <---- in stackoverflow page code code command working put here intentionally in wrong way. i wanted make specific string data that. in application, string data <textarea class = "form-control" name="input"></textarea> but when displayed in html, <code> part not recognized sort of code string. partially seems make sense not understood. how can turn type of information formatted version ( meaning part highlighted! ) second question that, string data got <textarea> has "entering actions" meaning, user clicks "enter" couple of times. when display information (for instance, @a = user.information, <- user.informat...

php - Regex lookahead complex pattern -

this code replacing many single pipes double pipes. keep change small, i'd prefer correct second regex allows spaces between "|" , ",". so, question how modify second regex not match \|[[:blank:]]*[^,\r\n] . code: $patterns = array ( '/\\\\\|,/', "/(?<=[^,])\|(?=[^,\n\r])/" ); $replacements = array ( '|,', '||' ); $line = preg_replace ($patterns, $replacements, $line); example: for string: "|di|,|15| ,|c00413914|,|| ,|f|" expected / desired result: "|di|,|15| ,|c00413914|,|| ,|f|" actual result: "|di|,|15|| ,|c00413914|,||| ,|f|" i've tried this, didn't work: "/(?<=[^,])\|(?=[[:blank:]]*[^,\n\r])/" please note: this question fixing bug smallest change possible. current regex may suboptimal (like using negative character classes instead of negative lookaround), first priority minimize changes , not optimize ...

Writing a bamboo deployment task -

i have written couple of tasks bamboo. non of them available deployment stage. i have tried setting category name deployment, still no success. here task section in atlassian-plugin.xml. <tasktype key="mydeploymentservice" name="my deployment service" class="za.co.my.bamboo.plugin.mydeploymentservicetask"> <category name="deployment"/> <configuration class="za.co.my.bamboo.plugin.mydeploymentservicetaskconfigurator"/> <resource type="freemarker" name="edit" location="my/editmydeploymentservice.ftl"/> <resource type="freemarker" name="view" location="my/viewmydeploymentservice.ftl"/> </tasktype> the tasktype module definition 's category element within atlassian-plugin.xml purely informational, i.e. determines section of bamboo 's task selection dialog task sorted. section introduction 5.0 - deployments within ...

ios - Massive Parent-Child and delegate pattern -

Image
i'm facing complex design problem. due hard designed graphic can't use apple navigation pattern uinavigationcontroller or other ones. app diagram black arrow: protocols direction blue arrow: parent-child pattern direction i created flow because want maintain code inside single viewcontroller clear , isolated: thought them modules can used somewhere in other apps. rootviewcontroller mainvcs position manager. decides current view-controller must showed , configures based on status (modified delegate methods). single mainvc doesn't know rootvc exists , call root using protocols. single childviewcontroller doesn't know mainvc exists , call main using protocols , on. code clear , easy understand, purpose, when have apply modify skeleton ( rootvc ) childviewcontrollern , child of umpteenth childviewcontroller , child of umpteenth mainviewcontroller , have propagate protocol until rootviewcontroller . my first question is : pattern correct? think it? m...

Access TransferSpreadsheet Excel - Prevent Duplicates? -

i working on application there desire automate data entry as possible. wish add button such entry forms choosing excel file import. have done 1 interface, , i'm working on others. i'm looking best way prevent duplicates imported table. 1 working on now, simple 2 column import. 1 method have used before import spreadsheet temp table. can utilize query insert <> . wonder if best method use. any thoughts? thanks! something should work. can tailor more if list more details of projects. from "external data" on ribbon, link excel file. then write following query: insert table1 ( field1, field2 ) select a.field1, a.field2 tableexcel left join table1 b on a.field1 = b.field1 (((a.field1) null)); then attach macro button running query above.

shell - How to write a background multiple sh run in a perl script? (tried several methods but all failed) -

i tried write background multiple sh run in perl script, below 3 tries: for ( $i = 0; $i < @num - 1; $i++ ) { $num1 = $num[ $i + 1 ] - 1; `nohup sh ./tmpscript/matrixr.$num[$i]-$num1.sh &` # don't know why not background run........just run 1 one , have wait......... } tried: `sh *.sh &` #wrong ........just run 1 one , have wait......... also tried: `cd tmpscript; file in *.sh; nohup sh \$file \&; done `; #still wrong........just run 1 one , have wait......... they failed..could of , solve it? thanks! p.s.: "``" these marks didn't displayed above..(seemed eaten stackoverflow, it's first time asking..) so, given problem seems be: invoke sh ./tmpscript/matrixr.$num[$i]-$num1.sh & multiple times in parallel. my first thought it's worth having @ script, because perl can too. however general case suggest using parallel::forkmanager : use strict; use warnings; use parallel::forkmanager; $...

c# - How do I return a single object with an array and a list? -

i have list , array return, i'm unsure how bring 2 together. have deserialized json , created 2 objects. how bring list , array in single object? : var 1 = jsonconvert.deserializeobject<mydata.rootobject>(first); var 2 = jsonconvert.deserializeobject<mydata.rootobject>(second); list<mydata.dataone> listone = new list<mydata.dataone>(); foreach (var items in one) { somedatamodel model = new somedatamodel(); model.property = one.rows.f[0].v; listone.add(model); } string[] array = new string[two.rows.count]; (var items = 0; items < two.rows.count; items++) { array[items] = two.rows[items].f[0].v; } return null; create new class represent combination of these 2 pieces of data: public class myreturntype { public list<mydata.dataone> listone {get;set;} public string[] array {get;set;} } then return it: return new myreturntype {listone = listone, array = array};

c# - Unable to retrieve metadata for 'JMAP.Models.tempSource'. Keyword not supported 'data source' -

Image
i using visual studio 2010 , entityframework version 5.0.0.0 trying create controller 'tempsource' table in oracle 11.2 , getting following error. this code entity. namespace jmap.models { public class tempsource { public string systemname { get; set; } public string systemdesc { get; set; } public string userid { get; set; } } public class tempsourcedbcontext : dbcontext { public dbset<tempsource> tempsources { get; set; } } } add name="tempsourcedbcontext" connectionstring="user id=user_id;password=pwd;datasource=(description = (address_list = (address = (protocol = tcp)(host = hostname)(port = portnumber))) (connect_data = (service_name = dbname)))" providername="system.data.oracleclient" and have added above connection string in web.config file. can me error. it bad! following wrong approach. using code-first approach whereas wanted use data-first approach,but being new mvc , ...

How to run a Powershell script from C# that references another script -

i'm trying run powershell script c# program so: var ps = powershell.create(); ps.addscript(@"<full-path-to-script>.ps1").invoke() but fails because within script references script gives me error saying it's not found. however, running script commandline works fine. i'm not sure understand why not working within c# works in commandline. ideas? probably have different working directories. how line inside <full-path-to-script>.ps1 includes second script? should use $psscriptroot .

android - My FloatingActionButton has some weird lines coming out of it on 4.4 and lower -

Image
as title says, floatingactionbutton has weird lines coming out of on 4.4 or lower. on lollipop works fine. this picture of issue: the play image doesn't have lines in it. xml: <android.support.design.widget.floatingactionbutton android:id="@+id/play" android:layout_width="48dp" android:layout_height="48dp" android:src="@drawable/ic_av_play_arrow" app:borderwidth="0dp" app:elevation="6dp" app:layout_anchor="@+id/image" app:layout_anchorgravity="center_vertical|right|end" app:ripplecolor="@color/color_primary_light" /> so doing wrong? edit: goes away if set elevation 0dp think i'll older phones your problem here you're making floatingactionbutton unexpected size. floatingactionbutton in support library supports 2 sizes, , must set using fabsize at...

php - How to implement observation if we already used intheritance? -

there forumthread class: class forumthread extends dbtable { public function insert ($threadid, $comment) { sql insert parent::tablename values $threadid, $comment // email sending how? // putting on "notice-wall", how? } } some other functions should done here, e.g. email sending. cant put here otherwise violate srp. cant put neither controller , want insert post elsewhere too. im planning implement observed pattern, cant extend 2 classes. with observer pattern have dispatch notification method in order execute relevant observers code. you execute within insert method: $this->notify('table_insertion', $data); then somewhere else before notify line executed, event must registered so: static::$observers['table_insertion'][] = array('class_to_call' => 'method_in_class_to_call'); the notify method like: public function notify($event, $data) { foreach(static::$observer[$even...

c# - How do I change a value in the ModelState, so that it will be valid, using ASP.NET MVC? -

i allowing selectlist have initial value of "". user can choose whether fill in option or leave on default value. this selectlist works on id, id passed controller. however, int not being selected, modelstate results in false input empty string rather int. i want change value of empty string 0. result in modelstate being true. have been looking @ modelstate dictionary class, can change key, value pair before modelstate checked. however, have been unable use successfully. https://msdn.microsoft.com/en-us/library/system.web.mvc.modelstatedictionary(v=vs.118).aspx any appreciated. try using modelstate.setmodelvalue("propertyid", new valueproviderresult("new value", "", cultureinfo.invariantculture)); here usefull article. http://geekswithblogs.net/bobhardister/archive/2013/03/11/retain-and-set-posted-checkbox-value-in-the-mvc-4.aspx

asp.net mvc - Visual Studio 2013 freezes on context menu Add -

i've moved solution vs2012 2013 (the solution has 21 different projects). the problem have context menu solution explorer asp mvc project, after right click on folder when hover on add submenu vs freezes 30 seconds or so . the same thing happens when right click service references folder in project (when right click, not when hover on something). i've tried: clearing nuget cache see this stating in safe mode(this solves problem still don't know what's causing it) blank mvc project, different project in same solution(no problems here) disabling extensions can(like web essentials) restarting pc (no effect) disabling 'automatically adjust visual experienced based...' tools -> options -> environment -> general deleting .suo files this have installed microsoft visual studio professional 2013 version 12.0.31101.00 update 4 microsoft .net framework version 4.5.51641 installed version: professional team explorer visual studio 2013 061...

java - Spring Tool Suite - ClassNotFoundException: oracle.jdbc.driver.OracleDriver -

i keep fighting spring. i'm trying connect app local oracle database, error: classnotfoundexception: oracle.jdbc.driver.oracledriver i figured out problem missing .jar , , tried include it, keep getting same error. i install oracle jdbc jar in maven repository, checked loads correctly in project, classes, etc., still not working. i tried add jar in build path, , warning saying won't include it. i tried copy&paste jar workspace, server, java path... , nothing. the thing couldn't copy web-inf/lib folder (as answers recommended), because folder doesn't exists in project. sts didn't created (i assume that's because folder structure spring mvc webapplication not same usual webapplication one). any ideas? -- update -- my pom.xml requested: <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:sch...

html - how to implement progress bar using angular js for processing multiple request? -

i have created multiple orders , have confirm these orders until , unless orders gets confirmed have show progress bar , have show status of ordered confirmed i.e. suppose have confirmed 10 orders 1/10 2/10 3/10 ...10/10 status of orders getting confirmed @ background. below have 1 example doesn't meets requirement .. angular.module("app", []) .controller("main", ['$scope', function($scope) { $scope.value = 10 $scope.items = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] }]) .directive('progressbar', [function() { return { restrict: 'a', scope: { 'progress': '=progressbar' }, controller: function($scope, $element, $attrs) { $element.progressbar({ value: $scope.progress }) $scope.$watch(function() { $element.progressbar({value:...

c++11 - C++ casting a std::vector<Derived>* to std::vector<Base> ...? -

i'm making vector of pointers vectors: std::vector<std::vector<base>*> all; // vector keeping pointers vectors and problem have several vectors of derived classes: std::vector<derived1> derived1; // vector of derived class std::vector<derived2> derived2; // vector of derived class std::vector<derived3> derived2; // vector of derived class is there safe way change type of pointer vector<derivedx> vector<base> ? every derived class shares behavior , alive of program's life. i'm still not @ explaining programming problems, should questions concerning details arise - please ask in comments. no, not possible. there no relationship between std::vector<base> , std::vector<derived> . in other words: std::vector<derived> not derived std::vector<base> .

Deactivating links in PHP -

the below code has link apply job when deadline not met.how can make link deactivate after deadline application has passed,or change link label 'apply' 'closed'?i appreciate help. while($row = mysqli_fetch_array($query)) { $ref=$row['id']; echo "<tr id=".$ref.">"; echo "<td >" .$row['refno'] . "</td>"; echo "<td >" . $row['title'] . "</td>"; echo "<td >" . $row['positions'] . "</td>"; echo "<td>" . $row['typeofcontract']."</td>"; echo "<td>" . $row['deadline'] . "</td>"; echo "<td>" .$row['dept']."</td>"; $det= $row['details']; echo "<td style='width:100px' >" ."<a href='../../admin/admin/jobdetails/".$det."...

Hiding table body when all the rows are hidden in angularjs -

i'm trying display table activities, row displaying day , after list of activities day. want user able filter activities. "myactivities" map user's activities assigned true, , rest false. code looks this: <table> <tbody ng-repeat="date in dates"> <tr><td>{{date.day}}</td></tr> <tr ng-repeat="activity in date.activities" ng-show="myactivities[activity.id] == true"> <td>{{activity.time}}</td><td>{{activity.name}}</td> </tr> </tbody> </table> the problem when there day no relevant activities user, row displaying date still shown activities under hidden. solved problem function: $scope.checkdate = function(activities) { activities.foreach(function(activity){ if (myactivities[activity.id] == true) return true; }); return false; } //added ng-show tbody in html: <tbody ng-repeat="date in dates" ng-show="checkd...

json - Django RestFramework group by -

my issue related django restframework , how group elements. this serializers.py from collaborativeapp.models import * rest_framework import serializers class vocabserializer(serializers.modelserializer): term_word = serializers.charfield(source='term.word',read_only=true) kwdgroup = serializers.stringrelatedfield() class meta: model = vocab fields = ('id','term_word', 'meaning','kwdgroup') class termserializer(serializers.modelserializer): word = serializers.charfield(read_only=true) class meta: model = term fields = ('url', 'word') the following json it's actual result: {"results":[ { "id": 5, "term_word": "word1", "meaning": "text1" "kwdgroup": "a" }...

ios - Refresh view controller with new data after JSON request -

nsstring * storyboardname = @"storyboardx"; uistoryboard *storyboard = [uistoryboard storyboardwithname:storyboardname bundle: nil]; uiviewcontroller *vc = [storyboard instantiateviewcontrollerwithidentifier:@"viewcontrollerx"]; [vc.view setneedsdisplay]; i trying refresh display in view controller after json request completes in thread. data refreshes correctly, view not. trying setneedsdisplay @ end of data pull method crashes nsrangeexception index 0 beyond bounds. assume because view controller above not instantiated correctly, or current view not being deallocated. arc on. i have tried [vc.view viewdidload] same result. the code above located @ end of (void)main json pull method. 1) json pull not executing in main thread (i'm assuming you've not shown it, , if not should anyway if json being obtained server) , gui code can't called on background thread. 2) should not doing attempting anyway, unless want load view controller op...

mysql - How to insert a row to table with another table's row and an variable? -

there 2 table: a: col1, col2 b: col3, col4 i want insert row table a, col2 selected table b's col3, col1 variable, how should this? i'm considered sql: insert a(col1, col2) select ?, col3 b col4=? , troubled variable. try this declare @variable_name int; set @variable_name= your_value; insert a(col1, col2) select @variable_name, col3 b col4=[your_condition]

python - Comparing and replacing values inside DataFrames -

i have 2 lists, 1 being main list used "key" , other 1 being updated due missing information. main_df: +---------+--------+--------+--------+--------+ | id | value1 | value2 | value3 | value4 | +=========+========+========+========+========+ | 9845213 | 1 | 11 | | aa | +---------+--------+--------+--------+--------+ | 545167 | 2 | 22 | b | bb | +---------+--------+--------+--------+--------+ | 132498 | 3 | 33 | c | cc | +---------+--------+--------+--------+--------+ | 89465 | 4 | 44 | d | dd | +---------+--------+--------+--------+--------+ | 871564 | 5 | 55 | e | ee | +---------+--------+--------+--------+--------+ | 646879 | 6 | 66 | f | ff | +---------+--------+--------+--------+--------+ ... data_df: +----------+--------+--------+--------+--------+--------+ | id | value1 | value2 | value3 | value4 | value5 | +==========+========+=======...

Java: Get Class<T> object of generic class -

this question has answer here: create instance of generic type in java? 23 answers i have generic class public myobject<t extends someclass1, s extends someclass2> extends someexternalclass { // .... @override public void somefunction() { externalclass.dosomething(t.class); // problem here! } } inside class, need object of type class<t> pass function of external library. external library expects object of type class<t extends someclass1> as parameter. i read solution pass class<t> constructor of object. unfortunately, myobject extends class, external library, has constructor called - no option me. i read guava, example here: get generic type of class @ runtime difference problem need object of type class<t> , not object of type type . how can achieve this? thanks in advance! as mentioned psh...

playframework - Creating Test Scope/Context to seed data and run application, Scala Play Framework 2 -

i'm having trouble figuring out best way create easy way test of db centric application code. maybe skewed more oo languages, trying start application, seed database, pass seeded data test, clean database. trying use before , after blocks, have been running sorts of problem delayedinit , other race conditions. in docs can use setupdata , deletedata, doesn't provide opportunity pass data actual tests. there way achieved? here sample of wrapper using: abstract class withuserdata extends withapplication { var user = null override def around[t: asresult](t: => t): result = super.around { setupdata() t deletedata() } def setupdata() { logger.info("running before") val passwordinfo = passwordinfo("bcrypt", "$2a$10$at8n/gzhkdbhlh6er.usboujvqx.igebo2wc7emmd2m4tolin7eag") val u = user(new identityid("harrypotter@naytev.com", usernamepasswordprovider.usernamepassword), "harry...

jquery - Zoom Effect Only Zooms Original Image Not New Image From Thumbnail -

info have grid of div's. each div opens modal. each modal has simple thumbnail gallery (click thumbnail, main image replaced). problem zoom working original main image. doesn't realize there new main image after clicking thumbnail continues zoom original image. fiddle http://jsfiddle.net/zuhloobie/bcuh489d/2/ question how alter code zooms new main image chosen thumbnail? html <div class="container"> <div class="image wow rotatein" data-wow-delay=".3s" data-wow-duration=".3s"> <div id="gallery" class="zoom"> <div class="content"> <img src="http://dummyimage.com/900x900/000/fff" class="image_1"> <img src="http://dummyimage.com/900x900/f00/fff" class="image_2" style="display:none"> </div> </div> ...

Add new tab dynamically with bootstrap/twig -

i want add remove tab dynamically bootstrap in twig found source code dynamically add/remove new tab dosen't work when click on "add tab" nothing happend can me please twig : {% block javascripts %} {{ parent() }} <script type="text/javascript" > $(doument).ready(); var pagenum = 1; $('#btnadd').click(function () { var nexttab = $('#tabs li').size()+1; $('<li><a href="#tab'+nexttab+'" data-toggle="tab">tab '+nexttab+'</a></li>').appendto('#tabs'); $('<div class="tab-pane" id="tab'+nexttab+'">tab' +nexttab+' content</div>').appendto('.tab-content'); $('#tabs a:last').tab('show'); }); $('#btnadd').click(function () { var nexttab = $('#tabs li').size()+1; $('<li><a href="#t...

ios - Objective C: Resizing a UIImageView -

i'm trying resize uiimageview. tried directly edit frame of image view so verticalbar.frame = cgrectmake(verticalbar.frame.origin.x, verticalbar.frame.origin.y, verticalbar.frame.size.width, verticalbar.frame.size.height); yet when didn't change of values image contorted greatly. mean had rotated rectangle(i used cgafflinetransformmakerotation) @ 45 degree angle when tried editing frame shown above rectangle became 5 times wide. not sure problem is. great! from docs uiview frame : however, if transform property contains non-identity transform, value of frame property undefined , should not modified. in case, can reposition view using center property , adjust size using bounds property instead. so either leave transform in place , update image view's center , bounds , or reset transform set frame .

intellij idea - How to configure PHP Storm for working and debugging remote project (existent PHP files) -

i have been using lot of ides, lot of intellij idea. cannot configure phpstorm ide work remote project. have tried several times several hours, still doesn't desired result. i have remote web server, let has name mysuperdomain.com . have ftp access , if required can ssh access. i have web site/application on remote server, nothing magic. simple location /var/www/mysuperdomain/public/ . have common web file formats here js, php , html, css... simple web page. interested in editing , debugging project remotely. so want create project on local machine, configure access remote server directory project /var/www/mysuperdomain/public/project , files there, can edit them , changes saved , synchronized remote server. i have used ssh access open files in sublimetext edit them, , each time pressed ctrl+s changes have been affected remote server files. need same in phpstorm + debugging (variables values, breakpoints..) i have tried follow official tutorials, still cannot ...

boot2docker - Is it possible to run docker client in window server as done in Windows 7? -

presently possible run docker client in window server2008 or 2012 in similar line done in windows 7 , 8 ? know have been working on window container hyper v container supposed release in next version in 2016. there way use docker client in directly presently ? yes, if can install virtualbox on windows server, can run docker client (through boot2docker , tiny core os). since windows server 2008 supported host server , installation of boot2docker should possible. see how docker run on windows system behind corporate firewall? .

EXCEL:delete b1 if a1 font color is red -

if a1 written in red color , delete content of cell b1 if a2 written in red color , delete content of cell b2 if a3 written in red color , delete content of cell b3 if a4 written in red color , delete content of cell b4 if a5 written in red color , delete content of cell b5 , on ...please help something like: sub betterredthan() dim rng range, r range each r in intersect(range("a:a"), activesheet.usedrange) if r.font.color = vbred r.offset(0, 1).clear end if next r end sub

javascript - Hiding part of div element -

i having div element populated on button click, looks this. http://localhost:8080/sample?q1=asd&q2=ads i want hide particular query parameter (say q1 here). how do ? i want solution in eithre js/jquery/html. edit: more clear, how div element looks, <div> <pre> "curl -x --header accept: application/json" "http://localhost:8080/sample?q1=asd&q2=ads" </pre> <div> sure, can change address displayed whatever want js: history.replacestate(null, null, "/whatever url"); you can try modifying location.search , refreshes page.

c++ - Getting segmentation fault *sometimes* from an attempt at a selection sort implementation -

i've attempted debug on own, can't figure out! i'm getting segmentation faults when running code, when there's not seg fault runs fine , works. guidance appreciated, thanks! also, please keep in mind i'm new c++. here's have far: #include <iostream> #include <vector> using namespace std; vector<int> selection_sort(vector<int> numbers) { int lowest_number_index; int lowest_number; int starting_size = numbers.size(); vector<int> sorted_numbers; (int = 0; < numbers.size(); ++i) { // find lowest number if (numbers[i] <= lowest_number) { lowest_number_index = i; lowest_number = numbers[lowest_number_index]; } // found it! let's add other array // , remove one. if (i == numbers.size() - 1 && numbers.size() != 1) { sorted_numbers.push_back(lowest_number); numbers.erase(numbers.begin() + lowest_nu...

android - Moving hotspots i.e View over scaled & panned Image. -

i have been working on panning image in container using touchimageview. trying achieve want translate other view respect amount of panning i.e translation made. below action_move event when user makes pan event. case motionevent.action_move: if (state == state.drag) { float deltax = curr.x - last.x; float deltay = curr.y - last.y; float fixtransx = getfixdragtrans(deltax, viewwidth, getimagewidth()); float fixtransy = getfixdragtrans(deltay, viewheight, getimageheight()); matrix.posttranslate(fixtransx, fixtransy); fixtrans(); // function callbacks. // want restrict callback if translation values matrix 0 after scaling / zooming // still gives values > 0 if trying pan. moveviewswithsamedistance(fixt...

java - How to check if a BigInteger is null -

i have code may assign null biginteger. need check if null or not. i've tried following things, , not work: == check reference, not value. biginteger x = biginteger.one; if(x== null) { system.out.println( x ); } output of above prints x. (somehow boolean condition satisfied, though x not null). following gives nullpointerexception upon comparing biginteger x = biginteger.one; biginteger mynull = null; if(x.compareto(mynull) == 0 ) { system.out.println( x ); } another npe: biginteger x = biginteger.one; if(x.compareto(null) == 0) { system.out.println( x ); } how check if biginteger null properly? there difference between null reference , object value 0. check null references, use: biginteger value = getvalue(); if (value != null) { // } to check value 0, use: biginteger value = getvalue(); if (!biginteger.zero.equals(value)) { // } to ensure object neither null reference nor has value 0, combine both: biginteger valu...

android - action bar compact height changes when searchitem expand -

Image
i have list fragment in baseactivity , want implement search functionality. action bar compact height changes while click on search item button see below screenshot menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com.android.bypeople.uber.baseactivity" > <item android:id="@+id/action_add" android:icon="@drawable/btn_profile_selector" android:orderincategory="100" android:title="@string/action_add" android:visible="false" app:showasaction="always"/> <item android:id="@+id/action_search" android:icon="@android:drawable/ic_menu_search" android:title="@string/action_search" android:visible="false" app:actionviewclass="android.support.v7...

How can I embed plotly graphs into powerpoints or apple's keynote? -

i learning how generate graphs plotly. biochemistry graduate student. use these graphs presentations (e.g. powerpoint, keynote). wondering if please give me general strategy or link tutorial. thank you! plotly has ms office app allows embedding in powerpoint on windows computers: https://store.office.com/plotly-charts-wa104379485.aspx?assetid=wa104379485 keynote not allow iframes, plotly graphs can't embedded in keynote. slides.com allow iframes , works plotly graphs: http://slides.com/jackparmer/deck-3#/

twitter bootstrap - daterangepicker - set only one date range (from/to) -

using daterangepicker i'm trying found solution as: 00/00/0000 - 26/06/2014 or 26/06/2014 - 00/00/0000 i can't add 0 or checkbox set date 'unlimited' or end of date. how set date on 1 (from or to)? found lazy solution due lack of functionality , submit github add feature unlimited daterange: $('#dpdiv').daterangepicker({ 'applyclass' : 'btn-sm btn-success', 'cancelclass' : 'btn-sm btn-default', format: 'l', showdropdowns: true, showweeknumbers: true, singledatepicker: false }, function(start, end, label) { // not used }) .prev().on(ace.click_event, function(){ $(this).next().focus(); }); $("body .daterangepicker .ranges .range_inputs button").first().before('<div><a href="#" id="d...

Deserialize JSON in Java by inferring/embedding object type -

i serializing map<string, object> json using jackson. later when deserialize it, objects not of primitive type converted linkedhashmap 's instead of class belonged to. is there way deserialize json map nested objects of correct type? use constructcollectiontype of typefactory arraylist collectionclass & pojo class second argument , read "list" value using objectmapper. this: list<t> list; objectmapper om = new objectmapper(); typefactory t = typefactory.defaultinstance(); list = om.readvalue(json, t.constructcollectiontype(arraylist.class,pojo_clazz)); hope helps!

c# - Set database schema name without setting table name -

i want set database schema name table, way using method totable : modelbuilder.entity<myentity>().totable("mytable", schemaname); however don't want set table name explicitly, need this: modelbuilder.entity<myentity>().toschema(schemaname); can me it? using extension method: using system.data.entity.modelconfiguration; public static class modelconfigurationhelper { public static entitytypeconfiguration<t> toschema<t>(this entitytypeconfiguration<t> config, string schema) { return config.totable(typeof(t).name, schema); } } you can do: protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.entity<myentity>().toschema("someschema); }

ios - More efficient way to retrieve Firebase Data? -

Image
i have hierarchical set of data want retrieve information firebase. below how data looks: however, issue this: upon looking @ how data structured, when want grab name or object id of attendee , have perform following code: func getattendees(child: nsstring, completion: (result: bool, name: string?, objectid: string?) -> void){ var attendeesreference = self.eventsreference.childbyappendingpath((child string) + "/attendees") attendeesreference.observeeventtype(feventtype.childadded, withblock: { (snapshot) -> void in //get name/object id of attendee 1 one--inefficient? let name = snapshot.value.objectforkey("name") as? string let objectid = snapshot.value.objectforkey("objectid") as? string if snapshot != nil { println("name: \(name) object id: \(objectid)") completion(result: true, name: name, objectid: objectid) } }) { (error) -> void in ...