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

How to detect the disk full error and let program resume after getting free disk space
Check the return value of each call to fprintf() and fwrite(). If either call returns a negative value, check errno to see if errno is equal to ENOMEM or EDQUOTA. If so, you're probably out of disk space. As for resuming the operation as if nothing ever happened; that's a little bit harder; you'll need to keep track of what data you successfully wrote to the disk, so that after you've notified the user and they've indicated that it's time to try again, you can resume writing that data from the point at which the error occurred. That means keeping the state of the write in a structure of some sort (i.e. not just on the stack) so that you can return from your writing-function and then resume it later on. (Either that, or do the writing in a separate thread, and have the thread notify th

Categories : C++

Mongodb exists after claiming that there is no disk space while disk was not full
This is a bug in MongoDB. As of today it remains unresolved. The best advice I can give you is to ensure you have plenty of available disk space at all times.

Categories : Mongodb

FileStream will not open Win32 devices such as disk partitions and tape drives. (DotNetZip)
Usage MergeDirectories("Sample 1.zip", "Sample 2.zip", "Merged.zip"); Code: private void MergeDirectories(string filePath1, string filePath2, string mergedName) { string workspace = Environment.CurrentDirectory; filePath1 = Path.Combine(workspace, filePath1); filePath2 = Path.Combine(workspace, filePath2); mergedName = Path.Combine(workspace, mergedName); if (File.Exists(mergedName)) { File.Delete(mergedName); } DirectoryInfo zip1 = OpenAndExtract(filePath1); DirectoryInfo zip2 = OpenAndExtract(filePath2); string merged = Path.GetTempFileName(); using (ZipFile z = new ZipFile()) { z.AddDirectory(zip1.FullName); z.AddDirectory(zip2.FullN

Categories : C#

Bootstrap: how to extend input to occupy available space?
First you need to remove the width that bootstrap places on your input field by overriding it with width: auto then use absolute positioning to give the proper widths.. to conform to the width of its containing div. I created a jsFiddle of this: http://jsfiddle.net/w8YfL/ Here is the code: <div class="container"> <ul class="thumbnails"> <li class="span4"> <div style="height:200px; position: relative" class="thumbnail"> <div style="position: absolute; left: 5px; right: 5px; bottom:5px;"> <form style="margin:0;" class="form-inline"> <input style="position: absolute; right: 70px; left: 0; bottom: 0; width: auto;" type="text" placeholder="Name…" ng-model="mashName"/&

Categories : CSS

PDF: how do I find how much space will the text occupy when rendered?
The mechanisms and math of PDF text rendering are exhaustively explained in the PDF specification ISO 32000-1. Most important are chapters 8 Graphics and 9 Text. Essentially you need to know the current graphic state (which should be easy because you after all are the one who creates the PDF) and the metrics of the font you use and then calculate. Most of these details are governed by the operators and calculations described in chapter 9 but one should not forget the current transformation matrix described in chapter 8.

Categories : C

RoboCopy , Virtual Hard Disk, or other?
I got the answer from a different thread. Basically, we are creating a Microsoft VHD (virtual Hard Disk) and filling in the files with RoboCopy and shipping the VHD. See: Unzip too slow for transfer of many files

Categories : Apache

should I let mongodb make use of the new hard disk in this way?
Unfortunately this one will not be that straightforward. Even if you succeed with the mounting it will not move the files at all. What you can do is to mount the disk elsewhere (mkdir /var/lib/mongodb1, mount /dev/sda3 /var/lib/mongodb1) stop mongo copy the files from /var/lib/mongodb to /var/lib/mongodb1 (only helps if the new disk is bigger) reconfigure mongo to use as db dir the new directory or swap the names with mv commands start mongo if everything went fine, mongo started and so on,(check it first!!!) you can delete the old data. If you have a disk which is the same size so with moving the data you will run into the same problem, if you need larger space then a single disk you should play around with RAID and/or LVM and more disks.

Categories : Mongodb

How can i add some bat files to my project so i will not need them anymore on the hard disk?
// create the dxdiag.bat file using (StreamWriter sw = new StreamWriter("dxdiag.bat")) { sw.WriteLine("........."); // ...... } Process proc = new Process(); proc.EnableRaisingEvents = true; proc.StartInfo.UseShellExecute = false; proc.StartInfo.FileName = "dxdiag.bat"; proc.StartInfo.CreateNoWindow = true; proc.Start(); proc.WaitForExit(); proc.Close(); //delete the file File.Delete("dxdiag.bat");

Categories : C#

Reading boot Sector of the hard disk
The boot sector of the disk contains not ASCII data, but code. With high probability, one of the first bytes will be NULL and remaining possibly not printable codes (such as CR, LF, etc.). Trying to print the buffer by INT 10h, which prints ascii codes, and ending on 0 will result probably with nothing displayed at all. You should convert every byte of the buffer to hexadecimal string and then print these strings to the display. This way you will get simple hex dump of the boot sector.

Categories : Assembly

Do integers occupy less space as keys in a java HashMap compared to strings?
As far as the HashMap is concerned, there is no difference in memory usage when replacing String with Integer. This is because HashMap stores the reference values of the key and value in its KV Pair, and instead of referencing String objects, the key will refer to Integer objects. For all intents and purposes, the hashing of Integer objects and String objects, do not have any impact on the HashMap's storage capabilities.

Categories : Java

How do I make a dynamic number of divs occupy all of the space in their container equally?
Make your html dividers behave like a table set. Table-dividers (<td>) are meant to spread evenly by default. HTML <div class="table-div" style="width:100%"> <div class="tr-div"> <div class="td-div">td-div 1a</div> <div class="td-div">td-div 2a</div> <div class="td-div">td-div 3a</div> <div class="td-div">td-div 3b</div> </div> <div class="tr-div"> <div class="td-div">td-div 1b</div> <div class="td-div">td-div 2b</div> <div class="td-div">td-div 3b</div> <div class="td-div">td-div 3b</div> </div> </div> CSS .table-div{display:table} /* you can add table-layout:fixed; to

Categories : CSS

How to get the total size of hard disk of Windows machine?
Look at GetDiskFreeSpaceEx(), which has an lpTotalNumberOfBytes output parameter. It is subject to per-user disk quotas, though. If you need the raw byte size of the physical disk, use CreateFile() to open a handle to the desired disk and then use DeviceIoControl(), specifying the IOCTL_DISK_GET_LENGTH_INFO control code, to get the disk's total byte size.

Categories : Windows

which widget to use to show hard disk sectors as hexadecimal?
How do they achieve this in a single scroll area It is not a "single scroll area" containing the entire disk. It is a scrollbar and dynamically generated content for whatever disk content you are showing at the time. Simply calculate the position based on the scroll location (unless your screen is 10000's of pixels tall, however, you will not be able to place the cursor EXACTLY on the disk sector you want). also provide the undo functionality in that.... Undo functionality, I expect (I haven't looked at the code) is done by holding "address changed, old value" in some sort of container. Pretty much the same way you'd do undo information for any other large dataset. which widget should be used to display such a huge amount of data.???? One which shows text and allows yo

Categories : C++

I want to use powershell to map a network hard disk on a remote machine
PSExec is not short for "PowerShell exec", it's "process exec". You cannot execute an PowerShell cmdlet directly from it. To use PSExec to execute a PowerShell command remotely, you must do the following (untested, as I don't have psexec): psexec \func2_web1 powershell.exe -command -nologo "New-PSDrive -Name x -PSProvider FileSystem -Root \argentodrops -Persist" Or, if you want to go the remoting route from within your local PowerShell session: invoke-command -computername func2_web1 -scriptblock {New-PSDrive -Name x -PSProvider FileSystem -Root \argentodrops -Persist} With the latter, you may have "double-hop" issues that need to be resolved via CredSSP.

Categories : Powershell

windows azure virtual machine hard disk backups
Azure attached disks, just like the OS disk, is stored as a vhd, inside a blob in Azure Storage. This is durable storage: triple-replicated within the data center, and optionally geo-replicated to a neighboring data center. That said: If you delete something, it's instantly deleted. No going back. So... then the question is, how to deal with backups from an app-level perspective. To that end: You can make snapshots of the blob storing the vhd. A snapshot is basically a linked list of all the pages in use. In the event you make changes, then you start incurring additional storage, as additional page blobs are allocated. The neat thing is: you can take a snapshot, then in the future, copy the snapshot to its own vhd. Basically it's like rolling backups with little space used, in the event

Categories : Azure

Write files into randomly non-contiguous hard disk positions
I think that the only way to do this is using some low-level OS commands No... RandomAccessFile has .seek(): final RandomAccessFile f = new RandomAccessFile(someFile, "rw"); f.seek(someRandomLong); f.write(...); Now, it is of course up to you to ensure that writes don't collide with one another. Another solution is to map the file in memory and set the buffer's position to some random position before writing.

Categories : Java

Why when loading html file from the hard disk through WebBrowser not everything is shown?
When you download the page, you download the source code of that page. However, when your browser downloads the page, there are a lot of stuff downloaded along with the HTML. For instance, there are JavaScript files, CSS files (for styling) and more. Even if you download them as well, you may need to modify your HTML to link those files to the HTML with a relative or absolute path (depending on your needs). In other words, the web page is not shown as you expect because the attachments are not downloaded and linked to the HTML. Update When you set the source of the document, the attached documents (css, js, etc.) relative to the HTML are not found and therefore not used in the web page. For instance: <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/stackoverflow/all.cs

Categories : C#

With PowerShell, is there a way to make an external hard disk attached to host available to VM?
I don't use Win8, so this is entirely untested. Judging from the description of Add-VMHardDiskDrive something like this might work, though: $usbdisk = gwmi Win32_DiskDrive | ? { $_.PNPDeviceID -like 'USBSTOR*' } Add-VMHardDiskDrive -VMName MyWin7PC -ControllerType IDE -ControllerNumber 0 ` -ControllerLocation 1 -DiskNumber $usbdisk.Index

Categories : Powershell

Serving Static content from local hard disk in jboss as 7
As of my knowledge, we dont have an option to access static files on the hard disk through JBOSS AS 7.1. The solution I have tried was , I have created a dummy web application and I have been storing the files into the dummy web application. Once the files are stored over there, they are accessed with URL pointing to newly created dummy web application. Though this is not the correct way for this kind of access, I find no other way for this. Pl. let me know if any other ideal way exists... Thanks....

Categories : Java

getting size of multiple files located inside the hard disk using python
if item < 1000: size = str (item) + 'K' if item > 1000: #this will never execute #since you have already asserted that item < 1000

Categories : Python

Read Streaming Excel file which is not saving content to hard disk
There is approch you can follow: open temp.xls with readonly flag with standard way: Workbooks.Open Method Perform your traitement on data. Peraphs copying content to another Workbook. detect changes on temp.xls using FileSystemWatcher Class and reopen it as 1st point Another thing can be useful is to detect end of process from abc.exe. Maybe it is only by detect non-existance of temp.xls or non-existance of abc.exe in table of process (via ManagementEventWatcher Class). Anyway at this point you should sniff everything passing thru temp.xls.

Categories : C#

How can I resume connection between SQL Server and physical files after hard disk disabling?
Lets start saying that you are in a very bad shape and you should check your physical server ASAP. IMO, the best thing to do is backup the files as-is just in case you can't do anything else then one of the following options restart SQL Server service delete the broken database restore restore back ups to the latest transaction point If the above is impossible. restart SQL Server service hope that things will work

Categories : Dotnet

To find duplicate files on a hard disk by technique other than calculating hash on each file
You may want to use multiple levels of comparisons, with the fast ones coming first to avoid running the slower ones more than necessary. Suggestions: Compare the file lengths. Then compare the first 1K bytes of the files. Then compare the last 1K bytes of the files. (First and last parts of a file are more likely to contain signatures, internal checksums, modfication data, etc, that will change.) Compare the CRC32 checksums of the file. Use CRC rather than a cryptographic hash, unless you have security measures to be concerned about. CRC will be much faster.

Categories : File

Hive - dynamic partitions: Long loading times with a lot of partitions when updating table
During this slow phase, Hive takes the files it built for each partition and moves it from a temporary directory to a permanent directory. You can see this in the "explain extended" called a Move Operator. So for each partition it's one move and an update to the metastore. I don't use EMR but I presume this act of moving files to S3 has high latency for each file it needs to move. What's not clear from what you wrote is whether you're doing a full load each time you run. For example why do you have a 2013-03-05 partition? Are you getting new log data that contains this old date? If this data is already in your logs table you should modify your insert statement like SELECT fields FROM new_logs WHERE dt > 'date of last run'; This way you'll only get a few buckets and only a few files

Categories : Amazon

Provide uploading files, write the file on hard disk, get full path (string) to add in database CakePHP
While this may not give you a direct solution in CakePHP, you had asked for some ideas. I've outlines some pros and cons of storing a file on the filesystem (along with some other approaches) in this post. Hope that helps...

Categories : PHP

.svn folders using a lot of disk space
These folders are necessary as long as you want to use SVN version control system. They are used to keep trace of your local version changes in order to commit your work and checkout (eventually merging with your information) upstream data. If don't want to use version control anymore you could delete all .svn folders. If you don't mind keeping history you could make a clean checkout, delete .svn folders and then create a new repository.

Categories : Svn

Total Disk Space JDK 1.4
Given that the File disk space methods were only added in Java 6, I suspect your only option is to invoke a OS-specific binary e.g. df -k / (for Linux) The amount of effort you need to expend on implementing such a solution may be better spent moving your application to a recent JDK/JRE (you may have limitations I'm not aware of, however, so please ignore if so!)

Categories : Java

PostgreSQL 9.0.13 doing a pg_restore but no evidence that disk space is being used
Try it without the "-f" flag in the pg_restore command. Also, you might want to try creating the empty salesdb database and pass in "-d salesdb". Note that the db name will fold to lowercase unless it was created within double-quotes. Added example steps to show that the db grows in size as the restore is running -- sample pg_dump command pg_dump -f testdb.out -Fc src_test_db -- create the db to restore into createdb sometestdb -- restore with 4 parallel jobs, from the "testdb.out" file, into the db "sometestdb" time pg_restore --dbname=sometestdb --jobs=4 testdb.out -- In another window, every few seconds, you can see the db growing psql -d postgres -c "select pg_size_pretty(pg_database_size('sometestdb'))" pg_size_pretty ---------------- 4920 MB psql -d postgres -c "select pg_si

Categories : Postgresql

Azure Virtual Machine low disk space
You cannot increase your os disk size. Not sure when you created your Virtual Machine. I know that a long time ago the size was set at (I believe) 30GB, and now the os disks should be around 127GB. You may want to check what size the OS disk is. I'm not sure what chewed up your OS disk space except maybe some type of temporary os storage.

Categories : Azure

Getting the CPU, memory usage and free disk space using powershell
How about: cat '.servers.txt' | % {select -property @{'n'='CPUUsageAverage';'e'={$_ | Get-CPUUsageAverage}},@{'n'='Memory Usage';'e'={$_ | Get-MemoryUsage}},@{'n'=C PercentFree';'e'={$_ | Get-CPercentFree}}}

Categories : Powershell

Slow MySQL query is filling up my disk space
where is WHERE clause : create temporary table temp_ids_codes select ID, CODE from temp_ids, temp_codes; table should have PK on collumnsID, CODE

Categories : Mysql

How to check amount of cached disk space used on iPhone
No. You can never access the file system in general. And thus not the cache being used by other apps. If you re-ask the question as "Is there any way to tell how much disk space my app is using in the cache, the answer is yes. Walk the file system of your cache directory using NSFileManager and use [NSFileManager attributesOfItemAtPath:error:] to get the size of each file.

Categories : Iphone

An Error Occurred During Report Processing - Not Enough Memory Or Low Disk Space
As we have two recovery models. Simple Recovery Model Full / Bulk Logged Recovery Model To my experience in this scenerio, most SQL Servers there is no backup of the transaction log. Full backups or differential backups are common practice, but transaction log backups are really seldom. So the transaction log file grows forever (until the disk is full). In this case the recovery model should be set to "simple". Don't forget to modify the system databases "model" and "tempdb", too. A backup of the database "tempdb" makes no sense, so the recovery model of this db should always be "simple". Process: What i do on my database. Right Click on properties -> Option -> Set Recovery Model: Simple. Then, right click -> Tasks -> Shirnk -> Files. Just thats it will make space. But for better

Categories : Sql Server

Android app installer displays wrong information about required disk space
I'm not sure if this will work: Try restarting your device and then install the app. i was encountering the same problem which got solved by doing the above.

Categories : Android

calculate total used disk space by files older than 180 days using find
du wouldn't summarize if you pass a list of files to it. Instead, pipe the output to cut and let awk sum it up. So you can say: find . -mtime +180 -exec du -ks {} ; | cut -f1 | awk '{total=total+$1}END{print total/1024}' Note that the option -h to display the result in human-readable format has been replaced by -k which is equivalent to block size of 1K. The result is presented in MB (see total/1024 above).

Categories : Linux

Clear three20 & Restkit cached information to free disk memory space
The Cache.db is the Cache used by Apples URL Loading System. It is no documented how it works, but it is reasonable to think that this cache will manage it's size on it's own. Even if you remove files from Three20's cache they still live in the URL Loading Systems cache, are served from there and then readded to Three20's cache. Find more about this cache in the URL Loading System Programming Guide

Categories : Iphone

Powershell command to retrieve Failover Cluster Disk Size/Free Space?
You can't obtain free space information on a physical disk level. That kind of information is only available on the filesystem/volume level. For monitoring purposes I'd simply do a $filter = 'DriveType=3 AND DriveLetter IS NOT NULL' gwmi Win32_Volume -Filter $filter | select DriveLetter, Capacity, FreeSpace on each cluster node. That will give you the size and free space of "regular" volumes. You can run remote WMI queries by passing an array of hostnames to the -Computer option. In that case I'd recommend including the SystemName property with the output: $filter = 'DriveType=3 AND DriveLetter IS NOT NULL' $nodes = Get-ClusterNode -Cluster $cluster ` | ? { $_.State -eq 'up' } ` | % { $_.Name } gwmi Win32_Volume -Computer $nodes -Filter $filter | select S

Categories : Powershell

Write files to disk in sorted order in bash
The best answer is best summarized as "it's a fools' errand; don't try". Filesystems in general do not make guarantees about the order in which results are returned, and there's no guarantee that this order matches any canonical on-disk order. (Results may be returned from a cache; from an unordered index; etc). If you insist on trying... dest=$1 tmpdir=$(mktemp -d -t tempdir.XXXXXX) mv "$dest"/* "$tmpdir" # move files out of the location for f in "$tmpdir"/*; do # globs are implicitly sorted in LC_COLLATE order mv "$f" "$dest/" # ...so move them back in in that order. done

Categories : Bash

Error: You have exceeded your disk space quota error message in git
I was hoping I can cleanup some redundant stuff and create more space You couldn't reduce significantly the size of an upstream repo from a downstream location. That upstream repo is likely a bare repo, and even deleting a branch wouldn't change much (a branch is just a pointer, and the reflog of that repo would still have the reference of the commits for that branch. All the commands mentioned in "Reduce git repository size" are local commands. So even without increasing the disk space, you would still need an admin to go on that server an clean that repo for you.

Categories : GIT

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