FAQ Database Discussion Community


Java: make prefix tree remember last value that was not null

java,tree,prefix,trie
I have code for prefix tree (Trie) like this: public class Trie<V> { Entry<V> entry; char key; Map<Character, Trie<V>> childrens; public Trie() { this.childrens = new HashMap<Character, Trie<V>>(10); entry = new Entry<V>(); } /** non-public, used by _put() */ Trie(char key) { this.childrens = new HashMap<Character, Trie<V>>(10); this.key = key;...

getting java.lang.OutOfMemory error with my prefix expression evaluator

java,stack,prefix,evaluator
Below i have the code for evaluating a prefix expression. I first read the expression into inputArray which allows me to read from right to left, then use evaluationArray to do the operations. I get out of memory error on this line: evaluationStack.push(number); I have no idea why this is...

ubuntu, installation of a library, what to write in prefix and in environment variable

ubuntu,installation,environment-variables,ubuntu-14.04,prefix
I have recently started using ubuntu. I am installing linbox library: http://www.linalg.org/developer.html. The installation guide states that one should install several libraries, including fflas-ffpack library, and then run the script autogen.sh, optionally specifying the installation prefix: cd linbox ./autogen.sh [--prefix=] [options]. [options] include --with-fflas-ffpack=, which, according to the installation guide,...

Preprocessor Stringizing Operator with String Literal Prefixes

c++,macros,prefix,string-literals,stringize
So I want to do the traditional thing to do with the stringizing operator in a macro: #define FOO(x) foo(#x, (x)) However I need to use a string literal prefix: http://en.cppreference.com/w/cpp/language/string_literal Which is a problem because if I need a UTF-32 string literal I try to do this: #define FOO(x)...

Correct Postgres full text search indexes

ruby-on-rails,postgresql,heroku,full-text-search,prefix
I'm creating a multi-column full text search index and currently I have this running CREATE INDEX products_search_document ON products USING gin(to_tsvector('english', style_number || ' ' || brand || ' ' || style_description || ' ' || color)); This works great for queries that I'm using like this SELECT * FROM...

What CSS prefixes for properties I should use? [closed]

css,properties,prefix,use
If I want to use box-shadow for example which prefix I need to add after the simple box-shadow property? I read which browsers supports it, but I also got these prefixes: -moz- -webkit- -apple- -o- -xv- -ms- -mso- -atsc- -wap- -khtml- -prince- -ah- -hp- -ro- -rim- -tc- So which of...

Default values for CMAKE_FIND_LIBRARY_PREFIXES/CMAKE_FIND_LIBRARY_SUFFIXES

cmake,prefix,platform,defaults
i guess i'm missing something very obvious here, but it seems to me that the cmake variables CMAKE_FIND_LIBRARY_PREFIXES/CMAKE_FIND_LIBRARY_SUFFIXES are not set to any "decent" default value depending on the current system/settings! i've checked the cmake docs and google, but there seems nothing about it really. for example, a simple CMakeLists.txt...

Grep string start with . or whitespace

bash,grep,prefix
I'm running a script that get an argument $1 I want to find all strings that start with either space or . before that argument. and end with either . or % ex: if $1 is Table1 then 1) "Table1" 2) " Table1" 3) ".Table1" 4) "Table1." 5) ".Table1." 6)...

.htaccess redirect rule same domain but different prefix

.htaccess,rewrite,prefix
I need to redirect following url admin.example.us to myadmin.example.us I have tried different examples using RewriteBase, RewriteRule, RewriteCond. Nothing quite fits my case and my regex seems to fail. Thank you for your help...

Is there a Prefix Header (or something with this functionality) in Swift?

swift,import,header,prefix
Is there a way to get the functionality of a prefix header in Swift? I donĀ“t want to import external libs in every file where they are used.

limit the query exactly with 8 and 7 digits in javascript

javascript,html,prefix
i have a little question: how i can limit or generate the result of a query in 7 or 8 digits example: var x = 3143284294 var y = 387520525892 var z = -7632489234892 var w = 34563 result: var x = 3143284 var y = 3875205 var z =...

Prefix - something wrong in configuration

ios,objective-c,xcode,cocoapods,prefix
I created a new project 2 hours ago. Configured it the same way as my old (different) project, where everything is working. In my podfile I have: pod 'CocoaLumberjack', '2.0.0-rc2' If I import in AppDelegate: #import <CocoaLumberjack/CocoaLumberjack.h> everything is working fine. No errors. I can write code (DDLogs etc) and...

Trigger by suffix from same element class

javascript,jquery,triggers,correlation,prefix
I want make every button which have suffix class -dummy (let's call it "dummy") to trigger another button who have same class but without that suffix (call it "real button"). <button class="btn-submit hidden"> triggered by <button class="btn-submit-dummy"> <button class="btn-edit hidden"> triggered by <button class="btn-edit-dummy"> <button class="btn-delete"> triggered by nothing since...

Prefix in Prolog

list,prolog,prefix
I'm new in Prolog. I have a problem about predicate prefix but a little bit different. I want to get a prefix of a list but until an element The list can have repeat elements. An example: prefix(Element, List, Prefix) prefix(c, [a,b,c,d,e,f], [a, b]) The element is not included. What...

Fitting string literals for different string classes

string,templates,c++11,literals,prefix
The problem I am implementing a class where I want to let the user choose the string type (std::string, std::wstring, std::u16string, ...) via a template parameter. I currently fail to make the string literals fit the chosen string type: Once I decide for a literal prefix ("hello" vs. L"hello" vs....

How can I strip namespaces out of an lxml tree?

python,xml,lxml,xml-namespaces,prefix
Following on from Removing child elements in XML using python ... Thanks to @Tichodroma, I have this code: If you can use lxml, try this: import lxml.etree tree = lxml.etree.parse("leg.xml") for dog in tree.xpath("//Leg1:Dog", namespaces={"Leg1": "http://what.not"}): parent = dog.xpath("..")[0] parent.remove(dog) parent.text = None tree.write("leg.out.xml") Now leg.out.xml looks like this: <?xml...