Posts

Pass HTML Form Date to VB Variable for SQL insertion -

alright, have simple asp page (summary.asp) - see code: <html> <body> <form action = "summary.asp" method="post"> select day: <input type ="date" name = "selecteddate" /> <input type="submit" value = "submit"/> </form> <% dim selecteddate set selecteddate = date selecteddate=request.form("selecteddate") after want use date selected part of sql query: if selecteddate<>"" sql = "select location_name, [product code], sum(salesquantity) units [sales data] eventenddate = convert(date, getdate()) group [product code],location_name" ... end if %> where intend replace "convert(date, getdate())" date selected in form. i have not yet got part insert date form sql string. know date format html form in right format sql (yyyy-mm-dd), looks vb not format date? maybe i'm missing something, appreciated. thanks... hope makes sen...

Calculating days between today and a date field in an Access table -

hi i'm trying calculate number of days between date field in current access table , todays date. here have: days on report: datediff("d",[reportdate],[date()]) the problem having when run query pop box asking "date()" i trying avoid adding column "today" , doing days between column , reportdate column if possible. reportdate column existing in table. days on report field/column creating. when not enclosed in square brackets, date() function call returns current system date. putting square brackets around turns field name . since there no field name, query treats parameter , prompts value. solution: rid of square brackets.

user interface - Build list of Panels for management in C# with Rudimentary Form Builder -

i'm working in form builder allows me input select custom code. i'm trying build rudimentary window manager shows , hide's panels. i'm using .visible , system.drawing.point in form onclick: public void togglepanel(panel panel) { if(panel.visible) { panel.visible = false; } else { panel.visible = true; panel.position = new system.drawing.point(panel1.right + 5, panel1.top); } } currently closeallpanels long list of declarations, i.e. panel2.visible = false; how can generate list of these panels? can using getmembers() method? i'm new c#, i'm not sure class i'd need run getmembers() on generate list. or there easier way i'm missing? if of panels in same container, like: list<panel> panels = new list<panel>(this.controls.oftype<panel>()); console.writeline("# of panels: " + panels.count.tostring()); foreach(panel pnl in panels) ...

gorm - grails derived property creating column in database -

i'm using grails 2.4.4. i have domain class post { integer nbroffavorites static hasmany = [ favorites : favorite ] static mappings = { nbroffavorites formula: '(select count(1) favorite f (f.post_id = id))' } } the problem nbroffavorites being created in database, retrieving doesn't take account formula. is there wrong in syntax ? thanks yes there typo in syntax. change mappings mapping , like: static mapping = { nbroffavorites formula: '(select count(1) favorite f (f.post_id = id))' } ref# grails domain: mapping

ruby on rails - master failed to start, check stderr log for details -

i'm trying start unicorn , keep getting error constantly. my unicorn.rb ( https://gist.github.com/anonymous/d1f3d9bcdd1a6c4d8435 ) command i'm using start unicorn: /home/app/adsgold/# unicorn_rails master -c config/unicorn.rb -d -e production commands i've tried: /home/app/adsgold/# unicorn_rails -c config/unicorn.rb -d -e production /home/app/adsgold/# unicorn_rails master -c config/unicorn.rb -d -e production -p 3000 /home/app/adsgold/# bundle exec master unicorn -c unicorn.cnf -e production -d complete error beeing shown: https://gist.github.com/anonymous/828d9677f928fa671762 it looks have rvm , ruby installed system-wide. may cause lots of issues. rvm documentation warns that . try install rvm , ruby user, owns app directory. in case consistent system. by way, have directory /home/deploy/apps/shared on environment? writable app? according unicorn config following things depend on it: pid "/home/deploy/apps/shared/pids/unicorn.pid...

Run function from Button or URL in Laravel -

i have following test function, want call directly url or clicking link blade view. public function callmedirectlyfromurl() { return "i have been called url :)"; } my question: possible call function directly button-click or url link blade view in laravel? here solution: we assume have function callmedirectlyfromurl in yourcontroller , here how can call function directly url, hyperlink or button. create route route::get('/pagelink', 'yourcontroller@callmedirectlyfromurl'); add link in view blade php file <a href="{{action('yourcontroller@callmedirectlyfromurl')}}">link name/embedded button</a> this has been tested on laravel 4.2 -> 5.2 far. by clicking on link or call url www.somedomain.com/pagelink function executed directly.

python - Random and list slicing working strangely with online world list -

i don't know how use python interact internet. can't seem find beginner learning besides codeacademy course. anyway wanted try , make hangman game randomly selected word english dictionary. need world list have not definitions. can print out entire world list things aren't acting right when try select specific portion of or run through random.choice() import urllib import random webpage = urllib.urlopen("http://www-01.sil.org/linguistics/wordlists/english/wordlist/wordsen.txt").read() print random.choice(webpage) is have tried printing webpage[0: ] or webpage[0: 10] or random number , first doesn't work @ second prints 3 words or 3 pieces of words on separate lines. each of words on separate line in file, when open url large string of words new line characters. around need split string separate lines. luckily python has inbuilt methods things in case if add: webpage = webpage.splitlines() between 3rd , 4th line work, resulting in foll...