w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

Windows batch file to get C: drive total space and free space available
cut 9 digits of the size by bytes to get the size in GB: @echo off & setlocal ENABLEDELAYEDEXPANSION SET "volume=C:" FOR /f "tokens=1*delims=:" %%i IN ('fsutil volume diskfree %volume%') DO ( SET "diskfree=!disktotal!" SET "disktotal=!diskavail!" SET "diskavail=%%j" ) FOR /f "tokens=1,2" %%i IN ("%disktotal% %diskavail%") DO SET "disktotal=%%i"& SET "diskavail=%%j" (ECHO(Information for volume %volume% ECHO(total %disktotal:~0,-9% GB ECHO(avail. %diskavail:~0,-9% GB)>size.txt TYPE size.txt cmd can calculate only with numbers up to 2^31-1   (2,147,483,647 ~ 2.000001 Gigabytes)

Categories : Windows

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 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

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

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

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#

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

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

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#

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

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

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

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

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

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#

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

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#

Git installation in USB Drive that works in both OSX and windows?
Use a normal git repo on the usb drive. Use UTF-8 as encoding for all the files to make sure that you won't get any problems with that Before you go to your windows machine, make sure that you have checked out the branch that you want to work on. Use the checked out files and work with them. Back at your mac, you can commit and push and do whatever you like. OR Use your smartphone as usb drive. If you have Android, you can install botbrew on it and use git on your mobile. With that you can do your git operations while at your windows pc.

Categories : Osx

What is the linux command line to check kernel space and User space Memory used
Try: sudo slabtop or sudo cat /proc/slabinfo These should give you enough information to estimate the total kernel memory consumption. You can read more info about kernel and userspace memory here.

Categories : Linux

Pre-allocating drive space for file storage
You can pre-allocate space by writing a large file, but to be honest I wouldn't bother. Performance will be pretty good/ probably better than you need. If you really needed performance, you'd be writing C++/C# and doing RAW I/O. But that's typically only done when writing an RDBMS engine, high-volume media capture or similar.

Categories : Java

[Qt][Linux] List drive or partitions
You need to use platform specific code. And, please, read the docs! Returns a list of the root directories on this system. On Windows this returns a list of QFileInfo objects containing "C:/", "D:/", etc. On other operating systems, it returns a list containing just one root directory (i.e. "/").

Categories : C++

Linking R packages during installation to a Linux RPM
I was getting the exact same error as you when trying to install the R gmp package on Ubuntu, and it worked after installing libgmp3-dev. The equivalent rpm will be libgmp3-devel-something-or-other, try rpm search for your platform.

Categories : Linux

RESOLVED Using Python to print the amount of space left in a network shared drive
I think you probably need to break this up into sub problems, have a go at each and post a question for any that you are stuck on, including your attempts in the post. Here are some suggested steps and areas to look into for them: Work out space remaining on drive. There is a thread here which may be helpful for this. To write to Excel there is a module named xlwt, which can be downloaded from here. I have also found a brief tutorial for using this here. EDIT For Python 3.x I found a port of xlwt which may be worth a try. I found a post here pointing the a github repository here. I could not see an installer, but it should be straight forward to build from source. You will need to download everything from this github page into a folder and then cd to that directory from the command

Categories : Python

How can we use Linux from a small storage pen drive? Does it work on micro-controllers also?
I generally hear that LINUX OS can be downloaded on flash, pen drive (floppy disk?) etc. How > we can do that? If you can't get it to work on your own, you can buy a ready made Linux on a USB drive from a site like http://www.osdisc.com or http://www.cheapbytes.com Not all PCs, especially older PCs, can boot from the USB Drive. Even some newer PCs are beginning to ship with security features that can interfere with booting code. When it does work, you have to find out the proper way to boot the USB drive. You might have only a few seconds during reboot to enter the right key, or it will boot Windows (if Windows is installed). The key to get to the BIOS Boot Menu might be delete or escape or F10 or some other key (varies with PC motherboard manufacturer). A message on the screen

Categories : Linux

How to let terminal window be closed automatically in a linux Console Application when run by IDE
It is actually made for you. If you build executable of your application and run it from terminal (outside of IDE), it (your application... not the terminal) will close after execution (return in main). CodeBlocks uses smth called cb_console_runner to run executables and wait for ENTER to close terminal. I am not sure how is it possible to make it work without cb_console_runner EDIT: In codeBlocks... remove/rename cb_console_runner in /bin and it is solved:) to make it easier: run this command: sudo mv /bin/cb_console_runner cb_console_runner_s

Categories : C++

Which address space is occupied by the kernel in 64 bit linux
On a 64-bit Linux all 64-bit addresses with the highest order bit set to 1 are reserved for the kernel. In other words, the top half of the virtual address space. See http://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details

Categories : C

Shutdown (embedded) linux from kernel-space
The most general way would be for your driver to invoke shutdown as a userspace helper: static const char * const shutdown_argv[] = { "/sbin/shutdown", "-h", "-P", "now", NULL }; call_usermodehelper(shutdown_argv[0], shutdown_argv, NULL, UMH_NO_WAIT); (Presuming you have a /sbin/shutdown binary installed). This will shut userspace down cleanly, unmount filesystems and then request the kernel shutdown and power off. However, you may be able to do better than this - for example if you can guarantee that there's no disk filesystems mounted read/write, you could tell a kernel thread to invoke the kernel_power_off() function (it shouldn't be done from interrupt context).

Categories : Linux

How to get a millisecond precision uptime from user-space in Linux?
I think you have to check the main controller(CPU) on your board. Usually, there will be a hardware timer module integrated into the CPU, or decrementer register implementation in the CPU core. If there is a hardware timer or DEC register on your CPU, then use it to implement a periodical interrupt(the frequency can be 1000HZ or else). The interrupt handler can notify/wakeup the user-space process to do the necessary real-time work.

Categories : Linux

Is a linux application loaded in the loader's address space?
http://grahamwideman.wordpress.com/2009/02/09/the-linux-loader-and-how-it-finds-libraries/ http://www.tenouk.com/ModuleW.html basically there are assemblers and linkers too.The hiearchy of ld-linux (loader's linux is very well explained in the second url. Thanks & Regards, Alok

Categories : Linux

Does writing data to stdout in linux occupy disk space?
Unless the output is being redirected (though pipes to e.g. tee, or to a file with the > shell redirection operator), then no, output will not go to a file system. Output to a console (or terminal emulator) is slow as it is, passing it through the file system would make it even slower, and may not allow the disks to spin down if there's a lot of output. It may, however, end up in the swap space, if the OS thinks the process should be swapped out before the output is actually written.

Categories : Linux

Implementing user-space network card "bus-mastering" in C++ on Linux
If you mmap a region of memory, and give the address of that to the OS, the OS can lock that region (so that it doesn't become swapped out) and get the physical address of the memory. It is not at all used for that purpose, but the code in drivers/xen/privcmd.c, in the function mmap_mfn_range called from privcmd_ioctl_mmap (indirectly, by traverse_map). This in turn calls remap_area_mfn_pte_fn from xen_remap_domain_mfn_range. So, if you do something along those lines in the driver, such that the pages are locked into memory and belong to the application, you can program the physical address(es) of the mmap'd region into the hardware of the network driver, and get the data directly to the user-mode memory that was mmap'd by the user code.

Categories : C++

Which Linux platfrom required for Installation of ingres database version 9.2 and openROAD version 4.0
If you want answers don't use Stackoverflow as its ridiculous policies prevent me supplying the four links that would have been helpful to you. Google for the Actian community, which you will find far more helpful with fewer egos struggling to rule the world.

Categories : Misc

Tomcat process killed by Linux kernel after running out of swap space; don't get any JVM OutOfMemory error
You probably have other processes on the same computer that also use memory. It looks like your java process reaches around 5.3GB before the machine is desperately out of RAM and swap. (Other processes are then probably using 12GB-5.3GB = 6.7GB) So your linux kernel sacrifices your java process to keep other processes running. The java memory limit is never reached so you're not getting an OutOfMemoryException. Consider all the processes you need running on the entire machine, and adjust your Xmx setting accordingly (enough to leave room for all the other processes). Perhaps 5gb? In any case, counting of OutOfMemoryExceptions being delivered is a pretty bad code smell. If I recall correctly, getting even a single OutOfMemoryException can leave the JVM in an "all-bets-are-off" state and

Categories : Java

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

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

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



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