w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Javascript/HTML5 - simple File system not working
The error you are seeing is a SECURITY_ERROR. See: https://developer.mozilla.org/en-US/docs/Web/API/FileError?redirectlocale=en-US&redirectslug=DOM%2FFileError for more details. This is because you are using the file: protocol. You have 2 ways around this: Serve files from a (local) webserver. Use Chrome and launch with the --allow-file-access-from-files flag. In general, the file system is meant to access sandboxed local files, so you can't access just any file on disk (this would be a massive security hole). So, you can't just read/write to C:My Documentsmy_credit_card_numbers.txt. A really great tutorial is available at HTML5 Rocks

Categories : Javascript

How to use navigator instead of window.webkitStorageInfo HTML5 File-system API?
The error message tells you to use navigator.webkitTemporaryStorage or navigator.webkitPersistentStorage and you try to use navigator.webkitStorageInfo which is undefined. UPDATE: PERSISTENT should not be passed to navigator.webkitTemporaryStorage or navigator.webkitPersistentStorage but only to window.webkitRequestFileSystem. Then there is no more error. (see: Filesystem API not working in Chrome v27 & v29)

Categories : Javascript

HTML5 File System Info Bar Not Responding In Kiosk Mode
What version of Chromium Portable are you using? I had a similar issue awhile back, but I don't have the same problem in the newer versions. I am using the latest version as of now which is Chromium Portable 30.0.1599.10 (released on 2013-08-21).

Categories : Javascript

PHP Distributed File System, File System for downloading from Network Storage
Network file system, using PHP and MongoDB http://verens.com/2014/11/06/distributed-file-storage-using-php-and-mongodb/

Categories : PHP

file system that is platform independent and where i receive any changes made to the file system
The Java NIO API can do this, and is already platform independent http://docs.oracle.com/javase/tutorial/essential/io/notification.html

Categories : Java

Failure to update an entity in the appengine backend using auto-generated backend API
The issue seems to be arising in the containsEvent() method. From your local, after editing eventsincloud, you are passing a JSON to your endpoint method updateEvent. This then calls containsEvent, passing on a JSON as the parameter event and here you are calling the method getKey() on event. The app engine method getKey() is to be used for getting key value from an entity instance and not from a JSON representation of an entity. You can modify your updateEvent to query an entity by its Id , similar to getEvent . You can either find the id in your cloud or get it at local as you do in eventLocal.getId(), which is a local method for getting Id stored in your JSON. Then in your endpoint method, you can use the id to query the required entity (a working code should be already in place in getE

Categories : Android

Sending a message from cloud backend (Mobile Backend Starter)
I also had the same issue with onBroadcastMessageReceived() in GuestbookActivity . To make it receiving broadcast messages I commented listed below condition in CloudBackendActivity. private void _onPostCreate() { // if (!isSubscribedToBroadcastMessage) { // isSubscribedToBroadcastMessage = true; CloudCallbackHandler<List<CloudEntity>> handler = new CloudCallbackHandler<List<CloudEntity>>() { @Override public void onComplete(List<CloudEntity> results) { onBroadcastMessageReceived(results); } }; cloudBackend.subscribeToCloudMessage( CloudBackendMessaging.TOPIC_ID_BROADCAST, handler); // } this.onPostCreate(); } So the issu

Categories : Android

Call a BackEnd-Method from FrontEnd written in BackEnd
I recommend attaching a CSS class name via the CssClass property of your dynamically created button. Then have jQuery handle the click of the button via event delegation using the on () function. Read jQuery on() function documentation for more information. Once you have jQuery handing the event client side, then you have several choices of interacting with the server (__dopostback, ASP.NET AJAX Page Methods, ASP.NET Web API, asmx web services, WCF, etc.).

Categories : Asp Net

best way to synchronise method
The easiest way to synchronize access to this method would of course be to mark it as synchronized in the signature. @RequestMapping(value = "commentTask", method = RequestMethod.POST) @ResponseBody public synchronized List<List<Task>> reply(@ModelAttribute Task task, @RequestParam ("parentId") long parentId, HttpSession session) { It seems unlikely to me that synchronization here will solve your problem since the code does not seem like it has any particular race condition: it takes care to construct the full URL from the provided Task object. I suspect that somehow either your Task object is not thread-safe or that the wrong parentId is being passed in.

Categories : Java

synchronise local directories over ssh
First option: use rsync. Second option, and it's not going to be a one liner, but can be done in three or four lines: Create a tar archive on the remote system using ssh. Copy the tar from remote system with scp. Untar the archive locally. If the creation of the archive gets a bit complicated and involves using find and/or tar with several options it is quite practical to create a script which would do that locally, upload it on the server with scp, and only then execute remotely with ssh.

Categories : Unix

MySQL, Synchronise two tables
You could write your trigger this way: CREATE TRIGGER `a` AFTER INSERT ON `A`.`answer` FOR EACH ROW INSERT INTO `B`.`answer` VALUES (NEW.col1, NEW.col2, ..., NEW.colN) where you have to specify all column names. Please see fiddle here.

Categories : Mysql

Why won't my scrollbars synchronise properly?
I'm suspecting that your scrollbars don't have the same range. You should connect the rangeChanged(int,int) signal from one of your scrollbars to some function, where you set the range of your other scrollbar to those values.

Categories : Qt

System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite
The assembly cannot be located due to a HintPath declaration in your .csproj file: <Reference Include="System.Data.SQLite, Version=1.0.88.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> <HintPath>E:Developer SoftSQLitesqlite-netFx20-binary-bundle-Win32-2005-1.0.88.0System.Data.SQLite.dll</HintPath> </Reference> It works on your machine, because you really have the .dll at that location. However, the other person may want to use the System.Data.SQLite.dll file you placed in the root of the repository. Since that is one level up from the .csproj, you can use a relative path, like this: <Reference Include="System.Data.SQLite, Version=1.0.88.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> &l

Categories : C#

System.IO.IOException: "The file exists" when using System.IO.Path.GetTempFileName() - resolutions?
As Sayse suggested, you might try setting the %TEMP% environment variable when your app launches. Environment.SetEnvironmentVariable("TEMP", "<dir>");

Categories : C#

What is the best PHP function to get a file hidden in the backend?
Just store the file out of the root directory that holds all of your front-facing files. So assuming your directory structure is as such: root -- public_html -- -- access_book.php -- -- index.php -- -- ... -- books -- -- mobi_dick.pdf -- -- ... Then, just grab your file with a relative path (here is an example pulled from readfile): <?php // Replace this with the path to the actual file $file = '../books/mobi_dick.pdf'; if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate');

Categories : PHP

multi-file backend and severity
BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(my_logger, boost::log::sources::logger_mt); should be changed to BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(my_logger, boost::log::sources::severity_logger_mt<severity_level>); PS: BOOST log suck. Configuration is very complicated (i don't configure it properly yet). Do you know easy to use log lib? I need write logs to different files, severity levels and rotation size.

Categories : C++

Capture file system system calls on Linux platform
How about write your own profiling tool using a wrapper? See GCC -wrapper: -wrapper Invoke all subcommands under a wrapper program. The name of the wrapper program and its parameters are passed as a comma separated list.

Categories : Linux

What is the easiest way to synchronise model changes? Rails
Yes. You can implement after_save hook to listen on any changes in User and Stakeholder model. As you have maintained the relationship between User and Stakeholder, you can retrieve first_name and last_name from User table for particular Stakeholder record. Why you are keeping them twice as same values for fields first_name and last_name you want to store?

Categories : Ruby On Rails

Synchronise 3 threads with 3 condition variables
Quick answer: Don't wait for the variables to be true when you already have the lock. If the readyForTransmit is not true after entering the mutex->Lock() area, it never will be, because none of the other threads can enter their mutex->Lock() area to set it. You seem to synchronize the threads so that you always transmit exactly ONE item, THEN receive exactly one, THEN plot it. That is no parallel behaviour and you could just put them together in one thread, which would be easier and more efficient. I will assume that this is just test code and you will want to, like, transmit multiple items into the buffer without waiting for the plot thread. In this case your problem looks exactly like the consumer-producer-problem, the textbook-example for using semaphores for synchronization. You can

Categories : Multithreading

How to synchronise call in jquery or javascript
You should be passing that variable (CASENAME) around... or the variable should be in the scope of both the functions. Try this: $(document).on('click', '.del', function (event) { var ROW_ID = $(this).closest(".caseRowClick").attr("id"); var CASENAME; //getCaseNameValue(); db.transaction(function (tx) { var caseName_h = $('.caseName_h').val(); $yoursql = 'SELECT CaseName FROM CaseTable WHERE id =' + ROW_ID; tx.executeSql($yoursql, [], function (tx, results) { CASENAME = results.rows.item(0).CaseName; alert("CASENAME" + CASENAME); }); }); deleteData(); deleteFolder(CASENAME); $(".ctrl").toggleClass("togg"); event.stopPropagation(); }); function deleteFolder(CASENAME) { alert(CASENAME);

Categories : Javascript

Is there a way to synchronise 2 sliders with JQuery cycle 2?
Of course, check out the demo Synchronized Slideshows HTML <div class="cycle-slideshow" data-cycle-fx=scrollHorz data-cycle-reverse=true data-cycle-timeout=0 data-index=1 > <img src="http://jquery.malsup.com/cycle2/images/beach1.jpg"> <img src="http://jquery.malsup.com/cycle2/images/beach2.jpg"> <img src="http://jquery.malsup.com/cycle2/images/beach3.jpg"> <img src="http://jquery.malsup.com/cycle2/images/beach4.jpg"> </div> <div class="cycle-slideshow" data-cycle-fx=scrollVert data-cycle-timeout=0 data-index=2 > <img src="http://jquery.malsup.com/cycle2/images/beach1.jpg"> <img src="http://jquery.malsup.c

Categories : Misc

How to synchronise two databases that have used by two diffrent application
Replication is not going to help you out here very much as the table structures are different. An approach I've used before to tie together two systems like this is to write a small api wrapper around the new account, update, login and logoff process. Then when user creates a new user or logs in or logs off or updates application A then you can issue a curl https call via php from server A to your api on Application B and update the state over there. If you can expose the same subdomain on both applications ie, appA.mydomain.com and appB.mydomain.com they can even share cookies which makes single login and logoff easier as your api integration can set the proper logon cookies for both applications at the same time. You'll have to dig in a little bit on how ApplicationB works to buil

Categories : PHP

Synchronise two threads passing events between each other
The problem is the question you are asking really doesn't make sense. Multiple threads are designed to run at the same time and you're trying to play a game of pass the buck from one thread to another to get sequential serialised behavoir. Its like taking a really complicated tool and ask how it solves what is normally a really easy question. However, multithreading is a really important topic to learn so I'll try to answer what you need to the best of my ability. Firstly, I'd recommend using the new, standard C++11 functions and libraries. For windows, you can download Visual Studio 2012 Express Edition to play about with. With this you can use std::thread, std::mutex and a lot [but not all] of the other C++11 goodies (like std::condition_variable). To solve your problem you really ne

Categories : C++

Best way to synchronise data: MySQL -> SQL Server
There are several third-party tools to make this transition easier. Check out SSMA here and here. I'd also look at SQL Studio scheduled tasks to automate the process.

Categories : Mysql

Salted sha512 in C, cannot synchronise with Symfony2's FOSUserBundle
Not really an answer but I'm guessing you have not looked into how Symfony encodes passwords in any great detail? The encoding process is tucked away into an encoder object. For SHA512 we use: namespace SymfonyComponentSecurityCoreEncoder; class MessageDigestPasswordEncoder extends BasePasswordEncoder { /** * Constructor. * * @param string $algorithm The digest algorithm to use * @param Boolean $encodeHashAsBase64 Whether to base64 encode the password hash * @param integer $iterations The number of iterations to use to stretch the password hash */ public function __construct($algorithm = 'sha512', $encodeHashAsBase64 = true, $iterations = 5000) { $this->algorithm = $algorithm; $this->encodeHashAsBase64 = $encodeHashAsBase64; $this->iteration

Categories : C

Hide thumbnail of Backend file uploader in Magento?
Hello chgeck getElementHtml() function in below file lib/Varien/Data/Form/Element/Image.php & comment image tag OR skin/adminhtml/default/default/boxes.css (line 1583) add below css .v-middle { display: none; vertical-align: middle !important; }

Categories : PHP

JS - html5 file reader API - get file as binary string and send it via ajax
img.src = e.target.result; Dude, the "src" attribute of an image is a URL, not a string where every character is an int between 0 and 255 !! You have to use ReadAsArrayBuffer() instead, and then the canvas API to render the ArrayBuffer you have into the context of a canvas. Edit: If you don't want to show it in an image, but just to Ajax it to your server, here is a solution !

Categories : Javascript

Read a local file using JavaScript HTML5 file api (offline website)
I'm afraid I may be the bearer of bad news for your design: The action you are requesting expressly violates the security model as specified in the File API spec. The client implementation of FileReader() must make sure that "all files that are being read by FileReader objects have first been selected by the user." (W3C File API , 13. Security Considerations: http://www.w3.org/TR/FileAPI/#security-discussion). It would be a huge security risk of browser scripts could just arbitrarily open and read any file from a path without any user interaction. No browser manufacturer would allow unfettered access to the entire file system like that. If your script really needs that XML file, you are going to have to instruct users on how to grant the browser access to it, as every browser will prev

Categories : Javascript

Android: File not showing up on file system while trying to copy SQL file from assets to app data directory
I had to override the getReadableDatabase function for the helper class because it has no idea to return myDatabase. The helper loads it up properly and everything, but it never actually returns it. @Override public SQLiteDatabase getReadableDatabase(){ return myDataBase; }

Categories : Android

I want to use a literal "FILE" in Java as a storage point for the data contained in a file system file
As of Java 7 you can have artificial file systems, like the ZipFileSystem, which is very near to what you want. In fact adding a file, removing a file, renaming a file, maintaining relative paths between two file systems. All such examples would be usable for your file system too. Also the new nio API can provide file attributes by free key. The advantage is using one generic API for all file systems. The class Path also holds its file system for instance.

Categories : Java

HTML5 File API modify file.name
I assume that you are using HTML5 File API to store sandboxed file to local file system. You have to get fileEntry object first if you want to modify an exist file's name: window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, function(fs){ fs.root.getFile("targetFileFullName",{},function(fileEntry){ fileEntry.moveTo("original path","newName"); },errorHandler); }, onError); FileEntry.moveTo function help you move or rename file. You just want rename it so all you have to do is assign new name to parameter two and do not change file path parameter. I wrote a jsfiddl demo that show a list of your local storage files and a target name field means which file you want to modify and a new name input field: After you press the change button. The "test3.txt" file will b

Categories : Javascript

Could not load file or assembly 'Oracle.Web, Version=2.112.1.0... The system cannot find the file specified. (It's already loaded in my GAC)
I'm not exactly sure why this didn't work, but what I did was simply install the 32-bit and 64-bit versions of ODAC 11.2 Release 5, which took care of registering all required assemblies in the GAC, among several other tasks I'm sure. Once installed, I ran the app, and it worked fine. Thanks to all that have contributed to this.

Categories : C#

how to show a file chooser dialog in GWT with server-side file system?
GWT does not have an out-of-the-box widget+servlet doing that, and I dont know any 3party library doing that (but maybe you have some success searching in the web). So you have to create a service in server side to provide the info (folders and files list). In client side I would use a CellTree which is very appropriate to display a filesystem structure.

Categories : Gwt

How do I know what file wasn't found when java gives the error "The system cannot find the file specified"?
Let us go through this, step by step. Caused: java.io.IOException: Cannot run program "gfortran.exe" (in directory "C:UsersJason ZwolakAppDataLocalTemppet2-biopack-Jason Zwolak"): CreateProcess error=2, The system cannot find the file specified If you look at the end of the line, it states that gfortran.exe cannot be found in the directory listed, or "The system cannot find the file specified." Now, this will always be the case, IF the file cannot be found. So the file can't be found, not the command. We know that this isn't a library that depends of gfortran.exe or the library would be explicitly stated that the error is caused by a dependency in the stack. This exception can be thrown when a file exists, but can't be accessed. This happens when file permissions don't allow reading

Categories : Java

Using .ogg file while with
Try using 3rd party HTML5 video player library, e.g. VideoJS for better support of different formats, browsers, as well as providing Flash player fallback.

Categories : HTML

Batch file move command "The system cannot find the path specified." despite correctly identifying the file to be moved
Shouldn't your target path be: "C:Main DatabaseRawArchive\%mydate:~0,8% ... ? it is: C:Main DatabaseArchive\%mydate:~0,8% ... => move /y "C:Main DatabaseRawIN*.CSV" "C:Main DatabaseRawArchive\%mydate:~0,8%IN" move /y "C:Main DatabaseRawOUT*.CSV" "C:Main DatabaseRawArchive\%mydate:~0,8%OUT"

Categories : Batch File

Node-Webkit: How to create a file in the local file system?
It sounds like you might be trying to use the web filesystem API. That might be a reasonable solution, it would allow you to run your app as a regular webpage, however the web filesystem API is sandboxed. node-webkit offers "Complete support for Node.js APIs," which I think means you can use the node.js file system API to write anywhere on the file system. Pretty cool. So something like this should work: var fs = require('fs'); fs.writeFile("path/to/anywhere/test.txt", "Hi mom!", function(err) { if(err) { alert("error"); } }); Also, node-webkit web-workers do not support require I hear. So you'll need to do your filesystem stuff in your main thread.

Categories : Javascript

Taking a file list using os.system(ls -1) and write it in a file in python
On Unix, os.system returns the exit code of the process you invoked. So, os.system("ls") will give you an integer, not a list of files. Instead, use the subprocess module. The check_output method will give you the values that are printed to the screen. import subprocess result_of_ls = subprocess.check_output(["ls", "-l", "/amxusers7/inf/aimsys/netabp6/ALL_SCRIPTS/VOICE"]) As an example gives: total 75032 -rw-rw-r-- 1 user user 0 Jun 3 22:04 122.txt -rw-rw-r-- 1 user user 0 Jun 3 22:04 154.txt -r-------- 1 user user 8666 Mar 29 22:11 2731_74814450810_2074865_n.jpg -rw-rw-r-- 1 user user 111872 May 30 21:40 3065397482_cd8b581c9a.jpg -rw-rw-r-- 1 user user 24661 Jun 18 13:11 375585_782393371042_1430263587_n.jpg Taking the single string return

Categories : Python

How to encode a file from the file system as multipart/form-data?
You need to open that photo (of type Windows.Storage.StorageFile) for reading, convert it's stream to blob, append it to FormData object and upload using whatever Ajax library you want (WinJS.xhr, jQuery.ajax etc). Following code illustrates it better than words: file.openReadAsync().done(function(fileStream) { var fileData = MSApp.createBlobFromRandomAccessStream(file.contentType, fileStream); var formData = new FormData(); formData.append('upload', fileData, file.name); ... // send formData as xhr request body });

Categories : Javascript

JavaScript creates and saves a file to local file system
I've just tested it, google doesn't create a file named log.txt (but the file will be accessible via the File-API by using this name). For me (WinXP) the file is located in %LOCALAPPDATA%/Google/Chrome/User Data/Default/FileSystem/ You'll find there some folders named by numbers, inside these folders may be 2 folders named t and p . You have ro search within the t-folder(because you have used window.TEMPORARY) Inside the t-folder is one more folder named by numbers, which contains files named by numbers. These files are the stored files. For me it's e.g. %LOCALAPPDATA%/Google/Chrome/User Data/Default/FileSystem/000/t/00/00000000

Categories : Javascript



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