Posts

php - Creating a Form that autofills itself -

php - Creating a Form that autofills itself - i'm working on "ticket" page, simple form collects info , saves record. need have select (combobox) when select something, other inputs (textfileds) auto fill or populate themselfs. simple! when select 1 alternative combobox others textfields "retrieve" info related combobox , "print" on page without reloading. i been working php, mysql, java , i'm soooo stuck :p the thing achieved java "pull" value of selection combobox textfield need @ to the lowest degree 2 diferent values related first option: in database this: solution - code - cost paint - p990 - 3.20 grind - g789 - 5.27 repair - rii8 - 89.2 so, display "labels" in combobox, related values, code , cost need auto fill textfields every time take different combobox :) you need utilize javascript , observe when combo box changes value utilize javascript http request (get or post), php returns ...

c# - Run WCF Service Library when .exe in debug is ran -

c# - Run WCF Service Library when .exe in debug is ran - when run wpf uses wcf service library through visual studio wcf service host startup @ same time service starting wcf service library, when click on exe wpf in debug folder doesn't startup there anyway create start in code next code have believed work doesn't. try { host = new servicehost(typeof(service1), new uri("http://" + system.net.dns.gethostname() + ":8733/databasetransferwcfservicelibarymethod/service1/")); host.open(); }catch(addressalreadyinuseexception) { } i'm trying not utilize service references. i'm no expert @ this, perhaps you're missing binding. here simplest illustration can create of hosting , consuming wcf service in code (you'll need add together references system, system.runtime.serializaton, , system.servicemodel, otherwise, code complete). using system; using system.runtime.serialization; using system.servicemodel; namespace co...

java - What is the best practice for putting classes under package names in Android -

java - What is the best practice for putting classes under package names in Android - android studio 0.8.11 hello, i have completed test on android build app takes live news feed, , display them. however, instructor critical set classes under 1 package. i wondering best practice packaging classes. particular test have next classes under bundle name: com.viewsys.ncon my classes these: dbhelper <-- database creating , ugprading detailactivity <-- activity add together ncondetailfragment nconcontract <-- properties of database schema columns, table name ncondetailfragment <-- detail fragment nconlistfragment <-- list fragment nconviewpager <-- view pager jsonnewsfeed <-- class downloads , parses json format mainactivity <-- main activity newsfeed <-- class of properties getters/setters news feed newsfeeddb <-- simple array list store object sqlite3 db splashactivity <-- activity add together splashf...

c++ - How can i add a return statement to magicTime? -

c++ - How can i add a return statement to magicTime? - i'm trying find output of next code. how can add together homecoming statement magictime? out set should a: 10 b: 30 c: a: 10 b: 30 #include <iostream> using namespace std; int magictime(int a, int &b, const int &c){ a=c; b=20; } int main(){ int = 10; int b = 30; int c; cout << "a: " << << " b " << b << " c " << c << endl; c=b; magictime(c, b, a); cout << "a: " << << " b " << b << " c " << c << endl; homecoming 0 ; } ok want homecoming array of int pseudo code int[] magictime(int a, int &b, const int &c){ a=c; b=20; homecoming new int [] { a, b, c}; } c++ nullpointerexception pass-by-reference pass-by-value

ruby on rails 4 - How to fetch an associated-through collection (proxied collection) using active-record methods -

ruby on rails 4 - How to fetch an associated-through collection (proxied collection) using active-record methods - i have has_many relation between subscription , article , article has product . class subscription < activerecord::base has_many :articles end class article < activerecord::base belongs_to :subscription belongs_to :product end class product < activerecord::base has_many :subscriptions end now. i'd fetch products within subscriptions. solution includes : class subscription < activerecord::base has_many :articles def products articles.includes(:product).map{|a| ap.product} # or .map(&:product) end end solution has_many :through : class subscription < activerecord::base has_many :articles has_many :products, through: articles end the first has downside not homecoming collection can chained upon (e.g. subscription.products.pluck(:id) ), rather simple array. the sec not exclusively 'semantically...

c# - Fastest way to get directory data in .NET -

c# - Fastest way to get directory data in .NET - this question has reply here: is there faster way scan through directory recursively in .net? 8 answers i'm working on file synchronization service synchronize files between 2 folders on different machines. need find fast way enumerate directory , pull next info it: a info construction or structures of file paths , sub-directory paths within directory, includes lastly write time each file or sub-directory. for each sub-directory found @ level below current directory, same above. so far, have come this: static void main(string[] args) { list<tuple<string, datetime>> files = new list<tuple<string, datetime>>(); list<tuple<string, datetime>> directories = new list<tuple<string, datetime>>(); stopwatch watch = new stopwatch(); while (true) {...

Clearing Arduino's serial buffer -

Clearing Arduino's serial buffer - i have simple arduino code: void loop() { if serial.available { c = serial.read(); if (c == 'a') { blinkled(); } else offled(); } } it should glow led if send character 'a'. , shld go off when dont give when loop goes next itration. but 1 time give 'a'. starts glowing , never goes off. is reading char 'a' buffer? if how clear ? serial.flush() not working. any ideas please. new arduino. sorry if silly. you have set offled function within serial.available() path. turn off serial.available() beingness true , pushing different character reads other 'a' unfortunately illustration above makes same mistake. construct led turns off outside if statement arduino