w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Methods for tracking changes to hard drive
For realtime tracking when file or directory changes you can use inotify on Linux or FileSystemWatcher on Windows. Combine with rsync to get delta.

Categories : Svn

how to shrink KVM hard drive image
Images can be sparsed, and your cp might not respect that for various reasons. I would: check the real file usage (du -sh vm.img or qemu-img info vm.img) use qemu-img convert -S to recreate a sparse image convert to qcow2 to have growing and versatile image instead

Categories : Misc

Is there a way to read directly from the hard drive to the GPU
The GPU is not directly connected to the system RAM. There's a bus inbetween, in current generation computers a PCI-Express bus. ATA storage has a controller inbetween. There is no direct connection between memories. BUT there is DMA, which allows certain periphials to directly access the system memory through DMA channels. DMA on PCI-Express also works between periphials. Theoretically a GPU could do DMA to the ATA controller. Practically this is of little use! Why? Because of filesystems. Even if there was some kind of driver support to let the GPU access a storage periphial directly, it'd still have to do all the filesystem business, which doesn't parallelize to the degree as GPUs are designed for. Alas regarding your question: In my OpenGL program I read from the header file t

Categories : Opengl

Adding a new hard drive to xampp
If you want to sort of "span" the drive, Windows has this handy feature (similar to linux's symlinking) called mklink which you can create a folder in the current directory that is just a symbolic link to the drive. Quick and easy way to span it. I am not sure of any downsides to do doing this, other than if the drive letter changes (if external drive). That way you should not have to add or change any of your paths in the config etc. Not sure if that is what you were looking for, but hopefully it helps. Also, did you try your 3rd config you pasted? Did it not work? From what I can see, as long as permissions are fine it should work that way.

Categories : PHP

How to identify system hard drive using Win32_DiskDrive
The documentation you linked has the answer: string SerialNumber; uint32 Signature; Your management object will have those properties in it. If you're getting null for those values then the problem is that you're using a version of Windows that doesn't support them. SerialNumber ... Windows Server 2003 and Windows XP: This property is not available. In which case you have to use the Signature property, but this requires XP SP3 I believe.

Categories : C#

Accessing a file on the server's hard drive
You cannot reach the file that is "above" the wwwroot folder by design. The way to do this is to a) copy the file there, b) setup a symbolic link (if on linux) or c) preferably, move / setup another web root folder. Alternatively, write a server script to dump the file contents.

Categories : Javascript

Unmount my external hard drive in bash
Searching for "Unmount Hard Drive Terminal" yields http://ubuntuforums.org/showthread.php?t=842698 as the first result. >.> russlar provides a solution: open terminal, and run df -h. this will tell you all the hard drives mounted. then, run sudo umount /dev/something, where somethign is the name of the hard drive that you want to unmount. Nothing wrong with asking, but when a solution is on the first Google result, it's a little... odd.

Categories : Misc

Save Work Done In MS Word To A Database Not On A Hard Drive
The method you are using is extremely inefficient and I wouldn't recommend the process, but the reason that you code is failing is your length.... when you are saving your MemoryStream you are setting the length int len = Application.ActiveDocument.Content.StoryLength; but when you try to retrieve it, you are setting it int len = int.MaxValue; which would be far past the end of the data stream.

Categories : C#

Remove files from a NetBeans project but not the hard drive
Solution working with Netbeans 7.3.1: right click on your project in the "Projects" window, click on "Properties", click on "Ignored folders" in the left panel called "Categories", click on "Add folder" and select the folders you want to ignore.

Categories : Misc

How to remove file permissions on linux from an external hard drive?
To make the partition accessible under Linux run: sudo chmod -R 777 /media/<drive-name>/ this should make the mac drive accessible for you. Changing ownership would do about the same, but you need not worry about it.

Categories : Linux

Is three a way for a Chrome App to reach user's file on hard drive with permission?
Streaming can be done using HTML5 Video tag. Please check : http://html5doctor.com/the-video-element/ Also, you can use plugins like : http://www.videojs.com/

Categories : HTML

Single git repo setup tracking multiple locations on hard drive
No, there is no mechanism in git for this. Git assumes that all files that it manages (the "working copy") live in a single directory (and subdirectories); there is no support for managing two separate directories in in repo. So you'll have to somehow keep everything in one directory, probably as subdirectories HTMLTemplates and theme or similar. You could use two git repos, but I'd strongly advise against this. A single repo should contain a whole "project", i.e. everything needed to build one piece of software (excluding things like external libraries). If you split your project across two repositories, you cannot usefully branch and merge (because you'd have to do it in both repos simultaneously), you cannot easily check out old versions etc.. To solve your problem, I see a few poss

Categories : Wordpress

Change my current working directory in Python to my external hard drive.
You are correct. >>> 'E:CollegeProject3dlife-gc-2013-dataset-hhi3dlife-gc-2013-dataset-hhi' 'E:\College\Projectx03dlife-gc-2013-dataset-hhix03dlife-gc-2013-dataset-hhi' Double the backslashes, use forward slashes, or use a raw string.

Categories : Python

How do I bind a WPF Image element to a PNG on the local hard drive using a relative filepath derived from a DB?
You need to use custom value converter to convert strings to images if you want to load files from the file system. Image.Source, when a string is passed, expects a file name from resources. You can find implementation of a such converter here: Display an image in WPF without holding the file open.

Categories : C#

Python upload an Image form my hard drive and show it on a canvas wideget.
There's a handy module for that: tkFileDialog! import tkFileDialog tkFileDialog.askopenfilename() The function will return the path to the file for you and theres a variety of options you can set here

Categories : Python

My Apple MacBook hard drive crashed - provisioning profiles lost, is there a way I can still update my app?
Create a new certificate if needed then create a new set of provisioning profiles. Install the updated profiles and update your apps to use the new profiles. That's it. Not that big of deal other than spending 30 minutes redoing this stuff.

Categories : IOS

Serial Communication gets back wrong answer when something is running in the background (like browsing the hard drive)
Note: serialPort.Write(string) is a non-blocking store into the output buffer. That means the following won't guarantee you've even finished writing your request before you stop listening for a response: serialPort.Write(request); Thread.Sleep(50); _shouldStop = true; You could add: while( serialPort.BytesToWrite > 0 ) Thread.Sleep(1); // force blocking but it's ill advised. One thing I'm wondering. There is only a single serial port here. Why do you want many different threads to work with it when you could manage the entire serial port interaction with a single thread? (Or at worse, 1 thread for input 1 thread for output) To me it makes a lot more sense to store up requests into a queue of some kind and then peel them off one at a time for processing in a single threa

Categories : C#

Need Apps Script to Copy a File(s) from my Local Hard Drive to a Google Sites Folder
You have to write an UI to that allows the visitor to the site to upload the file. See https://developers.google.com/apps-script/reference/ui/file-upload for an example.

Categories : Google Apps Script

google drive api - copyfile working only with permission for accessing all files in drive (but jst need to copy)
According to the documentation, Files.copy() requires at least one of the following three permissions: https://www.googleapis.com/auth/drive: "View and manage the files and documents in your Google Drive" which is the one you want to avoid https://www.googleapis.com/auth/drive.file: "View and manage Google Drive files that you have opened or created with this app." Which means you can freely create any file but only open the files your app created. You can only copy a file you created, but you cannot copy any other files even if it is public. https://www.googleapis.com/auth/drive.appdata: "View and manage its own configuration data in your Google Drive" Which only lets you control your application-specific Appdata folder which is probably not what you want. You can only copy a file with

Categories : Javascript

Google drive: Get (root) file and folders with javascript api (get only deleted files on drive)
Same situation as following question: google drive api, javascript list files returns nothing I needed to add to the scope the path 'drive' at authorizing, I had only drive.file which is intent to create/edit files only. The weird thing is that the API returns deleted files when you don't have permissions to view files, I think it's a bug in the API (a serious one). Post this bug on google drive: https://productforums.google.com/forum/#!searchin/drive/security$20issue$20permission$20view/drive/pupjKxTz9FU/cUarGIl_Ah0J

Categories : Javascript

Error while Retriving files from google drive using drive API. “Calling this from your main thread can lead to deadlock
You should do any code that could take a long time such as I/O or network activity on a different thread. In your situation your file retrieval would be best done within an ASyncTask. The reason for this warning is because when your code is being executed to retrieve the file from Drive, the code will block until the file retrieval has completed, this means that nothing else within the program will be able to respond, i.e. GUI will not update and input from the user trying to do stuff with the GUI will not be registered. After a few seconds, if the file retrieval still isn't complete, then the user will be presented with an ANR (Application Not Responding) message. This will either give the user the choice of waiting, if their patient, or most likely force closing your app.

Categories : Android

Google Drive Javascript API: Detect drive changes - return changes only
Start with zero on your first call. Within the response is the current largest change id, which you need to store and use on the next request. In your code, it will materialise as "resp.largestChangeId".

Categories : Javascript

Monitoring changes in Google Drive files for whole domain using Drive API
Domain-wide delegation simplifies the authentication portion for your app but you'll still need to auth as each user to get their files and changes. It may be possible for your app to "grab" all files and make itself (or a special user) the owner, then you just have one user account to scan but the "grab" process would still need to run at regular intervals to find new files created or uploaded by end users. I believe most apps that need to scan content at this level do it via cron jobs or AppEngine task queues which make it easy to chunk up the scans throughout the day. Generally they expect to scan each user account once every 24 hours or so.

Categories : Google App Engine

How can i run perl "prove" using maven's pom.xml
The simplest way to run an external command may be through the exec-maven-plugin. See the example for how to bind execution to a phase of your build. A configuration like: <configuration> <executable>perl</executable> <arguments> <argument>src/main/bin/script.pl</argument> <argument>arg1</argument> ... </arguments> </configuration> will run a script through Perl.

Categories : Perl

Why can't I prove that I need an AtomicReference in my code?
Your code is thread-safe, because the CountDownLatch guarantees that every change done before await() returns happens before everything done after. See http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/package-summary.html: Actions prior to "releasing" synchronizer methods such as Lock.unlock, Semaphore.release, and CountDownLatch.countDown happen-before actions subsequent to a successful "acquiring" method such as Lock.lock, Semaphore.acquire, Condition.await, and CountDownLatch.await on the same synchronizer object in another thread.

Categories : Java

How to prove correctness of this algorithm?
The point of the exercise is that this recurrence can be proven with induction. Once it is proven, then we have proven that f(n,n) is the minimum cost for winding up with a solution where the nth value is at most bn. To finish proving the result there is one more step. Which is to prove that any solution where the nth value exceeds bn can be improved without increasing that maximum value. But that's trivial - just omit one of the +1s from the first value to exceed bn and you have a strictly better solution without a larger maximum. Therefore no solution winding up with a maximum greater than bn can be better than the best with a maximum at most bn. Therefore we have the optimal solution.

Categories : Algorithm

How can I prove or disprove the efficiency of compilation?
EDIT, okay that was fun... Folks that make the blanket statement that compilers outperform humans, are the ones that have not actually checked. Anything a compiler can create a human can create. But a compiler cannot always create the code a human can create. It is that simple. For projects anywhere from a few lines to a few dozen lines or larger, it becomes easier and easier to hand fix the optimizations made by a compiler. Compiler and target help close that gap but there will always be the educated someone that will be able to meet or exceed the compilers output. The claim I would like to prove or disprove is that compilers generate code that is 2-4X "fatter" (and therefore consume 2-4X times as much power) compared with hand written assembly code. Unless you are defining

Categories : C

Where can I find a U-Prove implementation for WS-Trust?
Although this isn't the implementation per-se, it is a document that describes the implementation http://research.microsoft.com/apps/pubs/default.aspx?id=166974

Categories : Wcf

Does unit testing prove functionality?
Unit tests are for testing each individual sub system. You have to write an integration test to ensure that all the different subsystems work in concert. You can not conclude that a program works just because the unit tests for its parts are passing. Mostly because unit tests typically abstract and simulate the integration points. You need the integration test to ensure proper integration between the different components. I think it's a judgement call to decide what needs testing. No two system are equal, and the testing requirements are also often different for different systems

Categories : Unit Testing

Scala Cannot prove type equality
this.type is the type of a specific instance. It is not compatible with any other instance, even if instances of the exact same type. So basically in this definition: def -[A](other: A)(implicit evidence: this.type =:= A): this.type your evidence tries to prove that other is the exact same instance as this, which is probably not what you has in mind. I think you'll want to rework your design. You might try to use F-bounded polymorphism instead: trait Operable[Self <: Operable[Self]] { def +(other: Self): Self def -(other: Self): Self def *(other: Float): Self } /** Position descriptions */ trait Pos[T <: Operable[T]] { def eval: T } def test[T <: Operable[T]](x1: Pos[T], x2: Pos[T]): T = { x2.eval - x1.eval }

Categories : Scala

Prove big O of addition and subtraction of functions
Formal definition : f(n)=O(s(n)) if and only if two constants M>0 and N>0 exist such as for all n>N , |f(n)|<M|g(n)|. (equivalent definitions exist such as the one given by adi, you can find more in wikipedia) The two constants are not unique, but they cannot depend on the variable n, if they do there are not constant anymore and you will have proved nothing. I strongly recommend you to calculate and to manipulate the definitions by yourself. Only reading answers will not be sufficient to cope with future problems involving the notions described here a) is false : counter-example : let f(n)=n, s(n)=n, g(n)=1 and r(n)=n we have : f(n)=O(s(n)) (N=1, M=1 do the job for the definition) and g(n)=O(r(n)) (same, N=1, M=1) let suppose that f(n)-g(n) = O(s(n)-r(n)), we have the t

Categories : Algorithm

function to prove if file exists
$html.=sprintf("<td>%s</td> ",any_function()); means your taking the return value of any_function and insert that in your string, which later will be echoed. But if (file_exists($testPath)) { $path = $testPath; echo $path; break; } already echoes something ($path) which obviously will corrupt your output. Delete that echo line. same in the other function.

Categories : PHP

Windows: How to symlink drive to another drive?
No, mklink isn't going to do it for you. What you need to do is to create a virtual hard drive (VHD) and copy the client's data to it. (Or modify the export script, which is the best thing to do.) I used Windows 7 to test my instructions below. Start-> run-> diskmgmt.msc (accept all defaults... I'm not doing anything special below) From the menu bar select Action -> Create VHD Choose the location and name the file (which will be the vhd) and specify the size and click OK. Right click on the Disk # (underneath will be Unknown and the size and "Not Initialized"). Select "Initialize Disk" & click OK Right click on the black bar of the unallocated disk space and select "new simple volume". A wizard opens up an on the second page it lets you assign the drive letter. Complete the wizar

Categories : Windows

How do I create & edit a spreadsheet file on google drive using Google Drive APIs only from my Android app?
You should take a look at Google Spreadsheet API 3.0. It supports JAVA which you can use in your Android application.

Categories : Java

How do I prove that Jetty 9 SelectChannelConnector timeouts work?
Jetty 9 does not have a SelectChannelConnector, nor is it under the org.mortbay package name...that is Jetty 6 code. Jetty moved to the Eclipse Foundation from Jetty 7 onward and there have been over 150 releases since Jetty 6. As for your test case, see this test code: http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-server/src/test/java/org/eclipse/jetty/server/ConnectorTimeoutTest.java

Categories : Sockets

Can one prove correctness of a function with side-effects
The answer is that, although there are no side effects in math, it is possible to mathematically model code that has side effects. In fact, we can even pull this trick to turn impure code into pure code (without having to go to math in the first place. So, instead of the (psuedocode) function: f(x) = { y := y + x return y } ...we could write: f(x, state_before) = { let old_y = lookup_y(state_before) let state_after = update_y(state_before, old_y + x) let new_y = lookup_y(state_after) return (new_y, state_after) } ...which can accomplish the same thing with no side effects. Of course, the entire program would have to be rewritten to explicitly pass these state values around, and you'd need to write appropriate lookup_ and update_ functions for all mutable variables, but i

Categories : Testing

How to prove the ownership of a public git/github repo?
How picky are they? I would think the first thing to try is to show them the very first commit. It's normally a git object you can't remove from the history so it should show your address email and/or name. If it's not enough, you can probably show the the public key on your machine and the public key registered on Github is the same? Third theory, maybe just ask Github support? They may have more internal history that may be useful.

Categories : GIT

How to prove that HashMap in java is not thread-safe
Is reading the API docs enough? There is a statement in there: Note that this implementation is not synchronized. If multiple threads access a hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more mappings; merely changing the value associated with a key that an instance already contains is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the map. If no such object exists, the map should be "wrapped" using the Collections.synchronizedMap method. This is best done at creation time, to prevent accidental unsynchronized access to the map: The problem w

Categories : Java

Google Drive sdk for android, Getting error 400 Bad Request when uploading file to Google Drive
You seem to be setting the mime type in the File object, but you need to set it in the FileContent object. When you create your file content, you can try passing in the type in the constructor new FileContent("image/jpeg", localFile); or using the method setType("image/jpeg"); but in your mediaContent instance, not in your body instance.

Categories : Android

Using paragraphs 8.5.3p4 and p5 in the C++11 Standard, how do I prove that the snippet below doesn't compile?
Firstly, a common mistake in reading 8.5.3p5 is to miss that it has two top level bullet points. You may have accidentally misread the final occurence of "Otherwise" as a third bullet point - but it is in fact a subpart of the second bullet point (also starting Otherwise). char a = 'a'; char* p = &a; OK const char* & r = p; So we have a lvalue-reference to cv1 T1 = pointer to const char being bound to an lvalue of type cv2 T2 = pointer to char The two types are not reference-related or reference-compatible. cv1 and cv2 are both empty. The initializer expression does not have a class type cv1 is not const. Therefore, neither of the two bullet points in 8.5.3p5 apply, and the code is ill-formed. The two bullet points are: If the reference is an lvalue reference an

Categories : C++

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