w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
JSLint Missing Semi-colon
In the callback, after the function addClass() the semicolon is missing: $('.animation1').delay(350) .queue(function(){ $(this).addClass("animate-from-top"); // semicolon missing here -----------------------------^ });

Categories : Javascript

Java semi-colon issue
this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + (" Has Been Enabled!"); should be this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + " Has Been Enabled!"); You have an extra starting bracket at which needs to be removed (" Has Been Enabled!") ^^^ //Above causing error

Categories : Java

Get lines which don't end with semi-colon from a file
I think the easiest way would be with grep. Given an input.txt file like this: spam foo;<Space><Space> sausage baked;<Tab> beans unladen; You could do grep -v ';s*$' input.txt and obtain spam sausage beans grep's -v flag means "return all lines not matching this regular expression", so it will skip all lines ending with semi-colons. If your lines have also spaces after the semi-colons, the s* means "any sequence of space characters" so grep will remove those lines aswell.

Categories : Bash

Unable to separate semi-colon separated line awk
Why awk when you can do it in pure bash? while IFS=';' read -r field1 field2 field3; do echo "Field1: $field1" echo "Field2: $field2" echo "Field3: $field3" done < file.txt Or if you don't know the field count: while IFS=';' read -ra fields; do echo "Number of fields: ${#fields[@]}" echo "Field1 ${fields[0]}" done < file.txt

Categories : Bash

Using IntelliJ IDE to autocomplete line and place semi-colon
Why don't you redo the key binding? Go to: (spanner icon) Settings -> Keymap -> Complete Current Statement and rebind how you will (for example, ctrl-enter might suit you better). Or there's also a default keymap set for Eclipse that you can choose. I'm not sure if it affects the complete-current-line action, but you could take a look.

Categories : Eclipse

Split string on semi-colon, then loop through results
Just create a split function, e.g. (updated to deal with a trailing ;, a scenario not outlined in the question): CREATE FUNCTION dbo.SplitStrings_XML ( @List NVARCHAR(MAX), @Delimiter NVARCHAR(255) ) RETURNS TABLE WITH SCHEMABINDING AS RETURN ( SELECT Item FROM ( SELECT Item = RTRIM(y.i.value('.[1]', 'nvarchar(4000)')) FROM ( SELECT x = CONVERT(XML, '<i>' + REPLACE(@List, @Delimiter, '</i><i>') + '</i>').query('.') ) AS a CROSS APPLY x.nodes('i') AS y(i) ) AS x WHERE LEN(Item) > 0 ); GO Then you can say any of these: --DECLARE TCursor LOCAL FAST_FORWARD FOR SELECT Item FROM dbo.SplitStrings_XML('hello;my;apple;world;is;good', ';'); SELECT It

Categories : Sql Server

Is there a name for storing data where each line either has a semi-colon or curly braces?
That's the PHP serialize format. See : http://php.net/manual/en/function.serialize.php Not sure how to get the formatted version exactly like you have it (but you could probably put that together easily), but here is another way to get an idea of what is in the serialized string: $test_string= 'a:1:{s:9:"home-team";a:6:{s:2:"id";s:9:"home-team";s:4:"slug";s:9:"home-team";s:4:"type";s:6:"select";s:4:"name";s:9:"Home Team";s:11:"description";s:0:"";s:4:"data";a:4:{s:7:"options";a:3:{s:60:"wpcf-fields-select-option-3892e2c3ad45e24dc7f47ff2ba880c33-2";a:2:{s:5:"title";s:13:"Chicago Bears";s:5:"value";s:1:"1";}s:60:"wpcf-fields-select-option-09fbd82bfa4142df6439c8e15d96dbfc-1";a:2:{s:5:"title";s:15:"New York Giants";s:5:"value";s:1:"2";}s:60:"wpcf-fields-select-option-7c7df972f933545b37c41c

Categories : Mysql

[SOVLED]PDO/MySQL Prepared Statement Injection Semi Colon
I was wondering why in my prepared statement some characters from formular user input aren't escaped as i would expect it to be. Because your expectations are wrong. Prepared statement is not necessarily involve any escaping at all Even if so - a honest semicolon character is totally harmless, and require no escaping at all. PDO/MySQL Prepared Statement Injection There is no possible injection in your code, it is perfectly safe. when i enter ';' for example it just throws out every result. That's another question, irrelevant to injections and escaping. Double-check your data and other premises. By the way, to shorten your code a bit $sql = "SELECT titel, date, content FROM News WHERE content LIKE ? OR titel LIKE ?"; $temp = "%".$_POST['key']."%"; $stmt = $pdo->pre

Categories : PHP

if, for, or while with an empty body, use empty braces instead of a semi-colon
This guards against things like: if(condition); { // oops, I really meant for this to be conditional. // now it always executes, regardless of condition. } The error raised forces you to explicitly put the empty {} before the ; so it's clear that that's what you intended.

Categories : Javascript

Split string with colon (:) and separate the numbers with colon
Try string.Split string input = "D93:E93 E98 E9:E10 E26 D76:E76 D83:E83 D121:D124"; var output = input.Split(new [] {':', ' '}); Console.WriteLine(output); or if you need the commas: string input = "D93:E93 E98 E9:E10 E26 D76:E76 D83:E83 D121:D124"; var output = input.Split(new [] {':', ' '}); var outstr = output.Aggregate((a,e) => a + ", " + e); Console.WriteLine(outstr);

Categories : C#

Semi transparent div
Use background: inherit; for #main div. You can also specify any other background-color explicitly. http://jsfiddle.net/F4sYM/3/ EDIT: removing position: relative; for #main div seems to have done it. http://jsfiddle.net/F4sYM/7/ EDIT 2: solution using 3 divs: http://jsfiddle.net/7e3BG/

Categories : HTML

Semi-oval with CSS
I've updated your demo with one possible solution: http://jsfiddle.net/QGtzW/1/ div { background-color: #80C5A0; width: 400px; height: 100px; border-radius: 50% / 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0; } By using percentage based units for the border-radius it should always keep a smooth semi-ellipse regardless of your width and height values. With a few minor changes, here's how you'd render the semi-ellipse split in half vertically: http://jsfiddle.net/QGtzW/5/ div { background-color: #80C5A0; width: 400px; height: 100px; border-radius: 100% / 50%; border-top-left-radius: 0; border-bottom-left-radius: 0; }

Categories : HTML

CSS semi-dynamic width
I can't think of any way to do this in CSS, but with a little JavaScript magic you can make it work: // assuming all elements are in a container with id="container"... var qsa = document.getElementById('container').children, l = qsa.length, i; for( i=0; i<l; i++) { if( qsa[i].scrollWidth > 240) { // this one handles REALLY long text by cutting them off with "..." qsa[i].style.textOverflow = "ellipsis"; qsa[i].style.whiteSpace = "nowrap"; } if( qsa[i].scrollWidth > 160) qsa[i].style.width = "240px"; else if( qsa[i].scrollWidth > 80) qsa[i].style.width = "160px"; // else do nothing, leave the deafult 80 width }

Categories : CSS

semi specialization of templates
One solution would be to write a traits class and use std::enable_if : template<typename T> struct has_2_elements { static const bool value = false; }; template<> struct has_2_elements<cv::Point2i> { static const bool value = true; }; template<> struct has_2_elements<cv::Point2d> { static const bool value = true; }; template<class dataType, typename = typename std::enable_if<has_2_elements<dataType>::value, void>::type> void SSDFinder<dataType>::FindSSD() { // some code. } While you would still have to tell by hand which classes "have 2 elements", it would be separated from your function, easy to extend, and reusable in another places in your code. NOTE: std::enable_if is c++11, but you can find the equivalent in Boost

Categories : C++

How to do semi-transparent overlay
Add a div, set it to position: fixed, have all of it's location values (top, bottom, left and right) at 0, and give it an rgba() background. Note that this will make anything under it unclickable (unless you also give it pointer-events: none). Here is a jsFiddle example of the concept.

Categories : CSS

Semi-strict "and then" in Javascript?
"Does "&&" guarantee to stop if the first clause is false already?" Yes. The short circuit operators && and || will only evaluate the operands until the result is known, contrary to their & and | counterparts. Some languages have an and then or AndAlso operator. That corresponds to the && operator in Javascript, as the and operator corresponds to the & operator.

Categories : Javascript

Semi-transparent overlay with tab bar
The Tab Bar is not amenable to having 6 buttons on it. It will put the extra buttons beyond 4 into an "other" category. You should just create your own view with your own buttons. You can "gamify" it better that way. Just make them custom buttons on a view and give them selector targets.

Categories : Iphone

Semi-colons in URL changes to %3b via .htaccess
Your first rule is doing this. When I click on your second link, since it doesn't end with a slash or a period, it redirects me to the same URI except with a slash. Try using the NE flag so that the semicolons don't get encoded: RewriteCond %{REQUEST_URI} !(/$|.) RewriteRule (.*) %{REQUEST_URI}/ [R=301,L,NE] Not sure why the dev site isn't doing the same thing, unless it's missing the redirect rule.

Categories : Htaccess

C# XML 'colon' in root name possible?
The "site:" bit with the colon in is actually your XML Namespace, set this property instead. Look at this question: How to create XmlElement attributes with prefix?

Categories : C#

Regex before a colon
If you wan't to find word (\w+) between &[ and : then you can use look-around mechanisms (?<=&\[)\w+(?=:)

Categories : Java

Very large semi-csv file- out of memory
Totally untested, the strings must be "mystring". No support for escapes in strings. No support for escape of the " in string. So these are not valid: "my""quote" nor "my"quote". The file must be perfect: no eof at the end, no new line at the end, no spaces anywhere but inside a string, no new lines anywhere but inside a string. Inside a string anything goes but the " (that marks the end of the string), no lines with too many elements, no lines with too few elements, no null handling (technically a ,, for a string will return an empty string with no error thrown). All the types supported by Convert.ChangeType are supported. Usage: using (var fs = new StreamReader("myfile.txt")) { foreach (var objs in ParseStream(sr, new Type[] { typeof(int), typeof(double), typeof(string) }, CultureI

Categories : C#

Make bootstrap well semi transparent
Change the background-color instead of changing its opacity .well { background-color: rgba(245, 245, 245, 0.4); } With a notice that the value 245 comes from the default background-color of the .well class: #F5F5F5.

Categories : CSS

QProgressBar as semi-transparent overlay
You can use setWindowOpacity to set window transparency, but it only works on top level windows. So if you change your code like this, it should work. #include <QApplication> #include <QProgressBar> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget *widget = new QWidget(); QProgressBar *progress = new QProgressBar(); QPalette palette(widget->palette()); palette.setColor(widget->backgroundRole(), Qt::green); widget->setAutoFillBackground(true); widget->setPalette(palette); progress->setWindowOpacity(0.5); widget->show(); progress->show(); return a.exec(); } I don't have a qt development environment right now so i can't try it, but if anything does not work as you expect, i would gladly t

Categories : Qt

Semi-explicit parallelism in Haskell
Yes, you are correct. You would not gain anything by creating a spark for every expression you want computed. You would get way, way too many sparks. Trying to manage this is what Data Parallel Haskell is about. DPH is a way of breaking down a nested computations into well-sized chunks which can then be computed in parallel. Keep in mind that this is still a research effort and probably not ready for mainstream consumption. Once again, you are correct. If a depends on b you have to compute as much of a as b needs to be able to start computation of b. Yup. Threads actually have a pretty high overhead compared to some of the alternatives. Sparks are somewhat like thunks only they can be computedd independently of time. No, the RTS will not create a thread to compute a. You can decide how

Categories : Multithreading

The [semi-?] official CSS validator complains about some MS CSS
according to the spec, you need to specify an angle or a direction as the first parameter to gradient(): Formal grammar: linear-gradient( [ <angle> | to <side-or-corner> ,]? <color-stop> [, <color-stop>]+ ) You're missing the to in front of left.

Categories : CSS

PHP Session Script Semi-Functional
In a couple of different places, you have session_write_close() after a return. A return statement is always the last thing executed in the function. Also, just to make sure, you are calling session_start() to actually start a session, right?

Categories : PHP

Basic CSS - how to overlay a DIV with semi-transparent DIV on top
.foo { position : relative; } .foo .wrapper { background-image : url('semi-trans.png'); z-index : 10; position : absolute; top : 0; left : 0; } <div class="foo"> <img src="example.png" /> <div class="wrapper">&nbs;</div> </div>

Categories : CSS

Intermittent semi-transparent sphere in Three.js
To create, for example, a partially transparent blue sphere, you could try: var sphereGeom = new THREE.SphereGeometry( 40, 32, 16 ); var blueMaterial = new THREE.MeshBasicMaterial( { color: 0x0000ff, transparent: true, opacity: 0.5 } ); var sphere = new THREE.Mesh( sphereGeom, blueMaterial ); For more examples of creating semi-transparent materials, check out http://stemkoski.github.io/Three.js/Translucence.html If you want the sphere to fade in and out, you can change the transparency in your update or render function -- make the sphere a global object, also create a (global) clock object to keep track of the time in your initialization, for example, with clock = new THREE.Clock(); and then in your update, you could, for example, write sphere.material.opacity = 0.5 * (1 + Math.s

Categories : Three Js

Semi-transparent 2d VTK text background
I've found a way to do this with vtkPolyMapper2D which seems to work okay. It seems to be a very stupid way to do this. If there is something more elegant, I'm all ears. import vtk extents = [[0,0],[620,0],[620,220],[0,220]] polyPoints = vtk.vtkPoints() for x, y in extents: polyPoints.InsertNextPoint(x, y, 0) num_corners = len(extents) polyCells = vtk.vtkCellArray() polyCells.InsertNextCell(num_corners + 1) for i in range(0, num_corners): polyCells.InsertCellPoint(i) polyCells.InsertCellPoint(0) ## Rejoin at the end poly_profile = vtk.vtkPolyData() poly_profile.SetPoints(polyPoints) poly_profile.SetPolys(polyCells) ## Goes solid cut_triangles = vtk.vtkTriangleFilter() cut_triangles.SetInput(poly_profile) _poly_mapper = vtk.vtkPolyDataMapper2D() _poly_mapper.SetInput(poly_p

Categories : Python

awk help in modifying a semi csv file to a new format
Based on Ed Morton's recommendation about split: $ awk '{split($1, a, ","); for (i in a) {print a[i], $2}}' file fig|1671.3.peg.2935 operon1 fig|1671.3.peg.2936 operon1 fig|1671.3.peg.29370 operon1 Explanation split($1, a, ",") splits the string based on comma. So an array a[] will be created. {for (i in a) {print a[i], $2}} loops through the array printing the element + 2nd field of the input file. Note that it works for any number of comma separated amount of fields: $ cat file hello,how,are,you good! $ awk '{split($1, a, ","); for (i in a) {print a[i], $2}}' file hello good! how good! are good! you good!

Categories : Perl

Semi-local Levenshtein distance
It's not exactly what you were asking, but it might help you. If you want to find the minimal distance from the short word to any of substrings of the long word, there's a simple variation on the Levenshtein Distance Fuzzy substring matching with Levenshtein distance in Python Generally, you set the cost of adding characters at the end or beginning of the string to 0

Categories : Algorithm

Can you create semi transparent text
You can use CSS: .transparent_text { color: gray; /* fallback */ color: rgba(0, 0, 0, 0.5); } and <div class="transparent_text">Hello</div> or <div style="rgba(0, 0, 0, 0.5);">World</div> The last value is the transparency (this is semi-transparent-black). 0 for completely transparent, 1 for opaque Example: http://jsfiddle.net/xUgYP/

Categories : HTML

Get all letters before the optional colon
Try: preg_replace("/^([A-Z]+).*$/", "$1", $cell) It'll 'save' the first part and remove everything else. regex101 demo.

Categories : PHP

Parse JSON with colon in key
You could write your own parser and just parse the json as a string, there you can add custom parsing features to the id field. Although being in java, this might help

Categories : Python

How to align colon vertically using css?
You'll need to use elements that have display:inline-block then you can use vertical-align:middle EDIT I misunderstood the question. You could set a minimum width on your <b> tags, but it's not fully cross-browser: <style> p b { min-width: 50px; display:inline-block; } </style> <p><b>Foo</b>:</p> <p><b>Bar</b>:</p> However, as you're using a table anyway, I'd suggest using the table itself to keep things aligned

Categories : HTML

Match text after colon
If you're doing this in C# and using the included Regex engine, your original regex should work, with a slight modification: string myString = "type : something"; var match = Regex.Match(myString, @"(?<=types*:s*)w+"); Console.Write(match); Edit: The reason why the ?<=types*:s*)w* version wasn't working for you with multiple spaces, is because the regex match was happily returning various combinations of strings with 0 characters after the variable number of spaces following the colon. You can view the various matched strings by using Regex.Matches, you'll see that your matched word is in there, but it's not the first result.

Categories : C#

Python ConfigParser with colon in the key
Split out your URL protocol, base and the port, i.e. the bits after the : and use them as a secondary keys OR Replace : with something allowed and vice-versa, possibly using a 0xnn notation or something similar OR You could use a value based on the URL such as a MD5 of the URL value as your key.

Categories : Python

Assembly, the meaning behind the colon ":"
Those are memory addresses expressed in the segment:offset scheme. See e.g. http://thestarman.pcministry.com/asm/debug/Segments.html

Categories : Assembly

DateTimeFormat with Timezone and no colon
Function format-dateTime() looks for current-dateTime() format which needs colon between time zone HH:MM, in your case it is missing (0230). You should use another method to put colon between them: let $x:= "2013-02-13T16:49:51.733+0230" return concat(substring-before($x,'+'),'+',substring(substring-after($x,'+'),1,2),':',substring(substring-after($x,'+'),3,2)) output: 2013-02-13T16:49:51.733+02:30

Categories : String

Add namespace with colon to xml file
Try This XNamespace ns = XNamespace.Get("http://namespace"); var xDocument = new XDocument( new XElement(ns + "Root", new XAttribute(XNamespace.Xmlns + "ns0", ns), new XElement("Node1", new XElement("A", "ValueA"), new XElement("B", "ValueB") )));

Categories : C#



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