w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
CSS @Styles.Render not rendering stylesheet
There seem to be two parts to the problem. CSS One part of the problem is related to invalid CSS. For example, border-top is the shorthand declaration for a combination of style, width and colour: border-top: [width style colour] With this in mind, I would change your CSS as follows: header { border: 2px solid #0094ff; /* width style colour */ border-bottom-right-radius: 10px; border-top-style: hidden; border-left-style: hidden; box-shadow: 2px 2px 0px #000; /* x-offset y-offset blur colour */ } IE / Compatibility Mode If IE is coming through in compatibility mode, you're probably rendering using the IE8 (or older) engine. Unfortunately these do not understand HTML5, so things like the <header /> elements and border-radius and box-shadow CSS declarati

Categories : HTML

How to cancel initial stylesheet when a mobile stylesheet is loaded?
You cannot cancel a stylesheet per se, but you can negate the effects of the previous stylesheet by overriding its CSS rules. You can also use a third stylesheet or apply media query rules to make some CSS that only applies for non-mobile devices. Like: <link rel="stylesheet" type="text/css" href="index.css" /> <link rel="stylesheet" href="desktop.css" type="text/css" media='screen and (min-device-width: 481px)'/> <link rel="stylesheet" href="handheld.css" type="text/css" media='screen and (max-device-width: 480px)'/> Note that these approaches require support for CSS3 min/max media queries. If you need to support browsers that are not capable of doing that (IE6/IE7/IE8), use a polyfill like Respond (https://github.com/scottjehl/Respond).

Categories : HTML

should I put default declaration on the same stylesheet with the media queries stylesheet?
The problem is that your selectors are of equal specificity (@media rules don't have any specificity) - both rules are using one class selector (.box) and because you're loading .style.css after enhanced.css the former takes precedence. You need to increase the specificity of your @media rule if you want to include it before your regular .box rule - e.g. @media only screen and (min-width: 320px) and (max-width: 480px) { body .box { height: 300px; }

Categories : CSS

Internal Stylesheet NOT overriding External stylesheet?
I see at least one issue. If you're interested in finding out what happened to this: <h1><a href="#">xx</a></h1> Here's your problem. In your external CSS: #header h1 a { display: block; width: 273px; height: 51px; background: url(images/cap-logo.png); text-indent: -9999px; } The use of the ID is the most specific version of h1 with an a inline child to a #header element, so this is what gets used. As you can probably tell, this is moving the header outside the visible area. There's a couple ways to bring this back on the screen. The easiest way is to change the <h1> to a span with an id: <span id="big-x"><a href="#">xx</a></span> And then it's relatively trival to do what you need with this element. Oth

Categories : CSS

inline stylesheet to cascading stylesheet
Looks like someone already answered this for you - see the first response, there's an online tool to extract inline css and distill it into classes. Tool to automate converting inline css to external css?

Categories : HTML

Using TinyMCE how do I limit html while ensuring that styles in the textarea match the styles output to my app
To clean on paste use: http://www.tinymce.com/wiki.php/Plugin3x:paste You can have advanced control over the html on submit with the new Event API: http://www.tinymce.com/wiki.php/API3:class.tinymce.Editor

Categories : Django

ckeditor styles conflicting with bootstrap styles
I solved this by adding a class to each of my ckeditor authored content areas, and then doing some reset within this class. For example (scss): .ckeditor-content { [class*="span"] { margin-left: 0px; } h1, h2, h3, h4, h5, h6 { text-align: left; margin: 0px; } color: #000000; } Any element specific styles added by the user via CKEditor could then override these, but this at least handles the case where no element style has been added and Bootstrap (or your own css) is applying unwanted formatting.

Categories : Django

Converting D3.js CSS Styles to Inline Styles
The easiest thing to do is probably to set the styles you want explicitly, i.e. svg.append("g") .attr("class", "xAxis") .attr("fill", "none") .attr("stroke", "black") .style("shape-rendering", "crispEdges") .attr("transform", "translate(0," + height + ")") .call(xAxis) .selectAll("text") .style("fill", "black") .style("stroke", "none") .style("text-anchor", "end") .attr("dx", "-.6em") .attr("dy", "-0.195em") .attr("transform", function (d) { return "rotate(-90)" }); Updated jsfiddle here.

Categories : Jquery

SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
Change only the color attribute for css rules that contains :visited or :link selector http://msdn.microsoft.com/en-us/library/ie/hh180764%28v=vs.85%29.aspx

Categories : HTML

How to combine two multidimensional arrays with showing duplicate keys or if duplicate, must add the values
$array1 = array( 'a1' => array(200,300,300), 'a2' => array(100,600,200)); $array2 = array( 'a1' => array('gen','gen2','gen'), 'a2' => array('gen2','gen3','gen3')); $result = array('a1' => array(), 'a2' => array()); foreach($array2 as $k => $v) { foreach ($v as $k2 => $v2){ if (array_key_exists($v2, $result[$k])){ $result[$k][$v2] += $array1[$k][$k2]; } else { $result[$k][$v2] = $array1[$k][$k2]; } } } Output: Array ( [a1] => Array ( [gen] => 500 [gen2] => 300 ) [a2] => Array ( [gen2] => 100 [gen3] => 800 ) )

Categories : PHP

Hudson server running app engine, duplicate shell script executions result in duplicate property errors
It might be the case that the dev_appserver is already running and then you run it again with hudson job. The best way will be to stop the dev_appserver instance first and then pump it up again.

Categories : Python

DIV with seperate CSS file in same document?
The short answer is NO, if you want to prevent the div to inherit styles from other stylesheet, the only way to do is to override the styles either by using more specific selectors or using !important, I would prefer specific selectors here. For example, you've something like the below snippet in stylesheet 1 div { color: #f00; font-weight: bold; } and you've below in stylesheet 2 div { font-weight: normal; } In this case, the font will be normal for div as it is overridden, but the color will be #f00, inorder to have some another color, you need to specify the color in your stylesheet 2 too... If you want to target a div specifically, I would suggest you to use an id which will be unique, and than write the respective styles for that particular div For example <div

Categories : HTML

Less css - Can we use more variables seperate with coma
Assuming that you want the same properties to apply in many places you can do something like this .aProperty{ color:#606369 } Then you can do something like this to add the same properties to other elements .anotherProperty{ background:#000; //just like that .aProperty; } This way .anotherProperty will inherit the properties of aProperty. This way you can even add other properties and use them at many places.

Categories : CSS

How to read xml data and seperate it by tag
XML can be accessed like this (if it is valid): var customerID = xmldata.getElementByTagName('CustomerID')[0].nodeValue; like if it is a list: for(var i = 0;i<xmldata.getElementByTagName('customer').length;i++){ var customer = xmldata.getElementByTagName('customer')[i]; var customerID = customer.getElementByTagName('CustomerID')[0].nodeValue; }

Categories : Javascript

Design issue- should use seperate thread for GUI?
You should use for heavy task SwingWorker, is designed for this situations. Here you have a nice article why do we need SwingWorker?. You need this cause if your algorithm take for example 5 secs and you run in the same thread as gui, it's gonna to freeze your view until finish. BTW all gui-components must be updated in the Event Dispatch Thread, so you don't have to update them in another thread cause they don't be updated.

Categories : Java

How to seperate asset pipeline with different layouts
You will have to use two layout files in app/views/layouts: one you just leave like it is and then you create a second that will be called something like application_bootstrap.html.erb. In the second one you will include a stylesheet link tag like <%= stylesheet_link_tag "bootstrap" %>. In the assets directory you will have the regular application.css where you have to make sure not to include the assets/bootstrap directory and a new bootstrap.css which simply requires the assets/bootstrap/ tree to be included. Then in you controllers you can switch the layouts: layout application_bootstrap and it will include the new layout file which in return includes the new CSS that you created. Of course you could also switch the layout in the application_controller.rb based on user settings

Categories : Ruby On Rails

SQL server : How to seperate XML nodes in different rows
Try this SELECT A.Col1 ,A.Col2 ,Split.interaction.value('@id', 'INT') AS [ID] ,Split.interaction.value('@name', 'VARCHAR(10)') AS [Name] FROM ( SELECT Col1, Col2, Col3 FROM #Tablexml ) AS A CROSS APPLY Col3.nodes ('/Interactions/interaction') AS Split(interaction); DEMO

Categories : SQL

Add data to database on two seperate pages
I've done something similar to this before. I asked users to enter a zip code on one page and then based upon that zip code it loaded in different options for the form on the next page. Here is how I did it using request.session Note that this is is my soultion to MY problem. This may not be exactly what you are looking for but might help you get a start. If anyone has a better solution I'd love to see it since I'm not entirely happy with my answer. views.py def find_zip(request): c={} form = FindZip() c['form'] = form

Categories : Python

seperate html string using componentsSeparatedByString
NSString *str=@"<table border=1><tr><td>row 1 cell 1</td><td>row 1 cell 2</td></tr><tr><td>row 2 cell 1</td><td>row 2, cell 2</td></tr></table>"; NSArray *temp1 = [str componentsSeparatedByString:@"</td></tr><tr>"]; NSLog(@"1 = %@",[temp1 objectAtIndex:0]); NSLog(@"2 = %@",[temp1 objectAtIndex:1]); //output 2013-06-12 15:49:02.641 PhotoPicker[5967:11303] 1 = <table border=1><tr><td>row 1 cell 1</td><td>row 1 cell 2 2013-06-12 15:49:11.544 PhotoPicker[5967:11303] 2 = <td>row 2 cell 1</td><td>row 2, cell 2</td></tr></table> y that error.. can you add your string?

Categories : HTML

Should Calculations be done in SurfaceView or seperate Thread
Sure, you should avoid doing any time-consuming calculation in the UI Thread. You could also incur in an ANR error message. You can either use: AsyncTask, but be aware that it has some flaws and drawbacks. For example it isn't guaranteed to even start or complete. IntentServices or HandlerThreads if you need to do operations that need to be executed sequentially in a worker thread WorkerThreadPool if you need to execute true parallel tasks.

Categories : Android

Best way to sum and seperate by date in MYSQL with/witout php
I'm neither a php nor MySQL programmer, but I can explain the logic you want to follow. You can then code it. First, query your db and return the results to php. Next, set two sum variables to 0. Start looping through your query results. Increment the first sum variable until you reach the first row that has status 55. Once you do, start incrementing the second variable. The tricky part will be to sort your query by the row number of the table. Here is a link that will help you with that part.

Categories : PHP

What's the best way to seperate the first line of a string from the rest in JS?
You can use shift to remove the first item from an array. var lines = text.split(" "); // split all lines into array var firstline = nums.shift(); // read and remove first line var rest = nums.join(" "); // re-join the remaining lines This is perhaps idomatically closest to what you do in Python, but it's hardly the most efficient approach.

Categories : Javascript

IE Conditional Stylesheet
You can't target IE10 with conditional comments. Support for those has been dropped in IE10, due to it being far more "standards compliant" than past IE versions (and therefore mostly eliminating the need to specifically target it). The only way to target IE10 specifically would be via JavaScript by checking the navigator.userAgent string for values specific to IE10. This, however, is greatly frowned upon (I'll leave it up to you to research why, Google will turn up tons of stuff on why you should not use userAgent). Rather than check for what browser is being used (or appears to be used, as you can spoof userAgent), you should check if a particular piece of functionality that you want actually exists, and if not fall back on something else. The way you check depends on the functionality

Categories : CSS

XOM convert XML (SVG) into XSL stylesheet
You can’t do this: new Element("xsl:template%20match="/"") You have to define the name (xsl:template) when you create the element and then add the attribute (match=""). Like this: Element template = new Element("xsl:template", "http://www.w3.org/1999/XSL/Transform"); template.addAttribute(new Attribute("match", ""));

Categories : Xml

PHP Variables in the CSS Stylesheet
You do this the same way you would with HTML: <?php header('Content-Type: text/css'); $css = $_GET['css']; // or wherever your're initializing the variable from... ?> body { <?= $css ?>border-radius: 3px } But, I don't think this is necessary for your use case. It's actually not uncommon to just statically include all the various -*- options in a css file: body { -moz-border-radius: 3px; border-radius: 3px; } Just add all effective options, and the browser will determine which are most effective for it. This also means you get to avoid the dull and error prone task of browser sniffing.

Categories : PHP

How to simplify my CSS stylesheet?
CSS: .red{ color:red; } .black{ color:black; } HTML: <div class='table_test'> <div class='div'>...... <table> <tr> <td><input class="black">...</td> </tr> </table> </div> <div class='table_name'> <div class='div'>...... <table> <tr> <td><input class="red">...</td> </tr> </table> </div> The best part? This CSS will work wherever you need it to.

Categories : HTML

iPhone Stylesheet or JS
The idea that you can download an arbitrary HTML/CSS/JS(?) template that is designed for mobiles and have it magically adapt to look right in a classic browser window is .... naive. Either look for a template that is designed to look good in both contexts, or build your own layouts using something like Twitter Bootstrap which is responsive to differences in the display port size.

Categories : Iphone

meteor: using more than one stylesheet
I can not recommend using !important rule since it will mess up your code and make it hard to maintain. In Meteor you can use as much stylesheets as you like you just have to keep the load order in mind: Files in the lib directory at the root of your application are loaded first. Files that match main.* are loaded after everything else. Files in subdirectories are loaded before files in parent directories, so that files in the deepest subdirectory are loaded first (after lib), and files in the root directory are loaded last (other than main.*). Within a directory, files are loaded in alphabetical order by filename. These rules stack, so that within lib, for example, files are still loaded in alphabetical order; and if there are multiple files named main.js, th

Categories : Twitter

iOS equivalent to a stylesheet?
There's Appearence. You often see this being used for colours, but it also does fonts, sizes, and a few other things. Here's another good article from a well known source. Additionally, a common way to style/'skin' is by having different sets of background/button/... images. You can also style by parameterizing drawing code. Have a look at the fabulous tool PaintCode. Then, some companies do (part of the) UI in HTML/JavaScript. Another thing to mention in this context is iOS' Auto Layout

Categories : IOS

perform alert when seperate function is done using jquery
Ok try this <div style="width:200px; height:200px; background:#000" onclick="changecolor(this); alert(0);"></div> Or wrap both functions in a single method

Categories : Javascript

When should behaviour that is to be customized in subclasses be put in seperate methods?
I would prefer the first solution for one simple reason: What if you want in the Child class to override just the on_start_main and leave the on_end_main unchanged. If you choose the first solution, then you just override the on_start_main method and your done. You don't have to know or even care what the Parent class does in it's on_end_main. If you choose the second solution you have to know exactly what the Parent class exactly does in the main method, so not only you have to dig into the source of the Parent class but also duplicate the code already written.

Categories : Python

Seperate an array into columns , and enter these two in database
Use foreach loop with your array like $sql = "INSERT INTO my_table (ID,Name) VALUES"; $i = 0; $my_id = "your id"; $my_cnt = count($my_array); foreach($my_array as $name) { $exploded = explode(' ',$name); $sql .= "($exploded[0],$exploded[1])"; if($i++ < $my_cnt) $sql .= " , "; } echo $sql; then execute the query $sql

Categories : PHP

Python 3: Regex matching 2 seperate conditions
import io import re import sys file = io.StringIO(''' title|Head1|Head2|Head3|head4 ----|------|-----|-----| 1|1150976|0|25300992|bfa92720/bfa924f8|su|(None, None) 2|1150976|0|25300992|bfa92720/bfa924f8|su|(None, None) 3|1150976|0|25300992|bfa92720/bfa924f8|su|(None, None) 4|1150976|0|25300992|bfa92720/bfa924f8|su|(None, None) 5|1150976|0|25300992|bfa92720/bfa924f8|su|(None, None) All|processes:|MemAlloc|=|408125440|(None, None)|0.0.0.0 |(None, None) 0.0.0.0 ,text ''') sys.stdout.writelines(line for line in file if re.match('d+|', line))

Categories : Regex

How to do Oauth Authentication using seperate new tab for verification of account?
When creating the new window for authentication you can get the reference to the window object. var authWindow = window.open("location",""); In the authentication tab you on authentication success you can call a method which would close the window and set a property or call a method on the source window suggesting that authentication is complete. var authenticationSuccessUrl = "http://auth-sucess.url" authWindow.onClose = function () { authWindow.close(); window.location = authenticationSuccessUrl; } On the authentication window javascript: var onAuthSuccess = function (){ window.onClose(); } Be sure to remove the reference to the authWindow at the end of processing. Having window objects as references could potentially lead to memory leaks in the application.

Categories : Twitter

How to fetch only few dependencies among many from a seperate repo in java?
I think with the repositories you can configure that , it will first try to download the artifact from your mentioned repository url , if it is not available their then it try to download from Maven Central Repo. Add the repositories under your project in pom.xml <repositories> <repository> <id>cloudera</id> <url>Your Cloudera Specific Location</url> </repository> </repositories> For more you can refer maven specs here. Try with this .

Categories : Maven

Multiple force-layout graphs with d3 in seperate svg/div's
i am working on force layout only, with many graphs at same time. 1 You don't need to have a count variable for each graph. 2 Don't make these variable(force, svg, graph) as array. There is no need for it. just declare them above as (var svg;) and further on. As you call the function, it automatically makes its different copy and DOM maintain them separately. So every variable you are using in graph, make it declare on top of function. 3 You are drawing all the graphs at same time, so as the new one is called, the previous one stops from being making on svg, that's why only last graph built successfully. So draw them after small time intervals. <html> <script> function draw_graphs(graphs){ var color = d3.scale.category20(); var force; var div; var svg; var graph; var link

Categories : Javascript

Python or R, efficient seperate time series into zig zag
A solution in general Python, note that the l can be any iterator, and it is scanned only once. l = [0, 0, 1, 2, 2, 2, 1, -1, -1, -1, 0] def zigzag(l): if not l: return [] last = l[0] # the elements in current rise current_rise = [] # the elements in current drop current_drop = [] # return value zigzags = [] # iterate over elements for i in l: # if we are growing... if i > last: # and the current_drop is longer than # current rise, then we just stopped a drop if len(current_drop) > len(current_rise): zigzags.append(current_drop) # in any case, a new drop can start here. current_drop = [i] else: # else just accumu

Categories : Python

Transferring javascript from a view to a seperate JS file
Server side code like that cannot run in a seperate javascript file. My solution for such problems is having a short javascript part in the head that runs on the onload event. There you can set variables that you can use in a seperate javascript file: in the head: array = @Html.Raw(Json.Encode(ViewBag.JobList)); in the seperate javascript file: var array; Then, in the seperate javascript file you can do with your array whatever is necessary.

Categories : Javascript

Pop up dialog to save file in seperate thread
QFileDialog::getSaveFileName() returns file name, it does not try to open the file nor return the file handle. It's not clear from your question, but I assume that your button starts the thread to execute some lengthy task and to store the results to the file. So call QFileDialog::getSaveFileName() right there in the button click slot, obtain the file name and provide that name to the thread. Your thread will just read that file name, so probably there is no need for synchronization. And then, you just open the file with provided file name in that non-GUI thread.

Categories : C++

Does application scoped beans run on seperate thread in JSF?
Does application scoped beans run on seperate thread in JSF? No, it definitely doesn't. Should I create a thread and let the infinite loop run in that thread instead? No, you shouldn't. You should just create a scheduled task. Best way to that is to use a @Singleton @Schedule EJB. @Singleton public class SomeDailyJob { @Schedule(hour="0", minute="0", second="0", persistent=false) public void run() { // Do your job here which should run daily at midnight. } } That's all. No additional configuration of manually messing with threads necessary. If you want to access its state -if any- from in a JSF managed bean, just inject with @EJB the usual way. See also: ApplicationScope bean that uses a TimerTask (sheduler), good or bad? Java mail how to send automa

Categories : JSF



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