w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can find out how much space my snapshots are taking in Amazon EC2
Snapshots are persisted to S3, but are not stored in buckets owned by the user - so you won't be able to see them there. To see how much space is being used by snapshots, you should be able to log in to the AWS Console through your web browser and see it under "Elastic Block Store", or if you've installed the command-line tools by running the ec2-describe-snapshots command you will see the following parameter returned: volume-size The size of the volume As for downloading your snapshots, it's possible with the non-Windows instance snapshots, but it's also quite involved. But here's the instructions.

Categories : Amazon

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

What is taking up space in web page?
It's the white space in between the tags. Check out this article for things you can do to combat it. My suggestion is to simply put the HTML all on one line. It's harder to read, but renders what you want. The best way, though, is to have a build step that will minify your HTML and get rid of all of it automatically.

Categories : HTML

Why isn't this anchor tag taking up 100% of the available space of its parent div?
I believe its because the block element has no content inside of it. If you add a letter inside the anchor link the anchor link will become 100% of the width of the div. If you add width:100% and height:100% it will take up the entire div.

Categories : HTML

SearchView taking all the space in the new ActionBarCompat
Have you tried using collapseActionView()? I use it like this: public static MenuItem msearchMenuItem; @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); // Associate searchable configuration with the SearchView SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.search).getActionView(); searchView.setSearchableInfo( searchManager.getSearchableInfo(getComponentName())); msearchMenuItem = menu.findItem(R.id.search); return true; } public static MenuItem getSearchMenuItem() { return msearchMenuItem;

Categories : Android

Why ordering in SQLite table taking more space?
Your new table has more columns than the old table. Anyway, to remove free pages from a database file, execute VACUUM. However, this makes sense only if you are not going to fill the database with more data later.

Categories : Android

ReCaptcha isn't displaying (or taking up space) in chrome.
<div id="recaptcha_widget" style="display:none"> <div id="recaptcha_image"></div> <div class="recaptcha_only_if_incorrect_sol" style="color:red">' . $strincorrectpleasetryagain . '</div> </br></br> The Above Break down to the div will work. I have done it to my site by place the Line Break only then it started working on Crome and IE. Thanks

Categories : Javascript

Panels taking unnecessarily huge space in ExtJs
check my update to your code where was some wrongly used minWindth, removed layout fit on top and missing some parts and needed to add MaxWidth to bottom part. You can check the full code on the fiddle link layout: 'border', maxWidth : 400,

Categories : Javascript

Components in GridBagLayout are put to the center, without taking all free space
You're adding 10 panels which all have their own gridbag layout, checkbox and label. So each panel has its own grid, and the width of the cells are computed independantly, based on the components they contain. If you want a well-aligned single grid, you should have a single panel using GridBagLayout, and add your 10 labels and 10 checkboxes to this unique panel. Moreover, you should give a weightx > 0 to the label's constraint if you really want it to fill horizontally.

Categories : Java

Query taking more space on /tmp dir and more load & time while executing
Your overall query looks simple and sound... Your primary table of ISMPBI is all left-joined to the others which implies to me that they are more secondary / lookup tables. To help, I would to the following... Add "STRAIGHT_JOIN" keyword to your select SELECT STRAIGHT_JOIN DISTINCT .... For your ISMPBI table, make sure it has an index on (PBIBRAND) Make sure that all your other tables have index on their respective "JOIN" column names... For the ISMPIT table, have index on (PITBIRFNUM, PITVIEWSEQ) -- since you have an AND clause for PitViewSeq EDIT -- prequery test option.. Can you run this as a prequery to see what performance IT has vs the join to every table... SELECT pbi.pbirfnum, pil.pilsellersku, group_concat(DISTINCT ppt.p

Categories : Mysql

Expendable list view icon removed but still taking a empty space
I have also face this issue and i have apply android:groupIndicator="@null" but it was not worked for me. I think that is only hide the Icon at that place it is not removing the icon. So i have follow some other example and edit that code as per my requirement. Please try it once hope it will works for you.

Categories : Android

how to find when ad has been closed Revmob cocos2Dx
I need to check that the ad has been closed Revmob offers an option to pass custom delegate when launching: RevMobAds.h: + (RevMobAds *)startSessionWithAppID:(NSString *)anAppId andDelegate:(id<RevMobAdsDelegate>)adelegate; The RevMobAdsDelegate allows you to implement a function, which would be called when the ad gets closed by user (which is what you want). RevMobAdsDelegate.h: /** Fired by Fullscreen and popup. */ - (void)revmobUserClosedTheAd; Basically you want to implement that delegate callback and you are set. Personally I prefer to make my AppController implement the required delegate protocol (in your case - RevMobAdsDelegate): AppController.h: @interface AppController : NSObject <UIApplicationDelegate, RevMobAdsDelegate> And then, in AppController.m

Categories : C++

Do files get closed during an exception exit?
No, they don't. Use with statement if you want your files to be closed even if an exception occurs. From the docs: The with statement is used to wrap the execution of a block with methods defined by a context manager. This allows common try...except...finally usage patterns to be encapsulated for convenient reuse. From docs:  The with statement allows objects like files to be used in a way that ensures they are always cleaned up promptly and correctly. with open("myfile.txt") as f:     for line in f:         print line, After the statement is executed, the file f is always closed, even if a problem was encountered while processing the lines. Other objects which provide predefined clean-up actions will indicate this in their documentation.

Categories : Python

How can I find in Oracle which queries are taking most of CPU time?
Sounds like you need to generate some SQL trace files and analyse the results using tkprof. There's a good Ask Tom question here that should show you how to go about this: http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:969160000346108326

Categories : Oracle

Changes to PHP files on LAMP server not taking effect
You can see cached version (try to to force refresh - CTLR-F5) Or you changing the files in the different location than they are being served from. Check your httpd config and see if both location matches.

Categories : PHP

Svn Merge not taking Roo generated aspectj files into account
Eclipse could be filtering the aj files. you can turn off the filtering by: in package explorer, click down arrow on top right corner click filters... uncheck "Hide generated Spring Roo ITDs"

Categories : Java

where do I find page source of pages on my system which I opened in Chrome and then Closed
it should be at ~/Library/Caches/Google/Chrome. good luck digging there :S this issue of loosing files was fixed years ago, learn how to use git http://try.github.io/

Categories : Osx

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

Cut string when find a space
You would be better off by using explode this way: $text_arr = explode(" ", $datum[0]); echo $text_arr[0]; Forget about the foreach loop, just use the first element as it's already cut on the first space. Hope this helps.

Categories : PHP

iOS Find the box given a point in space
The CGRectContainsPoint method does all the work for you. Say for example you used a tap gesture. -(void)handleTap:(UITapGestureRecognizer *)gesture { CGPoint point = [gesture locationInView:self.view]; if (CGRectContainsPoint(box.frame, point)) { NSLog@("Point is in Box"); } }

Categories : IOS

How to search for few files out of hundred files in UNIX and if not find replace with 0 byte file
Assuming by shell u mean bash: Skeleton to start with: luk32:~/projects/tests$ cat ./process_files.sh #!/bin/bash DEST=./copies for num in "$@"; do file="AllResponses_"$num"_6_20_2013.txt" if [ -f $file ]; then cp $file $DEST else touch $DEST/$file fi done; It takes numbers as arguments, then tries to find a file with given pattern in current working directory. If found copy to destination folder, else touch the file. You will probably have to tinker a little bit to get friendlier than hard-coded date handling. Example: luk32:~/projects/tests$ ls -l total 40116 -rw-r--r-- 1 luk32 luk32 4 cze 21 11:33 AllResponses_1_6_20_2013.txt -rw-r--r-- 1 luk32 luk32 5 cze 21 11:33 AllResponses_3_6_20_2013.txt -rw-r--r-- 1 luk32 luk32 0 cze 21 11:32 AllResponses_4_6_20

Categories : Unix

Find Missing files and sub directories with it's files list while copy and paste?
Can i make one simple exe tool for this. Of course. How to i find that missing files can any one give some guide to do. You need two lists. You'll need to read and fill one, and then read and compare to determine what's missing. The code might look something like this: var targetFiles = new List<string>(); foreach (var f in Directory.GetFiles(targetDir)) { targetFiles.Add(Path.GetFileName(f)); } var missingFiles = new List<string>(); foreach (var f in Directory.GetFiles(sourceDir)) { if (targetFiles.Contains(Path.GetFileName(f))) { continue; } missingFiles.Add(Path.GetFileName(f)); } Now all of the missing files in the target are in the missingFiles list. You can then loop through that list to copy those missing files to the target.

Categories : C#

find+xargs: for all files in a dir find pair in other nested dir and move there
This bash script should work. Sometimes a solution cannot be easily stuffed into a pipeline: #! /bin/bash for svg in svg/*.svg ; do name=${svg##*/} # Remove the path. name=${name%.svg} # Remove the extension. png=$(find -name $name.png -not -path '*thumb*') dir=${png%$name.png} # Remove the filename. mv "$svg" "$dir" done

Categories : Bash

how to find list of files file name starts with All_Responses_11367*.txt and copy total files to another directory in unix command
This find command should give all file starting with All_Responses_11367* in current directory modified/created in last 77 days: find . -name "All_Responses_11367*" -maxdepth 1 -type f -mtime -77 -exec cp '{}' dest ; Change dest to some other directory where you want to copy these files.

Categories : Unix

space complexity to find a subtree
The function calls itself recursively, so although you are not explicitly using memory, the stack will cost O(h1) + O(h2) in the call stack. If the tree is sufficiently balanced, this is the same as O(logn) + O(logm).

Categories : C++

Regex:find extra space
string pattern = @"ss[INF]ss"; Regex Test

Categories : C#

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

How to ssh to a certain directory and then be able to use the FIND command to find certain files and gunzip them
NB: don't confuse "zip" and "gzip", two different animals This should work: cd <local_directory> # collect files names as $1 $2 ... $N set -- *.gz # or use your own filter like "dumps*.gz" # put source file a tar archive and send it as input to ssh # then, on the other side, untar the file then decompress tar cf - $* | ssh <user>@<remote_host> "cd <remote dir> && tar xf - && gunzip $* Note: using "&&" instead of ";" to prevent "tar" command to be executed if "cd" fails for any reason

Categories : Unix

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

FInd an unused/empty space in an array
This should work, please note, it's untested. LINQ: var nullOrEmptyIndexes = ListObject.Select((item, index) => new { item, index }).Where(x => x.item == null).Select(x => x.index); Loops: public static IEnumerable<int> GetEmptyIndexes(List<object> list) { for (int i = 0; i < list.Count; i++) { if (list[i] == null) { yield return i; } } } Change ListObject to the list you wish to check. Although, you really shouldn't have blanks in your list, seems messy to me.

Categories : C#

How to find convex hull in a 3 dimensional space
I would suggest first try an easier approach like quick hull. (Btw, the order for gift wrapping is O(nh) not O(n2), where h is points on hull and order of quick hull is O(n log n)). Under average circumstances quick hull works quite well, but processing usually becomes slow in cases of high symmetry or points lying on the circumference of a circle. Quick hull can be broken down to the following steps: Find the points with minimum and maximum x coordinates, those are bound to be part of the convex. Use the line formed by the two points to divide the set in two subsets of points, which will be processed recursively. Determine the point, on one side of the line, with the maximum distance from the line. The two points found before along with this one form a triangle. The points lying insid

Categories : Algorithm

How to find loop in a Link List using O(N) space complexity
For detailed implementation, read this post(How to determine if a linked list has a cycle using only two memory locations). Basically you maintain two pointers, both of which point at the head of the linked list initially. On each enumeration, advance the first pointer by one node and the other by two. If at some point these two pointers reach an identical node again, a cycle is detected. I gather from your description that you do know this algorithm. If the space taken by the linked list itself is not considered, this one works in O(1) space. And even with that much space considered, it's still O(n). (If space complexity is the only concern, obviously worse algorithm exists.)

Categories : C

How to find if url containing special characters or space exists in java
URLs with spaces in them are invalid. The correct way to create a properly encoded URL from a filename that may contain spaces is URI.toASCIIString(), and then passing that to new URL(), making sure to use a URI constructor that takes multiple arguments so the filename part gets encoded: see the Javadoc. However I question the requirement. The best way to test whether any resource is available is to try to use it. In this case presumably you are going to read from the URL if it exists, so just do that and catch the FileNotFoundException.

Categories : Java

Newbie Python: Cannot Count Files in a Folder is there is a SPACE in name
Try the solution in this other question. Define another function: def shellquote(s): return "'" + s.replace("'", "'\''") + "'" Then, when you've captured path within getPath(), do new_path = shellquote(path) and return new_path instead of path. When you drag the file in or write a path with spaces, you need to either escape the spaces or put the whole path in quotes so it's clear that it's one single string. The shellquotes() function achieves both.

Categories : Python

pcregrep for finding all files with extra space before php opening tag
You can try this pattern: ([s ]+)(?=<?php) You should try escaping < and ? since they have a specific meaning in regex. I prefer look around here since no need to consume the upcoming stuff and grouped the results that comes before PHP tag. You can skip from the above pattern. Live demo

Categories : PHP

Rename list files cannot find files
I think you should change os.rename(f, f.replace(',','')) to os.rename(os.path.join(self.dirname, f), os.path.join(self.dirname, f.replace(',',''))). Essentially the rename function expects a valid path to a file, and you need to concatenate the base directory path to the filename if the file is not in the current directory.

Categories : Python

A Shell script to find and cd into a folder taking a folder name as argument in one step
You must run cd in your current shell. Running it in another shell won't work, as you've seen. Create a function. Example: mycd (){ cd "${1}foo" }

Categories : Linux

Regular expression to find position of the last alpha character that is followed by a space?
I'm not sure about REFindNoCase, but I think you can try with REReplaceNoCase. I hope that CF can take back references like most regex engines do: REReplaceNoCase(MyString, "(.*[a-zA-Z]+)s.*", "$1", ALL); EDIT: for the backreference, it appears that you use the backslash instead of the dollar sign: REReplaceNoCase(MyString, "(.*[a-zA-Z]+)s.*", "1", ALL); And if it goes well, you should have something like this. .* matches anything besides a newline character,  matches word boundaries, [a-zA-Z]+ are for alphabet characters and s is for the space just after it. The greediness of the first .*'s is being exploited here to capture as much as possible until you get the last word followed by a space. And I guess you can add the ellpses after the $1 like so: REReplaceNoCase(MySt

Categories : Regex

Import Multiple space delimited files into one Excel Sheet
You don't "reset" the value of path. If your path is "C:MyFolder" (for example), the first time through the loop, your path is "C:MyFoldercom*.txt" When you go through the loop again, the path becomes... "C:MyFoldercom*.txt es*.txt" ...which creates an invalid path. Update the code as per below. count = count + 1 ' ADD THE LINE BELOW TO YOUR CODE path = Sheet3.Cells(2, 7)

Categories : Excel

Java Heap Space Error while reading large files
You should pass your is into the class that needs the data. As long as you don't read in all the contents of is at once, you won't use up all your memory. Change your code to this: InputStream is = null; try { is = getFileAsStream(item); SomeClass(is) //of course this probably doesn't compile, I'm just using your code sample } finally { //close is }

Categories : Java



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