w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Barcode Scanner Phonegap plugin; Can't save results into global variable, or save to hidden field
You need to pass functions for callback to .scan() so they can be called after the scan intent finishes. You want something like this: scanner.scan(success,error); function success(result) { document.getElementById('barcode').value = result.text; } function error(error) { alert(error); }

Categories : Javascript

Xslt 1.0 apply-templates on a variable node-set changes root node
Read about the <xsl:import> and <xsl:include> instructions. http://www.w3.org/TR/1999/REC-xslt-19991116#import and: http://www.w3.org/TR/1999/REC-xslt-19991116#include

Categories : Xml

How to save a variable value on AS3 for IOS when application is closed and reopened dont lose variable value
You can either: Store information on a SharedObject (the easiest way) Write a local file in AMF format Use the SQLLite database More info here: http://www.adobe.com/devnet/flash/articles/saving_state_air_apps.html

Categories : Iphone

Unable to connect to Oracle 11g using node-oracle driver for Node.js: are they compatible?
The solution was to use a recent patch to the module that hasn't been released yet. The current release is 0.3.1 of node-oracle. That version does not have the TNS support fix. If you check out the latest code for the module from github to a new directory and build it there ('npm link' in that directory) and then do npm link oracle from your project directory you will get the new version with the fix. We had to work through a number of permission problem which are most likely platform specific so I won't delve into those here. I have requested that the authors of the module release this patched version soon presumable as 0.3.2.

Categories : Node Js

Unable to use $.parseJSON on string variable constructed with array variable
There are quotes Inside your html strings: "html":"<fieldset id="formelement_1" class="radio"> This is totally broken (the string values ends at id="). You need to escape quotes with ". EDIT: of course this is the answer "why it doesn't work". The better way to do it is indeed to serialize your objects with JSON.stringify, which takes care of this issues and others, as suggested in Kevin's comment.

Categories : Jquery

Unable to save BufferedImage to specified URL
It's entirely possible to store images on a remote location. Instead of using File, use something like: URL url = new URL("http://localhost:8080/prashant%20Pic/j.jpg"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); // Do necessary setup of connection, like: // - setting the HTTP method (POST/PUT) // - setting authentication parameters? // These depends on what kind of service you have running on localhost:8080 OutputStream stream = connection.getOutputStream(); try { ImageIO.write(img, "jpg", stream); } finally { stream.close(); } Obviously, you also need a service running on localhost:8080 that accepts file upload via POST or PUT.

Categories : Java

Unable to save canvas to image
The WebGL context needs to be created with { preserveDrawingBuffer: true } in the options, otherwise the buffer being rendered is cleared once it is drawn to the screen, and toDataURL will give you a blank image. See also: How do you save an image from a Three.js canvas?

Categories : Javascript

Unable to Save Excel File Using C#
This problem is for backwards compatible sheet (a .xls) instead of a .xlsx. To allow sheets to be opened in pre office 2007 version it can't contain more than 65k rows. You can check the number of rows in your sheet by using ctrl+arrowdown till you hit the bottom. If you try to get a range larger than that number of rows it will create an error

Categories : C#

Unable to save array to NSUserDefaults
From the Apple documentation: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSUserDefaults A default object must be a property list, that is, an instance of (or for collections a combination of instances of): NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary. If you want to store any other type of object, you should typically archive it to create an instance of NSData. If allContacts is an NSArray, just use that in your setObject:forKey: call. If it's an NSMutableArray, use: [allContacts copy] to get a non-mutable copy of the array.

Categories : Misc

How to modify a MP3 metadata and save by Node.js?
I don't know whether there's a way to actually do the meta data manipulation in NodeJS. This is a work around way but you could do this using child_process.exec and perl: NodeJS Code var exec = require('child_process').exec, child; child = exec('perl changeTags.pl file.mp3', function (error, stdout, stderr) { console.log('stdout: ' + stdout); console.log('stderr: ' + stderr); if (error !== null) { console.log('exec error: ' + error); } }); Perl code #!/usr/bin/perl use MP3::Tag; $mp3 = MP3::Tag->new(@ARGV[0]); # create object $mp3->get_tags(); # read tags print "Attempting to print tags for @ARGV[0] "; if (exists $mp3->{ID3v2}) { print "Comments: " . $mp3->{ID3v2}->comment . " "; print "Zip: " . $mp3->{ID3v2}->album . " ";

Categories : Node Js

Unable to save the existing Excel file
You need to quit (close) Excel, and then set the worksheet, workbook and app variables to Nothing when you're finished, so they're actually released (closed). workbook.Save() app.ActiveWorkBook.Close() app.Quit() worksheet = Nothing workbook = Nothing app = Nothing

Categories : C#

Unable to save JStree state with cookies
There is a bug in jsTree cookies plugin. Plugin initialization code should unescape data read from jquery cookie plugin. To fix this, find and change following line tmp = $.cookie(s.save_opened); to tmp = unescape($.cookie(s.save_opened));

Categories : Jquery

Cloud9 on Raspberry Pi, Unable to save files
There were several complains about IDE file saving hangs on cloud9 support. At the bottom of the page there is a solution you can try.

Categories : Node Js

Unable to save to a text file using Vbscript
In my eyes you want to append some content to an existing textfile. According here you have to tell the runtime enviroment that you want append something. If so, you have to use the constant value 8 instead of 2.

Categories : Vbscript

Unable to save description in products with magento
First disable all extensions to make sure thats not the problem. It usually is. And disable it from System>Config>Advanced. If that doesnt change anything, check your tax rules, rates and classes in Sales>Tax. Remove them all as you may have delete, and created a rule and maybe its a conflict. Also, did you make any custom attributes related to tax or anything? One last thing, based on your update. Go to System>Configuration>Content Management> and disable the wysiwyg editor.Try to update and save then. Good luck

Categories : Magento

Unable to save data using parse.com service
May be you were making changes in APPLICATION ID and CLIENT KEY,that are not acceptible, try the same keys given at parse website page which come with your project name, hope you will get rid of this problem....

Categories : Android

Unable to save class objects to a SharedObject FIle
In order to save a custom object, you either have to make all its properties public and accessible, AND have no references to DisplayObjects, or implement IExternalizable and define writeExternal() and readExternal() methods. Note that if your object is read from elsewhere, it first is initialized via zero parameter call to its constructor, and then the instance's readExternal() is invoked. The manual on IExternalizable An example: public class Tower2 extends Obstacle implements gameRunnable,IExternalizable { // HUGE set of statistics skipped, all methods skipped public function writeExternal(output:IDataOutput):void { output.writeInt(gemType); output.writeInt(gemGrade); output.writeBoolean(affectsFlying); // as some gems might be elongated, saving this output.w

Categories : Actionscript

Trying to download from URL and save to file with node.js.. what is my issue?
That is because restler.get is asynchronous and by the time the first file is being written, the for loop is on the last element. You can get around this by using a forEach and creating a separate scope for each elem you iterate over: var filenames=["a.txt", "b.txt", "c.txt"]; filenames.forEach(function(filename) { var url = 'http://myhomepage/'+filename; restler.get(url, { }).on('complete', function (data) { fs.writeFile('./' + filename, data, function(err, data) { }) }); } } ); Alternatively, if you want to keep your implementation less changed, you can create a wrapper function to create a separate scope: var filenames=["a.txt", "b.txt", "c.txt"]; for(var i in filenames) { (function(i) { var url = 'http://myhomepage/'+filenames[i]; restler.get(

Categories : Javascript

Can I use node-gm to resize an image in memory or do I need to save it first?
you can just pipe a stream through gm, and dont need to save the file to disc! you can even do several operations one after the other because gm-functions are chainable (in my example i resize the image and afterwords crop it from the middle (therefore the gravity function) gm(req.files['profile-picture']['path'], 'img.jpg') .resize("100^", "100^") .gravity('Center') .crop(100, 100) .stream(function (err, stdout, stderr) { // do whatever you want with your output stream (stdout) here });

Categories : Javascript

Magento - Add node and save module config
If is more easy to you, you could try with custom variables. Hope it helps. The official Doc Greetings.

Categories : PHP

XML Parsing - Unable to retrieve value of node
You forgot to define $data = array(); <?php error_reporting(E_ALL); ini_set( 'display_errors','1'); libxml_use_internal_errors(true); libxml_clear_errors(); $data = array(); //notice this??? // create the reader object $reader = new XMLReader(); // reader the XML file. $reader->open('test.xml'); // start reading the XML File. while($reader->read()) { // take action based on the kind of node returned switch($reader->nodeType) { // read more http://uk.php.net/manual/en/class.xmlreader.php#xmlreader.constants.element case (XMLREADER::ELEMENT): // get the name of the node. $node_name = $reader->name; // move the pointer to read the next item $reader->read(); // action based on the

Categories : PHP

How to compare the querystring parameters saved in a variable, and save the variable in cookie and compare on each page
Try this <script type="text/javascript"> $(document).ready( function(){ var params = getUrlVars(); var utm_campaign = params["utm_campaign"]; var utm_content = params["utm_content"]; if( utm_campaign === "percentoff" && utm_content == "COUPON_CODE_HERE") { alert("hi"); } if( utm_campaign === "freeship" && utm_content === "COUPON_CODE_HERE") { alert("hello"); } }); function getUrlVars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[

Categories : Javascript

Node & Express + jQuery: After authenticating save for session
Store this boolean in an Express session, and select which page to send to the client. // enable session support app.use(express.cookieParser()); app.use(express.session({ secret: 'secret key for signed cookies' })); app.get('/foo', function(req, res) { req.session.authenticated = true; }); app.get('/bar', function(req, res) { if (req.session.authenticated) { // send page with files } else { // send page without files } });

Categories : Javascript

Xml data Node values need to save into Database table
You can easily extract the information from the <Computer> node and insert it into Asset: (PS: Note: it's a processor - not a "processior" (no i after the two s) ) DECLARE @Input XML SET @Input = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Computer Name="WH7" Processor="Intel(R) Core(TM)2 Duo CPU P9600 @ 2.66GHz" Manufacturer="Dell Inc." Model="Latitude E6500" Domain="WORKGROUP" RAM="3536 MB" ServiceTag="DGQKTJ1"> <BIOS Manufacturer="Dell Inc." Version="Phoenix ROM BIOS PLUS Version 1.10 A19"/> </Computer>' INSERT INTO dbo.Asset(Name, Processor, Manufacturer, Model, Domain, RAM, ServiceTag) SELECT Name = @Input.value('(/Computer/@Name)[1]', 'varchar(50)'), Processor = @Input.value('(/Computer/@Proc

Categories : Xml

node.js async array save data to mongodb
You need to change your convert_to_array function so that it calls a callback when the result is done, instead of returning the result a return value. function convert_to_array(text, callback) { // do some stuff, call this when done: // callback(null, arr); // or this on error: // callback(err); } Now when your result is ready? It's when all text_arr items were processed (i.e. all calls to profileObj.save are finished). Probably the simplest way how to express this in code is to use async module (npm install async): var async = require('async'); // ... function convert_to_array(text, callback) { if(text && text !== '') { var text_arr = text.split(', '); text_arr.pop(); var arr = new Array(); var new_profiles = new Array(); var all_prof

Categories : Javascript

node-orm2 instance lacks save method
Even if you limit the number of results to 1, node-orm2 will still pass an array of results: this.find({uid: uid}, 1, function(err, users) { if (! err && users.length) { var user = users[0]; // user.save() should work now ... } });

Categories : Javascript

How to save datetime as BSON Date using Node driver?
I found a way to do what I wanted to do. This seems kind of klugey to me, so if anyone can find a better way, please let me know. My solution uses the underscore.js library: var _ = require('underscore'); vary query = {} query['foo'] = 'bar' Db.connect(mongoUri, function (err, db) { if (!err) { db.collection(analyticsCollection, function (err, coll) { if (!err) { coll.save(_.extend(query,{"datetime":new Date()}), {safe:true}, function (err, result) { db.close(); res.send(200,result); //console.log(result); }); } else { res.json(503,{errno:503,msg:'error: collection does not exist.'}); }

Categories : Node Js

open xml file with nokogiri update node and save
First of all, your node_update is actually a NodeSet, not the Node that you probably think it is. You need a Node if you want to call inner_html= on it: node_update[0].inner_html = 'true' Then writing out the updated XML is just a bit of standard file manipulating combined with a to_xml call: File.open('whatever.xml', 'w') { |f| f.print(doc.to_xml) } As an aside, your input isn't valid XML. You have a </details> but no <details>.

Categories : Ruby On Rails

How do I create and save an expiring user token in node js?
First, the user token should be a Model: var mongoose = require( 'mongoose' ); var Schema = mongoose.Schema; var Token = new Schema({ token: {type: String}, createDate: {type: Date, default: Date.now} }); Token.methods.hasExpired= function(){ var now = new Date(); return (now - createDate) > 7; //token is a week old }; //don't forget to add the token as a field in your user mongoose.model( 'Token', Token); Next, in the router, inside the else clause, I would change your findOneAndUpdate to findOne, because you are not updating the whole User object, but simply a property on it. require('crypto').randomBytes(48, function(ex, buf) { var userToken = buf.toString('hex'); User.findOne({email: (req.body.email)}, function(err, usr) { if(err || !usr) {

Categories : Node Js

appfog is unable to install node.js application
I run into the following and managed to fix it by: 1) removing the node_modules folder (rm -rf node_modules) 2) reinstall all the dependencies (npm install) 3) recreate the shrinkwrap.json (npm shrinkwrap)

Categories : Node Js

Unable to undestand behaviour of node.childrens
The output is as expected. There are two, empty text nodes in the markup - before the <th> and after it - the line breaks count. You can exclude empty text nodes in your output.

Categories : C#

Unable to save a domain class instance from Groovy Console in GGTS
That's the Groovy console, not the Grails console. They use the same code and look the same, but the Grails version hooks into the application, whereas the Groovy console just has access to the code. To run the console, go to Grails Tools | Open Grails Command Prompt and enter console in the text field. This is just a GUI wrapper for running grails console from the commandline.

Categories : Grails

Node save with multiple taxonomy field of different vocabulary in drupal 6
$node->taxonomy is stored in the following way: [taxonomy] => Array ( [2] => stdClass Object ( [tid] => 2 [vid] => 2 [name] => Descrip 1 [description] => [weight] => 0 ) [1] => stdClass Object ( [tid] => 1 [vid] => 4 [name] => Descrip 2 [description] => [weight] => 0 ) ) Have you tried the following: $node->taxonomy[] = array( etc etc etc )

Categories : Misc

What is correct way to save Node with RelationshipEntity in Spring Data neo4j?
The type property does not need to be set explicitly by you. It is managed by spring-data-neo4j. The following code snippets work for me: The event class: @NodeEntity public class MyEvent { @GraphId private Long nodeId; @RelatedToVia(type = "INVITED_TO") @Fetch Set<EventResponse> eventResponse; } The user class: @NodeEntity public class User { @GraphId private Long userId; } And the response class: @RelationshipEntity(type = "INVITED_TO") public class EventResponse { @GraphId private Long nodeId; @StartNode MyEvent event; @EndNode User user; } I use them in a short junit test: @Autowired private Neo4jTemplate template; @Transactional @Test public void saveEv

Categories : Java

How to fetch an array of image URLs with node.js and save to s3 asynchronously?
There are several things you could improve with your code: HTTP Agent First of all, node.js uses an HTTP Agent, which limits the number of concurrent connections to a host. If it wasn't, you could easily accidentally hammer websites with thousands of connections. You can disable it by passing {agent: false} to request. Note that knox already disables it. I suspect this is the reason why your code runs sequentially. Async.each Async.each will run all iterations in parallel. When you are calling nextImage(), you are not telling async to start the next iteration, but rather say that you are done. Async completes when all iterations are done. The problem here is that you keep doing work after you told async that you were finished.

Categories : Node Js

Unable to move (rename) a node with Jackrabbit and WebDAV
I had the same problem. I solved it by using the move method of the Workspace object instead of the Session object: getSession().getWorkspace().move(node.getPath(), parentPath + newName);

Categories : Java

Unable to send messages to who are not online using node.js on my localhost
I figured out other way to do this client.on('message_from_client',function(data){ alldata = data.data; console.log(alldata); alldata = JSON.parse(alldata); alldata.forEach(function(data){ if(data.message_to!=''){ client.emit("update_message_from_server", data); if(data.message_to != client.username){ redisClient.SISMEMBER('online',data.message_to,function(err,reply){ if(reply!=0){ redisClient.get(data.message_to,function(err,reply2){ if(reply2!=null){ io.sockets.sockets[reply2].emit("update_message_from_server",data ); }

Categories : Javascript

Unable to compile C++ code: invalid conversion from 'Node*' to 'int'
adj is of type Node*. adj[someIndex] is then of type Node. You are trying to assign Node* to Node. My educated guess is, you have Node::operator=(int), so the compiler tries to interpret your code that way - but that doesn't work out either, producing the error message you observe.

Categories : C++

How to use JQuery to pass object data to node server and save to mongodb?
The most straightforward way, it seems, would be to expose an API on your server to handle the new values. For the routing part: Check out this article for how to create your own routing system. You could also just use Express or Connect to setup routes (which comes at the advantage of being for free). More info on which router to choose here: Which Node.js Router Should I Use? For saving in the db Assuming that you decide to go with Express, and that your API is : /user/:userId/view/:viewId/position, you could then do: var mongoose = require('mongoose'); var View = new Schema({ id: String, x: Number, y: Number }); mongoose.model("View", View); And, in your router handler: exports.post("/user/:userId/view/:viewId/position", function (req, res) { //Find user with userId in

Categories : Jquery

Meteor + node-amqp: unable to connect via SSL to RabbitMQ server
Rather late response at this point, I'm afraid, but I just had a similar problem and it turned out I was piping plaintext into the RabbitMQ server socket. The server was expecting an SSL negotiation, but my client-side code hadn't correctly set up an SSL socket and instead used a regular socket, resulting in a "record overflow" just like this one- though mine was over STOMP and looked like this: =ERROR REPORT==== 19-Oct-2015::15:03:10 === STOMP detected TLS upgrade error on <0.1224.0> (127.0.0.1:52065 -> 127.0.0.1:61614): alert record overflow http://erlang.org/pipermail/erlang-questions/2012-December/071099.html was the giveaway. So, I'm providing this answer in the hope that the next person to view this question checks what their client is spewing into the socket.

Categories : Node Js



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.