w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Libgdx : setting another screen, but still buttons from old screen active
I changed this : I moved the input processor to the show() method of that screen using stage variable of that screen public void show() { ... Gdx.input.setInputProcessor(stage); } before I was setting this only in the constructor of the screen, so even If I was changing the screen, the input processor was still attached to the last created screen's stage

Categories : Java

pixel color detection on system screen
Compare it with the Color.RED etc, and take the one closest to the input. Or you could use wolfram alpha API http://products.wolframalpha.com/api/libraries.html FFF0F5 is for example called Lavender Blush and if you type FFF0F4 it would suggest this as the closest http://www.wolframalpha.com/input/?i=%23FFF0F5

Categories : Java

Form feed does not clear the screen
According to this article the proper way to clear the screen is printf("33[2J"); (provided your terminal supports ANSI escape sequences and is VT100-compatible). I can confirm that this works on Linux Mint using GNOME Terminal, and on Windows using xterm and PuTTY. ^L clearing the screen doesn't look like a portable convention. For example on HP-UX with the POSIX shell, passing ^L to the shell doesn't do anything. This seems more like a bash occurrence. Printing f will clear the screen with some terminals but not others. For example logging to a Red Hat host from Windows, I can clear the screen with printf("f"); in PuTTY but not in xterm (I get a blank line in the latter case).

Categories : C

Clear screen in C and C++ on UNIX-based system?
It is usually not a matter of just clearing the screen, but of making a terminal aware application. You should use the ncurses library and read the NCURSES programming HowTo (You could perhaps use some ANSI escape codes as David RF answered, but I don't think it is a good idea)

Categories : C

x86 Video memory clear screen crash
Welp, seems that bochs developers are (or maybe i am) a little bit stupid, as CX register is nonexistent in bochs. I found out when i dumped register info to screen while debugging. The CX register simply does not exist there. My solution? Being in 32 bit mode, and having access to 32 bit registers I simply replaced the CX register to ECX, which did work, and screen got cleared perfectly.

Categories : Assembly

print the data on window screen and then clear the window screen before printing other data.in python
In that case, all you have to do is remove the previous content of the widget just before printing the new one. If you have an Entry widget, use the delete method: entry.delete(0, 'end') # print new serial data Or if you have a Text widget: text.delete(1.0, 'end') # print new serial data

Categories : Python

How to erase, clear, wipe HTML 5 localstorage for a web app saved to home screen on an iPad?
You can use this function to clear the localStorage. localStorage.clear() You can add counter to be stored in localStorage and do something like this. onload: localStorage.reloadCount = localStorage.reloadCount || 0 //make sure its not undefined localStorage.reloadCount = localStorage.reloadCount*1; // it stores in string values if(localStorage.reloadCount>4) localStorage.clear()

Categories : Javascript

Best way to hide buttons off-screen
If you're ok with an ellipsis, how about this? http://jsfiddle.net/CkESR/2/ .button-text { max-width:150px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }

Categories : Javascript

Buttons in the action bar vs on screen
I usually prefer to put buttons belonging to the content (such as the question) WITH the content. Then I find buttons that interact with the app as a whole to belong to the action bar. It can also be used if it interacts with multiple content items on single screen (more common on tablets For example putting a login button in a login screen in the action bar would be kinda awkward.. Im no UI expert by any means though

Categories : Android

center a group of buttons on the screen
Lets say you need three buttons in center, then following is the process to achieve the x coordinate of each of 3 buttons. //Define these globally somewhere CGSize buttonSize = CGSizeMake(50,50); int numOfButtons = 3; //num of buttons horizontally in one line. this will be 2 for 2nd and 1 for the third line as per your reference screen. CGFloat maxSeparationBwButtons = 20.0f; //your horizontal margin b/w buttons CGFloat screenWidth = [UIScreen mainScreen].bounds.size.width; CGFloat totalLengthWithOffsets = buttonSize.width*(CGFloat)numOfButtons+(maxSeparationBwButtons)*((CGFloat)(numOfButtons+1)); CGFloat originatingX = (screenWidth - totalLengthWithOffsets)/2.0f; //global definition ends... //Now you can use this method to get the desired button's x coordinate //Note : in 3 buttons the

Categories : Iphone

How to I align these buttons along the bottom of the screen?
I would suggest you to change <LinearLayout android:layout_width="match_parent" android:layout_height="305dip" android:orientation="horizontal"> to <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:orientation="horizontal">

Categories : Android

Android : Make buttons appear at bottom of screen
If you really need them created dynamically then we can help with that. However, it looks like you are creating them unconditionally every time in onCreate() so it would be a lot easier to put them in your xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".AudioRecordTest" > <TextView android:layout_width="wrap_content"

Categories : Android

Place buttons (or divs) one below the other if they can't fit in screen resolution
Since the button width is set using percent, they will always shrink to fit within their container. If you remove the width declarations and use left/right padding instead, buttons that don't fit in the container will drop to the next line. The margin-left declarations also appear to be unnecessary. Not quite sure why you've included those; if removing the margin/width declarations doesn't work, it would be helpful to view your HTML to see the buttons in context.

Categories : HTML

try to display seven buttons with scrollview in a small screen
As I understand from your question it works in portrait but not landscape, so try this. As you rotate your device it should still scroll. I have placed this is in one Layout instead of multiple layouts. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <Button android:id="@+id/lieu_depart" android:layou

Categories : Android

CSS Centering - div with inline buttons that can be at top and bottom of screen
Like this demo2 #control-div{ background-color: #FF0000; font-family: Verdana,Geneva,Arial,sans-serif; height: 70px; left: 50%; margin-left: -125px; position: absolute; top: -35px; visibility: visible; width: 250px; } html <div id="control-div"> control-div </div> demo css #control-div { width: 100px; height: 100px; background-color: red; position: absolute; top:0; bottom: 0; left: 0; right: 0; margin: auto; } OR var centerIt = function (el /* (jQuery element) Element to center */) { if (!el) { return; } var moveIt = function () { var winWidth = $(window).width(); var winHeight = $(window).height(); el.css("position","absolute").css("left", ((winWidth / 2) - (el.width() / 2))

Categories : CSS

need buttons to spread out dynamically according to screen width
You need to dynamically(programmatically) adjust the positioning of your layout elements. For example, if we have 2 TextViews inside a LinearLayout, we can add a OnGlobalLayoutListener to the LinearLayout: myLinearLayout.getViewTreeObserver().addOnGlobalLayoutListener(ViewTreeObserver.OnGlobalLayoutListener) Inside this listener, we can access the width and the height of the layout elements. So, if we need to position our TextViews (spread them equally across the screen-width), we'll do the following: int width = myLinearLayout.getWidth(); int lMarginTextView = (width - myTextView1.getWidth() - myTextView2.getWidth()) / 3; LinearLayout.LayoutParams paramsTV = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); paramsTV.le

Categories : Android

add buttons dynamically based on screen size
Following code may help you Display display =((WindowManager)activityContext.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); DisplayWidth = display.getWidth(); DisplayHeight = display.getHeight(); if(DisplayHeight > DisplayWidth) { ButtonWidth = (6 * DisplayWidth) / 7 ; ButtonHeight = (4 * DisplayHeight) / 5 ; } else { ButtonWidth = (6 * DisplayWidth) / 9 ; ButtonHeight = (4 * DisplayHeight) / 5 ; } Divide and multiply display width and height as per your requirement and set as button width and height.

Categories : Android

buttons not working in pause screen in cocos2d
Does [[CCDirector sharedDirector] replaceScene:[CCTransitionScene transitionWithDuration:1.0 scene:[PauseMenu scene]]]; works? You paused director and after this replaceScene.. If it works(I'm not sure).. you changed scene, so it means your GameScene doesn't exist anymore. I would write something like this in my pauseTheGame method: PauseMenu *pause = [PauseMenu pauseNode]; // create PauseMenu instance [self addChild:pause z:10]; // add pause in your scene; after this call this in your pauseMenu init method [self performSelector:@selector(pauseCocos2d) withObject:nil afterDelay:1.0/60]; Here is pauseCocos2d: -(void)pauseCocos2d { [CCDirector sharedDirector] stopAnimation]; [[CCDirector sharedDirector]pause]; } Call this in your retryTheGame, resumeTheGame and opt

Categories : Iphone

How to resize buttons and labels in Bootstrap according to screen size
Yes! Using the usual responsive class on a <div> and making a block level button inside it. <div class="span2"> <button class="btn btn-block">My Button</button> </div> demo

Categories : CSS

Show/hide buttons depending on screen size
You can't get the physical size of the screen, but you can get its resolution. The 4" iPhone 5 and the new iPod touch have 320×568 points, while the other iPhones have 320×480. You can get these dimensions using [[UIScreen mainScreen] bounds].size. It's of course possible that Apple releases a new phone that has the same pixel dimensions as the 4" iPhone 5, but uses a 5" (or whatever) screen, or that they release a device that has completely different dimensions. Your code should ideally be prepared for that, and not make the assumption that these dimensions are set in stone. On the other hand, this kind of change typically doesn't happen overnight. So, if you want to hide a button on devices with "small" screens, you could do something like this: - (void)viewDidLoad { self.myButt

Categories : IOS

As android device screen is bigger, buttons are upper
//try like this below one #remove the margin top 102dp #don't use button background image use color with white stroke #make your button width as match parent and minheight= 100dp as ur need. #add android:gravity="center" to your parent layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/background" android:gravity="center" tools:context=".BasicScreenActivity" > <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignPa

Categories : Android

Android layout of a menu to fill screen with buttons
You can use weighting. See the docs for LinearLayout params. Basically if you have a LinearLayout that takes up the whole width, with three buttons in it, you can set weight on all the buttons to 1 and they will fill the layout taking up equal space.

Categories : Android

to make buttons resizable according to screen sizes using jquery/javascript
Css3 has mediaqueries which allows you make screen specific styles. This is not very well supported in older IE's, that is why you always have to define an normal. The cascading effect stays in affect, you do not need to redefine properties from normal in the mediaqueries (for example, background will be green in all scenarios) /*normal*/ button{ width: 200px; background: green; } @media only screen and (max-width: 600px) { button{ width: 150px; } } @media only screen and (max-width: 480px) { button{ width: 100px; } } This is called responsive design, the design responds to the widths. IE will do nothing, but if you are using Firefox and make the width of the browser smaller, it will hop automatically to the media styles

Categories : Javascript

OpenCV object detection from face detection code - ANDROID
sure, that's possible. the cascade classifier just finds, what the cascade-file was trained on, be it faces, eyes or soda-cans. lots of existing examples here , and ofc, you can train your own, opencv comes with tools for that ( cascade_training, haar_training )

Categories : Android

how do I use browser detection code to run certain HTML depending on detection result?
if (isFirefox) { // do FireFox stuff here } else if (isChrome) { // do Chrome stuff here } else if (isSafari) { // do Safari stuff here } else if (isOpera) { // do Opera stuff here } else if (isIE) { // do IE stuff here } else { // other browser }

Categories : Javascript

Barcode detection using Hough Transform & Edge Detection
So, the Hough transform MUST be used? Barcode analysis is usually much easier than this, since you know a priori that all the barcode lines are parallel. If you can guarantee that they will be scanned relatively accurately (ie: the bar code scanner is operated roughly perpendicular to the barcode lines, give or take 30 degrees each way), you can just take a single "slice" of the barcode image, so it goes from an MxN image to a 1xN image. You then just convert the image to plain black and white, either using thresholding, or segmentation (ie: K-means segmentation). You can then perform noise removal (a median or mode filter would be ideal) so that a single noisy pixel doesn't split a single barcode line into two separate lines. Finally, a single for loop can be used to calculate the width

Categories : Matlab

How multiscale detection loop works in OpenCV's HOG detection?
If you look at the source code for this function void HOGCache::init(const HOGDescriptor* _descriptor, const Mat& _img, Size _paddingTL, Size _paddingBR, bool _useCache, Size _cacheStride) You will see the following comments // Initialize 2 lookup tables, pixData & blockData. // Here is why: // // The detection algorithm runs in 4 nested loops (at each pyramid layer): // loop over the windows within the input image // loop over the blocks within each window // loop over the cells within each block // loop over the pixels in each cell // // As each of the loops runs over a 2-dimensional array, // we could get 8(!) nested loops in total, which is very-very slow. // // To speed the things up, we do the following: // 1. loop over windows is unrolle

Categories : C++

how to clear the radio buttons using check box un check
Why can't you use a reset button to clear the form? <input type="reset" value="Reset Form" /> But to answer your question, if you are able to use jQuery then you can do this very easily: jQuery method: http://jsfiddle.net/zzrVN/2/ $(document).ready( function() { $('#clearCheckboxes').click( function() { $('[name="thisForm"] input:checkbox').removeAttr('checked'); $('[name="thisForm"] input:radio').removeAttr('checked'); }); }); To use jQuery you just need to add one script tag to your document: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> However if you do not want to use jQuery then the pure JavaScript solution would be something like: var inputItems = document.getElementsByTagName('input'); for (v

Categories : Javascript

Design images, buttons, text, etc to fit all screen sizes for android tablet in landscape mode
You need to make the images for only one size (or for one device). Lets say you are working on a tablet with screen size 640x960. You can then make a layer of size 640x960 and add the images to that layer. Once you have your layer with all the images you want on it, you must then scale that layer up or down depending on the device screen. So if you made an image for a device with screen pixels: 640 x 960, and you test it on a different device with screen size 400 x 800, you would then scale the layer that contains your images like so: layer->setScaleX(640/400); layer->setScaleY(960/800); And the layer will stretch inwards to fit the smaller screen.

Categories : Android

Reduce false detection in Pedestrian Detection
You could apply a background subtraction algorithm on your video stream. I had some success on a similar project using BackgroundSubtractorMOG2. Another trick I used is to eliminate all "moving pixels" that are too small or with a wrong aspect ratio. I did this by doing a blob/contour analysis of the background subtraction output image. You need to be careful with the aspect ratio to make sure you support overlapping pedestrians. Note that the model you're using (not sure which) is probably trained on a front faced pedestrian and not with a 45 degrees angle down. This will obviously affect your accuracy.

Categories : Opencv

Confusion between "#define clear()" and "std::wstring::clear()"
The reason is because the preprocessor basically does a search-and-replace on all macros that are defined. And it's done before the compiler proper gets the code, and it does not know anything about namespaces, classes or scope in general. So if you have e.g. #define clear() something and then use wstr.clear(); The preprocessor will replace the clear() so that the compiler sees wstr.something;

Categories : C++

How to clear the bottom of an image like clear left / right
Based on your image, you can realize the layout by using the the following HTML: <div class="contentpart"> <a href="#"> <img src="http://placehold.it/300x200"> </a> Donec adipiscing, lorem non euismod venenatis... </div> and applying the following CSS rules: .contentpart { border: 1px dotted gray; display: table; } .contentpart a { display: table-cell; vertical-align: top; padding-right: 20px; } You can see the demo at: http://jsfiddle.net/audetwebdesign/wknjA/ How This Works You can use CSS tables to get the text to stay in a single column without wrapping it in a block element. Apply display: table to the parent block and display: table-cell to the a tag. You can have some control over white space by

Categories : CSS

Java clear console error: java.io.IOException: Cannot run program "clear"
There's pretty much nothing in the console related API to do a clear screen. But, I think you can achieve the same effect through println()s. A lot of putty clients clear the page like that and then scroll up. private static final int PAGE_SIZE = 25; public static void main(String[] args) { // ... clearScreen(); } private static void clearScreen() { for (int i = 0; i < PAGE_SIZE; i++) { System.out.println(); } }

Categories : Java

how to position Views on an Android screen relative to the screen edges using offsets in terms of pixel position on the screen coordinates?
You can put a margin to your element to move it away from the edge. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" <!-- move it to the top left corner --> android:layout_alignParentLeft="true" <!-- move it to the top left corner --> android:layout_marginTop="10dp" <!-- move it 10dp down --> android:layout_marginLeft="10dp" <!-- move it 10dp right --> android:text="@string/hello_world" /> </RelativeLayout>

Categories : Android

How to remove dotted outlines on links, buttons, inputs, textareas and buttons
Try using the appearance property: -webkit-appearance: value; -moz-appearance: value; appearance: value; for more info: http://css-tricks.com/almanac/properties/a/appearance/

Categories : CSS

How to disable buttons from Button Helper for single image, and enable all this buttons for the gallery? (Fancybox 2)
Forget about finding elements and/or adding btnDisabled classes, etc. Just add this conditional in your afterShow callback : afterShow: function () { if(this.group.length < 2){ // gallery has a single element so disable loop $.extend(this,{ loop: false }); } // more options, etc. } // END afterShow See JSFIDDLE .... or your updated JSFIDDLE

Categories : Jquery

JQuery Mobile Radio Buttons stay selected when selecting other buttons. Using .html function
http://www.w3schools.com/html/html_forms.asp The radio button grouping is defined by the name attribute. Your buttons all have different names, so they are part of different groups. It should be something like this: <fieldset data-role='controlgroup' data-type='horizontal'> <input type='radio' name='camera' id='10000' value='10000'> <label for='10000'>test1</label> <input type='radio' name='camera' id='10001' value='10001'> <label for='10001'>Camera 2</label> <input type='radio' name='camera' id='10002' value='10002'> <label for='10002'>Camera 3</label> <input type='radio' name='camera' id='10003' value='10003'> <label for='10003'>Camera 4</label> </fieldset>

Categories : Javascript

radio buttons post show value even none of the buttons are checked how to validate this?
One really quick way of doing this is defaulting to a choice in the UI. This makes sure that the value is non-empty because you can't "uncheck" a radio button. <input type="radio" name="gender" id="optionsRadios1" value="female" checked> Female Edit: Write your own submit function, and bind it to your submit button's onclick() function submit() { if (!$("#optionsRadios1").prop("checked") && !$("#optionsRadios2").prop("checked")) { alert("please select a gender"); } else { //Whatever you do to submit } }

Categories : PHP

Sencha Touch 2: Message box with buttons: How to align buttons vertically?
If you only have two buttons in your Ext.Msg.Show, you can achieve the desired results with 'docked' property. (Like this): Good Luck! Here is the updated code: Ext.Msg.show({ title: 'The title', message: 'and some text...', scope: this, buttons : [ { docked: 'top', itemId : 'no', id: 'no', text : 'Top button' }, { docked: 'bottom', itemId : 'yes', id : 'yes', text : 'Bottom button' } ], fn: function(btn) { if (btn == 'yes'){ //do something } } });

Categories : Javascript

Cant move UIScrollView that has buttons in it when pressing and dragging the buttons
This is by design. Conceptually, only one view should be processing a touch event. When you touch a button, only the button related processing is handled (e.g., button press). the touch event cannot be processed by both the button and the scroll view at the same time. Once you start a touch event in a button, the button "owns" that touch and so the scroll view doesn't get to process it. The reason why when you slide "really fast" the scroll view does move is because your scroll view gets to inspect a touch event first since it is the parent view of your buttons. If the touch event isn't "moving", it will pass it along to subviews, in this case your buttons, to see if they can process it. However, if the scroll view detects that touch is moving before the button has a chance to process the

Categories : IOS



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