Posts

Showing posts from April, 2010

Android Second activity does not load -

sorry english. i'm trying use second activity in android, doesn't load. it's code jump it. below, can see code. thanks. 1- first activity public class mainactivity extends activity { button button; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); addlisteneronbutton(); public void addlisteneronbutton() { final context context = this; button = (button) findviewbyid(r.id.btenviardados); button.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { system.out.println("helooo"); intent intent = new intent(mainactivity.this, com.example.seven.reader.activity_janela1.class); startactivity(intent); system.out.println("ebadasdadas"); } }); } 2- second activity public class activity_janela1 extends activity { public void...

image - Plone Error "Value error: unable to find update_version_before_edit" -

i trying (very hard) plone version 4.2.4 work correctly. had previous installation removed. attempted reinstall @ later point. seemed fine until couldn't upload pictures , had pulled in data previous install (folders , such). i've tried purge 5 times , fresh install either pulls in data (folders in particular) previous installation or breaks somehow not allowing me upload files etc. does have suggestions on how combat this? i'm ready ditch plone. error message: traceback (innermost last): module zpublisher.publish, line 126, in publish module zpublisher.mapply, line 77, in mapply module zpublisher.publish, line 46, in call_object module products.cmfplone.factorytool, line 453, in __call__ module zpublisher.mapply, line 77, in mapply module zpublisher.publish, line 46, in call_object module products.cmfformcontroller.fscontrollerpagetemplate, line 91, in __call__ module products.cmfformcontroller.basecontrollerpagetemplate, line 28, in _call ...

ruby on rails - ERROR: 'rake/rdoctask' is obsolete and no longer supported -

out of blue, started getting following error message: (in /users/me/.rvm/gems/ruby-1.9.3-p125@mysql2/gems/rails-0.9.5) rake aborted! error: 'rake/rdoctask' obsolete , no longer supported. use 'rdoc/task' (available in rdoc 2.4.2+) instead. /users/me/.rvm/gems/ruby-1.9.3-p125@mysql2/gems/rails-0.9.5/rakefile:3:in `<top (required)>' when rails s (in development environment terminal - mac mountain lion). application in production, went production environment, did bundle show, , modified gemfile, harcode gems versions. here's have on my local development environment (what's producing error message). actionmailer (3.2.3) actionpack (3.2.3) activemodel (3.2.3) activerecord (3.2.3) activeresource (3.2.3) activesupport (3.2.3) annotate (2.4.1.beta1) arel (3.0.2) bcrypt-ruby (3.0.1) bootstrap-datepicker-rails (0.6.15) bootstrap-sass (2.0.2) builder (3.0.4) bundler (1.1.3) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.6.1) common...

sql server - how to call function inside a trigger? -

what problem @temp variable? create function dbo.getnumofreviews2 (@email varchar(40)) returns int begin declare @numofreviews int select @numofreviews = count(*) dbo.reviews email = @email group email return @numofreviews end create trigger setdiscount on dbo.[contains] insert declare @orderid int declare @productid int declare @size varchar(15) declare @temp int if cursor_status('global','c_cursor')>=-1 begin deallocate c_cursor end declare c_cursor cursor select productid,orderid,size inserted begin open c_cursor fetch next c_cursor @productid,@orderid,@size while (@@fetch_status=0) begin @temp = dbo.getnumofreviews2(select billingemail dbo.orders orderid=@orderid) if (select count(*) dbo.[contains] orderid = @orderid) > 5 or (select sum(quantity) dbo.[contains] orderid...

tvos - How to detect if Siri button is clicked from Apple TV Siri Remote -

i clicking on siri button of apple tv siri remote. now, want siri perform action saying on click of siri button of remote within app. there way it? no. unfortunately, there no way detect if siri button has been clicked. clicking siri button send app in background giving siri process focus. i recommend filling feature request using bug report system

eclipse - Error When Deploying Java Appp to App Engine? Can not get the System Java Compiler. Please use a JDK, not JRE? -

Image
i got issue when deploying java app app engine unable update app: cannot system java compiler. please use jdk, not jre. see deployment console more details unable update app: cannot system java compiler. please use jdk, not jre. that absurd because set jdk1.7 in installed jres following picture: in log file. debugging information may found in c:\users\appdata\local\temp\appengine-deploy3218365179732638698.log unable update: java.lang.runtimeexception: cannot system java compiler. please use jdk, not jre. @ com.google.appengine.tools.admin.application.compilejavafiles(application.java:904) @ com.google.appengine.tools.admin.application.compilejsps(application.java:892) @ com.google.appengine.tools.admin.application.populatestagingdirectory(application.java:687) @ com.google.appengine.tools.admin.application.createstagingdirectory(application.java:629) @ com.google.appengine.tools.admin.appadminimpl.doupdate(appadminimpl.java:569) ...

php - Code never executed, not getting any errors -

i trying use ajax , html5 handle file uploads clients computer folder on server. right alert message below in addition success function never executed , not sure why. not getting js errors. both php script , folder save file granted full read/write permissions. it extremely difficult me work without seeing errors. i appreciate assistance in identifying cause of problem, , getting errors or @ least alert message execute. many in advance! jquery $.ajax({ url: 'upload.php', //server script process data type: 'post', xhr: function() { // custom xhr myxhr = $.ajaxsettings.xhr(); if(myxhr.upload){ // check if upload property exists myxhr.upload.addeventlistener('progress',progresshandlingfunction, false); // handling progress of upload } return myxhr; }, //ajax events success: function(data){ alert("ok"); ...

Optimize jpeg images using assetic from css file instead of image tag -

the article below i'm trying do, instead of working on <img> tags want work references made in css well, background-image:url('someimage.jpg'); make optimizing hundreds of images have on website far faster manually doing , more convenient. for example documentation how using twig templating engine. {% image '@appbundle/resources/public/images/example.jpg' filter='jpegoptim' output='/images/example.jpg' %} <img src="{{ asset_url }}" alt="example"/> {% endimage %} is possible assetic , jpegoptim (or through other solution) http://symfony.com/doc/current/cookbook/assetic/jpeg_optimize.html your best bet, honestly, write script jpegoptim existing files. it's possible want creating new assetic filter, if want save jpegs different location (what using image tag filter now), little detail looks it'd quite hard. if used filter find , rewrite images in-place, have big clunky version of ...

android - Possible to alternate row colors in textview? -

what have done created 1 button 3 textview(tablelayout) , making looks record display. however, encountered problem want alternate row colors , found out can listview. there way can without listview current code? sortname(button) date(textview) name(textview) url(textview) 12/01/2015 google www.google.com 02/11/2015 yahoo www.yahoo.com activity_record.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="#b7010101"> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightsum="3" android:id="@+id/linearlayout"> <button android:id="@+id/sortname" android:layout_width=...

Failed to convert string to Tag in C# (ix developer) -

ix developer software uses c# scripting , trying pass tag name string in order fetch value on button click event. while compiling gets compiled 0 error when click on button @ runtime throws object reference not set instance of object please me , doing wrong. this code , log file please , link referring namespace neo.applicationframework.generated { using system.windows.forms; using system; using system.drawing; using neo.applicationframework.tools; using neo.applicationframework.common.graphics.logic; using neo.applicationframework.controls; using neo.applicationframework.interfaces; using neo.applicationframework.tools.opcclient; using system.reflection; public partial class screen1 { void button1_click(system.object sender, system.eventargs e) { getglobaldataitem("value1").value = 20; } private globaldataitem getglobaldataite...

asp.net mvc - Authentication & Authorization Role issue -

Image
i'm having controller name usercontroller in admin area (section). in can assign them roles admin (a) user (u) or user (u) admin (a). when change role of user updated in database ,but when login application user of had changed role user contains old role.i have put break point variable 'role' returning previous role. i'm surprised how can 'role' variable return old role. public override string[] getrolesforuser(string username) { string[] role = { obj.getall().where(x => x.emailaddress == username).firstordefault().role }; return role; } user controller assignrole action in code i'm updating role public actionresult assignrole(int id, string role) { try { bol.tbl_login user = (bol.tbl_login)obj.login.getbyid(id); if (role == "a") { user.role = "u"; } else if (role == "u") { user.role = ...

Script inside Ajax PHP File -

i coding program fetching divs using script name "awesome-grid.js", facing issue while getting data through ajax. script not working , divs coming in wrong layouts. function getload() { $.ajax({ data:'&task=results', type:'post', url:'ajax/ajaxloaddata.php', success: function(result) { document.getelementbyid('results').innerhtml = result; } }); } above script using ajax.

web services - How to store data in online and access using android app -

this first app doing create.i want create quiz app store questions online , when user uses app, questions fetched server. i dont want storage data offline. i want know how store data on server. if can done free of cost plz specify also. thnx in advance. use parse.com storage. when app used retrieve questions backend , display on screen. can learn more parse here tutorial start here i providing part of code retrieve server , display in listview. parsequery<parseobject> query = parsequery.getquery("post"); query.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> postlist, parseexception e) { if (e == null) { // if there questions, display (parseobject post : postlist) { question q= new question(post.getobjectid(), post.getstring("question")); posts.add(q); } ((arrayadapter<question...

pointers arithmetics not working in c++ -

i had worked pointer arithmetics in c but, started learn new , delete in c++ & not understand why runtime errors when incrementing pointer in c++ following error when use p++ or ++p... free(): invalid pointer: 0x0000000002324c24 ***0x2324c240x2324c28aborted (core dumped) #include<iostream> using namespace std; int main() { int *p; p=new int[4]; *p=34; *(p+1)=36; cout<<++p;//doesnot work(i wanted print address) cout<<p+1;//works delete[] p; return 0; } you need delete[] original pointer, 1 got result of new[] . , loose original pointer because ++p . that leads undefined behavior when delete[] p .

matlab - Sum of a cell array along the column -

i have cell array <1x74 cell> , each element of cell matrix of 4 x 4. how sum have final matrix of 4 x 4. did in following manner: total = in{1,1}+in{1,2}+in{1,3}+in{1,4}+in{1,5}+in{1,6}+in{1,7}+in{1,8}+in{1,9}+in{1,10}+.....in{1,74}; total = zeros(2,2); i=1:size(in,2) total = total+in{1,i}; end display('this result: ') total as mentioned in comments, if don't want define total in prior, this for i=1:size(in,2) if i~=1 total = total + in{1,i}; % executes numbers equal or larger 2 else total = in{1,i}; %executes on i=1 end end

duplicates - How to do de-duplication on records from AWS Kinesis Firehose to Redshift? -

i read document of official aws kinesis firehose doesn't mention how handle duplicated events. have experience on it? googled use elasticcache filtering, mean need use aws lambda encapsulate such filtering logic? there simple way firehose ingest data redshift , @ same time has "exactly once" semantics? lot! you can have duplication on both sides of kinesis stream. might put same events twice stream, , might read event twice consumers. the producers side can happen if try put event kinesis stream, reason not sure if written or not, , decide put again. consumer side can happen if getting batch of events , start processing them, , crash before managed checkpoint location, , next worker picking same batch of events kinesis stream, based on last checkpoint sequence-id. before start solving problem, should evaluate how have such duplication , business impact of such duplications. not every system handling financial transactions can't tolerate duplication. n...

php - Not able to store data in table -

this question has answer here: can mix mysql apis in php? 5 answers not able insert data in table using mysql database $conn = new mysqli("localhost","username","password", "dbname"); // check connection if ($conn->connect_error) { die("connection failed: " . $conn->connect_error); } $stmt = $conn->prepare("insert mail_sent(mid, miid,status) values (:mid, :miid,:status)"); $stmt->bind_param('dds',$mail_id, $inv_id, $mailstatus);//line 37 $stmt->bindparam(':mid', $mail_id); $stmt->bindparam(':miid', $inv_id); $stmt->bindparam(':status', $mailstatus); $stmt->execute(); fatal error: call member function bind_param() on non-object in c:\wamp\www\mail\toinvite.php on line 37 your problem confusing pdo mysqli. pdo have syntax :mid , mys...

c# - Get the href innertext with HtmlAgilityPack -

i trying create news agent news websites.so have use html parser htmlagilitypack .so here ca see code : public async void parsing(string website) { httpclient http = new httpclient(); var response = await http.getbytearrayasync(website); string source = encoding.getencoding("utf-8").getstring(response, 0, response.length - 1); source = webutility.htmldecode(source); htmldocument resultat = new htmldocument(); resultat.loadhtml(source); list<htmlnode> toftitle = resultat.documentnode.descendants().where (x => (x.name == "div" && x.attributes["class"] != null && x.attributes["class"].value.contains("latest-news"))).tolist(); var li = toftitle[0].descendants("li").tolist(); foreach (var item in li) { var link = item.descendants("a").tolist()[0].getattributevalue("href", null); var img = item.descendants("img...

android - Use RecyclerView inside ScrollView with fixed Recycler item height -

i implementing recyclerview inside scrollview <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:focusableintouchmode="true" android:orientation="vertical"> <android.support.v7.widget.recyclerview android:id="@+id/rv1" android:layout_width="match_parent" android:layout_height="wrap_content" android:divider="@android:color/transparent" android:dividerheight="0dp" android:listselector="@android:color/transparent" /> </linearlayout> set recyclerview fixed height this mrecyclerview_other.sethasfixedsize(true); recyclerview.layoutmanager layoutmanager_other = new linearlayoutmanager(context); mrecyclerview_other.setlayoutmanager(layoutmanager_other...

dbpedia - Difference in count result of a SPARQL query -

i have query: prefix rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix dbpedia-owl: <http://dbpedia.org/ontology/> select ?nom ?resource ?url (count( distinct (?o) ?nb)) { ?resource rdfs:label ?nom. ?resource foaf:isprimarytopicof ?url. ?resource rdf:type ?p. ?resource dbpedia-owl:wikipageexternallink ?o filter ( langmatches( lang(?nom), "en" )). ?nom <bif:contains> "apple". minus { ?resource dbo:wikipageredirects|dbo:wikipagedisambiguates ?dis } }group ?nom ?resource ?url now if replace line select ?nom ?resource ?url (count( distinct (?o) ?nb)) by: select ?nom ?resource ?url (count( (?o) ?nb)) it give me different results: example first example: | "simon apple"@en | <http://dbpedia.org/resource/simon_apple> | <http://en.wikipedia.org/wiki/s...

What does "+!!" do in JavaScript? -

this question has answer here: +!! operator in if statement 6 answers consider following codes var value = 0; (var i=0; < arguments.length; i++) { value += +!!arguments[i]; } what +!! here? 1 programming style in javascript? it's not 1 operator, it's three: + , ! twice. what apply ! arguments[i] , turns truthy values false or falsy values true , , applies ! make false => true , vice-versa, , applies unary + convert result number ( true => 1 , false => 0 ). a falsy value value coerces false . falsy values 0 , "" , nan , null , undefined , , of course, false . truthy value other value. so net result add count of truthy values in arguments value . is 1 programming style in javascript? using !! turn truthy true , falsy false normal practice. using unary + convert number normal practice. ...

javascript - Removing focus from an input element so the page can be scrolled using the arrow keys? -

i have page few text box inputs. default, first text box has focus (the cursor waits inside text box user start typing) page loads. although convenient, means up/down arrow keys cannot used scroll page. i tried: // when down key pressed... $("body").focus(); // or... $("body").first().focus(); // or... $("a:visible").first().focus(); but doesn't work. still have click outside of input box in order start using up/down arrows scroll again. use this, solve problem. $(function(){ $("input").blur(); }

Android v7 GridLayout -

i keep getting error when put v7 gridlayout linear layout: unexpected namespace prefix "xmlns" found tag android.support.v7.widget.gridlayout if don't have gridlayout within linear or relative layout work fine, have have gridlayout in kind of layout scrolling can work keep getting error above? does know prevent happening within layout? thanks help. i think know issue lint: http://code.google.com/p/android/issues/detail?id=52831 . just add tools:ignore="missingprefix" gridlayout item: <android.support.v7.widget.gridlayout ... tools:ignore="missingprefix"> to able use namespace, make sure included in root tag: xmlns:tools="http://schemas.android.com/tools"

c++ - QString - parsing QString with geoordinates -

i work in qt creator (community) 5.5.1. example, have string= "44° 36' 14.2\" n, 33° 30' 58.6\" e, 0m" of qstring. know, must parse it, don't know how, because have never faced problem it. our string want other smaller strings: cgt = "44"; cmt = "36"; cst = "14.2" cgg = "33" ; cmg = "30"; csg = "58.6" what must working programm how said? need real code. thanks. "i need code" not kind of question should asking, "gimme knowledge" not "do work" questions. question should demonstrate effort solve problem, people can tell doing wrong. not question lack such effort, didn't expend when devopia did half of work you. keep in mind future questions. struct g { double cgt, cmt, cst, cgg, cmg, csg; }; g parse(qstring s) { qstringlist list = s.split(qregexp("[^0-9.]"), qstring::skipemptyparts); g g; g.cgt...

mysql 5.7.10 create user issues -

installed latest mysql version 5.7.10 . when tried create new users it's giving me error. tried different ways provided in mysql documents. it's still giving me error mysql> create user 'monty'@'localhost' identified 'some_pass'; error 1054 (42s22): unknown column 'password_last_changed' in 'mysql.user' could me out regarding .thanks. thanks lot info. ran mysql_upgrade , fixed tables , create user working now.

Data weaver looping and checking nullify using ESB mule -

i tried implement simple loop checking null variable , setting in result. my portion of mule flow looks below. database(select) -> transform message(dataweave- convert xml) database has value below : book1 book2 book3 book4 book5 abc cde fgh ijk lmn opq rst null null null dataweaver code looks below : ns0#librarydetails:{ ns0#user: payload."book1", ns0#user: payload."book2", ns0#user: payload."book3", ns0#user: payload."book4", ns0#user: payload."book5" } expected output1 is <librarydetails> <user>abc</user> <user>cde</user> <user>fgh</user> <user>ijk</user> <user>lmn</user> </librarydetails> expected output2 is <librarydetails> <user>opq</user> <user>rst</user> </librarydetails>...

linux - Trying to use Passenger/Nginx for my Rails production server, 403 error -

i'm trying production server , running on ubuntu 12.04 lts server, followed tutorial step step, http://excid3.com/blog/setting-up-ubuntu-12-04-with-ruby-1-9-3-nginx-passenger-and-postgresql-or-mysql/#.uuavdhnzvqi but when load nginx, 403 error. here namei -om /home/deploy(user)/app drwxr-xr-x root root / drwxr-xr-x deploy www-data home drwxr-xr-x deploy www-data deploy drwxr-xr-x deploy www-data knowyourroute and in nginx.conf have @ top user deploy www-data; and in server { have listen 80; server_name 10.0.0.30; root /home/deploy/knowyourroute/public; passenger_enabled on; location / { root html; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } i've googled crap out of tried changing permissions, groups, running root or running user deploy still nothing i'm running out of things try if has idea great. you need re-specify passenger_enabled in location block.

actionbarsherlock samples + Maven -

i have imported actionbarsherlock eclipse , i'm trying build samples. eclipse plugins up-to-date. took original pom.xml changed android api version 23. however in each sample encounter following message: dependency=[com.actionbarsherlock:actionbarsherlock:apklib:4.4.0:compile] not found in workspace whatis wrong combination maven/eclipse/sherlock apklib? apklib downloaded in local maven repository. ok, found answer. actionbarsherlock + maven + eclipse: dependency not found in workspace however answer-link not valid more (http 404).

concurrentmodification - Avoiding ConcurrentModificationException when using nested for-loops in Java -

in program i've created teams(football example) , want create method every team plays match against other teams. method throws concurrentmodificationexception. here is: public void playmatches(){ (team team : mteams) { mteams.remove(team); (team team1 : mteams) { match(team, team1); } mteams.add(team); } } i'm removing team mteams, doesn't play against itself, throws exception. how can handle that? since seem understand what's breaking, let's consider "how handle" part of question. news not need modify collection @ all. rather modifying collection removing , adding item, skip team outer loop when call match in inner loop, this: for (team team : mteams) { (team team1 : mteams) { if (team.equals(team1)) continue; match(team, team1); } }

html - javascript chalanging form elemts array validation -

hi have 1 html form. <form name="modeladd" ethod="post" class="form label-inline" enctype="multipart/form-data" onsubmit="return check('modeladd');"> <?php for($i=0;$i<$tot;$i++) { ?> <div class="field"> <label for="connect_msg">connect message </label> <textarea rows="4" cols="50" name="connect_msg[<?php echo getfield($langs[$lan]);?>]" id="connect_msg[]"><?php echo getfield($row[$lan]); ?></textarea> </div> <div class="field"> <label for="call_msg">call message :</label> <textarea rows="4" cols=...

c# - WCF To WPF client - Populating the ListBox -

that method populating listbox data comes wcf service. private void filllistbox() { servicereference1.service1client client = new servicereference1.service1client(); client.open(); listbox.itemssource = client.getallproducts(); } but in listbox can see productlistclient.servicereference1.product therefore have added override tostring() method in model, still can not see data in listbox. how can fix that? it seems binding working , list contain items. need implement itemdatatemplate in listbox this: <listbox width="400" margin="10" itemssource="{binding source={staticresource mytodolist}}"> <listbox.itemtemplate> <datatemplate> <stackpanel> <textblock text="{binding path=taskname}" /> <textblock text="{binding path=description}"/> <textblock text="{binding pa...

jar - Solving Error when instantiating an object of a compiled class in JSP page -

please need java gurus in forum, have problem jar file importing jsp file when define object of imported class passbuilder.java (which class in passhide jar file imported)as "passbuider passer;" no error once instantiate class object "page cannot displayed error". please can solve this????below sample of code: <%@ page import= "passhide.*"%> <% string userid = "owo123"; passbuilder passer;//no error passer = new passbuiler().getpass(userid);//throws page cannot displayed %> yeah later found solution this, cause me running jar file compiled jdk 1.7 on jdk 1.6 environment. had recompile jdk 1.6, , holla error gone.

Suggestion php dom parser or jquery for metabox value -

i have page has covered background image. in wordpress backend have 2 fields page: one high resolution image – and – the other low resolution. so far can give style inline in div php. in jquery changes class high resolution when reaches screen width. so in php have see if div has class determine resolution image use. found php simple dom parser might able or jquery through ajax. what suggested way? if in jquery, how able data?

twitter bootstrap - How can I make the dreamweaver format the css file as sublime -

Image
dreamweaver display css file style add sublime display below i suppose format sublime display helpful read css file you're looking @ 2 different files. in dreamweaver you're looking @ bootstrap.min.css , has been minified , while in sublime you're looking @ bootstrap-theme.css , has not been minified, of course they're going different. dreamweaver using "live view" function, examining files sent web server. minified files used here save bandwidth. if want view/modify file being displayed in dreamweaver, open project in sublime , find bootstrap.css . if make changes, make sure re-minify changes applied site. however, way bootstrap works, shouldn't have make changes bootstrap[.min].css , instead can override specific rules in own .css file loaded after bootstrap's.

business intelligence - Solution stack for BI with Pentaho and web app -

my goal build web app showing on-line reports , static reports bi system. i'm thinking solution stack. @ moment i'm focus on pentaho solutions. my question are: possible pentaho ce: -> load data kettle (etl process) -> analyse in pentaho -> shows reports in web app , gets data rest services (similar solution: http://www.webdetails.pt/showcase/ ) ? if not possible make ce version witch product ee needed? or other technology stack can me achive goal??

node.js - Create a new document using MEAN mongoose -

i'm new mongoose , mongodb, i'm trying create new document inside collection. i'm able update existing 1 or document collection. need create new document based on collection ( i have single collection now ). - createmoment function. var mongoose = require('mongoose'); var db = mongoose.connect('mongodb://url , pass'); var usersschema = require('./users_schema').usersschema; mongoose.model('usersm', usersschema); var usersaction; mongoose.connection.once('open',function(){ var users = this.model('usersm'); var query = users.find(); query.where('userid'); query.exec(function(err, docs){ usersaction = docs; console.log("docs: " + usersaction); return usersaction; }); }); exports.getdata = function(){ return usersaction; }; exports.createmoment = function(_fn, _ln, _conc,_lan,_lat,cb){ var users = mongoose.model('usersm'); console.log("createmoment called"...

asynchronous - Angular2 - updating variable after function (promise?) -

i havea problem. in registration want view error message if user exists in database. created "serveranswer" variable handle error answer server. my register.service.ts content @injectable() export class registerservice { constructor(private http: http) {} public serveranswer: object; getanswer() { return this.serveranswer; } adduser(user: user) { var headers = new headers(); headers.append('content-type', 'application/json'); this.http.post('/users/register', json.stringify(user), {headers: headers}) .subscribe( response => { if(response.json().success) { window.location.href = "/"; } if(response.json().error) { this.serveranswer = response.json(); } } ) } } as can see, @ start "serveranswer" variable empty. "response.json().error" handle error text. okay, it's time show register.component.ts content. ...

javascript - How to insert multiple values on HighCharts live data chart -

i'm new in web programming , i'm trying insert multiple points in highcharts live chart. have 1 mysql table each 11 seconds 11 values inserted, values past 11 seconds. can understand? so, want insert 11 points each 11 seconds in chart. searched on internet , have tried many ways , didn't find solution. here goes codes: data inserted in chart <?php // set json header header("content-type: text/json"); date_default_timezone_set('america/sao_paulo'); error_reporting (e_all & ~ e_notice & ~ e_deprecated); $con = mysql_connect("localhost", "root", "") or die (mysql_error ()); mysql_select_db("dr14", $con) or die (mysql_error ()); $result = mysql_query("select * dados_test order id desc limit 11"); $data1 = array(); $data2 = array(); $i=0; while ($row = mysql_fetch_array($result)) { $data1[$i] = $row [ "timestamp"]; //timestamp of points $data2[$i] = $row [ "vq_grid...

networking - cannot access ftp site via IE, Chrome or Firefox -

i have following ftp details example: server: 10.10.100.10 user: dreamer password: 12345 when used filezilla can access ftp site above credentials. when use windows explorer, put in address bar ftp://10.10.100.10 , pop-up asking credentials, enter , works. however, when use ie, firefox or chrome, cannot in. i use in address bar: ftp://dreamer:12345@10.10.100.10 please note, example. in filezilla right click on file want access. select 'copy url(s) clipboard' , paste browser popup window should appear asking logins. that works me.

javascript - Check if browser supports MutationObserver -

how 1 write if clause check see if mutationobserver supported? try using in operator the in operator returns true if specified property in specified object. syntax prop in objectname parameters prop a string or symbol representing property name or array index (non-symbols coerced strings). objectname name of object. if ("mutationobserver" in window) { // stuff }

java - Convert Strings of 0 & 1 into bytes -

i have 2 strings: string = "11111"; string b = "10001"; i'd make bitwise comparison wih "&" operator. what best way ? first, convert each binary string long value long.parselong(s, 2) . method parse given string using radix of 2, meaning should interpret string binary. calculate bitwise comparison & on 2 long values. convert binary string long.tobinarystring(i) . here's sample code: public static void main(string[] args) { string = "11111"; string b = "10001"; long la = long.parselong(a, 2); long lb = long.parselong(b, 2); long lc = la & lb; string c = long.tobinarystring(lc); system.out.println(c); // prints 10001 } another way without using primitive long value manually looping on digits , storing & result of code points in stringbuilder : public static void main(string[] args) { string = "11111"; string b = "10001...