w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
which is faster, saving chat history in a text file and display it or using mysql db to save chat history
For a real-world implementation, I wouldn't consider either one of these a good option, but it definitely could be fun to play with. Using files isn't going to scale as well as the db,well... as easily. But really, I'd look into just setting up a jabber server and play with that. Or maybe look into node.js.

Categories : PHP

DBD-mysql installed ,but still error "install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC"
Perhaps the DBD::mysql perl module hasn't been fully installed ...so install it. cpan DBD::mysql Or since you don't have internet access, perl Makefile.PL make make test make install You'll need MySQL's development header files installed first, as per INSTALL

Categories : Perl

Cannot locate mysql instance in Solaris 10
svcs shows service if this serivce building with SMF (Service Management Facility). In classic model service using control-scripts from /etc/init.d/ Error message "command not found" maybe occurred if your PATH variable does not contains paths where stored mysql, for example: /usr/local/bin/mysql. If you are sure that a server with Solaris installed mysql - try find mysql file on your file system. For find run command: find / -type f -name mysql

Categories : Mysql

How to locate mysql database on lan server...?
Use a DNS name for the MySQL server, rather than using the IP address. Then, should you need to change the server IP address you update the DNS entry and your clients will use the new server. Of course, if you anticipate this happening you should make your connection parameters easily configurable in the first place.

Categories : Mysql

Return specific text from MySQL using LOCATE and SUBSTRING
Something like this should work; SELECT SUBSTRING_INDEX( LEFT(description, GREATEST(LOCATE(' yards (', description), LOCATE(' yard (', description))-1), ' ', -1) FROM nflPxP An SQLfiddle to test with. While this query works for a row that is fetched by some other search criteria, it's not indexable, so you may want to just add a separate column to store the data if searching the data is required.

Categories : Mysql

Prerequisite installer (setup.exe) results in 'Unable to locate application file [file].msi' after restart
Just found the problem - my installation was executed from WinZip self-extractor which deletes the extracted files once the setup ends. Because one of the prerequisites required a restart, before the computer was restarted, the files had been deleted by the self extractor... Beware of self extractors folks! :)

Categories : Visual Studio 2010

How to locate the properties file in the spring context configuration file
Instead of: <context:property-placeholder location="/WEB-INF/spring/jdbc.properties"/> Use: <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" p:location="/WEB-INF/spring/jdbc.properties"/> And your properties will be available in Spring file, and don't forget to add a namespace: xmlns:p="http://www.springframework.org/schema/p"

Categories : Spring

History field in MySQL database
Use triggers on update rule. There set value of price to price_old CREATE TRIGGER `update_price_old` BEFORE UPDATE ON `table_name` FOR EACH ROW BEGIN UPDATE `table_name` SET price_old = OLD.price where OLD.id = id; END

Categories : Mysql

Can't locate file despite given path
You need to use the absolute file path. As you can see from your question, your code is looking in the wrong place for your file: C:xampphtdocsPVT oot estsunit-test estFunctions estFunctions.php vs C:xampphtdocsPVT ootsecurefunctions.php I use Linux, and I'm not sure if this would work in Windows, but try referencing the current/main directory the project is in, a la ./secure/functions.php if it were Linux.

Categories : File

Using VB locate an IP address within an XML file
This is an easy was to load the xml file. Once you know the element name to search for it is pretty easy. In my example the ipaddress is in the element named ipAdress. Dim x As XElement = XElement.Parse({xml string}) Dim ip As String = x...<ipAdress>.FirstOrDefault.Value

Categories : Xml

Locate nodes in XML file
Looks like the issue is that the XML uses namespaces, and your XPath does not. You didn't post your full XML, but you probably have something like xmlns:nc="http://some.url/ in there. Make sure to include a the namespace in a namespace manager, then add namespace prefixes to your query: var nameTable = new NameTable(); var nsMgr = new XmlNamespaceManager(nameTable); nsmgr.AddNamespace("nc", "http://some.url/"); var dataNodes = xmlDoc.SelectNodes("nc:RecordFilingRequest/nc:DocumentIdentification", nsMgr); foreach (var node in dataNodes) { var ID = Convert.ToInt32(node.SelectSingleNode("nc:IdentificationID", nsMgr).InnerText); // insert into database, e.g. using SqlCommand or whatever }

Categories : C#

How to optimise change history data for MySQL
You need a slow changing dimension: i will do this only for e-mail and telephone so you understand (pay attention to the fact of i use two keys, 1 as unique in the table, and another that is unique to the user that it concerns. This is, the table key identifies the the record, and the user key identifies the user): table_id, user_id, email, telephone, created_at,inactive_at,is_current 1, 1, mario@yahoo.it, 123456, 2012-01-02, , 2013-04-01, no 2, 2, erik@telecom.de, 123457, 2012-01-03, 2013-02-28, no 3, 3, vanessa@o2.de, 1234568, 2012-01-03, null, yes 4, 2, erik@telecom.de, 123459, 2012-02-28, null, yes 5, 1, super.mario@yahoo.it, 654321,2013-04-01, 2013-04-02, no 6, 1, super.mario@yahoo.it, 123456,2013-04-02, null, yes most recent state of the database select * from FooTable where

Categories : Mysql

eclipse can not locate my foregroundcameraplugin.xml file
I was able to reply the error with the new Eclipse Kepler and found the solution: upgrade your ADT to version 22 and install Android SDK Build-tools by SDK manager. I have also commited a new classpath file for ForegroundCameraPlugin project with some changes (included Android Private Libraries). Thanks to your contact and the help of this link: Eclipse giving error, missing R.java file after recent update

Categories : Java

Closed connection with ORMLite and MySql
I think this is a FAQ. After a while the server may close a database connection because it has not been used in a while or for some other reason. I talk about the ways to keep a connection open in this answer here: org.hibernate.exception.GenericJDBCException: could not execute query To quote, there are many ways you can work around this problem: You can issue some sort of "keep alive" type of query (ex: SELECT 1) on the connection every so often to keep it alive. This assumes that it got closed because it was idle. You can re-open the connection every so often. If you get a connect closed exception then you can just reopen the connection. Duh. You can use a connection pool which can do the keep-alive and the reconnection for you. Apache's DBCP is a favorite of many. See my

Categories : Mysql

Unable to locate asset (the file does not exist)
You can not use expressions inside context expression. But you can obtain asset through AssetSource service: @Inject private AssetSource assetSource; public Asset getSignImage() { final String path = "layout/images/" + itemProperty.getSignImage() + ".png"; return assetSource.getContextAsset(path, null); }

Categories : Misc

Where should I locate the independent php file in symfony2.3 which is being used in my contoller?
You could obtain the full path of the current file (your controller) with: dirname(__DIR__) Based on that you can obtaining the parent directory like: dirname(dirname(__DIR__)) And so on until you reach the desired path. As an example, I located the recaptcha lib under a folder named libs inside Resources directory (src/Company/Project/Bundle/Resources/libs/recaptchalib.php) and I require it on my Controller like follows: require_once dirname(__DIR__).'/Resources/libs/recaptchalib.php'; You could do something similar with the shell_exec command. Hope it helps.

Categories : Misc

Locate the file path on a Joomla website PHP
To find out the folder, adding the following PHP code to somewhere in your site should do the trick (index.php is probably your best bet): <?php if (defined('JPATH_BASE')) { echo JPATH_BASE; } else { echo getcwd(); } ?>

Categories : Joomla

Cannot locate the wav file in the root folder of the project
Assuming you have a directory called audio in your project you could access the file with a string like this: "..audiosound.wav" Or if your application is being run in a directory further down in your project you can use "~" to access the home directory

Categories : C#

How do you sunset a file in git? (I mean remove a file but preserve its history.)
git rm removes a file, and the subsequent commit commits the removal of that file. Removals are a change like any other, and are tracked by git. Checking out an old repo will restore the whole repo as it originally was, including files that are no longer in the tip of the tree.

Categories : GIT

Cannot read XLSX file - Exception with Stream "Cannot access Closed File
The difference is probably in the method: excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); Can you show us that code and verify that you're not accidentally prematurely closing the stream?

Categories : C#

Incomplete lines written into txt file when the file is closed - Android
Try using flush before closing: public void stopSaving() { try { myPrintWriter.flush(); myPrintWriter.close(); } catch (IOException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } try { myOutWriter.flush(); myOutWriter.close(); } catch (IOException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } try { fOut.flush(); fOut.close(); } catch (IOException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } }

Categories : Android

Increase file upload size but cannot locate/access php.ini
Create an .htaccess document and put it in you document root directory. Inside, place: php_value upload_max_filesize 10M Source: http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/ Honestly, I've never tried this, but it appears to be what you need. Edit: Here's something else I found, you can try: ini_set("upload_max_filesize", "xM"); where x is a number and the M signifies Megabytes. I'm not sure if it works with all versions, but it's listed as being editable on the php website (http://www.php.net/manual/en/ini.list.php).

Categories : PHP

cannot locate .npmrc file after installing nodejs and npm on ubuntu 12.04
There can be per-user, global and built-in npmrc configs. So don't worry about if there is no .npmrc file in your home directory. userconfig may or may not exist. You can check the documentation on npm configuration files. userconfig is not created for all users. To check if user config is there and its location you can do : npm config ls -l | grep config My output comes out as ; cli configs ; userconfig /home/ubuntu/.npmrc globalconfig = "/data/storage/node-v0.8.8-linux-x64/etc/npmrc" userconfig = "/home/ubuntu/.npmrc" The global npmrc exists where the npm is installed. And user's has its own. The userconfig file has higher priority over global config, when searching for keys. But if it is absent globalconfig is used.

Categories : Node Js

Bash - How can I locate a specific file in a directory within a loop?
try export d="`pwd`" find ./A/*|while read file do echo "$file" if [ -f "$d/B/${file}_extendedname1.jpeg" ] then echo "$d/B/${file}_extendedname1.jpeg" found fi done

Categories : Bash

Java code can't find or locate specified file path
I suggest you check the path of the file and that is exists before you try and delete it. Like below File f1 = new File(path); boolean sucess; if (f1.exists()) { success = f1.delete(); } else { System.out.println( "I cannot find '" + f1.getAbsolutePath() ); } This will print the file path if it cannot be found. Alternatively you could use Files.delete(Path)

Categories : Java

MySql clients are using or haven't closed the table properly
The reason why MyISAM tables get corrupted is inherent to the implementation of this engine. It relies on the operating system to flush database buffers back to disk instead of using a Write-Ahead-Log and a dedicated strategy to flush dirty buffers. MyISAM is also not transactional. I strongly suggest using the InnoDB engine which seems much more suitable for your case (table order_line). MyISAM is just not the right engine for your use case.

Categories : Mysql

Keep communication with database mysql when the browser closed by user
I would do exactly what @Joachim suggested and follow this flow: Replace residual_time with start_time with type being datetime. Add last_update with type being datetime. When the user clicks start set the start_time and last_update with the NOW() MySQL function Write a function and run it with AJAX every 30? second to check if last_update is 60 minutes past start_time and if so to stop the questionnaire and clear both start_time and last_update. Now let's assume a user quits and logs out mid time alloted and then logs back in to continue: //sudo code example //check if start_time is set if(isset(start_time)){ //check if last_update time is set if(isset(last_update)){ //calculate the time difference in minutes from previous start_time and last_update time time_

Categories : Mysql

Code::Blocks, Unable to locate header file even though its in the same project
Always use forward slashes in your #include directives. Backslashes only work on Windows. The layout of your Code::Blocks project has no effect on your C++ compiler. Go to Code::Blocks' project page and make sure that the folder in which include lies is in your include path. That setting should be in Project->Build Options->Search Directories->Compiler.

Categories : C++

PayPal Sandbox history redirects to REAL history
It's a known issue - sorry. Trying to change the URL to the Sandbox one still redirects you to the Live site and, occasionally for whatever reason, a security certificate page. A fix is coming soon. If you want to be updated on the issue as it goes on you create a ticket at PayPal.com/mts, let me know what the ticket number is, and I can grab it. Edit: This should be resolved now. I cleared my cache and cookies, closed the browser, and tried it out. I was able to view the transaction history in the Sandbox.

Categories : Paypal

How to detect Backbone.History referer (history length)
You can do the following: Router initialise function - this.on("all", this.storeRoute); this.history = []; Then the storeRoute function (also in router) - storeRoute: function() { return this.history.push(Backbone.history.fragment); } The also in router - previous: function(){ if (this.history.length > 1) { return this.navigate(this.history[this.history.length - 2], true); } } So, then you can just call yourApp.router.previous() at any time!

Categories : Javascript

Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

How to keep documentation history separate from source history?
You can do à la GitHub with their gh-pages branch: git checkout --orphan project-doc The branch will have its own history while being in the same repository.

Categories : GIT

history.js - initial page not being stored in history
You can to call statechange event by jQuery into the: $(document).ready(function(){ ... jQuery(window).trigger('statechange'); });

Categories : Javascript

Copy file and its entire history
You want to use the -C flag. That will detect copies as well as renames, so it can follow the history. diff, blame, and log accept this flag. Like @madara-uchiha said though: you should look at using tags, and maybe generating your git-x.y files from them instead. You can use something like the following to fetch the contants of a file at a given tag: git show v0.6:git.php > git-0.6.php Where v0.6 is the tag you're interested in. Update: Here's a small script to do it. This first one assumes your tags are of the form x.y or x.y.z: #!/bin/bash versions=$(git tag -l | egrep -o '^[0-9]+.[0-9]+(.[0-9]+)?$') for version in $versions do git show $version:git.php > git-$version.php done If you're tags are of the form vX.Y or vX.Y.Z and you want git-x.y.php or git-x.y.z.php

Categories : GIT

GIT copy file preserving history
Unlike subversion, git does not have a per-file history. If you look a the commit data structure, it only points to the previous commits and the new tree object for this commit. No explicit information is stored in the commit object which files are changed by the commit; nor the nature of these changes. The tools to inspect changes can detect renames based on heuristics. E.g. "git diff" has the option -M that turns on rename detection. So in case of a rename, "git diff" might show you that one file has been deleted and another one created, while "git diff -M" will actually detect the move and display the change accordingly (see "man git diff" for details). So in git this is not a matter of how you commit your changes but how you look at the committed changes later.

Categories : GIT

Restore moved file's history in Git
No, there is not. Git does not have any notion of file identity. It stores content of directory trees. Only the tree as a whole has notion of history. There is only one reason to track that a file was renamed instead of old one deleted and new one added and that is to allow merging changes in that file. Since you changed the file (beyond what the rename detection considers similar), there is no chance to merge the changes without conflict anyway, so there should be no practical difference. Note that Git does handle the merge reason by searching for similar file. It does this in git status and in all merges automatically and in git log, git diff and other commands showing changes if you ask for it. If it does not find the rename, it is unlikely to be possible to do a merge.

Categories : GIT

Combine subversion file history
It is possible. However, it is some work and it is not perfect. Let's assume only one file was moved, and it happened in rev 42. Create a feature branch right before it happened: svn cp ^/trunk@41 ^/branches/fix Go to the feature branch, merge the bad rev 42 and fix the move before committing: svn switch ^/branches/fix svn merge -c 42 ^/trunk svn revert foo.txt bar.txt svn mv foo.txt bar.txt svn commit Verify the results. The following command should show only changes for the property svn:mergeinfo: svn diff ^/trunk@42 ^/branches/fix Sync merge all other changes from the trunk: svn merge ^/trunk svn commit Reintegrate the branch into the trunk: svn switch ^/trunk svn merge --reintegrate ^/branches/fix The file bar.txt now contains the whole history. Although the revisions s

Categories : Svn

Git: Find code in a file's history
Can use the pickaxe git log -S preg_match -- datacar.php and if you want the diffs git log -p -S preg_match -- datacar.php More info -S<string> Look for differences that introduce or remove an instance of <string>. Note that this is different than the string simply appearing in diff output; see the pickaxe entry in gitdiffcore(7) for more details.

Categories : GIT

File being used by another process even if closed it before
When you are using using you don't need to close Stream because it automatically close the Stream after using; so try this code: using (FileStream fs = new FileStream(assemblyFile, FileMode.Open, FileAccess.Read, FileShare.Read)) { //read a file and write to memorystream. }

Categories : C#

Reopening closed file: Lua
So, now the problem is that the "LoadScript" function isn't doing what you expect: Because I'm psychic, i have divined that you're writing a Crysis plugin, and are attempting to use it's LoadScript API call. (Please don't assume everyone here would guess this, or be bothered to look for it. It's vital information that must form part of your questions) The script you're writing attempts to set Backup - but your script, as written - does not separate lines with newline characters. As the first line is a comment, the entire script will be ignored. Basicallty the script you've written looks like this, which is all treated as a comment. --[[ comment ]]--Backup="Hello!" You need to write a " " after the comment (and, I'd recommend in other places too) to make it like this. In fact, you d

Categories : Windows



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