Posts

Showing posts from August, 2014

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...

arrays - javascript indexOf() keeps returning -1 -

i have array this var = [[1, 0], [3, 0], [5, 0], [7, 0]]; i running simple line of indexof() . however, keep getting -1 although test value i'm using exist in array. var = a.indexof([1, 0]); console.log("index: ", i); did make mistake somewhere ? you can use #findindex() , #every() find index of inner array inside outer array - see demo below: var = [[1, 0], [3, 0], [5, 0], [7, 0]]; var search = [1,0]; // array index of 'a' var = a.findindex(function(n) { return search.every(function(p,q) { return p === n[q] }); }); console.log("index: ", i); and simpler es6 flavor: var = [[1, 0], [3, 0], [5, 0], [7, 0]]; var search = [1, 0]; // array index of 'a' var = a.findindex(n => search.every((p, q) => p === n[q])); console.log("index: ", i);

javascript - Webkit overflow scolling touch cannot applied on element that have function load -

i have problem week ago -webkit-overflow-scrolling: touch added on element have load function. tried lot can't. dont know problem issue or not. details problem : give example understanded example : <div id="scroll" style="max-height:100px; overflow-y:auto; -webkit-overflow-scrolling: touch"> <ul> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> <li>lorem ipsum dolor sit amet</li> </ul> </div> <script> window.onload = example(); function example(...

java - TabLayout setText() and setIcon() not working properly with custom view -

i building tab layout custom text , icon. tab layout setup viewpager. followed reference setting custom view. https://developer.android.com/reference/android/support/design/widget/tablayout.tab.html#setcustomview(android.view.view) but text , icon not updating when set settext() , seticon(). custom_tab.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"> <textview android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="top" android:textcolor="#ffffff" android:textsize="10dp" /> <imageview android:id="@+id/icon" android...

c++ - Why is my LLVM JIT implementation segfaulting? -

i'm trying implement simple jit compiler using llvm, following along tutorial ( http://releases.llvm.org/4.0.1/docs/tutorial/buildingajit1.html ), , i'm running segfault. i've rewritten code in form minimal (albeit still kinda long) example. example loops through integers 0 through 9 , each 1 attempts compile function prints integer, add module, execute function, , remove module jit. simulate interactive session in user inputs commands such print 0 , print 1 , etc. #include <array> #include <cstdint> #include <iostream> #include <llvm/executionengine/executionengine.h> #include <llvm/executionengine/jitsymbol.h> #include <llvm/executionengine/orc/compileutils.h> #include <llvm/executionengine/orc/ircompilelayer.h> #include <llvm/executionengine/orc/lambdaresolver.h> #include <llvm/executionengine/orc/objectlinkinglayer.h> #include <llvm/executionengine/sectionmemorymanager.h> #include <llvm/executioneng...

c# - will RegularExpressionAttribute and other validators on Automatic properties work? -

i'm using xsd2code generating classes schema. how ever i'm suspicious auto properties can validate values or not? because if enable automaticproperties in xsd2code here member regex restriction. [system.xml.serialization.xmlattributeattribute(datatype="token", attributename="color")] [system.componentmodel.dataannotations.regularexpressionattribute("#[\\da-f]{6}([\\da-f][\\da-f])?")] public string color { get; set; } and when automaticproperties disabled [system.xml.serialization.xmlattributeattribute(datatype="token", attributename="color")] [system.componentmodel.dataannotations.regularexpressionattribute("#[\\da-f]{6}([\\da-f][\\da-f])?")] public string color { { return this._color; } set { system.componentmodel.dataannotations.validationcontext validatorpropcontext = new system.componentmodel.dataannotations.validationcontext(this, null, null); validatorprop...

c - Why is fseek or fflush always required between reading and writing in the update modes? -

q: i'm trying update file in place, using fopen mode "r+" , reading string, , writing modified string, it's not working. a: sure call fseek before write, both seek beginning of string you're trying overwrite, , because fseek or fflush required between reading , writing in read/write "+" modes. my question why fseek or fflush required between reading , writing in read/write "+" modes? section 5.2 of andrew koenig's c traps , pitfalls (1989) mentioned because of backward compatibility issue. can explain in detail? the library buffers input , output operations. check out setvbuf() , _iofbf, _iolbf parameters funktion. fseek() or fflush() require library commit buffered operations. standard specifies seek or flush operation mandatory allow library shortcuts; otherwise, every i/o operation, lib have check if previous operation read op (or write op), , trigger flush if "direction"...

python - Reading Text from file and sending to GSM Module through Arduino -

i trying read strings off text file stored in pc. gsm module sim900a using python read following line contained in text file: at+cmgs=\"+9232xxxxxxxx\"\r this line contains @ command , phone number want send sms. the python code follows: import serial import time arduino = serial.serial("com3",9600,timeout = 5) time.sleep(2) = 0 while(i<1): arduino.flush() text_file = open("data.txt","r") line1 = text_file.readline() arduino.write(line1) time.sleep(1) = + 1 exit() text_file.close() the arduino code follows: #include <softwareserial.h> softwareserial myserial(7, 8); int counter = 0; string msg1; string numb = "at+cmgs=\"+9232xxxxxxxx\"\r"; void setup() { myserial.begin(9600); serial.begin(9600); delay(100); } void loop() { while (!serial.available()) {} // wait data arrive // serial read section while (serial.available()) { if(serial.available()>0) { msg1 = s...

wordpress - how to make the .htaccess rule work for specified domain ,subdomain or addons -

this cpanel directory structure: public_html |--->wordpress installed sudomain-directory |--->wordpress installed addon-domain |--->wordpress installed what have done: based on user choice passwd , .htaccess file created respective domains inside wp-admin directory .htaccess file authname "member only" authtype basic authuserfile /home/taragurung/public_html/wp-admin/.passfile require valid-user now when user try access www.somedomain.com/wp-admin authentication pop , works expected. problem: problem works wp-admin not www.somedomain.com/wp-login to make work added <filesmatch "wp-login.php"> rule , created .htaccess in root directory but doing make rule apply domains , subdomains why didn't put in root directory: don't want rules implemented on subdomains , addon domains. want implemented on domains or sub-domain user choose to. i hope i've understood question correctly - want a...

java - Updating two tables sql -

i have table tblpurchase , tblsale want update quantities of both tables salesperson purchases thing seller create table tblpurchase( id int primary key, p_name varchar(50) , p_qty int, date varchar(50), cust_name varchar(50) ) the second table create table tblsale ( id int primary key, p_name varchar(50), p_qty varchar(50), ) now how can update tblpurchase on sale in tblsale? here stored procedure tried use want implement in java how it? create proc deduce @p_id int @p_quantity varchar(50) update tblpurchase set p_qty = p_qty - @p_quantity update tblsale set s_qty = s_qty + @p_quantity @p_id = @p_id i not going answer entirely, can give hint. create triggers gets triggered when there sale in tblsale...

Unable to use a working query in a SQL Server View: 'IS' not recognized '>' not recognized -

Image
i have query running if used directly string query: select bi.customer_code [customer code], bi.add_name customer, si.account_code [account code], bid.bill_no [bill #], bi.bill_date [bill date], bi.cashier_no [cashier #], c.location, bid.service_code [service code], si.name service, bid.fees [service fee], bid.requested_qty [requested quantity], bid.requested_qty * 10 [knowledge fee], bid.requested_qty * 10 [innovation fee], bid.item_tot + bid.requested_qty * 20 total, bid.requested_qty * bid.fees [total w/o gov. fee], iif(bi.remarks null, '', iif(len(bi.remarks) > 100, concat(left(bi.remarks, 100), '...'), bi.remarks)) [remarks] dbo.bill_info bi inner join dbo.bill_info_detail bid on bi.bill_no = bid.bill_no , bi.cashier_no = bid.cashier_no , bi.pay_mode = bid.pay_mode inner join dbo.cashier c on bi.cashier_no =...

Django to_field not working -

i have 2 tables roompricedetails , hoteldetails . roompricedetails has foreign key want point primary key field named hotel_id of hoteldetails . used to_field attribute this, seems going wrong where. shows me error valueerror: invalid literal int() base 10: 'bmh-1' . when try add hotel_id 'bmh-1' in roompricedetails . 'bmh-1'is hotel id in hoteldetails . if wrong best way make foreign key point hotel_id field in hoteldetails accept values. my models: class roompricedetails(models.model): room_type = models.charfield(max_length=255, primary_key=true) hotel = models.foreignkey(hoteldetails, to_field='hotel_id') price_per_day = models.positiveintegerfield(default=0) class hoteldetails(models.model): hotel_id = models.autofield(primary_key=true, db_column='hotel_id') name = models.charfield(max_length=255) email = models.charfield(max_length=255) reg_no = models.charfield(max_length=255) contact...

datatables - data table columns data not display in mobile -

i using datatables , working fine in desktop in mobile there no data load table. problem? here code: $('#users-table').datatable({ dom: 'bfrtip', buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ], scrolly: 300, destroy: true, processing: true, serverside: true, responsive:true, ajax: '/depart/get_datatable/', columns: [ { data: 'depart_name', name: 'departs.depart_name' }, { data: 'levels', name: 'departs.levels' }, { data: 'name', name: 'colleges.name' }, { data: 'action', name: 'action',searchable:false, sortable: false, classname: 'text-right' } ] }); the solution add cache :false ajax call ajax:{ url:......, cache:false }

asp.net - datalist eval passed to javascript not workig -

i passing eval value datalist javascript function not passed. "first_name" not passed when passed "job_id" parameter display value. how can pass "first_name". below code: <%@ page language="c#" autoeventwireup="true" codefile="test.aspx.cs" inherits="test" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>jquery ui autocomplete - multiple values</title> <script type="text/javascript"> function showmodalpopup(name) { alert(name); return false; } </script> </head> <body style="margin: 0px 0px 0px 0px;"> <form id="form1" runat="server"> <div style="width: 100%;"> <asp:datalist id="dljobs" runat="server" repeatdirection=...

php - Symfony2 Forms Error: Warning: spl_object_hash() expects parameter 1 to be object, array given -

and day comes when need ask help: i have problem forms in symfony2.8. \form\bookordertype.php class bookordertype extends abstracttype { /** * {@inheritdoc} */ public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('customer', customertype::class) ->add('event', entitytype::class, array( 'class' => 'appbundle:event', 'choice_label' => 'name' )) ->add('ticket', tickettype::class) ->add('add', submittype::class) ->getform() ; } /** * {@inheritdoc} */ public function configureoptions(optionsresolver $resolver) { $resolver->setdefaults(array( 'data_class' => 'appbundle\entity\bookorder' )); } /** * {@inheritdoc} */ public fu...

postgresql - Vacuum analyze after huge deleting of rows not freeing space in postgres -

i delete huge amount of rows in our postgres database , ran vacuum analyze later on. i noticed disk usage did not moved in aws rds console. tried running query, based on table size did not move well. select *, pg_size_pretty(total_bytes) total , pg_size_pretty(index_bytes) index , pg_size_pretty(toast_bytes) toast , pg_size_pretty(table_bytes) table ( select *, total_bytes-index_bytes-coalesce(toast_bytes,0) table_bytes ( select c.oid,nspname table_schema, relname table_name , c.reltuples row_estimate , pg_total_relation_size(c.oid) total_bytes , pg_indexes_size(c.oid) index_bytes , pg_total_relation_size(reltoastrelid) toast_bytes pg_class c left join pg_namespace n on n.oid = c.relnamespace relkind = 'r' ) ) order total_bytes desc; is normal? or disk space not being reclaimed @ all? vacuum reclaims storage occupied dead tuples, is, marks space ins...

c++ - How to convert std::array to a class type -

i have below code need create array of object thru templated class. templated class receive class type: #include <iostream> #include <array> class b { public: b() {std::cout << "b called" <<std::endl;} b(int y){std::cout << "b int called" <<std::endl;} static const int mysize; }; const int b::mysize = 256; template <typename anotherclass> class : public anotherclass { public: a(){std::cout << "called" << std::endl;} static anotherclass* obj[anotherclass::mysize]; //static anotherclass[] init(); static std::array<anotherclass*,anotherclass::mysize> init(); }; template <typename anotherclass> std::array<anotherclass*, anotherclass::mysize> a<anotherclass>::init () { std::array<anotherclass*,256> objtemp[anotherclass::mysize]; (int = 0 ; < anotherclass::mysize; i++) { objtemp[i] = new anotherclass(2); } return ob...

Why is my https getter in Haskell so slow compared to curl? -

i'm writing simple https getter code in haskell. after response save file compression. version slow compared curl , gzip combination. how can make faster curl? details below. haskell code (fetcher.hs): import control.lens import qualified codec.compression.gzip gzip import qualified data.bytestring.lazy bl import network.wreq writeuribodytofile :: filepath -> string -> io() writeuribodytofile filepath uri = response <- uri let body = (response ^. responsebody) bl.writefile filepath (gzip.compress body) main :: io () main = writeuribodytofile "out.html.gz" "https://www.sahibinden.com/ilan/vasita-otomobil-seat-hatasiz-boyasiz-tramersiz-dsg-leon-469484363/detay/" haskell result: $ ghc -o fetcher fetcher.hs $ time ./fetcher real 0m9.240s user 0m8.840s sys 0m0.232s curl result: $ time curl "https://www.sahibinden.com/ilan/vasita-otomobil-seat-hatasiz-boyasiz-tramersiz-dsg-leon-469484363/detay/" | gzip > out.ht...

Android app doesn't work with mobile data connection -

my android app connected firebase database works when i'm connected internet via wi-fi doesn't work when i'm connected internet via mobile data <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.change_network_state"/> <uses-permission android:name="android.permission.access_network_state"/> <uses-permission android:name="android.permission.change_wifi_state"/> <uses-permission android:name="android.permission.access_wifi_state"/> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="android.permission.read_profile" /> <uses-permission android:name="android.permission.read_contacts" /> <!--<uses-permission android:name="android.permission.send_sms...

html - CSS Grid Systems: Purpose of positive padding simultaneously with negative margin? -

grid systems use code (or similar) snippet: .container { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; max-width: 1170px; } .row { margin-left: -15px; margin-right: -15px; } setting left-, right-padding can understand. prevents content touching viewport-edges when viewport becomes smaller. but in next becomes practically removed applying negative margin child-element (.row). that doesn't make sense me. what's purpose of pattern?

Boost-python installation issue for windows when tried pip install face_recognition -

python version: 3.5 32bit operating system: windows 7 description i trying pip install face_recognition , got error boost-python missing tried install boost-python rest frustration what did i have downloaded zip http://www.boost.org/users/history/version_1_64_0.html unpacked -> run bootstrap.bat tools/build folder , run command b2 -a --with-python address-model=32 toolset=msvc runtime-link=static build made c:\boost_build folder had set environment variables: set boost_root="path extracted folder root" path c:\boost_build folder\bin set in environment variable according instruction boost_librarydir cannot set missing set boost_librarydir="path extracted folder root \stage\lib" can please let me know can find boost_librarydir directory reference

entity framework - EF Core - Rewrite/Modify queries before sending to SQL Server or other providers -

is there way such thing? idbcommandinterceptor. example of use http://www.entityframework.info/home/fulltextsearch i found dependency injection not find examples , seems related ef core provider not providers. need on ef not on specific provider.

reactjs - During drag and drop if any component hover over the current component, the current component changes it's style.. This is not happening as expected? -

import react 'react'; import { finddomnode } 'react-dom'; import { droptarget } 'react-dnd'; import html5backend 'react-dnd-html5-backend'; let newstyle = {'display':'none','left':'0px'} ; let target = { hover(props,monitor,component){ newstyle.display = 'block'; newstyle.left = monitor.getclientoffset().x-finddomnode(component).getboundingclientrect().left+'px'; //the current mouse position "on hover indicator" expected return; }, drop(props, monitor,component) { newstyle.display = 'none'; newstyle.left = '0px'; return props; } } function collect(connect, monitor) { return { connectdroptarget: connect.droptarget(), }; } class component extends react.component { constructor(props){ super(props); } render = () => { const { connectdroptarget } = this.pro...

Shortest and most general way to convert base-10 integers to any base less than 10 ? (C++) -

i'm trying write function takes in 2 parameters: number converted , base of output number. based on code i've written, converts base-10 integers base-3, std::string decto3(int x) { std::string t; while (x != 0) { if (x % 3 == 0) t = "0" + t; else if ((x + 2) % 3 == 0) t = "1" + t; else t = "2" + t; x = floor(x / 3); } return t; } i've went on generalize base-n conversion (n<10) std::string decton(int x, int n) { std::string t; while (x != 0) { if (x%n == 0) t = "0" + t; else { (int = 1; < n;i++) { if ((x + n - i) % n == 0) t = ""+ + t; } } x = floor(x / n); } return t; } but none of tests i've made worked. code barely either returns "0" or nothing @ all. doing wrong here ? ...

c# - Deleting a message from Azure Queue Service by value -

i'm using azure storage queue service track queue of long running jobs en-queued multiple disparate clients, have requirement remove messages queue if exist matching given criteria. i realise anti-pattern queue, service provide functionality in addition simple queueing (such delete message , peek messages ) thought i'd try implement it. the solution i've come works, not elegant , quite inefficient - , i'm wondering if can done better - or if should bin whole approach , use mechanism supports requirement design (which require fair amount of work across different systems). here simplified code: var queue = methodthatgetstheappropriatequeuereference(); await queue.fetchattributesasync(); //populates current queue length if (queue.approximatemessagecount.hasvalue) { // messages , find messages removed. // makes messages unavailable other clients // visibilitytimeout period. // ...

plc - Pointer and reference behavour during online change -

could please me more information how pointers, references , interface references behave during online change? what have watch out for? understand other answers pointers may dangerous if these not written during each cycle, use interfaces , references. when online change made, variables, function blocks , other program parts may move in different memory location. therefore, if pointer address old information, might refer memory address containing else. so if pointers used, should updated regularly adr command, said. when using references , interfaces, don't see problems online change because system should handle them automatically. in twincat 3, system readdress variables automatically (source: https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_plc_intro/9007199390694027.html&id= ) , because codesys based, think same other systems. when using references, might idea check reference valid. in twincat 3 there function __isvalidref , should in...

java - Save Spark Launcher-Output to File -

i'm submitting jobs spark-cluster (with yarn) programmatically java-app , spark launcher (starting job startapplication(), not launch()). have log-output, produced on stdout und stderr launcher when executing java app, in file, can access java-app. don't want change global spark-log-config, want dynamic solution, can control depending on changing variables java-app on every single execution. following documentation should possible using child_process_logger_name option. defined java.util.logging.logger here , added code job-launcher: sparklauncher.setconfig(sparklauncher.child_process_logger_name, "mylog"); but doesn't work, logfile empty. tried other methods setconf(...) or add addsparkarg(...), without success. did wrong? or should better use log4j, make custom configuration, , give in way launcher? if yes, how in java-app? below code snippet have been using print sparklauncher logs slf4j-log4j: private static final logger logger = loggerf...

c# - How to pass collection from view to controller in asp.net MVC4 -

i want pass collection of skills id view controller action, have dropdownlist of skills : <select name="skills"> <option value="0">java</option> <option value="1">c++</option> <option value="2">fortran</option> <option value="3">asp</option> </select> i want user can select many skills dropdown , store value in collection ,i.e array, , post array action in controller follow [employee , skills have manytomany relationship]: [httppost] public actionresult addemp(employee emp ,ienumerable<skills> skills ) { dbctx db=new dbctx(); db.employees.add(emp); var emp_id=db.savechanges(); var employee=db.employees.find(emp_id); foreach(item in skills) { var skill = db.skills.find(item); employee.skills.add(skill); } db.savechanges(); return view(); } how can ...

SonarQube upgrade from 6.4 to 6.5 breaks the scanner -

i on sonarqube6.4 , have upgraded 6.5 sonar-scanner 3.0.3 now after upgrade scanner fails anytime there java file in source path. if don't scan java files works fine. however if rollback use 6.4 version, works fine, there regression? stack trace, when run scanner command -x command. mandate in 6.5 provided location of compiled classed, there way ignore it. 04:56:21.218 debug: sensors : javasquidsensor -> surefiresensor -> jacocosensor -> sonarjavaxmlfilesensor -> analyzer "php.ini" files -> 0 coverage sensor -> cpd block indexer 04:56:21.218 info: sensor javasquidsensor [java] 04:56:21.558 info: configured java source version (sonar.java.source): none 04:56:21.565 info: javaclasspath initialization 04:56:21.570 info: ------------------------------------------------------------------------ 04:56:21.571 info: execution failure 04:56:21.571 info: ------------------------------------------------------------------------ 04:56:21.571...

dictionary - Accelerated C++ header file not working -

i'm trying compile second exercise in chapter 7 written in book. created header file containing xref function: #pragma once #include <map> #include <string> #include <vector> #include "split.h" std::map<std::string, std::vector<int> > xref(std::istream&, std::vector<std::string> find_words(const std::string&) = split); afterwards wrote .cpp file: #include "xref.h" using namespace std; map<string, vector<int> > xref(istream& in, vector<string> find_words(const string&) = split) { ... } i cannot compile code, says parameter 1 not match. what's wrong? the error message says went wrong: should specify default parameter value in function declaration, whereas did again in function definition. error refers last parameter of function.

Qt 5.9 error eglfs with raspberry pi 3 -

i have compiled latest version of qt git 5.9.2 latest raspibian (2017-08-16-raspbian-stretch.img) sysroot. i have install library compile -opengl es2. compilation succeeded when run application have error : this application failed start because not find or load qt platform plugin "eglfs" in "". reinstalling application may fix problem. abandon i have necessary libs without unfound dependencies : pi@raspberrypi:~/testrpi $ ls -lisa /usr/local/qt5pi/plugins/platforms total 548 260886 4 drwxr-sr-x 2 root staff 4096 août 19 14:15 . 260882 4 drwxr-sr-x 8 root staff 4096 août 19 14:32 .. 260915 8 -rwxrwxr-x 1 root staff 6976 août 19 14:15 libqeglfs.so 260932 224 -rwxrwxr-x 1 root staff 228732 août 19 14:15 libqlinuxfb.so 260930 92 -rwxrwxr-x 1 root staff 90796 août 19 14:15 libqminimalegl.so 260888 24 -rwxrwxr-x 1 root staff 21472 août 19 14:15 libqminimal.so 260890 76 -rwxrwxr-x 1 root staff 74744 août 19 14:15 libqoffscr...

java - Typing game not working properly -

i working on typing game in java in worked on moving buttons....i wish when press key , specific button come on specific bounds of frame. not happening. can't understand reason. program not showing error not giving desired output. there should added in this? import java.awt.event.*; public class screen extends javax.swing.jframe implements keylistener { int x = 0; int y = 500; int x1 = 100; int x2 = 200; int x3 = 300; int x4 = 400; int y1 = 550; int y2 = 600; int y3 = 650; int y4 = 700; int rad = 50; public screen() { initcomponents(); setsize(1500, 800); setvisible(true); } void move1() { if (y < getheight()) y = y - 1; this.jbutton1.setbounds(x, y, rad, rad); if (y == 0) { x = 0; y = 500; this.jbutton1.setbounds(x, y, rad, rad); } if (y1 < getheight()) y1 = y1 - 1; this.jbutton2....

MySQL UPDATE statement works in query but not in PHP code -

when execute statement in phpmyadmin, works properly, when copy , paste exact same query php file, doesn't work. php code: if($_get['vote'] == 1) { echo "if statement ran"; $sql = "update raids set attendees = attendees +1 dateposted = '2017-08-19 16:15:46'"; mysql_query($sql, $link); } my link variable work , 'if' statement executes. other sql statements haven't given me trouble. why isn't php code incrementing 'attendees' when used in php code? as milan chheda said, mysql deprecated , no longer secure. use pdo or @ least mysqli instead. mysqli implementation code: //mysqli information $db_host = "localhost"; $db_username = "username"; $db_password = "password"; //connect mysqli database (host/username/password) $connection = mysqli_connect($db_host, $db_username, $db_password) or die("error " . mysqli_error()); ...

javascript - can't access to value tag for show data in jquery , mysql , php -

the below code jquery code: $(document).ready(function(){ $("#srchtxt").keyup(function(){ var addresshome = $("#srchtxt").val(); $.post("adrespath",{address:addresshome},function(res){ var json = json.parse(res); var lenths = json.length; for(var = 0;i <= lenths;i++) { var city = json[0]; var state = json[1]; var optionli = "<li id='item'><a href='#' value='"+res+"'>"+city+"-"+state+"</a></li>"; $(".resultsearch .ul").append(optionli); } }); }); $(".ul li#item a").each(function(){ $(this).click(function(e){ e.preventdefault(); var index_address,address; index_address = $(this).parent().index(); alert(index_address); add...