w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
I have a feeling f3() below exhibits UB. But how can I be sure about this?
Yes, the code's behavior is undefined because it returns the reference to a local pointer, which is correctly detected for f1 and f2. You cannot rely on the compiler's diagnostics to catch these (or any other) cases of undefined behavior, they are provided on a "best effort" basis. That a compiler is easily fooled is shown by g++ 4.8.0 not warning (with -Wall) on this simple example: int& r() { int x = 1; int& y = x; return y; } (Just returning x warns as expected, and clang warns on all four functions.)

Categories : C++

regular expressions for floating and non-floating point numbers followed by words
as java string : "^\d+(\.\d+)?\u0020(days|minutes|months|hours|years)\u0020ago$" as plain regex: ^d+(.d+)?u0020(days|minuits|hours|years)u0020ago$ i deliberately restricted the whitespace to only space character. doesnt seem tab and all is applicable here.

Categories : Java

Need help correcting an XSS vulnerability in my code
You're obviously getting the product's data on the server-side ($products_values->fields['products_name']), so why not get the image in the same way instead of passing it through $_GET? That should fix your problem.

Categories : Javascript

CSS: Floating IMGs inside floating divs
I can't really provide a solution because you haven't provided any code. (please do so) That said... Based on your description and your image, your floats on div#A and div#B are breaking. The most common reason for this is that your width is adding up to be more than 100% of the width of your div#wrapper (the containing or parent element of the floated elements) Your floats should always end up equally 100% (less than 100% works but then you have some extra space somewhere etc). For example... If you have #wrapper which is 100px wide, then you can have two div's inside which are 50px and 50px wide, or 30px and 70px etc. as adding those values = 100px which is 100%. So... Why is yours breaking? I suspect it is because you are trrying to mix a dynamic width element, with a static

Categories : CSS

Correcting a "Subquery returned more than 1 value error" when
Since your subquery returns multiple values you need to use either ANY keyword (to make condition applied to any of the subquery result) or ALL (to be applicable to all results) e.g.: select ProductID from ctbo.dbo.PRODUCT where (getdate() > ANY(Select Convert(DATE,CAST([expYear] AS VARCHAR(10))+'-'+ CAST([expMonth] AS VARCHAR(10))+'-'+ CAST([expDay] AS VARCHAR(10))) from PRODUCT where expYear not like '0' and expDay not like '0' and expMonth not like '0') )

Categories : Sql Server

Correcting matplotlib colorbar ticks
You can control the placement and the labels by hand. I'll start with a linear cmap generated from cmap_discretize on the page you linked: import numpy as np import pylab as plt # The number of divisions of the cmap we have k = 10 # Random test data A = np.random.random((10,10))*k c = cmap_discretize('jet', k) # First show without plt.subplot(121) plt.imshow(A,interpolation='nearest',cmap=c) plt.colorbar() # Now label properly plt.subplot(122) plt.imshow(A,interpolation='nearest',cmap=c) cb = plt.colorbar() labels = np.arange(0,k,1) loc = labels + .5 cb.set_ticks(loc) cb.set_ticklabels(labels) plt.show()

Categories : Python

correcting and fix explode and sort to show the result in PHP
Use array_slice() to extract the first 20 elements of the array. $list = array_slice(explode(',',$all_colors['color'], 21), 0, 20); print_r($list); Result: Array ( [0] => CCCCCC [1] => CCCCFF [2] => 99CCCC [3] => 333333 [4] => 9999CC [5] => 999999 [6] => CCFFFF [7] => 000000 [8] => 000033 [9] => 669999 [10] => 666699 [11] => 333366 [12] => 003333 [13] => 336666 [14] => 666666 [15] => FFFFFF [16] => FF9900 [17] => 333333 [18] => 333366 [19] => 336666 )

Categories : PHP

Detect and Correcting a code that causes a run time error?
Since there is practically no code here, there is no clear answer because there isnt really other code to escape to. The best I can think of is what you said, just print out an error message and terminating the program. Perhaps instead of explicitly calling exit(0) (probably should be exit(1) in this case) I would just let the program run to completion, but the difference is trivial.

Categories : C++

SSMS tool/option for correcting casing of DB objects in a script
Devart's SQL Complete (http://www.devart.com/dbforge/sql/sqlcomplete/) will do it: http://www.devart.com/dbforge/sql/sqlcomplete/documentation/formatting-code.html

Categories : Sql Server

Homebrew - Correcting warning after running Brew Doctor - Altering Path (/user/bin) issue
Running this command: echo 'export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"' >> ~/.bash_profile fixed the issue for me. I found it at this website: http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/ via Homebrew wants me to amend my PATH. No clue how

Categories : Ruby

CSS Alignment - Correcting Alignment of Floated Elements
Everything is looks good, you need to add display: inline-table; for below CSS. The element will displayed as an inline-level table ul.vt li.vt-line-header { display: inline-table; //----Add this to your CSS } Hope you understand.

Categories : CSS

2 divs floating left inside a div. 2 of such divs floating left inside another div - height issue
It's not a good idea to use a lot of <div class="clear"></div> on your HTML pages. Here is an example on how to force an element to self-clear : .clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } .clearfix { display: inline-block; } * html .clearfix { height: 1%; } .clearfix { display: block; } Notice: Apply a class="clearfix" to the parent element.

Categories : HTML

floating the last
  • to the right
  • First you have to edit your html You can't use form element inside your ul as its not valid. Just put your form to your last li or use it after your ul element so you can float it to right. If you want your text box next to the your textarea wrap them with div and float your div to left. Edit: just edited your html you can use some Css modification on it: <div class="idea_bar"> <div class="left_idea_bar"> <form method="post" id="idea_bar_form" action="/application_controller/email" accept-charset="UTF-8"> <div style="margin:0;padding:0;display:inline"> <input type="hidden" value="✓" name="utf8"> <input type="hidden" value="LxYk26gr0kt4jHn9lhSgwdywC8lotwEAqT3od0rsRiA=" name="authenticity_token"> </div>

    Categories : CSS

    Set floating div to height: 100%?
    This is the way I know how to do it. With position absolute and top / bottom / left Updated your fiddle: http://jsfiddle.net/8dstK/3/ Basically, you make the wrapper div position relative so that child divs can be positioned absolutely within the wrapper. Next, we set the left div to be positioned absolutely and account for the padding in our positioning. Set the top to 5px, left to 5px and bottom to 5px. That should do it. #wrapper { background-color: red; width: 200px; height: 100%; overflow: auto; padding: 5px; position:relative; } #left{ width: 90px; float:left; background-color: #ccc; top:5px; left:5px; bottom:5px; position:absolute; } #right{ width: 90px; height: 300px; float:right; background-color: blue; }

    Categories : HTML

    Floating help and confusion
    As per my understanding, the reason might be: There may be some float left given to the thumbnail image somewhere inside the style written for lower screen sizes. The best thing you can do is, inspect using firebug or something and check whether any float left is given to the thumbnail image. If so, remove that, or give it as float as none. If you are ok with having the entire text below the image when the screen is resized, you can make use of clear: both for lower screen size, which has to be given the text div. If you could give a link to review, it will be easy to tackle the real problem. Hope my solution helps. Thank you :-)

    Categories : HTML

    Floating Every Other Season Right
    Something like this, I believe; <ul class="episodes"> <div class="tv_container"> {foreach from=$episodes key=id item=val name=episode_loop} {if $val.episode eq 1} <h2>Season {$val.season}</h2> {/if} <h5 class="episode_item" {if $smarty.foreach.episode_loop.iteration % 2 eq 0}style="float:right;"{/if}> {if $global_settings.seo_links} <a class="link" href="{$baseurl}/{$routes.show}/{$val.perma}/season/{$val.season}/episode/{$val.episode}" title="{$lang.show_episode_title|replace:'#season#':$val.season|replace:'#episode#':$val.episode}">Episode {$val.episode}{if $val.episodetitle} <span class="tv_episode_name"> - {$val.episodetitle}</span>{/if}&

    Categories : PHP

    Floating Div Over An Image
    Change your positioning a bit: .container { border: 1px solid #DDDDDD; width: 200px; height: 200px; position:relative; } .tag { float: left; position: absolute; left: 0px; top: 0px; background-color: green; } jsFiddle example You need to set relative positioning on the container and then absolute on the inner tag div. The inner tag's absolute positioning will be with respect to the outer relatively positioned div. You don't even need the z-index rule on the tag div.

    Categories : HTML

    my span is floating behind - I need it on top
    I am not able to see a full map here. You have mentioned it too. Well there is also no other span found! The map is somehow cool. But if you want the images to ride over the image. You might use the position relative! Have you tried that? You have an absolute, but absolute works on the div or container its relative too. If there is no container having position relative the main body tag is considered to be the one. So try giving this image a relative position. Then add the z-index and absolute position!

    Categories : HTML

    floating div not on top of page
    This is what you want? DEMO I edited a bit your HTML code: <section class="container"> <div class="block one"></div> <div class="block two"></div> <div class="block three"></div> <div class="block four"></div> </section> Just add these CSS rules: *, *:before, *:after { box-sizing: border-box; } body, div, section { margin: 0; padding: 0; } html, body { background: #CCC; height: 100%; } .block { height: 100px; display: inline-block; border: 1px solid black; } .block:not(.four) { float: left; width: calc(60% / 3); } .four { width: calc(100% - 60%); } .container > .four { float: right; } I used the calc() function for set the anchors to the elements. You can s

    Categories : CSS

    add "floating" TextView
    Normal Translate Animation or ObjectAnimator or Viewproperty animator can be used for this purpose (Note: ObjectAnimator /Viewproperty animator is not available below android version 3 ). Suppose your view is at the bottom of the screen & height of the screen is 512px; you can perform translate UP animation by (with animation listener): view.animate().translationYBy(-512).setListener(new AnimatorListener() { @Override public void onAnimationStart(Animator animation) { } @Override public void onAnimationRepeat(Animator animation) { } @Override public void onAnimationEnd(Animator animation) { // after animation set visibility gone view.setVisibility(View.GONE); } @Override

    Categories : Android

    CSS Positioning and Floating
    add display: inline; to #channelInfo (since div elements are, by default, block elements) example: http://jsfiddle.net/c3QYp/

    Categories : HTML

    Floating the NAV bumps it down
    The problem comes from using display:inline-block; where the browser automatically inserts a margin on the bottom of the element to allow for letter descenders. You can change your display to :block; if it will not break your layout. If not, you can add a negative margin to the bottom. There are a few options here, that worked, depending on the layout I was using. Here are some that worked: margin-bottom:-3px; or margin-bottom:-4px; margin-bottom:-0.15em; worked too.

    Categories : CSS

    css paragraph not floating around div
    You will have to move your paragraphs inside the same div as the image, and float the actual image. Something like this:http://jsfiddle.net/cLcJu/ As you can see the code is very simple: <div class="userInfo"> <p>some content above the image</p> <img src='path_to_image'> <p>A bunch of content to the right of and underneath the image</p> </div> and the css .userInfo img { display: block; float: left; padding: 10px; }

    Categories : HTML

    Gap between floating divs
    To fix such an issue you need to calculate the width and height of each element and re-arrange them by positioning them absolutely, luckily for you there is such a plugin that does this, Isotope

    Categories : CSS

    Floating div with iframe
    try this http://jsfiddle.net/MqEhF/ HTML <div style="left: 0px; border: 0px none; height: 370px; position: fixed; width: 270px; overflow: hidden; bottom: -67px;"> <div style="overflow: hidden;"> </div> <iframe src="http://weather.gc.ca/wxlink/wxlink.html?cityCode=on-162&amp;lang=e" scrolling="no" style="height: 300px; border: 0px none; width: 165px; margin-bottom: 0px; margin-left: 24px;"> </iframe> </div> </div>

    Categories : HTML

    jquery floating div on hover
    use jquery offset() method to get position of hover of those elements and apply that as a left and top for the div. (Make sure to position the div as ABSOLUTE).

    Categories : Javascript

    Top align 3 floating divs
    you have given the left sidebar a border. If you give a border it will do 25%+1px. So that means if u add it all together it will be 100% and some pixel because u gave it a border. 25% + 50% + 25% + border:1px = 100% + 1px = whole width screen + 1px

    Categories : CSS

    How to achieve floating div on scrolldown
    You can do something like this on that line: $(".articlebutton").css("top", $(window).scrollTop()); Or event better, use a position: fixed; top: 0;

    Categories : Javascript

    Floating divs not aligning the way I want them
    <div style="float: left; width: 620px;"> <div style="float: left; clear: left; width: 300px; background-color: Red; height: 230px;"></div> <div style="float: right; width: 300px; background-color: Blue; height: 330px;"></div> <div style="float: left; clear: left; width: 300px; background-color: Green; height: 230px;"></div> </div> Live example.

    Categories : CSS

    floating point comparison in c++11
    According to: cplusplus.com Using isgreaterequal, if either arguments are NaN, then the comparison is evaluates to false. Using >=, if either arguments are NaN, then an FE_INVALID exception will be raised. So, I think you should keep your function the way it is, as you probably would like to know if one of your arguments was NaN. From C11 Draft N1570: p.516 Section F.9.3 Relational operators x < y → isless(x,y) (and similarly for ≤, >, ≥) Though numerically equal, these expressions are not equivalent because of side effects when x or y is a NaN and the state of the FENV_ACCESS pragma is ‘‘on’’. This transformation, which would be desirable if extra code were required to cause the ‘‘invalid’’ floating-point exception for unordered cases, could b

    Categories : C++

    Floating type value in ATMega8
    you are mixing multiple problems: first: even if your target controller does not contain a floating point unit (FPU) the calculations can be done with SW libries. Usage of this libs usally happens automaticly. and you can do calculations in float. these libraries are relativly huge in codesize and execution speed. even if you only add simple float arithmetics you will notice a huge increment in code size. the second problem is the output via the printf-routines. Since floating port support is nomaly not needed, it is striped to save code size. you can explicitly activate it by adding the libraries libprintf_flt.a libm.a and use the linker options -Wl,-u,vfprintf alternativly you can use the ftoa function.

    Categories : C

    Best way to handle floating points
    This smells strongly of premature optimization. Instead, name the floats meaningfully in relation to their purpose. Are they four unrelated value? Make them individual attributes. Are they four sequenced values? Make it an array. The actual performance different should be negligible if at all.

    Categories : C++

    How to generate ALL floating numbers?
    Study IEEE floating point format. Then simply generate all distinct bit patterns that represent finite values (skip all INFs and NaNs).

    Categories : C++

    Html/CSS floating problems
    Try setting border: 0 on both the floated elements because unless you're resetting your CSS via a reset or normalise, they will inherit a nominal border: #body { margin: 0 auto; max-width: 960px; } #user-menu { float: left; width: 15%; } #content { float: right; width: 85%; } #content, #user-menu{ border: 0; } #footer{ clear: both; } Heres a codepen:1: HTH

    Categories : HTML

    How can I centre a div between 2 floating divs
    make a wrapper around all 3 divs and then position the centered div with a margin <div id="wrap"> <div id="left" style="float: left"></div> <div id="content" stlye="float: left: margin: 0 auto;"></div> <div id="right" stlye="float: left"></div> </div>

    Categories : CSS

    Need Help Getting Floating Social Bar Working
    You can use the floating social bar plugin http://wordpress.org/plugins/floating-social-bar/ (it is my plugin) There is an option to manually add the floating bar on all WordPress pages if you want. Just look at the code on the FAQ page.

    Categories : Javascript

    css: floating nav bar that fixes when touching the top
    If you are using bootstrap, why not just the "Affix" component that is built in? To more properly answer your question though, no, there isn't a way to do this with CSS alone. Reason being is that CSS is not capable of monitoring scroll position. With javascript its as simple as adding a listener to scroll position of the window, and toggling a class that has a fixed position when it gets to "x" pixels.

    Categories : CSS

    Floating Point is not correct
    12.3 and 12.30 are the same value. The problem is not the value but the code that incorrectly converts the right value to the wrong representation. You probably want "###.00". With "#", zero shows as absent.

    Categories : Android

    Floating sidebar next to <% yield %>
    Please have a look at http://twitter.github.io/bootstrap/scaffolding.html#fluidGridSystem. May be something like this would work: <body> <%= render 'layouts/header' %> <% flash.each do |name, msg| %> <%= content_tag :div, msg, :id => "flash_#{name}" %> <% end %> <div class="container"> <div class="row-fluid"> <div class="span4"><%= render 'layouts/sidebar' %></div> <div class="span8"><%= yield %></div> </div> <%= render 'layouts/footer' %> </div> </body>

    Categories : Ruby On Rails

    Floating values changing
    You're not allocating enough space in these arrays. matrices = new Matrix[num_transforms-1]; probablility = new float[num_transforms-1]; You've allocated space for num_transforms-1 elements, but then you have this code: for (int i = 0; i < num_transforms; i++) { fscanf (input,"%f",&temp); std::cout << temp << std::endl; probablility[i] = temp; std::cout << probablility[i] << std::endl; matrices[i].Read3x3(input); } where you're initialising num_transforms, so you are going to be overrunning the allocated space.

    Categories : C++



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