w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to split page into 4 equal parts using two container divs?
You have placed - clear:both in the css of topLeft , topRight elements idea => clear:both; - No floating elements allowed on the left or the right side of a specified element , hence in your case also similar thing is happening, check this fiddle : http://jsfiddle.net/4q4Jz/ update: now check the fiddle.. demo

Categories : HTML

centering unknown width elements inside a known width element
I'd recommend using tables with borders disabled... Tables will equally separate text into individual cells. Here is a nice description about them

Categories : HTML

Disposing of parts when removing from container
As far as I know the parts added using the CompositionBatch are handled by the ComposablePartExportProvider (this is an implementation detail) which does not dispose them. Only the CatalogPartExportProvider disposes its exported parts and to use this provider you need to let MEF create the parts. For more information on this, you can read the first answer by weshaggard in What does ReleaseExport really do?. If you work on .NET 4.5 then you could use the Conventions Model introduced with MEF2. Otherwise you can use TypeCatalogs combined with an AggregateCatalog to add types to the container, CompositionContainer.ReleaseExport to release (and dispose if supported) non-shared parts at will and AggregateCatalog.Catalogs. Remove to remove types from the container. Here's a sample using a Typ

Categories : C#

Dynamic width of image for specific container width only
I think this will help. The code below will change your_images height and width if window size is > 1024, and runs on window resize as well as document ready. $(document).ready(function() { changeSize(); }); $(window).resize(function() { changeSize(); }); function changeSize() { var docw = $(document).width(); var imagebox = $(".imagebox").width(); var image_width = (imagebox / 5); var image_height = (image_width * 0.75); if(docw >= 1024){ $("your_images").width(image_width); $("your_images").height(image_height); } }

Categories : Jquery

How to export parts from an object not instanciated by the MEF container
The problem is that the SomeService is an instance property. You could have several SessionModel objects in your system, and MEF would have no way of knowing which SessionModel is returning the ISomeService instance that is supposed to be matched to an import. Instead, just make SessionModel a static class and SomeService a static property. Alternatively, make SessionModel a singleton. The SomeService property would still be static, but would export the service from the one-and-only instance of SessionModel.

Categories : C#

PHP - Split text into 140 character parts
Use array_slice if there is more than 140 keys, otherwise print as it was <?php $themessage = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."; $words = explode(' ', $themessage); if (count($words) > 140) { echo implode(' ', array_slice($words, 0, 140)) . '...

Categories : PHP

Split integer into parts using RegExp
You cannot do this with a regular expression. You will need to write a function to apply some logic to the input string and decide what time to convert it to. Some of your possible inputs are 4 12:00 am 1200 12 am 4:40 4.40 etc. This needs to be done by you in a function.

Categories : Javascript

Split graph into two parts according to min-cut between s and t vertices
You can use the information computed by the push-relabel algorithm to determine a min-cut. As you know, the push-relabel algorithm assigns a value h(v) for each vertex v. The possible values of h(v) are in the interval [0,N], where N is the number of vertices of the graph. It's easy to prove that there exists some number h' such that h(v) != h' for every vertex v (see exercise 26.4-3 of Cormen's book, 2nd Ed). After finding such h', every vertex v with h(v) < h' is in one side of the cut, and every vertex u with h(u) > h' is in the other side.

Categories : Algorithm

Want to split a string into 2 parts and holding each one in a different variable using c#
You can use String.Split: var results = yourString.Split("p"); It returns an array. You can access the first result by using: results[0]; And the second by: results[1]; To assign the value to the TextBox, you can do: TextBox1.Text = results[0]; TextBox2.Text = results[1];

Categories : C#

Regular expression to split a string into 5 parts as below
Your regex's 5th match doesn't match anything - there is no content after the &lt;xm&gt;. Also, you should really run regEx.matcher() once, and then pull the groups out of the one matcher; as written, it executes the regex 5 times, once to get each group out. Also your RegEx is never executed unless you call find() or matches.

Categories : Java

Split JSON file in equal/smaller parts with Python
I think your first thought is good. Just iterate over all tweets you got, save them in a temp array and track an index which you increment by one every tweet. Always when the current-index modulo 5000 is equals 0 call a method that converts the tweets in string-format and save this in a file with the index in the filename. If you reach the end of tweets, do the same on this last rest. I am not sure if I could answer your question. If you're looking for some more complex stuff, just google about hadoop json-file splitter.

Categories : Python

Read File And Split Into Multiple Parts Based On Flag in C#
A bit of a hack but should work string[] splitTeams = teams.Replace("< TEAM >", "|< TEAM >").Split(new [] { '|' }, StringSplitOptions.RemoveEmptyEntries); That should work as long as | isn't used anywhere else in your file. If it is, then just substitute it with a unique character or a string.

Categories : C#

split string into 3 parts, the middle starts and ends with alphacharacter from A to z
You could use: /([^a-zA-Z]*)(.*[a-zA-Z])(.*)/ Explanation [^a-zA-Z]* Selects everything until it reaches a letter .*[a-zA-Z] Selects everything until it reaches the last letter .* Selects the remainder of the string Example Use $string = "&%*&^h-e_l_lo*&^*&"; preg_match('/([^a-zA-Z]*)(.*[a-zA-Z])(.*)/', $string, $matches); echo $matches[1]; // Results in: &%*&^ echo $matches[2]; // Results in: h-e_l_lo echo $matches[3]; // Results in: &^*&

Categories : PHP

how to make sql query to split database string into 3 different parts and compare them?
SELECT [id], [specie], [sex], [date_of_birth], [greutate], SUBSTRING(date_of_birth,6,4) AS [an], SUBSTRING(date_of_birth,3,2) AS [luna], SUBSTRING(date_of_birth,0,2) AS [zi] FROM [people] ORDER BY SUBSTRING(date_of_birth,6,4), SUBSTRING(date_of_birth,3,2), SUBSTRING(date_of_birth,0,2) Many RDBMS also allow this... SELECT [id], [specie], [sex], [date_of_birth], [greutate], SUBSTRING(date_of_birth,6,4) AS [an], SUBSTRING(date_of_birth,3,2) AS [luna], SUBSTRING(date_of_birth,0,2) AS [zi] FROM [people] ORDER BY [an], [luna], [zi]

Categories : C#

Split ul in half and wrap those 2 parts around a div (logo inside dynamic menu)
$(function(){ var liCount = $('#top-menu>li').length / 2 -1; $('#top-menu>li').eq(Math.floor(liCount)).append("<li><div id='logo'><a href='#'><h1>Logo</h1></a></div></li>"); }); So what I did here is count the number of li inside of #top-menu, subtracted one because eq is zero based. Then appended #logo inside of a new li and place it right after the middle of your li's. It will look better if you have an even number of li's

Categories : Jquery

Rails routing - a good way to split the edit form into separate parts?
post/23/gallery/edit looks more semantic. gallery - resource related to post and edit - action on this resource. actual modification will have post/23/gallery url with POST, PUT, DELETE methods, which is more REST

Categories : Ruby On Rails

How to declare an iterator variable for unknown container
In C++03, you would need to get the iterator type from the container type explicitly: typename Container::iterator it; typename Container::const_iterator cit; In C++11, you can just use auto: auto my_iterator = c.begin(); // iterator in this case auto my_iterator = c.cbegin(); // const_iterator always Also note, as suggested my @Matthieu, that you can use a range based for loop in C++11, to simplify the code: template <class Container> void print(const Container& c) { for (const auto& elem : c) cout << c << endl; }

Categories : C++

C# Split Container
You have to calculate and store proportion of both sides of the split and to store it in a field. You have to set panelLeftProp on panel resizing. You have to check panel minimum width if it's necessary. double panelLeftProp; private void panelLeft_Resize(object sender, EventArgs e) { panelLeftProp = panelLeft.Width / this.Width; } private void Form_ResizeEnd(object sender, EventArgs e) { if (WindowState == FormWindowState.Minimized) return; panelLeft.Width = (int) (this.Width * panelLeftProp); }

Categories : C#

Break string into two parts on basis of the field width in crystal report
The only (somewhat-hacky) way that I know of to do this is to 1. Use a fixed-width font and 2. Figure out how many characters fit in the objects. So, in your example, "Four Thousand Five Hundred" goes to the very end of the 4000 twip field so you know that 26 characters fit in that field. You'd then be able to chop off the first words that fit in 26 characters. Something like: local stringvar input := {table.yourString}; //local stringvar input := "Four Thousand Five Hundred Fifty"; local stringvar array inputSplit := split(input," "); local numbervar charCount := 0; local numbervar i; //output strings global firstString := ""; global secondString := ""; //for each word in the input... for i := 1 to ubound(inputSplit) do (charCount := charCount + length(inputSplit[i]) + 1; if char

Categories : Dotnet

Centering elements with unknown width
If you make the ul a block element, so it will take up the full width, you can set the li to display:inline-block. Now that the li item's are inline block they can be centered with text-align:center; ul { display:block; text-align:center; } li { display:inline-block; } fiddle: http://jsfiddle.net/CZ9pX/1/

Categories : CSS

100% bg container img width issue
The video is a nice idea to describe your problem. :) You can use this CSS on the <div> with class hero-container. The background image will always fill the whole space but will never get distorted: -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; See here, which browser support the CSS3 Background-image options Demo Try before buy

Categories : HTML

How to create image with unknown width and height ?
If you know the font you are going to use to create the image from the text, you can use imagettfbbox() to determine the watermark size and then use imagecreatetruecolor() to generate the image. See http://www.php.net/manual/en/function.imagettfbbox.php

Categories : PHP

Container's width adjustment for different devices
If you want your CSS layout to work on all devices use Fluid-Fluid-Fluid CSS layout. Example: Instead of writing: width:800px; you can use: width:78%;

Categories : CSS

Image won't stretch container width
It is bad practice to scale images using the browser like that as it tends either to create extra overhead (unnecessarily large file size/resolution), or a bad user experience (pixelated low res image due to upscaling or incorrect aspect ratio). That being said, you are only setting the max-width of img in your CSS. Have you tried setting the width: 100% too? If that doesn't work on its own, also try adding float: left; to .top-sidebar img

Categories : CSS

Toggle width of a container using jQuery
Following is the code as per your requirement so try this code: HTML <div id="container">this is container div</div> <div class="wrp">this is wrp div</div> <input type="button" value="toggle" id="toggle-button"> CSS #container { width:960px; background-color: red; } .wrp { width:1000px; background-color: green; } JS $(document).ready(function () { var setWidth = $.cookie("width"); if (typeof setWidth !== "undefined" && setWidth == "85%") { $('#container,.wrp').width(setWidth); // 85% width set using cookie } else if (typeof setWidth !== "undefined" && setWidth == "960px") { $('#container,.wrp').width(setWidth); // 960px,1000px(for wrp) width set using cookie } $('#toggle-button').

Categories : Jquery

Trying to fit carouFredSel in a variable-width container
I originally wanted to solve this with CSS or by reconfiguring carouFredSel, but after walking away for the problem for an evening I decided it made sense to write more JavaScript to fix a JavaScript problem. I wrote a function to get the current width of the column and then set the image CSS to the appropriate value: function setMainColumnWidth(){ var mainColumnWidth = $(".span_5_of_10:first").width(); $(".posterCarousel img").css("width", mainColumnWidth); } Then I call this function when the page loads and every time the window gets resized: $(document).ready(function() { setMainColumnWidth(); /* carouFredSel code goes here */ }); $(window).resize(function() { setMainColumnWidth(); }); Problem solved!

Categories : Jquery

How to stretch .divider (for nav) 100% to width of container?
Its not showing upto 100% because the just above have the CSS property overflow hidden, also it have some padding-left, See the updated fiddle to see the changes after removing them <div class="container" style="width: 1300px"> <div class="row-fluid"> <div class="well sidebar-nav left"> <ul class="nav nav-list"style="width:100%; padding-left:0px;"> <li class="divider"></li> <li class="nav-header">Sidebar</li> <li class="active"><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li> </ul>

Categories : Twitter

count width for 4x verse container
var accum_width = 0; var test = Math.ceil($('#inner li').size()/4)*102; if(test > 1122){ $('#container').width(test); }else{ $('#container').width(1122); } thats the anwser 'math.ceil'

Categories : Javascript

Set a Fixed div to 100% width of the parent container
How about this? $( document ).ready(function() { $('#fixed').width($('#wrap').width()); }); By using jquery you can set any kind of width :) EDIT: As stated by dream in the comments, using JQuery just for this effect is pointless and even counter productive. I made this example for people who use JQuery for other stuff on their pages and consider using it for this part also. I apologize for any inconvenience my answer caused.

Categories : HTML

How to get floated divs (with unknown width) to stay on one line
Remove the float: left and add display: inline-block; to div, span: div, span { display: inline-block; } Recalculate the .wrapper width considering the paddings: width: calc(100% ~'-' 2*@itemDimension+@dropdownWidth+2*@itemPadding+2*@directionalLeftPadding); See the Codepen with the changes Full CSS LESS code: /* Bootstrap */ @import url('http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css'); /* FontAwesome */ @import url('http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css'); @directionalLeftPadding: 10px; @itemPadding: 3px; @itemDimension: 35px; @dropdownWidth: 150px; .square () { box-sizing: border-box; height: @itemDimension; padding: @itemPadding; width: @itemDimension; } div, span { display: inline-blo

Categories : HTML

How to bypass the width limit of the container element
You will need to position absolute your child div element in order for it to "escape" from the parent element. EXAMPLE HTML <div id="parent"> Parent <div id="child">Child</div> </div> CSS #parent { width:100px; height:100px; background-color:blue;} #child { position:absolute; width:200px; height:200px; top:100px; left:20px; background-color:red;}

Categories : Jquery

Divshot static container width with Bootstrap
We include the Bootstrap responsive styles by default (and as of Bootstrap 3 it will be baked into the framework). When you export your code you can remove the extra call but at present there is no option to do so.

Categories : Misc

how to limit navbar-fixed to container width
Remove the bootstrap-responsive.css. This enables the responsive features that will resize all DIVs to 100% once the browser is resized to less than 979px. <link href="assets/vendor/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> If you want to keep the responsive features, you can use a CSS @media query to change CSS styles for just the navbar. You'd put this in another CSS file (or container) and include it after the bootstrap-responsive.. @media (max-width: 979px) { .navbar { ... } }

Categories : HTML

Fit IMG with a border inside a fixed-width DIV container
you can try the following CSS for the second image in your markup: #image-container2 { padding: 30px; background: red; -moz-box-shadow: 0px 0px 10px 1px red; -webkit-box-shadow: 0px 0px 10px 1px red; box-shadow: 0px 0px 10px 1px red; } #image-container2 img.my-image2 { width: 100%; display: block; }

Categories : CSS

Packing fixed width div's into fluid container
I hope this will do the trick: http://jsfiddle.net/CnjZR/1/ <div id="container"> <div id="wrap"> <div class="block"></div> <div class="block"></div> <div class="block"></div> <div class="block"></div> <div class="block"></div> <div class="block"></div> <div class="block"></div> <div class="block"></div> </div> CSS: #container { width: 100%; overflow: hidden; background: red; text-align: center; } .block { width: 20px; height: 20px; background: blue; float: left; margin: 5px; } #wrap { background: green; overflow: hidden; display: inline-block; }

Categories : CSS

Two divs won't fill entire width of container
Instead of decreasing your text's width by 3 px, decrease the padding-right on .looktrai-text it won't change the way it looks but will give enough room for both to fit.

Categories : CSS

How to make text take full width of it's container?
What you ask can probably not be done. text-align:justify will make paragraph text extend to the right side, but you cannot adjust the size of a header so its 100% of the width. Edit: Well, actually, a JS library exist that seems to do this. http://fittextjs.com. Still, no pure-CSS solution is available.

Categories : CSS

Bootstrap fixed container with parent width
Is this close to what you are after? http://www.bootply.com/75880 I added width:100%; max-width:760px; /* set max width as req'd */ to the .main-content header section

Categories : Twitter

wordpress header and container width will not stay at 100%
You do have a max-width rule that's preventing the background from stretching: Disabling that rule extends the background to the full browser width in both sections.

Categories : CSS

Highcharts width exceeds container div on first load
I had a similar issue with centering the highcharts graph it gave. It would center and size correctly for some resolutions but not all. When it didn't, I had the exact same symptoms you're describing here. I fixed it by attaching/overriding additional css to the highcharts default. so in a custom css file, adding .highcharts-container{ /** Rules it should follow **/ } should fix your issue. Assuming that your div "hg=graph" has nothing but highcharts.

Categories : Jquery



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