Posts

Featured post

python - Skip/pass over view function so the next can execute in Flask -

i have flask app has following: @app.route('/') def home(): return "homepage" @app.route('/<slug>') def feature(slug): return "feature: " + slug @app.route('/<path:url>') def catch(url): return "catch: " + url this works in in following true: get / => "homepage" get /test1 => "feature: test1" get /test/2 => "catch: test/2" eventually, database driven. features, retrieved , displayed based on slug. catch , they'll loaded database , may result in behaviour such redirect, or return 404. none of problem. my question this: in /test1 example, i'd achieve following behaviour: attempt load database slug matches test1 if exists, fine. display. if not exist, i'd "fall through" catch view function. point 3 part don't know how achieve. seems ought exist, can't find kind of "fall through next matching view function&q

expression - bash variable evaluating with quote for special character -

below simple bash script test few password in rar file. when password contains special character (!), see option (-p) parsed quote ('). #!/bin/bash -x pwd=`echo sei{0..9}{0..9}b{0..9}axq!zx` #pwd=sei03b4axq!zx file="test.rar" eachpwd in $pwd eval unrar x "$file" -p"$eachpwd" id 2>/dev/null 1>/dev/null c=$? if [ $c = 0 ] echo "success" exit fi echo $eachpwd $c done output + eachpwd in '$pwd' + eval unrar x test.rar '-psei49b4axq!zx' id + c=10 + '[' 10 = 0 ']' + echo 'sei49b4axq!zx' 10 question how code such that, during eval not unrar x test.rar '-psei49b4axq!zx' id instead unrar x test.rar -psei49b4axq!zx id evaluated expression update 1 tried below code, still quote(!) on -p option refuses budge. passwords=( sei{0..9}{0..9}b{0..9}axq!zx ) file=test.rar password in "${passwords[@]}"; if unrar x "$file" -

c# - Connection String Trouble MetaDataException -

i got 2 models in project. when added second models got error in account page: system.data.metadataexception: specified schema not valid. errors: (8.6): error 0040: nclob type not qualified namespace or alias. primitive types can used without qualification. @ line 34 of `initializesimplemembershipattribute.cs` : using (var context = new userscontext()) ligne 33 : { ligne 34 : if (!context.database.exists()) ligne 35 : { ligne 36 : // create simplemembership database without entity framework migration schema and connection string : <connectionstrings> <add name="defaultconnection" connectionstring="user id=devart;password=1234;data source=localhost:1521" providername="devart.data.oracle" /> <add name="entities" connectionstring="metadata=res://*/models.modelmae.csdl|res://*/models.modelmae.ssdl|res://*/models

html - jQuery appending multiple line string -

i'm trying append string html element. works fine when it's 1 line string, when try break apart stops working. <div><h4 >list do:</h4><span id="added"></span></div> this doesn't work: var addtext = "<ol> <li>item1</li> <li>item2</li> </ol>" $("span#added").html(addtext); can make work. want add lot of html code, , i'd readable? try : var addtext = "<ol>\ <li>item1</li>\ <li>item2</li>\ </ol>";

ruby - How does Domino deal with a dashed class name -

i'm attempting create , use domino abstract login page describe :index, :type => :request before visit '/' blah_email_login('user1') end ... def blah_email_login(user) dom::email_link.find_by_name 'mail'.click .... end module dom class email_link < domino selector 'a' attribute :tab-label end here html <a class="tab-label fz-xs accent " href="https://mail.blah.com/..." id="blah"><span class="tab-icon img-sprite"></span><em class="strong tab-link-txt y-link-1 " title="mail">mail</em></a> the process cannot take dash indicated error pre run c:\blah.rb:93:in `<class:email_link>': undefined local variable or method `label' dom::email_link:class (nameerror) when attempted alter attribute to attribute :'tab-label' i got ... c:/railsinstaller/ruby1.9.3/lib/ruby/gems/1.9.1/gems/domino-0.5.0/lib/

c++ - auto vectorization - array reduction -

i'm trying vectorize simple reduction loop: #ifndef poissonsolverjacobi_hpp #define poissonsolverjacobi_hpp #include <stdlib.h> class p{ public: p(); void iterate(); protected: float* m_func; unsigned int m_maxit; }; p::p(){ m_func=(float*)calloc(5000,sizeof(float)); m_maxit=5000; } void p::iterate(){ float err(0.); for(unsigned int i(0);i< m_maxit;i++){ err+=m_func[i]; } } #endif using following compiling command gcc 4.6.3 -march=x86_64: g++ -c -o3 -msse2 -ftree-vectorizer-verbose=2 -fassociative-math -funsafe-math-optimizations could me point out why fails?

openssl - SSL convert url to .crt -

how can convert url .crt file? https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 please not perl. have openssl & jvakeyutil want create truststore.jks http://curl.haxx.se/docs/caextract.html has want. contains data converted in format want. if want convert data @ source code of mk-ca-bundle perl program used create converted data.