w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Serialize PHP => Unserialize JAVA / Serialize for php in string format
You can't natively read one languages serialised objects with another language (languages each have their own serialisation protocols/format, there is no guarantee they can read one-anothers format), Java serialised objects are serialised to a binary format and PHP your provided text format. There are libraries such as Google's protocol buffers that you can use, they don't officially support PHP, however there are 3rd party libraries which provide Protocol Buffer support for PHP. Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your

Categories : Java

How to serialize all li#id within an ul with jquery.serialize()?
serialize() is to encode a set of form elements as a string for submission. Try using .each() and loop all li elements inside div: $(document).ready(function(){ var myaudiotracks = new Array(); jQuery('#audio_list li').each(function(){ myaudiotracks.push($(this).attr("id").split("trackid_")[1]); }); console.log(myaudiotracks); }); DEMO FIDDLE

Categories : PHP

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

How serialize one listener and don't serialize other listener of same event
Frankly, I would strongly advise: do not serialize events... ever. That is pure implementation, where-as serialization should be talking data. With BinaryFormatter (which is, I assume, what you are using) the only way to selectively serialize this would be to implement ISerializable and do all the work yourself, but frankly I strongly advise against it - just as strongly as I advise against serializing events in the first place (of course, I also routinely caution people about using BinaryFormatter in the first place, especially if the intent is to store the data somewhere - too many horror stories...)

Categories : C#

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

Java method takes a size parameter, does some work and return a reference and updates the size, reference and size to be used by method 2
If you want to pass numBytes between function calls you have to choice: Using function return value numBytes = 1024; numBytes = numBytes - firstJob(numBytes, ...); secondJob(numBytes,...); or Apache commons-lang Mutable objects MutableInt numBytes = new MutableInt(1024); firstJob(numBytes, ...); secondJob(numBytes, ...); and inside functions you can change integer value inside mutable object without change numBytes reference (you can't do that in Java) Else, if you want to change a BlockInfo or BlockIDSet (passed as parameter) properties you can do without problem. public void firstJob(BlockInfo bi) { bi.blockSize = 23; }

Categories : Java

pdf /F font size size is not real size?
you should also apply Tm text matrix transformations for this value. "A font defines the glyphs for one standard size. This standard is arranged so that the nominal height of tightly spaced lines of text is 1 unit. In the default user coordinate system, this means the standard glyph size is 1 unit in user space, or 1 ⁄ 72 inch. The standard-size font must then be scaled to be usable. The scale factor is specified as the second operand of the Tf operator, thereby setting the text font size parameter in the graphics state."

Categories : Pdf

Setting body { font-size: 100% } results in font-size: 12px; and not font-size: 16px; Why?
If you inspect the inline box using a browser’s Developer Tools (hit F12 to open them), you can see that its height is indeed 12px, as set in your code. This happens because there is nothing in it that would require more height; in general, the exact calculation of heights of inline blocks is browser-dependent. The font size of the text is still the browser default, typically 16px. The font size does not mean the height of any particular letter. It is just a fundamental property of the font; typographers usually design characters so that they - together with ascenders, descenders, and diacritic marks - fit into the limits set by the font size (or extend over them just a little), and normally most letters have smaller height.

Categories : CSS

How to align picture in center and assign its size mode to auto size at the same time?
You can try using this simple Panel control that will handle the two requirements for you: public class PanelImage : Panel { private Image image; public PanelImage() { this.DoubleBuffered = true; this.ResizeRedraw = true; } public Image Image { get { return image; } set { image = value; if (image != null) { this.AutoScrollMinSize = image.Size; } this.Invalidate(); } } protected override void OnPaint(PaintEventArgs e) { e.Graphics.Clear(Color.White); if (image != null) { Point p = this.AutoScrollPosition; if (image.Width < this.ClientSize.Width) { p.X = (this.ClientSize.Width / 2) - (image.Width / 2); } if (image.Height < this.ClientSize.Height) { p.Y = (this.ClientSize

Categories : C#

How to reconcile difference in aspect ratio between camera preview size and picture size
I'm not too sure of what you're asking for, but the preview size actually is not determined by your layout. How it is displayed is determined by the layout. I'm assuming that you are using a SurfaceView to hold your preview/camera object. You can get the actual preview size with this method http://developer.android.com/reference/android/hardware/Camera.Parameters.html#getPreviewSize() And additionally, you can get the dimensions of your "displayed" preview by using the width and height you get from onSurfaceChanged() (It is part of the surfaceholder callback) I'm not sure how important that is. But the main point is now that you know the actual preview size from getPreviewSize() you can do math and get your points accordingly. This matches perfectly with onPreviewFrame(byte[] data, Ca

Categories : Android

dynamically changing the size of font size based on text length using css and html
Getting the size in pixels of a string of text is a hard thing to do and depends a lot on the browser and the user's settings, so it will probably be hard to come up with a solution that works in all cases. By "display user entered text" do you mean the user is typing into a textbox? If so, you can attach a keypress listener that checks the length of the value of the text, then adjusts the font-size accordingly. Here's an example, though you will probably need to change the lengths and font-sizes to meet your needs: Working Demo $('#text').on('keypress', function(e) { var that = $(this), textLength = that.val().length ; if(textLength > 30) { that.css('font-size', '5px'); } else if(textLength > 20) { that.css('font-size', '10px'); } else

Categories : Javascript

Reading a a ReadableStream and specifying a size param: Why does state.highWaterMark always get passed to ._read() as the size?
I think it's wrong to call rs.read(size).pipe(res); This is because according to the docs, rs.read(size) returns a buffer, a string, or null. However, pipe() is a method of Readable. You should probably be using rs.pipe(res); rs.read(size);

Categories : Javascript

WPF what determines whether scrollviewer and stackpanel give infinite size to a child as opposed to a set size?
StackPanel measures its children with infinity in the direction of its Orientation, so an infinite height when the Orientation is Vertical; the other orientation is usually given the constraint it got. Canvas always measures its children with an infinite width and height. For a ScrollViewer, if the Content implements IScrollInfo (i.e. it provides the scrolling functionality) and its CanContentScroll is true then the child is measured based on the constraint it is given, possibly minus the amount needed for the scrollbar(s) if they are shown. Of course then it is responsible for handling the scrolling.

Categories : Wpf

In MySQL, does the designated size of TEXT or BLOB affect performance or table size?
The difference between BLOB and MEDIUMBLOB is basically that it encodes the length in 2 bytes or 3 bytes. Otherwise, it stores only the length of content you stored on a given row. So you should just declare the column as MEDIUMBLOB. Some client database access libraries (e.g. PHP) will preallocate a buffer to hold the greatest length that the column might return, because they can't tell before fetching whether it's only 65K or 100K or 16MB. I have found that PHP for example blows up if you try to fetch a LONGBLOB, because it preallocates a 4GB buffer, which is greater than the PHP max memory limit.

Categories : Mysql

How do I change the size of a kendo popup edit screen and have all of the items in it resize to the new size?
Can you just use regular CSS? Like: .k-edit-form-container .k-textbox, .k-edit-form-container .k-widget { width: 600px; } You just have to make the selectors be a bit more specific that Kendo's built-in ones.

Categories : Kendo Ui

Susy Grids: change the size of 12-column div without changing the overall grid size?
You can adjust any of the grid settings to fit within the required space. Probably the most straightforward way to trim 30px off your grid size would be from the grid-padding setting. $total-columns : 12; $column-width : 69px; $gutter-width : 14px; $grid-padding : 10px; $container-style: static; You could alternatively tweak the column-width or gutter-width settings to achieve the same number. It's hard to say the best approach without seeing the design. Either way should get you to 1002px.

Categories : CSS

How to limit BlockingCollection size but keep adding new itens (.NET limited size FIFO)?
What you are describing is a LRU cache. There is no implementation that I know of in the standard libraries but would not be hard to create. Look at this c++ implementation for some clues. Edit Try this one from code project

Categories : C#

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 do you change the size of a size of an angular ui bootstrap date picker popup?
This size of the datepicker can be changed by overriding the css for the bootstrap form-control and btn classes as shown in the following example: .my-datepicker .form-control { height: 10px; padding: 11px; } .my-datepicker .btn { padding: 1px 2px; } then apply the my-datepicker class to the datepicker input-group <span class="input-group my-datepicker"> <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="validToDate" is-open="opened1" min-date="minDate" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" /> <span class="input-group-btn"><button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyph

Categories : Twitter

change picturebox size , spacing between buttons when user changes window size
You can use Anchor of your controls.Using anchor you can anchor it top ,bottom left right take a look at this Or you can also use Table Layout Panel

Categories : C#

How does Mailchimp manages to move box below antoher one when window size changes size (css3/media queries)
Its using media queries Check the following links to get more information and get started about it http://mediaqueri.es/ http://css-tricks.com/css-media-queries/

Categories : CSS

Changing website layout based on screen size and browser window size in Rails
You need to use CSS to do this, it has nothing to do with Rails. See http://www.1stwebdesigner.com/css/responsive-website-tutorial/

Categories : CSS

Web API Serialize XML
It says response.Content.ReadAsAsync().Result; Are your sure result is populated before you return it? In the debugger you have one behaviour, outside another. Try turning ReadAsAsync off to see if it is the culprit.

Categories : C#

opencv error: assertion failed (size.width>0 && size.height>0) in unknown function line 261
(size.width>0 && size.height>0) means that there is an empty Mat over there. In this case, it must be that image is empty because the camera couldn't be opened. Check VideoCapture::open return value.

Categories : C++

finding screen size and diagonal to adjust the size of objects
I don't know why you want this. I hope it works out: It seems that diagonalInches = Math.sqrt( (widthInInches*widthInInches) + (heightInInches * heightInInches) ) where widthInInches = width/ppi; and heightInInches = height/ppi; Also, why are you getting realppi by dividing 306 by ppi? Is displayMetrics.densityDpi not returning an accurate ppi?! I just tested it and it seems to be working properly for me. I hope you have better fortune soon. Hang in there!

Categories : Android

is there a way to revert an image back to it's orignal size, once it has been set to a percentage size?
of course :) width: auto; And with CSS you'll need to put this under the original rule, unless the ones above are more sepsific. So if thats the case, make it more targeted, again if thats not an option use the dreaded !important rule.

Categories : CSS

How to adjust table size to correspond to the media screen size?
There are loads of ways to handle tables on smaller screens. What a lot of sites do is put them in a div and assign the div a width of 100% and overflow:auto; Then they set a minimum width for the table itself so that the integrity of the data is maintained without bastardising the table. All the user does is scroll across when they reach a table that is too big for their screen, but because its contained in a 100% width div with overflow, it won't break the flow of the page. That's just one way of doing it, and is the easiest to markup. Hope that helps.

Categories : HTML

Automatically changing font size as parent control changes size
How about this - it has the view box in each grid cell and a textbox as it's content. It will resize the content as you resize the app <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="286" Width="440"> <Grid> <Grid.RowDefinitions> <RowDefinition ></RowDefinition> <RowDefinition ></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinitio

Categories : C#

Set java heap size in machine with dynamic memory size
If you have more than 2GB of memory available in you system for the the tomcat process to start, I guess then you can use -Xms2048m. -Xms2048 means, your JVM will need this much memory for initial allocation and if it cannot allocate, you might get the exception.

Categories : Java

MATLAB throw YDATA size error when using lsqcurvefit X and Y are of the same size
Your function F returns a scalar where a vector of the size of Y (or xdata as it is called the scope of F) is expected. A working example would be, for instance: F = @(x,xdata) x(1) * xdata;

Categories : Matlab

Text size vs other content size changing when zooming in on web page
It's an easy problem to get into, particularly for a beginner. Consider moving divs to percentage values etc. In terms of mobile viewing and standard desktop browsing, I would suggest you try using a grid system. One popular example which is very easy to use & I think is great for beginners is 960.gs I'm afraid without code snippets and your question being very generalised, its unlikely we can help. There are also ready to go grid systems that shift the page around depending on screen size but I wouldn't recommend them until you are comfortable using 960.gs

Categories : HTML

Computing folder size: Empty folders have a default size?
Explorer shows both "Size" and "Size on disk". Since multiple files cannot share disk clusters, the minimum size a file will occupy on disk is one cluster (4096 bytes on your machine). Look at "Size" in Explorer.

Categories : Python

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

How to Increase the bitmap image size according to the phone screen size?
Bitmap _bitmapPreScale = BitmapFactory.decodeStream(buf); int oldWidth = _bitmapPreScale.getWidth(); int oldHeight = _bitmapPreScale.getHeight(); int newWidth = 2592; int newHeight = 1936; float scaleWidth = ((float) newWidth) / oldWidth; float scaleHeight = ((float) newHeight) / oldHeight; This might be a help and you can visit the following post its a good one. Save bitmap to location you will get good idea from here.

Categories : Android

Rolling tables limited to a certian size (i.e. doing first in, first out on a table if its size is > y)
I believe you should be able to achieve what you try using a trigger. How you do that would depend on the database you are using. You can have a look at the trigger page in wikipedia.

Categories : SQL

Change the size of background video when browser size changed
When the window resizes, you need to see if it needs to fill the space horizontally (and crop vertically) or vice versa. The following jQuery will do that: $(window).resize(function() { if ($('body').width() < $('body').height()) { $('video').css({height:'100%',width:'auto'}); } else { $('video').css({width:'100%',height:'auto'}); } });

Categories : Javascript

Dialog fills screen size. I can't make it be a fixed size
Ok. Solved it. I've added a parent layout on dialog_users_to_invite.xml Now it is: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="100dp" > <LinearLayout android:id="@+id/containerUsersToInvite" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_marginRight="10dp" android:layout_marginLeft="15dp"> </LinearLayout> </ScrollView> Working perfectly. Everything on wrap_content except the ScrollView, which is 100dp.

Categories : Android

Does sizeof() in c# return only a size of type itself or it counts the reference size as well
Everything in your question is wrong. Or it also count the size of reference itself. There is no reference here. bool and such, usually memory inexpensive types, are quite memory expensive in c# No, they are not. Such types are value types, they do not use a reference and consequently incur no overhead. The size of such types is just that type itself. But the same is true for reference types: a structure containing two references has as its size the size of two references. It does not additionally have the size of the memory behind those references. NOTE: I know that Marshal.SizeOf allows you to call some special function which returns a precise size of unmanaged object / type, but that seems too slow to me. It’s not slow. I need a way to get a size of object which

Categories : C#

How to get the size of a row in a text with Jquery without ".css('lineHeight');" and ".css(font-size);"?
Try with outerHeight(): var height = $('#element').outerHeight(); Or maybe you are looking for innerHeight(): var height = $('#element').innerHeight();

Categories : Javascript

zlib inflate CHUNK size has to be the same as the size used in deflation?
No, the chunk sizes do not have to be the same. A valid deflate stream can be decoded by inflate using any chunk size. Even after I defined the CHUNK size as 256KB, I see the output data of each inflate() function call is only 8KB. From the discussion in the comments, you do not have a single deflate stream but rather a concatenation of a sequence of small deflate streams. Do inflate that, you will need to simply restart the inflate process each time you complete a stream, which is indicated by Z_STREAM_END being returned by inflate(). Use inflateReset() instead of inflateEnd() followed by inflateInit(), since that saves time and avoids unnecessary frees and allocations of memory. There is no way to speed up the decompression beyond that.

Categories : Misc



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