Posts

Showing posts from March, 2014

java - Check Folder exist on Google Drive -

i searched lot still did not direct solution can let me know how check existence of folder @ google drive? went through google drive android api - check if folder exists while using found error of folderid not initialised. can suggest solution it. other way, if refer basedemoactivity class, there existing folder id, or if know how obtain google drive folder id, solve problem. manually have solution file folder id, need java.

linux - Reach router admin page inside TOR (raspberry pi) -

i have pi 0 programmed wireless accespoint ( https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point ). wlan0 delegates ips computers via hostapd , wlan1 connected wireless. routed on tor. have admin page ( https://github.com/billz/raspap-webgui ) on adress 10.3.141.1. im trying reach can't, guess because traffic goes trough tor. i want able connect wlan0 (ssid=tor_test) , able access admin page directly. current iptables: iptables -t nat -a prerouting -i wlan0 -p tcp --dport 22 -j redirect --to-ports 22 iptables -t nat -a prerouting -i wlan0 -p udp --dport 53 -j redirect --to-ports 53 iptables -t nat -a prerouting -i wlan0 -p tcp --syn -j redirect --to-ports 9040 iptables -t nat -a postrouting -o wlan1 -j masquerade iptables -a forward -i wlan1 -o wlan0 -m state --state related,established -j accept iptables -a forward -i wlan0 -o wlan1 -j accept if exclude row iptables -t nat -a prerouting -i wlan0 -p tcp --syn -j redirect --to-ports 9040 it st...

Regex/bash find string with most recent date? -

for personal backup scheme, have set of folders names in pattern (something)_(day)(month)(year)_t(hour)(minute)(second) . here's sample: 01.hourly_02102016_t171011 00.daily_27092016_t102203 00.weekly_17032015_t050600 i want select list folder recent time in name. how in bash script? perhaps, shortest command: ls -1 | sort -t_ -k2.5nr,2 -k2.3nr,2 -k2.1nr,2 -k3r it sorts years, months, , days, in order. -t option specifies field separator column numbers used in -k option values. the -kx.ynr,2 options stand sorting column x , character number y in reverse ( r ) numeric order ( n ); stop sorting @ column 2 (the last character after comma). -k2.5 ··············v 00.weekly_17032015_t050600 ^^^^^^^^ column 2 the last -k3r sorts third column in reverse order. the recent @ top of list. can select appending | head -1 end of command.

android - Scroll Child Recycler view along with parent scroll view -

app hierarchy follows: tab1/tab2/tab3/tab4 (tab views viewpagers) tab1 has tab layout view pagers i.e., tab1--> subtab1,subtab2,subtab3(tab views viewpagers) in tab1 have scrollview , in subtab1 have recyclerview.. when scroll tab tab1 tab1 scrolls till action bar , subtab's action bar stop below first action bar , see contents of recycler view need scroll again... not want happen... want subtab's recyclerview scroll continuously along parent scroll view in tab1 when swipe tab1... here xml main tab layout <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content"...

C# don't understand calling methods. object oriented programming -

i've started object oriented programming , don't quite understand how call method. wanted calculate percentage increase , put out resulting overall price. done calling method working out returning value other method. i'm unsure how cross on between methods. could please explain how i'm meant this? preferably not giving answer can understand what's happening. p.s. piece of code in class called retailpricing . i've copied , pasted it, doesn't it's formatted (i understand how call class main program) namespace week7exercise2 { class retailpricing { public void calculateretailprice() { double inputcost; double inputpercent; string inputitemcost; string inputmarkup; console.write("please input cost of item: "); inputitemcost = console.readline(); inputcost = double.parse(inputitemcost); console.write("please input ...

json - PHP Fatal error: Call to undefined function json_decode() in Xampp -

i'm using xampp run php file using brackets. got error: php fatal error: call undefined function json_decode() in xampp i don't know if related checked php info file , there no disabled files. in json section says support enabled, json version 1.4.0. in ini file searched json couldn't find anything. how can resolve error? if on ubuntu use following command in command line shell sudo apt-get install php5-json if on windows, edit php.ini , enable json extension.

reload - Web App in Flaky Internet connection -

have php/mysql/js-jquery based web site records finish times racers, sends time server. server inserts finish time in db, calculates finish place based on handicapping formula. stores , send finish place web page , updated on screen. uses jquery ajax calls page doesn't reloaded @ all. works fine if data connection good. if data connection bad first version of page put message connection bad. trying make bit smarter, have started html5 feature tells browser if on or offline(i realize may not best way yet works concept testing) when new finish time recorded(or updated) , offline js adds class of notsent tag of finish time. finish place , of finish places come sever greyed out indicating data no longer valid(until can communicate server). when browser finds online, simple jquery each loop on each notsent class starts re-sending ajax requests , if completed processes return finish place information , display date. it disables external links on page when browser offline. ke...

Can I have a field be writable for validation, but not get passed to the model save in django rest framework? -

currently i'm doing this: class surveyresponseserializer(serializers.modelserializer): repeat_email = serializers.charfield() def create(self, validated_data): validated_data.pop('repeat_email') return super(surveyresponseserializer, self).create(validated_data) is there nicer way fix this? don't want keep growing create every field.

javascript - Using HTML Tags received from Api call in AngularJS -

i receive element rest api. follows: " hyderabad adventure & trekker's club (hat's) " the above written bold text b tags. it coming is(with b tags written separately) want content under tag should bold in html , there line break. try work : var app = angular.module('myapp',[]); app.controller('examplecontroller', ['$scope','$sce', function($scope,$sce) { $scope.myhtml = $sce.trustashtml("<b>hyderabad adventure & trekker's club (hat's)</b>"); }]); <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script> <div ng-app="myapp"> <div ng-controller="examplecontroller"> <span ng-bind-html="myhtml"></span> </div> </div>

r - Dynamic and conditional inserting of new rows that come after a certain Date -

following data frames like(thanks nice edits experienced community): library(data.table) df <- fread('account date blue red amount 1/1/2016 1 0 100 2/1/2016 1 1 200 b 1/10/2016 0 1 300 b 2/10/2016 1 1 400') df[, date := as.date(date, format="%m/%d/%y")] blue <- fread('date amount 6/1/2015 55 1/31/2016 55 2/28/2016 65 3/31/2016 75') blue[, date := as.date(date, format="%m/%d/%y")] red <- fread('date amount 12/31/2015 43 1/15/2016 47 2/15/2016 67 3/15/2016 77') red[, date := as.date(date, format="%m/%d/%y")] in primary dataframe df , blue , red fields depict category account ...

AngularJS $http POST to PHP not working -

Image
i attempting post data server using angular $http , having no success. have 2 issues: 1) form nothing when button clicked. no post request sent. when add action="include/index.php" form element, post request sent, page redirects php script , displays response. have tried setting action="" . i have attempted removing ng-submit form , added ng-click on submit button no success. have confirmed data correctly binding controller. 2) php not able read post data. when using action="include/index.php" on form , entering valid data, php returns validation errors. seems php not able access data properly. i've added json_decode(file_get_contents('php://input')); php script. have tried changing request content type 'application/x-www-form-urlencoded' . have using jquery's .param on form data in controller. http post using angular.js angular http post php , undefined i realize question has been asked before, none...

c# - Automated User Interface Testing with Visual Studio Team Services -

i working on wpf application , wanted try continuous integration workflow visual studio team services. is possible use teststack.white library automated ui tests in cloud visual studio team services? you need host own build agent . hosted build agents visual studio team services uses cannot run in interactive mode , required white run , interact application. from visualstudio.com : q: need run build service in interactive mode (not service)? a: no. can use hosted pool.

java - The entity has no primary key attribute defined -

i'm new jpa , have been struggling error time now. eclipse "saying" entity not have primary key defined, read bunch of tutorials , way it. example: https://en.wikibooks.org/wiki/java_persistence/identity_and_sequencing#example_embedded_id_xml <?xml version="1.0" encoding="utf-8" ?> <entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"> <entity name="befriendableuser" class="com.projects.socialconnections.befriendableuser.befriendableuser" access="field"> <embedded-id class="com.projects.socialconnections.befriendableuser.befriendableuserid"/> </entity> <embeddable name="befriendableuserid" class="com...

javascript - Prevent random particles to appear where unnecessary scrollbars are triggered -

how prevent random particles appear unnecessary scrollbars triggered? background element can't fixed-sized. think solution show particles on visible part of viewport , leave margin of few pixels, don't know how it. // https://github.com/maxspeicher/jquery-sparkle (function($, window, document) { const defaults = { fill: "#fff", stroke: "#000", size: 20, delay: 0, duration: 1500, pause: 1000 }; const optionskeys = ["fill", "stroke", "size", "delay", "duration", "pause"]; const optionsstrtoobj = function(optionsstr) { const optionsarr = !!optionsstr ? optionsstr.split(" ") : []; var optionsobj = {}; (var i=0; i<optionsarr.length; ++i) { optionsobj[optionskeys[i]] = optionsarr[i]; } return optionsobj; }; $.fn.sparkle = function(options) { $.destroysparkle = $.destroyspark...

Is it possible to define a bottom class in a sublattice of Scala's type hierarchy? -

say have abstract class a . want define final class abot such class b extends a (except nothing ), abot subclass of b . it's nothing , respect hierarchy a top. answer no . a class not subtype of x unless explicitly extend x. scala.nothing exception because scala compiler magic you.

Difference between comments in python # and """ -

starting program in python, see scripts comments using # , """ comments """ find out difference between these 2 ways comment. best thing read https://www.python.org/dev/peps/pep-0008/ , since longish, here 3 liner: comments start # , not part of code. string (delimited """ """) called docstring , used on special places defined purposes (briefely: first thing in module or function describing module or function) , accessible in code (so part of program, not comment).

excel - Quickest formula method to create a list without duplicates -

i have list of entries using formula want clean duplicate values. efficient , quickest formula way that? in rows have number+text (few letters) my column like: aa3 aa6 aa25 aa45 i prefer extract use of 1 formula only assuming entries in a1:a10 , first go name manager ( formulas tab) , define: name : arry1 refers to : =row($a$1:$a$10)-min(row($a$1:$a$10))+1 then enter array formula** , used count expected number of returns, in b1 : =sum(if(frequency(match(a1:a10,a1:a10,0),arry1),1)) then enter array formula** in c1 : =if(rows($1:1)>b$1,"",index(a$1:a$10,small(if(frequency(match(a$1:a$10,a$1:a$10,0),arry1),arry1),rows($1:1)))) and copy down until start blanks. **array formulas not entered in same way 'standard' formulas. instead of pressing enter, first hold down ctrl , shift, , press enter. if you've done correctly, you'll notice excel puts curly brackets {} around formula (though not attempt manually insert these your...

python - Django Rest Docs Show Wrong Urls -

Image
i'm using django rest docs describe api built in django rest framework, urls it's displaying incorrect. specifically, prepend /admin/ everything: these paths should /session-auth/, /session/, etc. don't know why /admin/ being preprended. here's urls.py file: # urls serving static media , user uploaded media urlpatterns = patterns('', (r'^static/(?p<path>.*)$', 'django.views.static.serve',{'document_root': settings.static_url, 'show_indexes': true}), ) + static(settings.static_url, document_root=settings.static_root) urlpatterns += patterns('myapp.views', #home page (r'^$', 'home'), url(r'^docs/', include('rest_framework_docs.urls')), # refresh locations (r'^admin/refresh-all-locations/$', 'refresh_all_locations'), # admin locations page (r'^admin/all-locations/$', admin.site.admin_view(all_locations)), # admin ...

css - Font Awesome: Fa Bars - Border Radius -

i'm trying remove border radius of fa-bars , can't. that's code: <i class="fa fa-bars fa-2x"></i> .fa-bars { border-radius: 0px !important; } thanks! as mentioned in comment, that's not possible, since how icon looks , nothing border-radius . use how looks, or alternative may take material icons. there's icon looking how want like. see here .

Trouble with pointers In C. Segmentation fault -

i'm having trouble project university consists in simulating shell. user types command , program divides line in tokens , checks if 1 of them internal command, such cd, export, jobs , source. prints tokens , basic explanation of command has been found in line. when run on codeblocks works fine, when compile on netbeans in linux, reports several warnings, explain in code , when run message appears: segmentation fault (core dumped). i've been researching , i've found has memory permissions (accessing part of memory not allowed access). can't find way solve it, hope here can me. thanks! #include <stdio.h> #include <stdlib.h> #define prompt "$" int parse_args(char **args, char *line){ char *token; int n=0; token=strtok(line," "); // warning: assignment makes pointer integer without cast while(token!=null){ printf("token%i: %s\n",n,token); *args=token; n++; *args++; token...

javascript - Get iframe URL with php or js in ajax mvc -

i started learn php , js 2 weeks ago , trying familiar writing simple comment system in pure php/js without libraries (no jquery/laravel, etc.) how things works. sorry dumb question. i stucked following issue. need url of page calling php app via iframe. mvc app , iframe includes index.php file. it works fine with $_server['http_referer'] , when run same php script ajax request index.php url (and not url need). i tired url js document.getelementbyid("iframe_id").contentwindow.location.href window.location.href but fails well. suppose issue js executes php base file i.e. index.php , pure php request starts on page loading iframe correct url. the way see @ moment executing script on load write url dom/file/db/json grab data work on ajax requests , delete data, complex h**l. maybe there better solutions?

python - Error while saving base64 encoded image to the filesystem -

i have tried follow example save base64 encoded image receive in http request, filesystem: imgdata = re.sub('^data:image/.+;base64,', '', inner_data['output']['image']) open("imagetosave.png", "wb") fh: fh.write(base64.decodestring(imgdata)) i have printed string i'm trying decode , seems correct. /9j/4aaqskzjrgabaqaaaqabaad/ [...] /+bax2njpq8daytvirzp7uqbbmgrveg6spf1qyk0bcnkzuf/z but keep getting error typeerror: expected bytes-like object, not str the base64.decodestring() function expects bytes , not str object. you'll need encode base64 string bytes first. since characters in such string ascii characters, use codec: fh.write(base64.decodestring(imgdata.encode('ascii'))) from base64.decodestring() documentation : decode bytes -like object s , must contain 1 or more lines of base64 encoded data, , return decoded bytes .

How to protect the text in android? -

i writing story , dont want else copy work. first in textview ,i relized when extract apk file, xml files editable notebook. tried show in code after while found out apk files decodeable tried show them in pdf password needs external app adobe reader or office open pdf file. after while found out pdf not working because of compresed apk. used progaurd text still there after decoding think not working because text in persian language. dont know do.

"Argument of length zero" in R -

i have data , dont know how make plot it, wirte script change form and here result of dput(head(e1)): structure(list(lon = c(-26.583, -26.25, -26.417, -67.25, -67.25, -67.417), lat = c(-59.083, -58.417, -58.417, -55.917, -55.75, -55.75), pre1 = c(105.4, 106.3, 106.6, 73.1, 68.7, 70.2)), .names = c("lon", "lat", "pre1"), row.names = c(na, 6l), class = "data.frame") the first column longitude , second 1 latitude, third 1 precipitation value of point. want make map data, dont know how deal format, want change 3 matrix: 1 longitude,one latitude, 1 precipitation, , can use function image.plot(lon,lat,pre1) make map of precipitation. this script: rerange<-function(e1) { latq<-sort(e1$lat,decreasing = t) latq<-as.matrix(latq) latq1<-unique.matrix(latq) lonq<-sort(e1$lon) lonq<-as.matrix(lonq) lonq1<-unique.matrix(lonq) lenlon<-length(lonq1) lenlat<-length(latq1) finalq<-matrix(0,lenlon,lenlat) (i in 1:lenla...

ios - Sending an on-the-fly created QR Code UIImage by AirDrop fails -

i creating qr code on fly , storing uiimage. want able send using uiactivityviewcontroller somehow fails: func generateqrcode(from string: string) -> uiimage? { let data = string.data(using: string.encoding.ascii) if let filter = cifilter(name: "ciqrcodegenerator") { filter.setvalue(data, forkey: "inputmessage") let transform = cgaffinetransform(scalex: 3, y: 3) if let output = filter.outputimage?.applying(transform) { return uiimage(ciimage: output) } } return nil } and calling function , store uiimage: let image = generateqrcode(from: "create code") imgqrcode.image = image the export button uses following action: @ibaction func sharebuttonclicked(sender: uibutton) { let objectstoshare = [imgqrcode.image!] [anyobject] let activityvc = uiactivityviewcontroller(activityitems: objectstoshare, applicationactivities: nil) activityvc.popoverpresentationcont...

How to use a string content as a variable name in a SSIS C# script -

hello , time , answers in advanced. let me give context first: i'm working in bank in metrics project. re-engineering etl processes , microstrategy dashboards of commerce sector, use lot of non data sources , have map info centralized sources in sql server 2008r2 servers. etl using ssis . i have etl loans. inside data flow gather information need loans, 1 particular table got conditions needs tested classify loan. conditions table has form: sk_condition_name: varchar sk_whatever: ... ... where_clause: varchar(900) in "where_clause" column have clause (duh!) test columns loan this: loan_type = x , client_tipe = y , loan_rate = z before deeper in this, need example i'm giving loans, same goes products bank sell, insurance or investment funds... and conditions classify product can change in time . and 1 specific loan can classified in multiple ways at same time , each positive clasification writes row in specific table, that's why need asynchronous ...

javascript - How to get data using fetch API with mode 'no-cors'? -

code looks this, not sure how read response data. idea?. var url = 'http://www.bbc.co.uk/sport/football'; fetch(url, { mode : 'no-cors' }).then(function(response) { console.log(response); }); response object you can't. if origin doesn't support cors, can't response data directly. that's whole point of no-cors ... allowing use response in ways, not read/access data.

embedded - C++ Arduino 1.6 on Visual Studio 2013 -

i'm working on arduino, , wanna build small toy piano. practice create own class called map. #ifndef map_h #define map_h #include "arduino.h" template <class key, class value> class map { public: map(); ~map(); void add(key key, value value); value find(key key); private: key *keys; value *values; int size; bool resize(); }; #endif in main call normally: map<char, int> *name_to_freq = new map<char, int>(); name_to_freq->add('c', 262); but got error when compile. ccqwtg4w.ltrans0.ltrans.o*: in function main ccqwtg4w.ltrans0.o*: (.text.startup+0x354): undefined reference map<char, int>::map() ccqwtg4w.ltrans0.o*: (.text.startup+0x3de): undefined reference map<char, int>::add(char, int) definition in .cpp file: does 1 see before , know how solve it? template <typename key, typename value> map<key, value>::map() { keys = new key[defaultarraysize]; values = new va...

shell - List files with extention matching conditions -

i trying list .mp4 files start d , length of filename should minimum of 5 in single command. dont know how add length requirement command. have far: ls [d]* | *.mp4 this it: ls d????*.mp4 ? matches single character; * matches 0 or more of character. d???? means "a string starting d , 4 more characters". encodes length requirement.

java - How to change the value of a user within an array list whilst using an if statement? -

so stuck on 1 final part of assignment, have created 2 array lists. 1 array list lists users within user group , other lists administrators within user group. have been asked change value of last administrator within second array list , set usertype user instead of administrator. i've tried using if statement i'm not sure on how structure it. post have tried date: mian class package test; public class main{ public static void main(string[] args) { usergroup2 usergroupobject2 = new usergroup2(); //once method complete, should called here. } } } usergroup2 class package main; import java.util.arraylist; import java.util.iterator; public class usergroup2 { private arraylist<user> administrators = new arraylist<>(); public usergroup2() { adduser(new user("hpf1g17", "admin", "harry")); adduser(new user("bdh1285", "admin...

Algorithm design, implement an algorithm for a directed graph -

i found interesting question related algorithm design, wasn't able solve properly. given directed graph g = (v,e), uses adjancency lists, , integer k < |v|, implement linear-time-complexity algorithm ( o(n) ) , check if graph g has @ least k vertexes same indegree number. suppose n == |v| + |e| it enough pass through edges, or through edge in-nodes, , maintain number of vertices possible indegrees. sketch of method in pyhon style: def check(graph, k): # each vertex count indegree indegrees = [0] * graph.number_of_nodes() # 'maps' number of vertices indegree num_with_indegree = [graph.number_of_nodes()] + [0] * (graph.number_of_nodes()-2) # pass through edge innodes. # iteration easy implement adjancency list graph implementation. in_node in graph.in_nodes(): # increase indegree node indegrees[in_node] += 1 # 'move' vertex it's indegree bucket indegree = indegrees[in_node] num_with_indegree[indegree...

javascript - How to print json object property values? -

i have json object this: jsonquery = ​'{ "from": 0, "size": 200, "sort": [{ "modified": { "order": "desc" } }], "query": { "bool": { "must": [{ "term": { "collectionid": { "value": "abcd" } } }, { "terms": { "container": ["en-us"] } }], "must_not": [{ "wildcard": { "_type": { "value": "@@" } } }, { "bool": { "filter": { "exists"...

java - JavaFX: Making an Object with a Shape and Text -

Image
i trying make object can added pane. object contain shape , text. through invoking: pane#getchildren()#add(new textellipse(...)) it add ellipse text in center referenced pane. my class such object represented below: public class textellipse extends shapeellipse { public textellipse(final string text, final double x, final double y) { super(text, x, y); } @override protected shape createshape() { final double padding = 10; final ellipse ellipse = new ellipse(); ellipse.setradiusx(gettext().getlayoutbounds().getwidth() / 2 + padding); ellipse.setradiusy(10); ellipse.setstroke(color.black); ellipse.setfill(color.white); return ellipse; } } public abstract class textshape extends pane { private final text text; private final shape shape; public textshape(final string text, final double x, final double y) { this.text = new text(x, y, text); shape...

c# - How to remove Home from HomeController in Mvc -

i have homecontroller , has many actions in it. users visit actions without typing home. here route below routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } ); i users not enter controller name, home in case. how can that? or mandatory? you can add custom route before defult route this: routes.maproute( "onlyaction", "{action}", new { controller = "home", action = "index" } ); routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } );

Assigning variables with dynamic names in Java -

i'd assign set of variables in java follows: int n1,n2,n3; for(int i=1;i<4;i++) { n<i> = 5; } how can achieve in java? this not how things in java. there no dynamic variables in java. java variables have declared in source code (*). period. depending on trying achieve, should use array, list or map ; e.g. int n[] = new int[3]; (int = 0; < 3; i++) { n[i] = 5; } list<integer> n = new arraylist<integer>(); (int = 1; < 4; i++) { n.add(5); } map<string, integer> n = new hashmap<string, integer>(); (int = 1; < 4; i++) { n.put("n" + i, 5); } it possible use reflection dynamically refer to variables have been declared in source code. however, only works variables class members (i.e. static , instance fields). doesn't work local variables. see @fyr's "quick , dirty" example. however doing kind of thing unnecessarily in java bad idea. inefficient, code more complicated...

How to Connect Python to Spark Session and Keep RDDs Alive -

how small python script hook existing instance of spark , operations on existing rdds? i'm in stages of working spark on windows 10, trying scripts on "local" instance. i'm working latest stable build of spark (spark 2.0.1 hadoop 2.7). i've installed , set environment variables hadoop 2.7.3. i'm experimenting both pyspark shell , visual studio 2015 community python. i'm trying build large engine, on i'll run individual scripts load, massage, format, , access data. i'm sure there's normal way that; isn't point of spark? anyway, here's experience have far. expected. when build small spark script in python , run using visual studio, script runs, job, , exits. in process of exiting, exits spark context using. so had following thought: if started persistent spark context in pyspark , set sparkconf , sparkcontext in each python script connect spark context? so, looking online defaults pyspark, tried following: conf = sparkconf()...

How to import Projects from Git by ssh in Eclipse -

my github ssh uri is: git@github.com:hellozjf/hellozjf.github.io.git this eclipse configuation the question is: how can import projects uri git@github.com:hellozjf/hellozjf.github.io.git ? want use username , password, uri changed . press next error happen. an error occurred when tyring contact hellozjf@github.com:hellozjf/hellozjf.github.io.git. see error log more details possible reasons: * incorrect url * no network connection (e.g. wrong proxy settings) howerver, can use cmd git clone git@github.com:hellozjf/hellozjf.github.io.git without error. can give me tips how import project git ssh in eclipse?

Saving array of data to Firebase with Javascript/NodeJs -

i need save data database @ index. tried pulling data down with var people = []; ref.once('value', function(snapshot) { snapshot.foreach(function(childsnapshot) { var id = childsnapshot.key; childsnapshot.foreach(function(lastsnapshot) { var qr = lastsnapshot.val(); people.push({[id]: qr}); return true; }); }); my firebase structure: people: { jake: "231", jessica: "412", rachel: "112" } then splice list , add @ index: index = 1; // add person after jessica people.splice(index, 0, person); i want sync firebase set , update don't allow format this. how can this? thanks!

Facebook doesn't pull image preview, title, etc. when sharing a link from domain -

i'm having issue boggling mind few days now. sharing of exact same content not working on www.raptorsrepublic.com fine on forums.raptorsrepublic.com (or other domain). i can't share (i.e., generate previews, title, etc.) links www.raptorsrepublic.com, when post exact same content different domain (as test, forums.raptorsrepublic.com), works. even graph debug tool crashes on link www.raptorsrepublic.com, works fine forums.raptorsrepublic.com. here's example: http://forums.raptorsrepublic.com/y.html http://www.raptorsrepublic.com/y.html exact same content, 1 works (forums.raptorsrepublic.com) , 1 doesn't (www.raptorsrepublic.com) , latter crashes facebook's share debug tool. can please me in getting working can share links domain www.raptorsrepublic.com? note domain not blacklisted can post link fine.

ios - Swift AppDelegate crashed -

whenever import firebase , firapp.configure() in appdelegate , crashes app. moreover, crashes class appdelegate: uiresponder, uiapplicationdelegate (thread 1: signal sigabrt) , reports this: libc++abi.dylib: terminating uncaught exception of type nsexception (lldb). i haven't worked storyboards. could please me fix crash? check whether have copied googleservice-info.plist project. also try enabling keychain sharing under capabilities in xcode.

Laravel 5.2 : Undefined Variable in WhereHas -

i undefined variable $jenis_mobil on $q->where('name', $jenis_mobil->name) $jenis_mobil = car_class::find($request->jenis_mobil); $dari_kota = city::find($request->dari_kota); $vehicles = vehicle::wherehas('car', function($q){ $q->wherehas('car_class', function($q){ $q->where('name', $jenis_mobil->name); }); }) ->wherehas('partner', function($q) { $q->wherehas('kota_pool', function($q){ $q->where('name', $dari_kota->name); }); }) ->where('year', $request->tahun_mobil) ->get(); is wrong code? think because $jenis_mobil not passed wherehas you should use use() pass variables closures: $vehicles = vehicle::wherehas('car', function($q) use($jenis_mobil) { $q->wherehas('car_class', function($q) use($jenis_mobil) { $q->where('...

java - How to create new instance dynamically? -

i want store car details sharedpreference. , there more 1 group of data. create new sharedpreference instance when car number not exist. so instance's name can't same previous one. have no idea create new instance of sharedpreference dynamically. @override public void onclick(view view) { switch (view.getid()){ case r.id.search_btn: responsetext.settext(""); mlist = new arraylist<sharedpreferences>(); string isnum = textnum.gettext().tostring(); iterator iterator = mlist.iterator(); while (iterator.hasnext()){ if((iterator.next().tostring()).equals(isnum)){ log.i("information","exist!"); break; }else { sharedpreferences pref = getsharedpreferences("data", mode_private); mlist.add(pref); sharedpreferences.editor editor = ...

uml - Why is it said "Collaboration" realizes "Use case" rather than vice versa? -

Image
i studying uml. have confusion realization , collaboration. consider diagram (i hope diagram correct) "make call" collaboration. "connect destination" use case. according book , various resources, read "make call" realizes "connect destination". but far understand, collaboration logical concept use group repetitive pattern(as in design patterns). use cases(which have own diagrams) ones implement them (indirectly, use cases have related class diagram. classes must implementing them). so shouldn't "use cases" realize "collaboration"? what getting wrong here? the source of confusion java, have interfaces, , classes implement them. class implements interface. isn't realization same implementation? what adds confusion collaboration diagram, seems have nothing collaboration. because first have use case. tells added value of system is. , there's story how value achieved. start thinking ho...

PHP not being able to pick data from HTML form -

my php page unable pick values html form. it's sending blank strings database. here html , php code. please find error. new php, unable solve problem. my html page: <!doctype html> <html > <head> <meta charset="utf-8"> <title>login</title> <link rel="stylesheet" href="css/reset.css"> <link rel='stylesheet prefetch' href='http://fonts.googleapis.com/css?family=roboto:400,100,300,500,700,900|robotodraft:400,100,300,500,700,900'> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css"> </head> <body> <!-- mixins--> <!-- pen title--> <div class="pen-title"> <h1>synchphony</h1> </d...

bash - select: accept an unlisted, char input -

i'm using bash select make multiple choice dialog in option numbers adjust automatically when add new selection between 2 existing ones. select choice in command1 command2 command3; $choice break done to display different command executed in itself, i've been told declare associative array declare -a choices=( [option 1]=command1 [option 2]=command2 [option 3]=command3 ) select choice in "${!choices[@]}" exit ; [[ $choice == exit ]] && break ${choices[$choice]} done the thing don't way, option exit viewed numbered selection. i'd want achieve like ps3="select desired option (q quit): " and make select accept q , besides 1 , 2 or 3 , valid input. the associative array causes problems fact input used index, switched nested case . way, not have declare separate functions store more 1 command ps3="select desired option (q quit): " select choice in "option 1" "option 2...

django - Cannot get models thats referencing another model aas foriegn key -

what want userimages use particular foriegnkey i'm doing user.objects.get(pk=1).profile.friends.all().values_list('userimages') but get. find strange uservideo model similar userimages , yet userimages cannot resolved. fielderror: cannot resolve keyword 'userimages' field. choices are: about_me, display_image, friends, id, nick_name, owner, owner_id, user, user_id, uservideo models class userimages(models.model): owner = models.foreignkey('auth.user', related_name='userimages') user=models.foreignkey(profile,related_name="profile_owner") # highlighted = models.textfield(default=none,blank=true,null=true) image=models.imagefield() pub_date=models.datetimefield(default=now) class uservideo(models.model): owner = models.foreignkey('auth.user', related_name='uservideo') # highlighted = models.textfield(default=none,blank=true,null=true) user=models.foreignkey(profile) image=models.filefield() pub_date=models.d...

npm - How to use a package script under a different platform? -

i have have line package.json "scripts": { "default_linux": "export node_env=default&& export node_minified=false&& webpack", "default_windows": "set node_env=default&& set node_minified=false&& webpack", "default_linux_min": "export node_env=default&& export node_minified=true&& webpack", "default_windows_min": "set node_env=default&& set node_minified=true&& webpack", }, but run not nice think each version separately , correctly configure scripts different platforms make team, not ..? $ npm run default_linux # frontend assembly under linux you can use cross-env package on npm. allows use unix style scripts, , handles cross-platform issues. works linux , windows, haven't tested mac. also, there's no need export . after install cross-env, can replace scripts field this: "scripts": { ...