w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Find partition size using df and awk
You can use sed instead of awk again: df -h | grep "/partition" | awk '{print $3}' | sed -e 's,[A-Z]$,,' Keep in mind that this (and your one-liner) does not print the size of the partition, but the size used.

Categories : Linux

Making an image of a SD with a partition smaller than the SD size
If you by any chance have an external hard drive you could copy ALL the contents of the Raspberry Pi partition including hidden and operating system files...Then you could delete the partition and merge it with your current partition using a tool like: Minitool Partition Wizard. Then you could create a system image of your 14GB HDD and copy it to the External HDD and then at last remake the partitions using a partition tool and copy back the contents of your Rasberry Pi partition into the new partition you would have made. Now I do not know what effect this has on registry files so I would try this with caution. I do not know if there are registry files tied to the partition that you cannot copy or see so I would also make a registry backup... Idk if you want to try this but maybe this wi

Categories : Image

After new partition gets created insert partition info in another table through trigger
You can do it with DDL Trigers. Check out this link One important note from the author you should consider adding a partition is not DDL if Oracle decides to do it internally, it’s only DDL if it’s an end-user statement Implicit partition creation is a new feature of 11g and it reffers to the interval partition option.

Categories : Oracle

Hoare partition : is this implementation more/less efficient than the standard partition algorithm?
I always prefer the standard Hoare's implementation. If you look at it, it is not very intuitive, but it has a visible advantage: Less number of swaps. While your implementation effectively always does exactly N comparisons and N swaps, the Hoare's implementation does only N comparisons, but it does not swap anything if it is not needed. The difference is significant in some scenarios. At first in a case you use environment where swaps or assignment of variables/objects is a costy operation. For example if you use C/C++ with arrays of objects. Another typical examples where Hoare's partition implementation performs better if when many of the items in your array are of the same value or when the array is almost sorted and needs just to swap a few items. In that cases Hoare's version perfor

Categories : Matlab

how partition works on the data from mapper to reducer?
How about doing the split in your mapper? For example, each mapper does if int(number) % 2 == 0: # Output "EVEN", number else: # Output "ODD", number Then reduce over two keys: EVEN and ODD, writing them to the appropriate file.

Categories : Misc

Partition (group) table on data change
A bit of a hack: SELECT id, test_data, logdatetime ,SUM(CASE WHEN test_data = prev_data THEN 0 ELSE 1 END) OVER (ORDER BY id) + 1 AS grouping FROM ( SELECT id, test_data, logdatetime ,COALESCE( LAG(test_data) OVER(ORDER BY id) ,test_data ) AS prev_data FROM test t ) x Uses the analytic function LAG to add a pseudo column to each row containing the test_data value of the previous row. Then uses the analytic function SUM to increment an accumulator each time test_data does not have the same value as the previous row. In steps: postgres=# SELECT id, test_data, logdatetime postgres-# ,COALESCE( LAG(test_data) OVER(PARTITION BY 'x' ORDER BY id) postgres(# ,test_data) AS prev_dat

Categories : Postgresql

Partition data based on condition ("where") in a single query?
If you don't want to iterate over the data twice, you will have to create a LINQ query that contains the true values and the false values with an indicator to which group they belong. You can do this using a ToLookup: var combined = items.ToLookup(x => MyCondition(x, blah)); var trues = combined[true]; var falses = combined[false];

Categories : C#

git - dual boot ubuntu and windows with separate data partition
I'm guessing there's an issue with line endings. You probably have commited your code with windows line endings and when you checked out the code in ubuntu git converted those to unix style line endings. Take a look at this page Dealing with line endings

Categories : Windows

MySQL table Partition with FLOOR function (partition function not allowed)?
MySQL documents the partitioning functions here. The floor() function appears to have some special considerations. In this case, I think the issue might be that the division is returning a float/double result rather than a decimal result. This is easily fixed in your case because you do not need to do the division: CREATE TABLE `fact_events` ( `event_key` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `event_type_key` tinyint(3) unsigned NOT NULL, `analytic_file_id` bigint(20) unsigned NOT NULL, `sdk_session_id` bigint(20) unsigned NOT NULL, `virtual_button_create_id` bigint(20) unsigned NOT NULL, PRIMARY KEY (`event_key`), KEY `idx_events_event_type` (`event_type_key`) ) PARTITION BY RANGE(event_key) ( PARTITION p0 VALUES LESS THAN (0), PARTITION

Categories : Mysql

MongoDb creates additional data files before data size grows beyond the initial allocated files size
It's because mongodb preallocates storage files. Suppose, you fill those two files up pretty quickly. You don't want to wait while a new file is allocated, because on some filesystems it may take time. Instead, mongodb arranges so that at each moment there is an empty file, ready to be written to.

Categories : Mongodb

How to use media Queries for android devices with android version 2.2.1 and 2.3.5 and their screen size of 240 * 320 and screen size of 480 * 800?
These are few possiblities why your media query is not working. 1.When you used media query css did you remove your normal css? or you kept both ? if you want to have both, then you need to keep them appropriately else normal css will over write the one inside mediaquery. For example if your css is like this ... @media only screen and (max-width: 241px) { .container { width:180px; height:150px; margin-left:10px; margin-right:10px; background-color:#CCCCCC; border-radius:20px; box-shadow: 10px 10px 5px #888888; padding:10px; ; } } .container { width:180px; height:150px; margin-left:10px; margin-right:10px; background-color:#CCCCCC; border-radius:20px; box-shadow: 10px 10px 5px #888888; padding:10px; ; } The .container style which is outside the media query will overw

Categories : Android

Whats the image size to keep in list view of size 70x70 in android
If your image does not have higher resolution you may need to set android:scaleType="centerInside" in order not to stretch the image. Update: If you wish the row to appear "larger" on higher dpi devices, first you 1) set all your views' layout_height to wrap_content 2)Create png images with fixed width/height pixels for different density drawable folders. For example, in drawable-mdpi all your png images should have fixed height 70 pixel, then all the rows will appear to be 70dp high in mdpi devices. If you create images of height 96 pixel in hdpi folder, then all hdpi devices will look wider with 96dp height.

Categories : Android

How to install android application whose assets folder size >1GB while apk max size=50 MB?
Correct, APKs have a maximum file-size of 50MB. To extend your app beyond the 50MB limit you can use one or two expansion files, each file being max 2GB. Refer to the official documentation for details regarding this. I would also ask myself if all of these assets are needed to use the application. The app would have to be pretty damn good/provide a lot of value before I'd download 1GB of data. Perhaps you could server up chunks of data from a server and download to external storage?

Categories : Java

SSRS limit data size to page size
The different renderers are rendering the report appropriately for their output. The web viewer is optimised for screen-based reading and generally allows more content per page than the print renderer does as the print renderer is constrained by the paper size that it formats to. Thus you get more pages when rendering for printing than web; however, the content of the report is exactly the same. The best illustration of this is the Excel renderer - the Excel renderer renders the entire report onto a single worksheet in most cases (for reports with grouping and page breaks set on the group footer it will render each group on its own worksheet). You wouldn't want the Excel renderer to artificially create worksheets to try to paginate your report. It does the appropriate thing which is to in

Categories : Reporting Services

Reduce the size of a bitmap to a specified size in Android
I found an answer that works perfectly for me: /** * reduces the size of the image * @param image * @param maxSize * @return */ public Bitmap getResizedBitmap(Bitmap image, int maxSize) { int width = image.getWidth(); int height = image.getHeight(); float bitmapRatio = (float)width / (float) height; if (bitmapRatio > 0) { width = maxSize; height = (int) (width / bitmapRatio); } else { height = maxSize; width = (int) (height * bitmapRatio); } return Bitmap.createScaledBitmap(image, width, height, true); } calling the method: Bitmap converetdImage = getResizedBitmap(photo, 500); photo is your bitmap

Categories : Android

If my screen Size is 480x800 what screen size should i choose in photoshop for android UI design
For this purpose exacly they created this page. The problem here is not only the devices resolutions, but also those here: Supporting Different Screen Sizes Supporting Different Densities You will also have to take a look here and here. Designing an App is not a simple matter if you would like it to look "the same" on different devices, those are devises with different screen sizes and/or densities. EDIT: You may also like to take a look at this like here, which explains, as stated on the title "Understanding Density Independence in Android". Cheers

Categories : Android

FreeImage: Pixel data accessed by FreeImage_GetBits is not correct (data + size)
The PNG images that were problematic were using indexed color modes and the raw pixel data was indeed being returned as 8bpp. The correct course of action was to treat this data as 8 bits per pixel, and treat each 8-bit value as an index into a palette of colors that can be retrieved using FreeImage_GetPalette. The alternative, which is the choice I ultimately made, was to call FreeImage_ConvertTo32Bits on these indexed color mode PNG images, and then pass everything through the same code path as the same 32-bit image format. Pretty simple conversion, but here it is: // Convert non-32 bit images if ( FreeImage_GetBPP( hImage ) != 32 ) { FIBITMAP* hOldImage = hImage; hImage = FreeImage_ConvertTo32Bits( hOldImage ); FreeImage_Unload( hOldImage ); }

Categories : C++

Is the size of a union equal to the size of its member of the largest size?
Looking at the Cx0 standard it says: The size of a union is sufficient to contain the largest of its members So, you cannot rely on the size being equal to the size of the largest member. Whether it is on not depends on the compiler implementation, flags used, etc.

Categories : C

Android GridLayout fit for all size
Don't put your images just in drawable-mdpi, also put the convenient ones to other co-drawable folders like drawable-hdpi, drawable-xhdpi etc. Or just create a new folder named drawable, no prefix or suffix, and put your images into it

Categories : Android

Android: Is there a way to get the screen size?
There is your answer: How to get screen dimensions . This however, may not solve your problems. You should check your animation speeds, because I'm pretty sure, that it is not from the differences in the displays. You should post some code, for better help. Hope this helps.

Categories : Android

Android cannot re-size LinearLayout
I don`t know if I understood what you want, but try to change this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > to this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > this way, it will fill the screen when size is different.

Categories : Android

SUM OVER PARTITION BY
remove partition by and add group by clause, SELECT BrandId ,SUM(ICount) totalSum FROM Table WHERE DateId = 20130618 GROUP BY BrandId

Categories : SQL

How to get SharedPreferences data size, Is it possible?
You could convert the string to bytes, and then get the length of bytes: String data = array.toString(); byte[] byteArray = data.getBytes("UTF-8"); long size = byteArray.length;

Categories : Android

A size of a data that actually was read
Simply check the length of the string with the built in len function: size_to_read = 999999 with open(file_name, "r") as f: read_part = f.read(size_to_read) if(not len(read_part) == size_to_read): eol_reached_unexpectedly()

Categories : Python

getting max Data-Uri size in Javascript
What about good old hardcode? :-) I also can imagine some js test, hence it's not reliable and requires server communication at least once and probably not very dependable since it also can vary on browser implementation as well as on the possibility of the server to handle long urls (but at least you know it for your server). Anyway here it is: load static html page from your server (with http headers to cache it forever on client, non varying by request params) into hidden iframe or just with ajax get. So for example you know that target url ("data:application...") is 3000 symbols length. Than you build fake url of the same length to your static html http://yourserver.com/test.html?param1=param1&param2=param2&.. and try to load it. If the load succeeds than it's fine to open rea

Categories : Javascript

How to limit data size in php?
you can used inbuilt php substring function. or there are 5 parameter for lenght in file_get_contents(path,include_path,context,start,max_length) Check Example#3 // Read 14 characters starting from the 21st character $section = file_get_contents('./people.txt', NULL, NULL, 20, 14); var_dump($section);

Categories : PHP

tinyint(size), varchar(size): "size" explaination
Your Solution to confusion is- In Mysql , int(6) doesn't mean they can store up to 6 digit. not more than 999999. However CHAR(6) This means a character column, with a maximum length of 6 characters, such as these words: houses If I tried storing the word “special” in that column, MySQL would chop the value to be “specia”, since the original word has 7 characters. Anyway, integer columns all have a preset range of values allowed. The number in parenthesis only indicates the display width. This is probably still confusing, so let me explain further… The display width is a number from 1 to 255. You can set the display width if you want all of your integer values to “appear” similarly: TINYINT[(M)] [UNSIGNED] [ZEROFILL] M indicates the maximum display width for integer

Categories : Mysql

Android buffer size and frequency
When you're generating the sound wave, you are writing out the data in 16-bit samples. However, when you're reading the data back in again, you are processing the data one byte at a time (but still dividing the value by Short.MAX_VALUE) which doesn't seem right. What is the audio data format of the AudioRecord object - ENCODING_PCM_8BIT or ENCODING_PCM_16BIT? If it's 8-bit then you should surely be dividing by 127 (Byte.MAX_VALUE). If it's 16-bit, then you should assumedly be processing two bytes at a time and converting them to a short. Update If the buffer variable is actually a short array rather than a byte array, then your read code is probably fine as it is and you can ignore my comments above. However, I've just noticed something strange in your write code. In this section: i

Categories : Java

air for android icon size too small
I think you miss two resource folder in you project: drawable-xhdpi where icon 96x96px drawable-xxhdpi where icon 144x144px More info at developer.android.com UPDATE: If you have no such folder, just try to add it by your hands in project tree and add proper icon. Or try new version of AIR SDK.

Categories : Android

how to get android screen size programmatically, once and for all?
By using the DisplayMetrics you can get height and width of the screen of any device. here is the code. DisplayMetrics metrics; int width = 0, height = 0; In your onCreate Method metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); height = metrics.heightPixels; width = metrics.widthPixels; Try this.

Categories : Android

android: how i can get size of string array?
Look at this post and understand the difference between array and Arraylist Array's length property To answer your question, you can get the size of the array by calling .length on it. array.length You should also look at this to learn more about arrays. http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html

Categories : Android

Android widget size and ImageView from XML
Thanks to @Samuil Yanovski he did fix it.. i changed my XML to : <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/Widget" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" > <ImageView android:id="@+id/buttonwidget" android:src="@drawable/normalwidget" android:layout_gravity="center" android:adjustViewBounds="true" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitCenter"> </ImageView> </FrameLayout> And all is fine how i like it :)

Categories : Android

How to dynamically set TextView size -- android
Just go this link is enough. Using SpannableString in your TextView.

Categories : Android

Android: Rotate and size FrameLayout
So the FrameLayout is the parent of the CustomView (the CustomView is inside the FrameLayout)? If so, set a padding of e.g. 10dp to your FrameLayout, and set the width and height property of your CustomView to: match_parent

Categories : Android

Android different size image issue
Create drawable-sw600dp-hdpi folder in res and put your file to this folder Example deprecated drawable-hdpi drawable-mdpi drawable-nodpi drawable-xhdpi New Technique Configuration examples drawable-sw320dp -> 320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc). drawable-sw480dp -> 480dp: a tweener tablet like the Streak (480x800 mdpi). drawable-sw600dp -> 600dp: a 7” tablet (600x1024 mdpi). drawable-sw720dp -> 720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc). Provide different layouts for different screen sizes The configuration qualifiers you can use to provide size-specific resources are small, normal, large, and xlarge. For example, layouts for an extra large screen should go in layout-xlarge/. Beginning with Android 3.2 (API level 13)

Categories : Android

Android- Buffer size when recording
http://developer.android.com/reference/android/media/AudioTrack.html#getMinBufferSize(int, int, int) getMinBufferSize() is the minimum buffer size required for successful creation of an Audio Track object in MODE_STREAM.

Categories : Android

Android Activity contentView size
The accepted answer should give the same amount of Widh and height than this: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.activity_main); svgImageView = new SVGImageView(this){ @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); int canvasH = canvas.getHeight(); int canvasW = canvas.getWidth(); Log.d("DisplayMetrics", "canvasW:"+canvasW + ", canvasH: "+canvasH);// Portrait 800 x 1176, Landscape 1280 x 696, } I am checking the Activity source public void setContentView(View view) { getWindow().setContentView(view); } I think the mWindow will have the required data. The question

Categories : Java

Image Size notification android
You can find icon size information here: http://developer.android.com/design/style/iconography.html#notification.

Categories : Java

set size of android.R.layout.simple_dropdown_item_1line
Create a custom layout, or copy android.R.layout.simple_dropdown_item_1 contents create a new xml and pass this xml to AutoCompleteTextView sample: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:id="@+id/autoComplete" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="10sp" /> </LinearLayout>

Categories : Android

Error with ImageView size in Android
I store all my images in the MDPI directory and then resize them for tablets using code like this: if (isTablet(getActivity())){ // tablets only debugLog( "display tablet image="+imagename); int resID = getResources().getIdentifier(imagename,"drawable", getActivity().getPackageName()); // the corresponding resource id if (resID != 0) { Bitmap bmp=BitmapFactory.decodeResource(getResources(), resID); int width=480; int height=300; Bitmap resizedbitmap=Bitmap.createScaledBitmap(bmp, width, height, true); ImageView imageView = (ImageView) getActivity().findViewById(R.id.tablet_image); // the imageview to change //imageView.setImageResource(resID)

Categories : Android



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