w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
CSS negation pseudo class not working
For your use-case I'd suggest: div:hover div.item { opacity: 0.3; } div:hover div.item:hover { opacity: 1; } JS Fiddle demo. The problem is that your selector is looking for element with the class item, that is not hovered, within another element of the same class. Your posted CSS shows that the parent element does not have a class, and so the selector can never match.

Categories : CSS

Regexp for validating decimals not working
first off, you shouldn't be using eval like that, it puts unnecessary stress on the client, just do var regex = /^[-+]?([0-9]*\.[0-9]{0,2})|([0-9]+)$/; return regex.test(number); instead. And you need to use .value after getElementById('Amount');

Categories : Javascript

not working RegExp for pairs of repeating numbers (JS)
If I understood your correctly, this should help: Demo return temp.replace(/"(d)"(.*?)"1"/g, function (all, i, whitespace) { n += 1; return '"' + n + '"' + whitespace + '"' + n + '"'; }); Temp string: id="1" some text "1", id="1" some text "1", id="1" some text "1", Output: id="1" some text "1", id="2" some text "2", id="3" some text "3",

Categories : Javascript

MYSQL REGEXP not working when keyword is enclosed in double quotes
Your problem is incorrect data in the database, and not the query. “keyword†is not "keyword", change '“' to a normal quote symbol, and it will work. Look at the fiddle: http://www.sqlfiddle.com/#!2/674b3/1 Both records: without quotes and with quotes were selected from the database.

Categories : Mysql

neo4j rest API not working
You'll probably have a bunch of jars to include as dependencies. Including the rest binding as a maven dependency would of course take care of it: org.neo4j neo4j-rest-graphdb 1.8.1 If you've built from source, then I usually do the unscientific thing of looking at the pom.xml https://github.com/neo4j/java-rest-binding/blob/master/pom.xml and picking out dependencies from /target/dependencies

Categories : Java

neo4j 2.0 findNodesByLabelAndProperty not working
Found it: I only included neo4j-kernel:2.0.0-M03 in the classpath. The moment I added neo4j-cypher:2.0.0-M03 all was working well. Hope this answer helps save some time for other users. @Neo4j: would be nice if an exception would be thrown instead of just returning nothing. @Ricardo: I wanted to but I was not allowed yet as my reputation wasn't good enough as a new SO user.

Categories : Neo4j

MySQL/Regexp: Partial regexp match
This should do it on MySql: select * from table t where 'foo-11.example.com' rlike t.data; There are other ways in PostGreSQL. Here's the link from where I have referenced this: http://www.tutorialspoint.com/mysql/mysql-regexps.htm Match a Query to a Regular Expression in SQL? PS: Using * is tricky though!

Categories : Mysql

Variable name of opposite of negation
To get rid of the boolean flag I would refactor the code by introducing two factory methods and making the original constructor private. Admittedly I don't do Java stuff regularly, so forgive the probably wrong syntax :) private Constraint(final Operation operation, final boolean negated, final T data, final String field) { this.operation = operation; this.negated = negated; this.data = data; this.field = field; } public static<T> Constraint<T> createConstraint(final Operation operation, final T data, final String field) { return new Constraint<T>(operation, false, data, field); } public static<T> Constraint<T> createNegativeConstraint(final Operation operation, final T data, final String field) { return new Constraint<T>(oper

Categories : Java

Regex Substring Negation
(?!foo) is a negative look ahead. You're looking for (?<!foo) which is a negative look behind. /http://url.com/wp-content/uploads/S+(?<!150x150).(?:jpg|jpeg|png|gif)/ ^^^ Regex 101 Demo.

Categories : PHP

complement/negation doesn't work right
The system you're describing is called ones' complement and it's not the system used in most modern environments (including C#). What is used is two's complement. In this system, -1 is 1111, -2 is 1110, etc. That means the numbers you're getting are correct, because ~1 == -2.

Categories : C#

Perl booleans, negation (and how to explain it)?
Logically negating a false value requires some value be chosen to represent the resulting true value. "1" is as good a choice as any. I would say it is not important which value is returned (or conversely, it is important that you not rely on any particular true value being returned).

Categories : Perl

Querying multiple indexes not working if one condition fails in Neo4j
In 2.0 you can use UNION and have two separate queries like so: start n=node:Users(Name="Hello") return n UNION start n=node:Location(LocationName="Hello") return n; The problem with the way you have the query written is the way it calculates a cartesian product of pairs between n and m, so if n or m aren't found, no results are found. If one n is found, and two ms are found, then you get 2 results (with a repeating n). Similar to how the FROM clause works in SQL. If you have an empty table called empty, and you do select * from x, empty; then you'll get 0 results, unless you do an outer join of some sort. Unfortunately, it's somewhat difficult to do this in 1.9. I've tried many iterations of things like WITH collect(n) as n, etc., but it boils down to the cartesian product thing at so

Categories : Neo4j

Neo4j : Retrieving All Nodes and Relationship connected to a Node in Neo4j Rest OR through Cypher
It's easy to get all nodes connected to a given node with Cypher START a=node(3) MATCH (a)-[:KNOWS*]->(d) RETURN distinct d But if you have large number of connected nodes and deep connections, you might not get a good performance. If you know the bounds of the connections, specify it explicitly in the query would be helpful for performance, START a=node(3) MATCH (a)-[:KNOWS*1..3]->(d) RETURN Distinct d

Categories : Java

Cant edit neo4j.properties file on Azure hosted neo4j instance
The images in VM Depot are Linux-based, which require you to connect via ssh. And the link you provided, referencing putty, is a good one to work from, as putty runs on Windows and provides an ssh-based terminal for you. When you launched your VM instance, ssh should have been set up for you. Assuming you only have one virtual machine in your cloud service, the port should have defaulted to 22, but you can check it in the Azure portal, under the Dashboard for your virtual machine (look at the Quick Glance data on the right). Ok, assuming you've connected: The neo4j image provided by Neo Technology has its configuration files located in /etc/neo4j, including neo4j.properties: You'll need to use a text-based editor (such as nano) to edit the file. I'd suggest you post a separate question

Categories : Ubuntu

Will IsConstructedGenericType always be the negation of IsGenericTypeDefinition, for a generic type?
Yes this is correct. Assuming that the Type in question is a generic type, exactly one of IsGenericTypeDefinition or IsConstructedGenericType is true. We can easily from the reference source for RuntimeType (which is the concrete implementation of Type you get when you do GetType() or typeof) why this is the case: public override bool IsConstructedGenericType { get { return IsGenericType && !IsGenericTypeDefinition; } }

Categories : C#

Negation operator logic not making sense
That if statement only checks to see if origin exists, and if origin does not exist, it allocates and initializes origin, before setting the values to the values from the method argument. Basically it's a convenience method. The first time you call it, the origin is created if needed, then set to the arg. If origin exists then it just proceeds to do the setting.

Categories : Objective C

Why negation of number (~ operator) in php gives such strange results?
The operator ~ computes the two's-complement of a number. You can find more information about what is the two's complement and how to compute it on wikipedia.

Categories : PHP

Neo4j on Mac: Prevent org.neo4j.server.Bootstrapper from appearing in dock
Go to the conf file and open neo4j-wrapper.conf (you find it from brew info neo4j look after /usr/local/Cellar/neo4j/community-1.9-unix/libexec check /usr/local/Cellar/neo4j/community-1.9-unix/libexec/conf/neo4j-wrapper.conf open .) And open up the neo4jwrapperfile Before (Should be row 8 and 9) wrapper.java.additional=-XX:+UseConcMarkSweepGC wrapper.java.additional=-XX:+CMSClassUnloadingEnabled Add this: wrapper.java.additional=-Djava.awt.headless=true to to conf/neo4j-wrapper.conf Good luck!

Categories : Java

Neo4j and spring-data: numeric index cypher queries not working?
Numeric index lookups don't work from cypher with literal values, the lucene parser doesn't create the correct internal queries. Also with parameters, normal primitive values passed to the index are treated as strings in the neo4j lucene implementation as the query cannot know if the data was indexed numerically or as string. // this won't work, you have to remove the single quotes around '{childId}' "START child=node:Principal(accountId='{childId}') " + "MATCH child-[r:IS_MEMBER_OF]->parent " + "RETURN count(r)", MapUtil.map("childId", accountId)).singleOrNull(); The only way you get numeric queries to work with cypher is to pass in a ValueContext.numeric(1) value as parameter in a java-parameter-map to an embedded database.

Categories : Neo4j

Add properties to relationships in a neo4j database using neo4j-OGM in PHP
There is no direct way to do it through the API at this time. While there is some work in progress, it is quite far from completed. You can register a callback on relation creation. $em->registerEvent(HireVoiceNeo4jEntityManager::RELATION_CREATE, function ($type, $relationName, $from, $to, $relation) { // $relation is the EverymanNeo4jRelationship if ($relationName === 'GOES_TO_MARKET') { $relation->setProperty('foobar', 'baz')->save(); } });

Categories : PHP

org.neo4j.kernel.lifecycle.LifecycleException in Neo4j
It seems that your data directory is corrupt. There is already a suggestion printed to the log to fix that issue: Unable to start TM, no active tx log file found but found either tm_tx_log.1 or tm_tx_log.2 file, please set one of them as active or remove them.

Categories : Eclipse

Map stringified regexp to RegExp
If you have to store the regex as a single string (including all flags), you can use a regex to split the regex into the parts you need to pass to new RegExp (well, that was a sentence...): > regex = /^/(.*)/?$/i; /^/(.*)/?$/i > str = regex.toString() "/^/(.*)/?$/i" > m = str.match(/^[/](.*)[/]([^/]*)$/) ["/^/(.*)/?$/i", "^/(.*)/?$", "i"] > newRegex = new RegExp(m[1], m[2]) /^/(.*)/?$/i The regex matches /, then captures as much as possible, then matches the closing / and captures possible flags. Alternatively, if you can store it across multiple fields in your database, store the source string and three booleans for the three flags separately: > regex = /^/(.*)/?$/i; /^/(.*)/?$/i > regex.source "^/(.*)/?$" > regex.global false > regex.ignoreCase true > rege

Categories : Javascript

Set a mode from regexp to regexp?
The key functions are mumamo-possible-chunk-forward in combination with mumamo-chunk-start-fw-re andmumamo-chunk-end-fw-re - the latter two do the regexp matching. The following does the trick: (defun regexp-chunk-start (pos max) (let ((where (mumamo-chunk-start-fw-re pos max "math: "))) (when where (list where 'latex-mode)))) (defun regexp-chunk-end (pos max) (save-match-data (mumamo-chunk-end-fw-re pos max "\.\."))) (defun mumamo-quick-regexp-chunk (pos min max) (save-match-data (mumamo-possible-chunk-forward pos max 'regexp-chunk-start 'regexp-chunk-end))) (defun rst-bk-latex-directive (pos min max) "Find math chunks. Return range and 'latex-m

Categories : Emacs

Cannot Access Database Created with Neo4j Embedded Server on Neo4j Standalone Server
I suspect the problem is an issue with relative/absolute paths, meaning you might think it points to the right directory but actually it created an empty database somewhere else. If that's the case, just change your directory settings. As a temporary fix, you can always keep the default settings and just copy your embedded db into the data/graph.db folder. That always works for me. Checking your path, the thing you need to look for is a leading slash. A leading slash indicates an absolute path, whereas the lack of one indicates a path relative to the main server directory which is the directory that contains conf, bin, data, ... Also, if you typed in the line yourself, check for typos. The correct syntax is: org.neo4j.server.database.location=/this/is/an/absolute/path or else this : o

Categories : Ruby

Implmenting unary subtraction, negation, minus operator, "operator-" in class
The unary operator takes exactly one argument (hence the unary). If you want to implement it as non-member function you could define it like this: inline cents operator-(cents const& value) { return cents(-value.m_cents); } Of course, the signature of the friend declaration needs to match the definition.

Categories : C++

neo4j does not start with Neo4j.bat
The error translates to "cannot find the path specified." With that, you'll find a few posts, such as this one, discussing the problem. The answer involves a few things: Removing in from JAVA_HOME and JRE_HOME Making sure the bin path is in your path changing base.bat to windows-service-wrapper-4.jar instead of windows-service-wrapper-*.jar This is all outlined in the Windows 7 installation video found here.

Categories : Windows

Neo4j vs (Neo4j + Postgres)
I read that you are developing a recommender engine on top of neo4j. Could you have a look to Reco4J, it is an open source recommendation framework based on graph database, that has an implementation fro Neo4J. Have a look and let me know if you could be interested into it, since there we are resolving scalability issue with several of our customers. Cheers, Alessandro

Categories : Database

Regexp [xyz] vs. [x|y|z]
[xyz] matches just three characters - x, y, z. It's same as (x|y|z) [x|y|z] matches 4 characters - x, y, z, |. It's same as (x|y|z||) Note that pipe(|) has no special significance inside a Character Class.

Categories : Regex

What does RegExp.$1 do
$1 will return the first group that matches a regular expression. In your example, the value stored in $1 is whatever was matching .+ The group is denoted by parenthesis and you can have multiples. Each saved group will just increment the digit with the $, i.e. $1, $2, $3... Example: If your input was __product[Version 12 Coupe] then $1 would contain Version 12 Coupe

Categories : Javascript

What's regexp `^(.*) 1$` mean?
The patterns inside parentheses () are called capture groups. The 1 means "whatever matched the first capture group". Here's a character by character breakdown: ^ - matches the beginning of the input ( - begin capture group (the `(` character must be escaped with a backslash) .* - zero or more characters ) - end capture group - newline character 1 - the text "captured" by the first capture group $ - matches the end of the input

Categories : Regex

regexp in php str_replace
preg_replace just works as str_replace: $new_string = preg_replace($pattern, $replacement, $old_string); The pattern in your case would be "@srcs*=@i" (s* covers zero to infinite whitespaces, @ is just one out of different possible delimeters the pattern requires, i (after the last delimiter) makes the pattern case insensitive.)

Categories : PHP

How to use foreach for using regexp
Your regexp is evaluating first and regexp {[cell]+} $searched match returns 1, which then becomes: [1] Which is an invalid command. Remove the square brackets: regexp {[cell]+} $searched match Now, I don't think you're using the regexp correctly. This will look for any of the combinations c, e and l at least one time, meaning it'll accept cell, lec or even c alone. You probably want: regexp {((?:cell)+)} $searched match matched This will match cell, cellcell, cellcellcell and so on and store it in the variable matched. Brackets are used to capture matching groups; and these (?: ...) are for non capturing groups. EDIT: Following on my comment, I would do something like: set newlist [list] foreach searched $names { regexp {cells*("([^"]+)")} $searched match matched lappend

Categories : Regex

3 Regexp Patterns into one
You shouldn't really be using regular expression to parse HTML. You could use some parser, such as the PHP Simple DOM Parser to do that, for the same reason @Marty Wallace suggested. Also, your regular expressions are already relatively complex as they are, trying to merge them will only make it a maintenance nightmare.

Categories : PHP

php regexp last match
You can use regex pattern with negative lookahead (?!…) </p>(?!.*</p>) Example: http://www.debuggex.com/r/rgV-ddCbL-BH_rL_/0

Categories : PHP

Regexp for preg_replace in PHP
you can use this: $subject = <<<LOD F7998FM3213/02F J442554NM/05 K439459845/34D K439459845/34D34 LOD; echo preg_replace('~^[^/]*+/K|[^d ]++~m', '', $subject); explanation: The regex is an alternation between two things: You match the begining until you encounter / included the part after the / that is all that is not a digit or a new line one or more times Since the begining of the string is checked at first, all non digit characters are removed after the /

Categories : PHP

Regexp OR operator
in your case the simple quantifier ? for zero or one should work. ^page/([^/]*)/([^/]*)(?:/([^/]*))? ## # Edit: You also might look for a non-matching group so that you can quantify it as optional. It starts with ?:.

Categories : PHP

Regexp in Ant does not find anything
And just as I had posted this, I found the answer: <replaceregexp match="foobar&quot;&gt;(.*)&lt;" replace=foobar&quot;&gt; New text &lt;"> <fileset dir="${install.path}app_data" includes="Header.htm"/> </replaceregexp>

Categories : Ant

ext js 3.4 RegExp filtering
That's not the way RegExp work. That should be: (new RegExp(productValue)).test(item.get('Name')) See the doc for RegExp, and its test method. Note the regex will match anywhere if you don't add ^ (beginning) or $ (end) markers, so you don't have to add '.*'. Now, for this simple test, you'd only need to do: item.get('Name').indexOf(productValue) !== -1

Categories : Regex

Is there any regexp replacement?
As far as I'm concerned regexes are actually quite high-level already. They're obtuse for sure and the learning curve is steep, but it's short: you can read everything you need to know about a regex flavor on one HTML page, which certainly isn't true for e.g. Python. So if you have a regex but it's making you feel like your brain is leaking out your ears and you'd be a lot happier if it was just more explicit, I'd go down a level, not up. Writing some kind of state machine instead of just using pattern matching may even clarify your logic.

Categories : Javascript

Use RegExp to read value from xml
It is not recommended to parse XML with regular expressions. Use an XML parser instead. Basic example with jQuery (obviously requires jQuery): var xml = "<music><album>Beethoven</album></music>"; var result = $(xml).find("album").text(); Example using browser's built in DOM: <!DOCTYPE html> <html> <body> <script> text = "<bookstore><book>"; text = text + "<title>Galapagos</title>"; text = text + "<author>Kurt Vonnegut</author>"; text = text + "<year>1985</year>"; text = text + "</book></bookstore>"; var xmlDoc, bookTitle; if (window.DOMParser) { parser = new DOMParser(

Categories : Javascript



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