w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to form a grid on a rectangle in matlab
You can compute a grid with the meshgrid matlab's built-in function, and draw it with mesh for example. The mesh coordinates are stored in X and Y. Here the polygon you defined is plotted on the top of the grid. The following code x = [2271 -3645 -2267 3645]; y = [-3635 -2259 3639 2254]; outside = 100; grid_val = 50; figure('Color','w'); [X,Y] = meshgrid(min(x)-outside:grid_val:max(x)+outside, min(y)-outside:grid_val:max(y)+outside); hold on; hm = mesh(X,Y,X*0); hp = plot([x x(1)],[y y(1)],'r-'); set(hm,'EdgeColor','k') set(hp,'LineWidth',2) set(gca,'Visible','off'); gives the following grid (full and zoom)

Categories : Matlab

Libgdx - Get Intersection Rectangle from Rectangle.overlap(Rectangle)
Indeed, LibGDX does not have this functionality built in, so I would do something like this: /** Determines whether the supplied rectangles intersect and, if they do, * sets the supplied {@code intersection} rectangle to the area of overlap. * * @return whether the rectangles intersect */ static public boolean intersect(Rectangle rectangle1, Rectangle rectangle2, Rectangle intersection) { if (rectangle1.overlaps(rectangle2)) { intersection.x = Math.max(rectangle1.x, rectangle2.x); intersection.width = Math.min(rectangle1.x + rectangle1.width, rectangle2.x + rectangle2.width) - intersection.x; intersection.y = Math.max(rectangle1.y, rectangle2.y); intersection.height = Math.min(rectangle1.y + rectangle1.height, rectangle2.y + rectangle2.height) - i

Categories : Java

Matlab: Making code for coinflip
You can do as follow: faceId=rand(1,10)<0.5 faceId = 1 1 0 0 1 1 1 0 0 0 faceName='TH'; faceName(faceId+1) ans = THHHHTTHTH

Categories : Matlab

making matlab code android compatible
You have several options: The best things to do is to port your code in java or port your code to use openCV. Use Matlab coder to generate C code. This C code doesn't require the MCR, and could be compiled to run directly on Android

Categories : Java

matlab: making an areaseries transparent disrupts subplots
You could try using fill or patch with the 'facealpha' property instead of the area command: % x and y vals define the 4 corners of the rectangle % (slightly different than "area") x_vals=[datenum(time(4,1),1,1) datenum(time(8,1),1,1) ... datenum(time(8,1),1,1) datenum(time(4,1),1,1)]; y_vals=[1.3*min(SA(:,2)) 1.3*min(SA(:,2)) ... 1.3*max(SA(:,2)) 1.3*max(SA(:,2))]; Plotha2 = fill(x_vals,y_vals,'red','edgecolor','none','facealpha',0.2);

Categories : Matlab

I need coordinates of angles some rectangle area (like crop rectangle) on image/photo. How i can get them?
For your purpose you better to use Android Canvas. When you touch a particular point you can get details of that point using 'OnTouch'(http://developer.android.com/reference/android/view/View.OnTouchListener.html) method in android.

Categories : Android

LWJGL: Creating a semi Transparent Rectangle and then adding a Rectangle with a texture over it
If I understand you question correctly, then what you need to do is enable blending and tell OpenGL to blend using the alpha channels. So you need to add the following where you initialize OpenGL states. You can of course just add it to the rendering loop itself, though the less use of OpenGL calls the better. glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); If you have some things you don't want to get affected by transparency/opacity then you just need to disable the blending, like so. glDisable(GL_BLEND); ... render stuff ... glEnable(GL_BLEND); ... render stuff ... Incase you don't statically import the different classes then here is the same code though with its classes. GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_S

Categories : Java

Making a matrix of strings read in from file using feof function in matlab
You can do all of this pretty easily using a Map object so you will not have to do any searching or anything like that. Your second column will be a key to the first column. The code will be as follows clc; close all; clear all; fid = fopen('fileList.txt','r'); %# open file for reading count = 1; content = {}; lines2skip = 0; fileMap = containers.Map(); while ~feof(fid) if count <= lines2skip count = count+1; [~] = fgets(fid); % throw away unwanted line else line = strtrim(fgets(fid)); parts = regexp(line,' ','split'); if numel(parts) >= 2 fileMap(parts{2}) = parts{1}; end count = count +1; end end fclose(fid); fileName = fileMap('ptol') % do what you need to do with this filename This will provide f

Categories : Matlab

error: no matching function for call to 'Rectangle::Rectangle()'
You need to pass parent constructor parameters via initialization list... For example, if default Rectangle parameters are (4, 3): Square :: Square( ) : Rectangle(4, 3) { //super :: Square(4, 3); cout << "This is bullshit"; } Or, it will be better: Square :: Square(int len, int wid) : Rectangle(len, wid) { } And in header file: class Square : public Rectangle { public: Square(int len=4, int width=3); };

Categories : C++

Repaint Rectangle on Rectangle without flashing, Windows 7, Delphi
Use InvalidateRect instead of Invalidate. Using InvalidateRect, you can tell Windows only to repaint a specific rectangle in your canvas. In this case, Rect(1,y0,639,y0-341).

Categories : Delphi

JavaScript Canvas check if rectangle include rectangle
Here is the if condition to get a hit: if ( (boxes[j].x < (coins[i].x + coins[i].width) && (boxes[j].x + boxes[j].width) > coins[i].x) && (boxes[j].y < (coins[i].y + coins[i].height) && (boxes[j].y + boxes[j].height) > coins[i].y) ) { /* HIT - Do nothing */ } else { /* No Hit - Draw the coin */ } I didn't test it, but I'm sure it works ... EDIT: By the way, I noticed you are not re-setting i and j var in the for loops, you should do that at least with the second loop (j), otherwise loop it will not work. for (i = 0; i < coins.length; i++) { for (j = 0; j < boxes.length; j++) {

Categories : Javascript

error LNK2019: unresolved external symbol "public: __thiscall rectangle::rectangle(void)" (??0rectangle@@QAE@XZ) referenced in function _main
You're missing an implementation of the rectangle constructor rectangle::rectangle() { length = 0; width = 0; } Alternatively, if you don't care about initialising the members, just remove the definition of the constructor from the class definition. (Note that this probably isn't advisable; I'm just including it for completeness.)

Categories : C++

How to Move Rectangle next to Resized parent Rectangle in WPF using C#?
Sounds like you want a StackPanel for your rectangles. You can have the StackPanel nested in your Grid.

Categories : C#

Android: How to draw a rectangle on a movable image such that the drawn rectangle also moves along with the image?
In onCreate, create a new Bitmap image and a canvas for that bitmap. Use that canvas to draw the original bitmap and a rectangle to the new bitmap. Then in onDraw just draw that new bitmap wherever you want to. As a bonus you'll have very fast onDraws.

Categories : Android

Blinking underscore with console
You can hide the cursor by calling SetConsoleCursorInfo. . #include <windows.h> void ShowConsoleCursor(bool showFlag) { HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_CURSOR_INFO cursorInfo; GetConsoleCursorInfo(out, &cursorInfo); cursorInfo.bVisible = showFlag; // set the cursor visibility SetConsoleCursorInfo(out, &cursorInfo); } int main() { ShowConsoleCursor(false); system("pause"); }

Categories : C++

Blinking text on ProgressBar
I do not think, You will see the blink effect by this, even if it works. This is simply too fast. You must perhaps use a timer to reduce the speed, or, also possible, System.Thread.Sleep()

Categories : C#

Button blinking on Datatrigger
Try this- <Style x:Key="ButtonStyle" TargetType="{x:Type Button}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=Notification,RelativeSource={RelativeSource AncestorType=Window}}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard Name="StartBlinking"> <Storyboard> <ColorAnimation Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" From="Transparent" To="Orange" Duration="00:00:00.4" RepeatBehavior="Forever" AutoReverse="True"/> </Storyboard> </BeginStoryboard>

Categories : Wpf

How to make vim's replacement selection blinking
You change the highlighting of the to-be-replaced text with highlight IncSearch. For example, :highlight IncSearch ctermfg=Red guifg=Red highlights the text with a red background (despite it being fg not bg). However, I don't think there's any way to make it blink (and are you sure you really want that?). You might be able to use italics or underlines instead. See :h highlight for the options that are available.

Categories : Vim

jquery blinking text and div reload
try putting these codes inside a function so it looks like this: function checkForNewContent() { // check if atis cookie exits var Key = $("#key").data('key'); if ($.cookie('check_'+Key) == null) { $('.blink_'+Key).each(function() { var elem = $(this); setInterval(function() { if (elem.css('visibility') == 'hidden') { elem.css('visibility', 'visible'); } else { elem.css('visibility', 'hidden'); } }, 500); }); } } and then add the newly added function in the function callback of your first lines of codes so it looks like this.. setInterval(function() { $('#reload').load('/page.php #reload'), function() { checkForNewContent(); } }, 30000);

Categories : Jquery

Reset blinking marker in googlemap
You need to stop the interval timer with a clearInterval() call: function unblinkMarker( marker ) { clearInterval( interval ); interval = null; marker.setVisible( true ); } Also, you can simplify this line of code: interval = setInterval(function() { toggleMarker() }, 500); to: interval = setInterval( toggleMarker, 500 ); and it would be a good idea to clear the interval timer before setting it, just in case you'd already set it before: clearInterval( interval ); interval = setInterval( toggleMarker, 500 ); This assumes you have a var interval; somewhere globally to all these functions.

Categories : Javascript

Detect the sequence of blinking lights
If the lightsource is very prominent in your image you can use the mean intensity of your image for detecting changes. Here is a very simple example. I use this video for testing. You probably need to adjust the thresholds for your video. If your video is not as simple as the one I used for testing you might need to make some adjustments. For example you could try to segment the light source first if there is to much distraction in the other parts of the image. Or if the intensity changes between consecutive images are not big enough, you might need to look at the changes over several images. Edit: I just saw the question was tagged with python, but my source code is C++. But I leave it for now. Maybe it helps you to get the general idea so you can port it to python yourself. #includ

Categories : Python

jquery jtable is blinking by ajax
You're recreating the table every second. This involves clearing the previous contents of the element, re-initializing the basic structure, then waiting for the server to rely before re-populating it. This also resets any user changes such as sorting. Instead, you should update the data within the existing table instance. The reload function does this.

Categories : Javascript

How to run a blinking text code in background
This seems to work ok. Better than I thought it would (there are essentially two threads writing to the console at the same time and they aren't synchronized which is usually a recipe for unpredictable behavior). I added $x and $y parameters. $x is what column you want the blinking message to be in. $y is the number of rows above the row where the prompt currently is. It looks best if you make $y one less than $host.ui.rowui.windowsize.height The flashing message is at the top of the screen if you do. Otherwise the flashing message will end up on multiple lines whenever the console scrolls. Note this script is only tested on POWERSHELL.EXE. It definitely will not work on powershell_ise. While writing this, I crashed/hung powershell a number of times. Each time you run the script it crea

Categories : Powershell

Blinking Text Shadow CSS3
This should help you to begin with @-webkit-keyframes myfirst { from {text-shadow: 3px 3px 5px #ba8b00;} to {text-shadow : none;} } @-moz-keyframes myfirst { from {text-shadow: 3px 3px 5px #ba8b00;} to {text-shadow : none;} } @keyframes myfirst { from {text-shadow: 3px 3px 5px #ba8b00;} to {text-shadow : none;} } #container .title { color: #ba8b00; padding: 25px 0 30px 0; width: 560px; font-size: 42px; text-shadow: 3px 3px 5px #ba8b00; -webkit-animation: myfirst 1s 98765432; -moz-animation: myfirst 1s 98765432; animation: myfirst 1s 98765432; }

Categories : CSS

Stop blinking link once visited
Maybe you should use Javascript or CSS3 animations. text-decoration: blink; is deprecated and shouldn't be used. Please note that IE, Chrome, Opera and Safari don't support this attribute.

Categories : CSS

How to sort objects in a sprite without blinking?
I think you can use the setChildIndex method of the DisplayObjectContainer class (see documentation) to reorder your objects without removing and then re-adding them. Unfortunately I'm not in a position to test this at the moment, but I think the following should work: public function resort():void { for(var i:int = 0; i < ticketsBought.length; i++) { var t:TicketCard = ticketsBought[i] as TicketCard; tickets.setChildIndex(t, i); } }

Categories : Actionscript

Did GPS turned on when I saw blinking GPS icon on notification bar?
Mean that are looking for a GPS signal, when it stop to Blink you are with a GPS signal. You might have asked for some request. Like this: yourLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGPS);

Categories : Android

Blinking divs like traffic lights?
I suggest you give your elements a common class, ex: <div class="blink">One</div> <div class="blink">Two</div> <div class="blink">Three</div> Then you can simplify your code to: //Cache element collection and keep a reference to the visible element var $elements = $('.blink').css('visibility','hidden'), $visible = $elements.first().css('visibility','visible'); //Single interval function to handle blinking setInterval(function(){ //Hide visible element $visible.css('visibility','hidden'); //Find next one var $next = $visible.next('.blink'); if(!$next.length) $next = $elements.first(); //Show next element $visible = $next.css('visibility','visible'); },1000); Demo fiddle

Categories : Javascript

Blinking DIV for 5 seconds and then hide it after 1 second using jQuery
Try this... var blink1 = function() { $('.leftArrowMask').hide(); setTimeout(blink2, 5000); }; var blink2 = function() { $('.leftArrowMask').show(); setTimeout(blink1, 1000); }; $(document).ready(function() { setTimeout(blink1, 1000); }); It first runs blink1 which hides the div, and then runs blink2 after 1 second to show the div. Blink2 in turn runs blink1 again, 5 seconds later.

Categories : Javascript

HTML5 Canvas blinking on drawing
Right now you're reloading the image every frame and unless the onload callback fires within the 16ms of the frame you're going to see a blank canvas. You should only need to call the new Image, img.onload sequence once, to preload your images. The onload callback would then kick off your first frame, and the draw calls are free to use the image in memory. Something like: var camerax = 300, cameray = 100; var fps = 60; var img; var loop; function init() { img = new Image(); img.onload = function() { loop = setInterval(function() { update(); draw(); }, 1000/fps); }; img.src = "ground.png"; } function draw() { clearCanvas(); drawGround(); } function drawGround() { var width = img.width; var height = img.height;

Categories : Javascript

how to make blinking text in pygame
I assume waitForPlayerToPressKey() does not return until the player presses some key. If so, without changing much of your code, it is not possible. If you want to have control over what happens on the screen while waiting for a press, you could have your waitForPlayerToPressKey() return true when a button has been pressed. You could then do something like: while(True): drawText() flip() if(waitForPlayerToPressKey()): return You could then set a timer - and change some show blit flag every second.

Categories : Python

Can we avoid blinking cursor overlapping with div
the problem is related to the background filter/image properties of the ribbon. changing background to a simple color fixes the problem. http://jsfiddle.net/4drs2/6/ .editor-ribbon { height:100px; position:fixed; left:0px; top:0px; width:100%; border-bottom:1px solid #cfcfcf; width:100%; background-color: gray; }

Categories : Javascript

Blinking an LED with a 18PIC4550 using Assembly code
1 . Try setting the Tri-State of the pin you're toggling. You gotta indicate if it's input or output, in this case it's output. Like #define D0_1Tris B'11001111' movlw D0_1Tris ; set direction so LEDs D0 & D1 are outputs movwf TRISA ; all others are inputs (high-z) 2 . Make sure your A/D is configured as I/O digital clrf ANSEL ; configure A/D I/O as digital (might need to clear comparators too, whichever peripheral is multiplexed with the I/O of choice) 3 . Also don't forget to use a reset vector ORG 0x000 ; processor reset vector nop ; required by in circuit debugger goto Init ; go to beginning of program 4 . Try at a slower clock rate to determine if it's because of a short delay. If it is a delay issue then imple

Categories : Assembly

Delphi+SQL form is blinking while scrolling
Since you mention SQL Server, I'm guessing you're using the ADO components (TADOStoredProcedure) here, so the normal MasterFields and MasterSource properties aren't available. You still have the basic functionality for other things, so you should use TDataSet.DisableControls and EnableControls to avoid this flickering: Bottom_table_SP.DisableControls; try Bottom_table_SP.Active := False; Bottom_table_SP.ParamByName('@ID').AsInteger := Top_table_SP.FieldByName('ID').AsInteger; Bottom_table_SP.Active := True; finally Bottom_table_SP.EnableControls; end; You might find Disabling and Enabling Data Display useful to explain.

Categories : SQL

jQuery clickable blinking text div
Your counter keeps being reset because it is defined inside the function. Moving the variable outside of the function fixed the iterations: http://jsfiddle.net/CaVEx/1/ var pad = 0; $('#clignotant').click(function() { if (pad==0) { pad++; blink(this, 800, 2); }else{ alert('Not document load, so now you can go to the streaming video'); } }); counter = 0; function blink(selector, blink_speed, iterations){ $(selector).animate({opacity:0}, 50, "linear", function(){ $(this).delay(blink_speed); $(this).animate({opacity:1}, 50, function(){ if (iterations == 0) { blink(this, blink_speed, iterations); }else if (counter>iterations) { return false; }else{ c

Categories : Jquery

How do you make a blinking animation in Javascript?
You're passing undefined to setInterval (because that's the return value of blinking). Pass a function reference instead: function startBlinking() { window.setInterval(blinking, 2000); //no parentheses here -----^ } Also, fix this typo: getElementbyId should be getElementById (JavaScript is case-sensitive). And always check your browser's error console, you would have caught this one. After you fix both issues, it appears to work: http://jsbin.com/ikubaz/1/edit

Categories : Javascript

Button blinking after click command is executed
I solved the issue by defining ControlTemplate for my buttons. Something like this: <ControlTemplate TargetType="{x:Type Button}" x:Key="PlainButtonTemplate"> <Border x:Name="bdr_main" BorderThickness="1" BorderBrush="LightGray" CornerRadius="6" Background="Transparent"> <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0" ContentSource="Content" /> </Border> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="bdr_main" Property="Background" Value="Transparent"/> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="bdr_main" Property="Backg

Categories : Dotnet

Blinking div and mouseover/mouseout events and Prototype?
The mouseout and mouseover events are constantly firing because of the structure of your HTML. Because you have a <a href> as well as a <img> within the div you are observing the mouseover event is bubbled up from those elements and hits the observer on the div. Also because the cursor is not technically on top of the <div> the mouseout event fires as well. I put together this http://jsfiddle.net/pkA5n/ and tried it in all the browsers I have available to me on my Windows Desktop (IE10/Chrome/Firefox) and I saw no blinking.

Categories : Misc

Blinking the taskbar icon when a SQL query completes
You could set SSMS to play a sound to notify you, there's a link here that shows you how to set this up in options.

Categories : Sql Server

removing blinking of cursor from read only fields
Simply set your input as disabled : <input disabled> If what bothers you is the grey background, you can change it using CSS : input[disabled] { background:white; } You can do it dynamically using theInput.disabled = true;

Categories : Jquery



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