Posts

asp.net mvc client side validation using jQuery -

does asp.net mvc client side validation using jquery work views which use html helpers generate html controls? work standard html controls? it possible use validation without turning htmlhelpers. see article details how mvc works in background unobtrusive validation. http://www.blinkingcaret.com/2016/03/23/manually-use-mvc-client-side-validation/ though think unless have specific requirement, rather stick helpers, make life easier.

java - Scanner is skipping nextLine() after using next(), nextInt() or other nextFoo()? -

i using scanner methods nextint() , nextline() reading input. basically, looks this: system.out.println("enter numerical value"); int option; option = input.nextint();//read numerical value input system.out.println("enter 1st string"); string string1 = input.nextline();//read 1st string (this skipped) system.out.println("enter 2nd string"); string string2 = input.nextline();//read 2nd string (this appears right after reading numerical value) the problem after entering numerical value, first input.nextline() skipped , second input.nextline() executed, output looks this: enter numerical value 3 //this input enter 1st string //the program supposed stop here , wait input, skipped enter 2nd string //and line executed , waits input i tested application , looks problem lies in using input.nextint() . if delete it, both string1 = input.nextline() , string2 = input.nextline() executed want them be. that's because scanner...

python - Catch all routes for Flask -

this question has answer here: python - flask default route possible? 1 answer i'm using flask react. i'd create catch route similar (although doesn't work): @app.route('*') def get(): return render_template('index.html') since app use react , it's using index.html mount react components, i'd every route request point index.html page in templates. there way (or using redirect best way)? you can follow guideline: http://flask.pocoo.org/snippets/57/ from flask import flask app = flask(__name__) @app.route('/', defaults={'path': ''}) @app.route('/<path:path>') def catch_all(path): return 'you want path: %s' % path if __name__ == '__main__': app.run()

c++ - Cmake linking error CLion -

i making nana project when try link cmake in clion maybe bug cmake file project(nanagui) cmake_minimum_required(version 2.9) set(cmake_cxx_standard 17) set(source_files main.cpp) set(nana_include nana) set(nana_filesystem_force 1) set(nana_library_d libnana_d.a) include_directories(include) add_executable(nanagui ${source_files}) #add_library(nana_library_d libnana_d.a) #set (cmake_exe_linker_flags -l libnana_d.a ) target_link_libraries(nanagui "${nana_library_d}") and error "c:\program files\cmake\bin\cmake.exe" --build c:\users\arllk\clionprojects\nanagui\cmake-build-debug --target nanagui -- -j 2 [ 50%] building cxx object cmakefiles/nanagui.dir/main.cpp.obj [100%] linking cxx executable nanagui.exe c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/7.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibnana_d collect2.exe: error: ld returned 1 exit status mingw32-make.exe[3]: *** [cmakefiles\nanagui.dir\build.make:97: nanagui.exe] error 1 mingw32-ma...

android - Firebase return null value -

this structure: enter image description here wanna select company, phone , city email = current email of connected user. this code: databasereference mdatabases = firebasedatabase.getinstance().getreference(); query query = mdatabases.child("users").orderbychild("email").equalto(firebaseauth.getinstance().getcurrentuser().getemail().tostring()); query.addlistenerforsinglevalueevent(new valueeventlistener() { @override public void ondatachange(datasnapshot datasnapshot) { if (datasnapshot.exists()) { user user = datasnapshot.getvalue(user.class); string company = user.getcompany(); string city = user.getcity); } } @override public void oncancelled(databaseerror databaseerror) { } }); the returned result null. when change datasnapshot.getvalue(user.class) datasnapshot.getvalue() , return values of node. you haven't indicated user want retrieve. datasnapshot re...

javascript - Update nav bar links to active and smooth scrolling -

i trying implement nav bar list of <a> tag navigate different part of current page , tag should change class active when user scrolling through page. not sure best way implement on vue app not want use bootstrap jquery on it. i found framework agnostic library: https://github.com/cferdinandi/gumshoe , smooth scrolling works, anchor tags not being set active. tried couple of other libraries implement updating of active no avail. so not sure if setting external libraries correctly in vue. what did include in index.html <body> <div id="app"></div> <!-- built files auto injected --> <script src="static/js/gumshoe.js"> </script> <script src="static/js/smooth-scroll.min.js"> </script> <script> smoothscroll.init({ offset: 20 }); gumshoe.init(); </script> </body> usage <ul class="nav-right-items" data-gumshoe> <li class=...

python - Why it my serializer does not recognize all fields when I send a json? -

Image
hello i'm working endpoint using django + django rest framework, endpoint must receive array objects file in every object , once received file sent amazon s3. note: using python-cassandra driver. my object is: class archivo(usertype): tipo_documento = columns.text() llave_s3 = columns.text() bucket = columns.text() tipo_contenido = columns.text() subido = columns.datetime() class laboratorio(model): certificado = columns.set(columns.userdefinedtype(cassandra_types.prueba)) foto = columns.userdefinedtype(cassandra_types.archivo) equipamiento = columns.userdefinedtype(cassandra_types.equipo) and serializers: class pruebaserializer(serializers.serializer): nombre = serializers.charfield() organismo = serializers.charfield() costo = serializers.floatfield() numero = serializers.charfield() norma = serializers.charfield() archivo = serializers.filefield(write_only=true, required=fa...