w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
node.js's "bad" packages?
Yes, the code in your example is synchronous. Node.JS has strength from it's asynchronous code, but not absolutely everything is asynchronous. Mostly, the asynchronous code is usful for blocking IO.

Categories : Node Js

Laravel 4/SimpleXML/PHP node no longer exists
Ah, I see your problem; your trying to get the attributes (maxlevel etc) from the first child-element, which is <config>, and that elements has only a 'enabled' attribute. Try this; <?php $xml = '<stages> <config enabled="0"/> <stage minlevel="1" maxlevel="8" multiplier="7"/> <stage minlevel="9" maxlevel="20" multiplier="6"/> <stage minlevel="21" maxlevel="50" multiplier="5"/> <stage minlevel="51" maxlevel="100" multiplier="4"/> <stage minlevel="101" multiplier="5"/> </stages>'; $list = simplexml_load_string($xml); echo "<pre>"; foreach($list->children() as $child) { switch($child->getName()) { case 'config': echo 'Config->enabled: '; echo (string)$child['enabled'];

Categories : PHP

Cannot download Node packages using npm and shell
"/usr/local/lib/node_modules" would be a UNIX (linux) path. I haven't tried running nodejs on windows but that path should be fine. sudo will make your command run as admin in linux, in windows you might want to try just "npm install -g sax".

Categories : Node Js

Managing node packages in a optimized way
The -g flag in npm will install the module globally -- this is how things like grunt work as a CLI tool, but for your dependencies, you probably just want them to be installed in your node_modules folder, defined in your package.json. Are you browserifying your front-end modules? You most likely do not want both your front and back end to have the same set of dependencies, best to keep them separate package.json manifests. Are your frontend modules just grunt tasks? Running grunt in either frontend or backend directories will call the gruntfile only there. Keep these two directories separate -- will save a lot of headache in the future.

Categories : Node Js

OPA how to reuse Javascript and Node.js packages
Before you had to prepare special file with JS values exported to Opa tagged with special annotations like: ##register value_name : type_of_arg1, type_of_arg2 -> void ##args(arg1, arg2) { run_someJS_code(); } The file had to be compiled to the package with special tool and then usable in Opa with %%Filename.value_name%%(x,y). Now tagging of JS values with Opa types and marking them for export to Opa is inside JS source files in comment syntax /** */. The files are still valid JS files, so you can update existing JS files in place. They also do not require special tool to compile them. Standard Opa compiler accept JS files as any other Opa file and understands annotations in comments. As before, you link the client JS and server Node.js code exactly the same way. Unfortunately, as

Categories : Node Js

Node/MongoDB scraper - Deleting records that are no longer valid
You either need to timestamp items (and update them on every scrape) and periodically delete items which haven't been updated in a while, or you need to associate items with a particular query. In the latter case, you would gather all of the items previously associated with the query, and mark them off as the new results come in. Any items not marked off the list at the end, need to be deleted.

Categories : Node Js

SQL Server Jobs with SSIS packages - Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B
It is because creator of the SSIS packages is someone else and other person is executing the packages. If suppose A person has created SSIS packages and B person is trying to execute than the above error comes. You can solve the error by changing creator name from package properties from A to B. Thanks, Kiran Sagar

Categories : Sql Server

python packages -- overriding built-in packages and the dreaded "Module xxxx was already imported" warning
Rename myprogramxlrd to myprogramfrozen_xlrd. Then import it with try: import xlrd except ImportError: import frozen_xlrd as xlrd Alternatively, you could tell Python to silently ignore this particular UserWarning: import warnings warnings.filterwarnings("ignore", message="Module xlrd was already imported", category=UserWarning) Place this early on in the program, before scikits gets imported.

Categories : Python

RVM is completely messed up. Need help to reinstall
rvm implode should do the trick. Incase you are getting permission denied errors, just change its permission using sudo chmod 777 -R <FILE_OR_DIR_NAME_HERE> or run sudo rvm implode

Categories : Ruby On Rails

Do I need to reinstall Django for new virtualenv?
The easiest way to go is to freeze your requirements into requirements.txt and then install them in the new virtualenv: pip freeze > requirements.txt pip install -r requirements.txt Another option is to make your virtual environment relocateable and copy each time you need a new one. This is somewhat harder to do, see: virtualenv-clone virtualenv relocatable -- does it really work Making a virtualenv based on another virtualenv FYI, virtualenvwrapper has cpvirtualenv command, but you should use it with caution: Copying virtual environments is not well supported. Each virtualenv has path information hard-coded into it, and there may be cases where the copy code does not know to update a particular file. Use with caution.

Categories : Python

Reinstall Ruby to use libyaml
If you built from source and kept the source code, then you should be able to run: $ cd path/to/ruby/source $ make uninstall You might need to sudo it. If you haven't kept the source code, then it's messier. You will have to locate all of the files created by the installation and remove them manually. On CentOS you should have the locate command, so just run: $ sudo updatedb $ locate ruby That will give you a long list of files. You should be able to work out which ones were installed and remove them. While you're rebuilding, include libreadline (might not be the exact name). I've had to re-build ruby for this a number of times.

Categories : Ruby

How to reinstall VS 2012 to different directory?
If you look at your C:ProgramDataPackage Cache folder, or if by any chance your ProgramData folder is located elsewhere type %ProgramData%Package Cache in your Run box you'll notice a whole lot of folders and files taking over 2GB of space. That is where the VS 2012 data is stored and that is where it is getting the data from when you install to a different location. Deleting the 'Old Folder' was therefore a bad idea because not all VS 2012 files were stored there, you must first uninstall VS 2012 which will remove the 'Old Folder' AND the C:ProgramDataPackage Cache at which point you can install into 'New Folder' and while VS 2012 installation will again copy all those files to the same folder it will also fix all the registy entries to point to your 'New Folder' instead. Alternatively

Categories : Visual Studio

Can't uninstall/reinstall NuGet package
In your Solution or Project you will find a file called packages.config. Open this file and you will see all the packages that NuGet has installed. The file will look something like this: <?xml version="1.0" encoding="utf-8"?> <packages> <package id="Json" version="2.0.3" targetFramework="net45" /> </packages> Simply delete the line of your package and save the file. <?xml version="1.0" encoding="utf-8"?> <packages> </packages> Then run NuGet again and it should install. The JSON.NET NuGet package should just work with a Windows Phone 8.0 project. Adding it in VS2012 NuGet manager pulls in the WP7 version of JSON.NET. (packagesNewtonsoft.Json.4.5.10libsl3-wpNewtonsoft.Json.dll) JSON.NET is now also available as a Portable Class Library

Categories : C#

Reinstall Visual Studio and retain all settings?
Export all of your settings, reinstall Visual Studio, and then import your exported settings. http://msdn.microsoft.com/en-us/library/vstudio/zbhkx167.aspx

Categories : Windows

Stop, remove, reinstall service in chef
For the most part the recipe will match exactly the pseudo-code you've defined in the question. One thing you need to consider however is how you will make the recipe idempotent. One of the core concepts in Chef is that if the machine is already in the correct state (i.e. you have the correct version of your app deployed already) then you shouldn't perform any work. While I've not used them you should probably take a look at the application and application_nodejs cookbooks which expose LWRPs for deploying applications.

Categories : Ruby

Reinstall Linux Package with File Backup
To completly remove all files and dependency packages try apt-get --purge autoremove apache2 After that you can do a fresh install of apache2 apt-get install apache2

Categories : Linux

how to reinstall SIGQUIT handler after SIGALRM is delivered - unix/c?
You need either to put the definition of SIGQUIT_Handler() before the reference to it in SIGALRM_Handler(), or to add a declaration before it: static void SIGQUIT_Handler(int iSig); Either will work, but one or the other is necessary. Why? When you write: signal(SIGQUIT, SIGQUIT_Handler); the second argument must be a pointer to a function, but the compiler must know that the name represents a pointer to a function because it has been declared before it is used. As it stands, the name SIGQUIT_Handler has never been declared or defined, so the compiler does not know what it is.

Categories : C

Code sign error following fresh reinstall OS X and Xcode 4.6.3
You did a reinstall of your system, so you lost your private key and your certificate that was stored inside your keychain. If you don't have a export from Xcode as backup then you need to request a new key and make new certificates: It is worth looking in the best practise guide: App Distribution Guide: Best practices

Categories : IOS

MSIEXEC using command line REINSTALL not using original INSTALLDIR
The easiest solution would be to store the installation directory in the registry and look it up upon reinstalling. To look up your registry value, you'd use something of the sort: <Property Id="INSTALLDIR"> <RegistrySearch Id="InstallLocation" Root="HKCU" Key="SOFTWARECompanyProduct" Name="Location" Type="raw" /> </Property> If the registry value isn't found, the INSTALLDIR property will be set to your directory structure. Rob has a complete solution on his blog for when you specify such a property from the command line.

Categories : Wix

how to rebuild / reinstall ssrs (reportserver, reportservertempdb) databases?
1. You can automate the initial install of SQL by using a .ini file with the setup.exe. After that point, you should be backing up your databases. But it seems like perhaps you haven't. If you still want to rebuild the databases, you can drop and then use the SSRS config tool to recreate them. If you'd like to automate that, you'll need to script a db drop, create, role creation (RSExecRole) and then run the Catalog.sql and CatalogTempDB.sql scripts located here, however I don't think you should be doing this, just backups - way easier! X:Program FilesMicrosoft SQL ServerMSRS10.XReporting ServicesReportServer 2. I'd use RSScripter to move objects which needs the web service to be running. It seems like you only have access to the database, which makes your job much more difficult.

Categories : SQL

Facebook giving invalid token Facebook exception on login after reinstall
Try this code for facebook login Session.openActiveSession(this, true, new Session.StatusCallback() { // callback when session changes state @Override public void call(final Session session, SessionState state, Exception exception) { if (session.isOpened()) { if(!session.getPermissions().contains("email")) { session.requestNewReadPermissions(new Session.NewPermissionsRequest(Facebookpersil.this, PERMISSIONS)); } // make request to the /me API Request.executeMeRequestAsync(session, new Request.GraphUserCallback() { // callback after Graph API response with user object @Override public void onCompleted(GraphUser user, Resp

Categories : Java

Do I need to reinstall pear and phing when I upgrade from PHP5.3 to PHP5.4 ?
No, you can't do that. Two reasons: PEAR allows packages to modify the package's PHP code during installation, e.g. to put the path of files directly into the code. When moving files, those now hard-coded paths break. The PEAR registry and configuration files have full paths in them. Moving the files breaks them.

Categories : PHP

Kendo UI treeview find the next node and previous node of the selected node
You should use jQuery next and prev for getting the nodes. You can use: var sel = treeview.select(); var next = $(sel).next(); var prev = $(sel).prev(); Where: treeview is the treeview object (i.e. $("#grid").data("kendoTreeView")) sel is current selected node, next is next node. and prev previous node. If you need to get the item in the model you should use treeview.dataItem with sel, next or prev as argument.

Categories : Kendo Ui

Does virtualenv isolate python itself + python packages, or just python packages?
Virtualenv installs python, but it's installed in the bin directory of the virtualenv you created. Therefore you need to run it with ./bin/python. You can also "activate" the virtualenv by running source bin/activate Which will put the virtualenvs bin directory first in the path (and do some other trickery I think) which will make the virtualenvs Python the default Python, so you can start it with just python. But this is not necessary.

Categories : Python

XPath: select node by position of another node with non-unique node name
The answer will probably involve the position() function, but the devil is in the detail, and it all depends on the context you're operating in at the time. Using XSLT as an example, this works: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="extracted"> <ex> <xsl:apply-templates select="row[position() > 1]" /> </ex> </xsl:template> <xsl:template match="row"> <r> <xsl:apply-templates select="item" /> </r> </xsl:template> <xsl:template match="item"> <!-- the current node is an item, and the current node list is the set of item children of the parent row element. Therefore position() is 1 for the fi

Categories : Xml

Node.js + Node-Webkit + Node-SerialPort Based Application - Is this Possible?
That's what most people use Node.js for https://npmjs.org/search?q=serial+port Again, that's what most people use Node.js for Because of 1 and 3, the most obvious UI for node.js apps is the browser. Write a config page to control your app. Using node-webkit is overkill, just use whatever browser is already available. Node can run multiple listeners on multiple ports, serving the same app. npm install is pretty simple. Go learn how to write simple Node.js apps (with express for easy http servering, and jade or nunjucks for easy html templating) and then move up from there.

Categories : Javascript

Call C++ library from Node.js (Node addons / node-ffi)
node-ffi seems to be primarily for C programs. I went through this in the last week, and found much better luck with node addons. What you have to do is write a shim between the C++ code in the library and node.js. In my case, I needed to encode and decode packets for a security protocol, so I made node buffers that contained the packets, and wrote C++ code that got the data out of the buffers, then send the data to my C code that encoded and decoded packets. This page: http://luismreis.github.io/node-bindings-guide/docs/returning.html has some great examples of how to get data in and out of node.js buffers in C++.

Categories : Node Js

add new child nodes in sibling descendant node based node's child node attribute value
Is this what you were trying to do ? var doc = XDocument.Load("XmlFile1.xml"); var hfIds = (from hf in doc.Descendants("hf").Attributes("id") select hf.Value).Distinct(StringComparer.Ordinal).ToList(); bool addFlag = true; foreach (var c in doc.Descendants("lze")) { foreach (var hfid in hfIds) { addFlag = true; foreach (var attr in c.Descendants("lz").Attributes("hid")) { if (hfid == attr.Value) { addFlag = false; break; } } if (addFlag) {

Categories : C#

How to point to the previous node of the current node and the next node of the current node in C?
You don't need a prev pointer. You just need a temporary variable to keep track of the previous and current node like so: prevNode = NULL; curNode = *p; while (curNode != NULL) { prevNode = curNode; curNode = curNode->next; } Once you find where you want to do your comparisons, you can use prevNode's data, curNode's data and curNode->next's data. Hope this helps.

Categories : C

ActivityManager No longer want my app
Empty process A process that doesn't hold any active application components. The only reason to keep this kind of process alive is for caching purposes, to improve startup time the next time a component needs to run in it. The system often kills these processes in order to balance overall system resources between process caches and the underlying kernel caches. http://developer.android.com/guide/components/processes-and-threads.html

Categories : Android

Is Rgraphviz no longer available for R?
You need to install it directly from the bioconductors site. source("http://bioconductor.org/biocLite.R") biocLite("Rgraphviz") More info can be found here.

Categories : R

Why does compilation through MSBuild take so much longer than through the IDE?
I guess there are some packages for which the IDE somehow can find the compiled dcu's in the path and MSBuild can only find the source. Doesn't MSBuild output a compilation log that you can examine or post here?

Categories : Delphi

Should I have a method name longer than its statement?
Code Complete 2nd Edition has this to say about method name length: Make names of routines as long as necessary Research shows that the optimum average length for a variable name is 9 to 15 characters. Routines tend to be more complicated than variables, and good names for them tend to be longer. Michael Rees of the University of Southampton thinks that an average of 20 to 35 characters is a good nominal length (Rees 1982). An average length of 15 to 20 characters is probably more realistic, but clear names that happened to be longer would be fine. Note the word average. If the method name is as clear as possible, and it's 50 characters, then whatever. It's fine. However, the book does mention another thing a few paragraphs up: If you have routines with side effects, you’

Categories : C#

No-name attributes no longer post
Rails 4 ships with the Turbolinks gem. This gem uses Ajax to speed up page rendering in most applications. It is automatically included when you create a Rails 4 app. The problem was that Turbolinks and Braintree.js were not playing nice. As a result, Braintree.js was not executing and so the encrypted credit card information could not be posted along with the other model bound parameters. I disabled Turbolinks (via gemfile and application.js), and Braintree is back to functioning normally.

Categories : Ruby On Rails

the class chrome_omniboxView is no longer available?
Run Spy++ to figure out the proper class names and window handles you need. You should have it installed assuming you have Visual Studio installed. With it, you can point at the window, see the hierarchy of window handles, and the exact class name you should use with FindWindow()/GetWindow() API calls.

Categories : Dotnet

SSRS - where ... is no more than 30 minutes longer than
You could use DATEDIFF to put something like the following into an expression for the visibility of whatever report element you're trying to hide or display: =DATEDIFF("Minute", e.eCreationTime, i.ClosedDate) <= 30 Or a little more explicitly: =IIF(DATEDIFF("Minute", e.eCreationTime, i.ClosedDate) <= 30, True, False) UPDATED: I see now you're looking for a WHERE clause in T/SQL. Well, it luckily happens there is also a DATEDIFF function in T/SQL (separate from the one in the SSIS Expression Editor): select e.eMapName, e.eFolderName, i.Status, i.AssignedTo, i.ClosedDate, e.eCreationTime from ework.eFolder e inner join ework.Incident_Management i on e.eFolderID = i.eFolderID where datediff(minute, e.eCreationTime, i.ClosedDate) <= 30 Does this help?

Categories : SQL

Rest API V1 No longer Active
I never worked with twitter http api directly. If your twitter codebase is small then you can refactor your code by using a library or implementing some kind of abstraction to make migration to later minor API changes less painful. As I can see from this article migration seems pretty straightforward. You should always authenticate your requests for all API calls.

Categories : IOS

Element is no longer attached to the DOM
The problem The problem you are probably facing is that the method returns the right (and valid!) element, but when you're trying to access it a second later, it is stale and throws. This usually arises when: You click something that loads a new page asynchronously or at least changes it. You immediatelly (before the page load could finish) search for an element ... and you find it! The page finally unloads and the new one loads up. You try to access your previously found element, but now it's stale, even though the new page contains it, too. The solutions There are four ways to solve it I know about: Use proper waits Use proper waits after every anticipated page-load when facing asynchronous pages. Insert an explicit wait after the initial click and wait for the new page / new

Categories : Java

ANT waitfor is waiting longer than it needs to
You may need to insert a short delay (just a few seconds should be enough, by the sound of it) before the first check. I suspect Ant is making its first attempt to fetch the URL too soon and hanging for some reason during that first fetch (before waitfor gets a chance to wait half a second and try again). <sleep seconds="5" /> <waitfor maxwait="3" maxwaitunit="minute" checkevery="500"> <http url="http://127.0.0.1:${product.listenport}/start/"/> </waitfor>

Categories : Ant

github: can no longer commit changes
You may have switched branches, but not created a new 'local branch' for this remote branch.. Netbeans now does not know where to commit to. Also, as there is no local branche, you can not push local to remote. I had this problem with Netbeans before, after a few branche switches. Try to switch to the correct branche (even if you only have one branche).

Categories : GIT



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