Posts

Showing posts from August, 2015

sql - Conditional WHERE clause with CASE statement in Oracle -

i'm brand-new oracle world softball. in working ssrs report, i'm passing in string of states view. twist users pick selection state list called "[ no selection ]" ... (that part not doing , i'm stuck implementing things way) if choose no selection option, want return states default, otherwise return list of states in comma-separated list. this seems should easy i'm stuck. here code have far (just trying sample work) eyes have gone crossed trying going. could give me direction on 1 please? begin :statecode:='mo,fl,tx'; --:statecode:='[ no selection ]'; end; / select count(*) statecount, :statecode selectedval hcp_state vw (case when (:statecode = '') (1) when (:statecode != '') (vw.state_cd in (:statecode)) (else 0) end) ; you can write where clause as: where (case when (:statecode = '') (1) when (:statecode != '') , (vw.state_cd in (:statecode

android - Alternate way to access multiple columns independently from a database? -

my application stores 3 items: "name", "email", "mobile" in database under same table. want access each of them independently display value under respective textviews. access them independently because if access them through 1 single function won't able display values currently, have write function each column information it. example "email" public string getuseremail(string mobile) { string[] columns = new string[] {user_email}; cursor c = maindatabase.query(reg_info_table, columns, user_mobile_number + "=" + mobile, null, null, null, null); string result = ""; int email = c.getcolumnindex(user_email); while(c.movetonext()) { result = result + c.getstring(email); } return result; } so, if need the "name", i'll have write function similar above it. now, if need access 50 such columns, i'll have make 50 such func

javascript - Get elements that have not been added to the DOM -

if create new html element using document.createelement , not add dom, there way find it? method of document , seems logical might become property of document . example: (function(){ document.createelement("a"); })(); console.log(document.getelementsbytagname("a").length); // -> 0 i understand why above example doesn't work. there alternative? you're creating elements, without insterting them in dom. you need store them if want know how many are. var myelements = []: var elem = document.createelement("a"); myelements.push(elem); myelements.length; // use length needs

php - Function expects array to be string, convert? -

before downvoting can atleast write bothering you, jesus christ arogance i "warning: mysql_real_escape_string() expects parameter 1 string, array given in bla bla..." everytime following happens: if($_post['action'] == 'napadi') { $igralec_ime = $_session['username']; $igralec = array ( 'ime' => $igralec_ime, 'napad' => prikazi_stat('ofe',$igralec_ime), 'obramba' => prikazi_stat('def',$igralec_ime), 'curhp' => prikazi_stat('curhp',$igralec_ime) ); $monster_ime = $_post['monster']; $monster = array ( 'ime' => $monster_ime, 'napad' => prikazi_monster_stat('ofe',$monster_ime), 'obramba' => prikazi_monster_stat('de

html - How to enable links if a parent element uses a fullscreen pseudo-element? -

my page looks this: <div.ui-page> <div.ui-content> <a href="foo.html"> </div> </div> on page, i'm setting fullscreen watermark so: /* watermark */ .ui-page:before { background: url("../img/foo.png") no-repeat center center; position: absolute; content: ""; top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; /* transparency */ opacity: .2; /* grayscale */ filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><fecolormatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); filter: gray; -webkit-filter: grayscale(100%) brightness(10%) contrast(100%); } which works fine. problem is, link no longer clickable. i tried moving

css - Equal line height with varying border width (border-box) -

Image
in simplified example have 4 circles, each varying border-width , trying maintain equal line height in each keep them horizontally aligned. however border width seems effect line height (despite being technically outside box?) is there anyway solve without manually adjusting each line-height? width: 50px; height: 50px; border-radius: 50px; border: 1px solid #1daeec; line-height: 50px; example: http://jsfiddle.net/vcj3g/ you can remove line-height, use display:table-cell instead, , add vertical-align:middle; stat class. jsfiddle example .stat { display: table-cell; width: 50px; height: 50px; border-radius: 50px; border: 1px solid #1daeec; text-align: center; margin: 10px; font-size: 16px; color: #1daeec; text-transform: uppercase; vertical-align:middle; }

difference between constructor and properties in C# -

i new programming, please explain me difference between constructor , property in context c#. since both used initialized class fields, & 1 choose in given situation . besides technical stuff, rule of thumb use constructor parameters mandatory things, properties optional things. you can ignore properties (hence optional), can't ignore constructor parameters (hence mandatory). for else, i'd recommend reading c# beginners book or tutorial ;-)

c++ - Using Qt To Build A Full Screen Layout -

Image
i trying use qt along qt designer create simple full screen webview line edit , button above create simple browser. the problem layout doesn't want expand fill of available space. seem think missing simple, can't seem figure out. here overview of layout <mainwindow> <gridview> <vboxlayout> <hboxlayout> <lineedit /><pushbutton /> </hboxlayout> <webview /> </vboxlayout> </gridview> </mainwindow> here code on mainwindow class mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow) { ui->setupui(this); ui->lineedit->showfullscreen(); ui->pushbutton->showfullscreen(); ui->webview->load(qurl("http://google.com")); ui->webview->showfullscreen(); } and here main code int main(int argc, char *argv[]) { qapplication a(argc

Linked lists and inheritance in java -

i have parent class extended 6 child classes , getting confused on how replace arraylists linkedlists have in child classes. need basic advice setting parent class made of getters , setters , variables. my parent class has no objects created it. need create node inner class in parent class or need node inner classes in each of child classes creating linked lists? you should have parent class use collections.list interface. generic list interface can implemented using arraylist, linkedlist, etc in child classes

backbone.js - Backbone relational - how is it possible to find related model by two foreign keys? -

in model i've defined relationship, it's property foreign key substituded related model. i had idea give away database 2 same values, example relatedid , related - if define models relationships field related , relatedid value left untouched - , able use it. is possible somehow use collection.where() method in backbone relational on model attributes, represent related models (they have object data type)? if define related id - following - not work: collection.where({ related : 14 // property contains related model, not id after backbone initializes, i've tried use relatedid key instead - not work }) i need such method much, because have find models lot of attributes, , hard scratch :/ could please advice way? i using database "views" flatten relationships way easier querying. works well.

qt - where can I download qmysql driver? -

after 2 days of following many tutorials how create qmysql driver qt give up. keep getting errors , know if possible driver downloaded off somewhere or has created on pc in order work ? thanks this official documentation: http://qt-project.org/doc/qt-4.8/sql-driver.html#how-to-build-the-qmysql-plugin-on-windows

ios - Show only part of coreData array -

i've tableview should display objects of coredata-entity if 1 of entity-attribute equal string. there's entity called buy , 1 of it's attribute string called position and in code tableviewcontroller is: @property (strong) nsmutablearray *buy; - (nsmanagedobjectcontext *)managedobjectcontext { nsmanagedobjectcontext *context = nil; id delegate = [[uiapplication sharedapplication] delegate]; if ([delegate performselector:@selector(managedobjectcontext)]) { context = [delegate managedobjectcontext]; } return context; } - (void)viewdidappear:(bool)animated { [super viewdidappear:animated]; nsmanagedobjectcontext *managedobjectcontext = [self managedobjectcontext]; nsfetchrequest *fetchrequest = [[nsfetchrequest alloc] initwithentityname:@"buy"]; self.buy= [[managedobjectcontext executefetchrequest:fetchrequest error:nil] mutablecopy]; [self.tableview reloaddata]; }

javascript - jQuery .height() and .outerHeight() returning zero -

Image
i'm trying write small jquery plugin vertically center div based on it's height, basically in css have top: 50% , since height variable need calculate this. the html looks like <div class="button-wrapper js-center" data-center="vertical" style="margin-top: 0px;" <span class="sub-text">multiline text 2 lines</span> <a href="" class="shop-btn">shop_</a> </div> in plugin tried logging height, keeps on returning zero: console.log($el); console.log("$el.outerheight(): " + $el.outerheight()); console.log("$el[0].scrollheight: " + $el[0].scrollheight); // output: $el.outerheight(): 0 $el[0].scrollheight: 0 when use dev tools check, looks this: so i'm wondering potentially go wrong, reference, plugin i'm (trying) write: http://pastebin.com/qz7bgkcg edit: main css used on .button-wrapper .button-wrapper { width: 250px; left: 50%

Google Map API V3 Weighted Search Results -

i wondering if knows if possible weight search results based on country or other variables? basically, i'm looking have user enter street address search canada before searching rest of world. the issue encountering users not inputting full address (inc. province , country) , map defaulting addresses outside of canada. is possible? is possible? yes! see component filtering .

vb.net - How to Get SQL Error message from Adapter.Update (ASP.NET with VB) -

writing asp.net app using vb. bll uses adapter.update insert new reocrds. turn calls stored procedure, returns meaningful messages (e.g. "this invoice exists") want display user. i can't figure out how message though. here's part of bll insert function: <system.componentmodel.dataobject()> _ public class invoicesbll private _invoiceadapter shipping_invoicetableadapter = nothing protected readonly property adapter() shipping_invoicetableadapter if _invoiceadapter nothing _invoiceadapter = new shipping_invoicetableadapter() end if return _invoiceadapter end end property ' insert new invoice <system.componentmodel.dataobjectmethodattribute(system.componentmodel.dataobjectmethodtype.insert, true)> _ public function addinvoice( _ byval tripno string, _ byval typeid integer, _

cakephp - Where should the template view file for the login function go? -

i trying follow simple authentication , authorization application tutorial not clear template view file login function (below) supposed go. <div class="users form"> <?php echo $this->session->flash('auth'); ?> <?php echo $this->form->create('user'); ?> <fieldset> <legend><?php echo __('please enter username , password'); ?></legend> <?php echo $this->form->input('username'); echo $this->form->input('password'); ?> </fieldset> <?php echo $this->form->end(__('login')); ?> </div> when put in app/view/users/login.ctp , users/add causes following error: error: view userscontroller::index() not found. error: confirm have created file: app\view\users\index.ctp when app/view/users/login.ctp renamed app/view/users/index.ctp , users/add indicates the user has been saved but going blog tut

vbscript - why CMD window get the parameter name and not the value of parameter -

i need run following command on cmd window under c:\program files\connection connect "user_vip" so write short vb script perform action dim oshell set oshell = wscript.createobject ("wscript.shell") userc = """user_vip""" wscript.echo userc oshell.run "cmd /k cd c:\program files\connection & connect userc " ,1 , true after run vb script see following cmd window connect userc and not expected see: connect "user_vip" why userc parameter in oshell.run not real value - "user_vip" ?? remark - wscript.echo userc print value - "user_vip" expected vbscript not interpolate variable content string literals , path containing blanks/spaces in shell command needs quotes (" escaped "") change oshell.run "cmd /k cd c:\program files\connection & connect userc " ,1 , true to oshell.run "cmd /k cd ""c:\program file

php - stream_get_line dont read line as it arrives -

i'm trying read streaming data using php. so read , show every message posted server in real time. i assume $uri, $context code snipped correctly defined. when use code, result got when lenght reached. seams doesnt stop on delimiter "\r" string. define('token', "my_token"); $opts = array( 'http' => array( 'method' => "get", 'header'=> "authorization: basic " . base64_encode(token))); $context = stream_context_create($opts); if (($fp = fopen($uri, "r", false, $context))) { while (!feof($fp)) { $contents = stream_get_line($fp, 1024, "\r"); echo "text: " . $contents . "\n"; } fclose($fp); when lenght reached, show correctly new messages posted. string "text: " before every message. how print 1 message 1 ? ps: tried use "\r", "\n", "\n\r" or "\r\n", nothing works :/. i need t

Grabbing Values Outside a Form with PHP -

i'm using following code on site. you'll notice there checkbox outside form (towards bottom). need value of checkbox called send_mail.php without creating second form, , without placing inside form element. possible php? ` <h2>search dream home<br /> , save now!</h2> <legend>which areas interested in?</legend> <div class="areas row-fluid" style="text-align:left !important;"> <div class='span5' style='margin-left:0px !important;'> <label> <input type="checkbox" name="arrayvalue[]" id="area[0]" value="test" style='margin-top:-5px !important;'> test</label> </div> </div> <input type="button

php - Session Management For redirection in Codeigniter -

i want manage page redirection in codeigniter, have 2 controllers: logggedin login when user try access login page while logged in, redirected loggedin controller function __construct() { parent::__construct(); $u = $this->session->userdata('username'); if(! isset($u)) { redirect('loggedin'); } } and when tries access loggedin controller while not logged in, should redirected login controller function __construct() { parent::__construct(); $u = $this->session->userdata('username'); if(isset($u)) { redirect('login'); } } but when press logout button, has redirect login controller, still remains on logggedin controller. function logout() { $this->session->sess_destroy(); redirect('login'); } what problem in code? your condition returning true $u=$this->session->userdata('username'); // true because $u equal va

asp.net mvc - Trouble with ModelState on datetime field -

in our asp mvc 3 site, want user able enter incomplete form, save record database, , come form later. if there fields entered incorrectly want error message appear when user hits save. a problem occurring specific date of birth field, however. if user enters incorrect date such 14/01/2011 , when user hits save , model object posts controller action, date of birth comes through blank. fails if (modelstate.isvalid) condition, not save database, , sent view blank date of birth. is there way allow user enter incorrect date in field, keep value , post view value , error message generated model? since using jquery input mask, value entered numeric , in mm/dd/yyyy format. model [displayname("date of birth")] [displayformat(dataformatstring = "{0:mm/dd/yyyy}", applyformatineditmode = true)] public datetime? birthdate { get; set; } controller [httppost] public actionresult edit(monet.models.agenttransmission agenttransmission) {

jquery - Scroll a div based on a draggable element (reversed) -

i found code scrolling div via draggable element. don't quite understand posted answer , want in reverse. original here : scroll div based on draggable element http://jsfiddle.net/xnlse/8/ i modified fiddle , made scroll down on load, original answer works without scrolling content down. i added block scroll down //modification var timeline = $('#timeline'); var tlparent = timeline.parent(); var tlheight = parseint(timeline.css("height")); var tlpheight = parseint(tlparent.css("height")); //scroll down content on load var newpos = 0 - (tlheight - tlpheight); timeline.animate({"top":newpos + "px"},800,"linear"); //end modification my modification : http://jsfiddle.net/j3toxicat3d/hxbgd/ help anyone? thanks hey battled script , got working in reverse - //modification var timeline = $('#timeline'); var tlparent = timeline.parent(); var tlheight = timeline.height(); var tlpheight = tlpar

Facebook App: How do I cause new chat messages to appear minimized? -

when user messaged while using app, there way make chat window appear minimized rather auto-opening? appears uberstrike: https://apps.facebook.com/uberstrike/ has way of doing this. cannot find being done in js on page though. can following: when examining difference between minimized , non-minimzed (uberstrike vs fb profile page) div title of chat has classes: uberstrike: fbnub _50-v _50mz 50m _5238 highlighttab highlighttitle fb profile page: fbnub _50-v _50mz 50m _5238 highlighttab opened highlighttitle the difference inclusion of "opened" class. additionally, when delve deeper html see there table represents contents of chat window. in uberstrike, discussion doesn't populate while on profile page, there many tags containing discussion. this leads me believe there must setting convince fb treat game's page differently. know how cause application behave same way.

php - Is there any way to determine the *actual* session save path? -

i know there half dozen ways value of session.save_path directive ( phpinfo() , session_save_path() , etc.), when value empty string, default, actual path can of several locations. i've read it's /tmp , except when it's /var/lib/php5 , on os x mountain lion it's /private/var/tmp . on windows, it's c:\windows\temp , knows. i specify location, won't me. i'm trying diagnose tricky problem , know current location on server don't have full access to. if there's right way it, haven't been able find it. i'm open clever hacks. i have not reviewed php source code confirm this, looks when session.save_path empty, php uses value of sys_get_temp_dir() (which varies user).

java - How can I make the button move from the first JTabbedPanel to the next one? -

i created window panel displays 6 tab panels, , made next , previous buttons move tab tab. problem able make go first tab last tab. buttons skip other tabs , can't seem find way make go through each tab. did: next = new jbutton("next"); next.addactionlistener( new actionlistener() { @override public void actionperformed(actionevent e) { for(int = 0; <= tabs.getselectedindex(); i++) tabs.setselectedindex(i); } }); previous = new jbutton("previous"); previous.addactionlistener( new actionlistener() { @override public void actionperformed(actionevent e) { for(int = 0; >= tabs.getselectedindex(); i++) tabs.setselectedindex(i); } }); i'm still going try figur

javascript - "TypeError: can't convert undefined to object" when Dynamically Resizing 2D Array -

i read text, consisting of triads of comma separated numbers 1 triad per line, 2d array. not know in advance array dimensions be. use following code. // read data matrix var inputdata = [[]]; while (alltextlines.length>0) { datarecord=alltextlines.shift(); entries = datarecord.split(','); var xcoord=parseint(entries.shift()); var ycoord=parseint(entries.shift()); var zcoord=parseint(entries.shift()); if (ycoord>=inputdata.length) inputdata[ycoord]=[]; inputdata[ycoord][xcoord]=zcoord; } this results in typeerror: can't convert undefined object from firebug when try call if (ycoord>=inputdata.length) inputdata[ycoord]=[]; or inputdata[ycoord][xcoord]=zcoord; i thought javascript arrays dynamically resized assigning value index higher current size. they can dynamically resized when exist . there

synchronization - Filter lock mutual exclusion property -

the following generalised version of peterson's 2-thread lock algorithm, allowing 'n' threads/processes compete critical section. basically there 'n' levels , 'n' threads. threads inactive or executing in non critical section region @ level 0. level n-1 critical section. every thread/process must cross n-1 levels before entering critical section. there 2 arrays, level[n] & victim[n]. first array indexed threadid of thread, , entry level[i] stores current level of thread threadid 'i'. second array indexed level number, , entry victim[i] stores threadid of recent thread enter level 'i'. all elements of level[] initialized 0. no specific initialization victim[]. 1 void lock() 2 { int me = threadid.get(); 3 (int = 1; < n; i++) 4 { level[me] = i; 5 victim[i] = me; 6 while ((∃k != me) (level[k] >= && victim[i] == me)) ; 7 } 8 } 9 10 void unlock() 11 { int me = threadi

r - error 'nzchar()' requires a character vector lubridate -

i trying run code webpage https://r-forge.r-project.org/scm/viewvc.php/pkg/appliedpredictivemodeling/inst/chapters/creategrantdata.r?view=markup&revision=11&root=apm . i error when run below line month info starttime <- dmy(raw$start.date) error in parse_date_time(dates, orders, quiet = quiet, tz = tz, locale = locale, : 'nzchar()' requires character vector code above webpage needs tweaks. 1 has copy file "unimelb_training.csv" on computer. file available @ http://www.kaggle.com/c/unimelb/data i have contacted author. wasnt able reproduce error , therefore couldnt help. suggested me provide link of above webpage instead of copy-pasting entire code.the book site http://appliedpredictivemodeling.com/ please help...thanks i emailed author of lubridate package. name , response below: garrett grolemund your error comes bug in lubridate working on. parsing functions can't handle factors @ moment. raw$start.date factor. can mak

asp classic - How to check if a POST submitted field exists in VBScript? -

after form submitted, how 1 check server-side if particular field exists? example: if [exists] request("fieldname") ... end if check if it's not empty. there few different ways, 1 i've seen more used along lines of: if request("fieldname") <> "" 'etc. end if i explicitly check form , querystring collections variation of 1 of code below if may getting variable 1 or other depending on context: select case true case request.form("fieldname") <> "" 'run if form isn't empty case request.querystring("fieldname") <> "" 'run if querystring isn't empty case else 'set predefined default if they're both empty end select or nested if ... then: if request.form("fieldname") <> "" 'run if form isn't empty elseif request.querystring("fieldname") <> ""

readdir - php read directory sorting -

i have little php script reads directory , echos files (jpg's in case) jquery image slider. works perfectly, dont know how sort images name desending. @ moment images random. <?php $dir = 'images/demo/'; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { echo '<img src="'.$dir.$file.'"/>'; } closedir($handle); } ?> any on great. one more thing dont understand. script pics 2 nameless non jpg files in folder not exist??? havnt realy checked yet try this: $dir = 'images/demo/'; $files = scandir($dir); rsort($files); foreach ($files $file) { if ($file != '.' && $file != '..') { echo '<img src="' . $dir . $file . '"/>'; } }

MySQL trigger syntax error on update query -

i'm trying create trigger on mysql using 2 tables. i'm able in database same code adjusted in database giving me syntax error since hours! create trigger `free_video_used` after update on `user` each row if new.field = 1 update free_video set free_video.used = 1 free_video.uid = new.uid; end if; as can understand after update on table "user", other table modified field "uid" equal. why isn't working?! thanks!! try: delimiter $$ create trigger `free_video_used` after update on `user` each row begin if (new.field = 1) update free_video set free_video.used = 1 free_video.uid = new.uid; end if; end$$ delimiter ;

java - Facebook login not working with signed application -

i using following code login facebook. login process works while debugging, not work signed application. have added both debug hash key , release hash key in facebook app settings without success. idea causing this? package com.priyank.safeboard; import java.util.arrays; import android.content.intent; import android.os.bundle; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.button; import com.actionbarsherlock.app.sherlockfragment; import com.facebook.session; import com.facebook.sessionstate; import com.facebook.uilifecyclehelper; import com.facebook.widget.loginbutton; public class mainfragment extends sherlockfragment { private static final string tag = "mainfragment"; private uilifecyclehelper uihelper; button b; loginbutton authbutton; @override public view oncreateview(layoutinflater inflater, viewgroup container, bun

android - Saving multiple jpgs to sd card -

i downloading images parse.com . never know amount of images have using counter retrieve them. reason, counter gets 5, , downloads image 5 times. in storage, have 1 image. here code: string root = environment.getexternalstoragedirectory().tostring(); int = 0; retrieve images: parsequery<parseobject> query = parsequery.getquery("fightgallery"); query.findinbackground(new findcallback<parseobject>() { @override public void done(list<parseobject> parseobjects, com.parse.parseexception e) { if (e == null) { int size = parseobjects.size(); log.d("query size", "size " + size + " int " + i); while (i < size) { parsefile fileobject = parseobjects.get(i).getparsefile("image"); fileobject.getdatainbackground(new getdatacallback() { @override public

java - How to transfer data to another jsp -

i've built dynamic table has add button (that adds new row), delete button (deletes rows) , submit. i wanna take information in table (i don't know how many rows user add) , process @ other jsp page. this have far: <script type="text/javascript"> var cb=new array(); var fn=new array(); var ln=new array(); var email=new array(); var i=1; function addrow(tableid){ var table=document.getelementbyid(tableid); var rowcount=table.rows.length; var row=table.insertrow(rowcount); var cell= row.insertcell(0); var element=document.createelement("input"); element.type="checkbox"; element.name="cb"+i+""; cell.appendchild(element); var cell1=row.in

c# - Using SQL Server "LEFT" function result in poor performance when running Batch data than without it -

while executing / processing batch dealer vehicles data using vin, noticed performance terribly slow. after benchmark testings, found if use t-sql function left , performance suffers if don't use it, works okay. without t-sql function left , end average of 73 car dealers per minute. left , end average of 5 or 6 car dealers per minutes. so what's problem , what's workaround problem? thanks. using (var dbconnection = new sqlconnection(this._dbconnectionstring)) { using (var dbcommand = dbconnection.createcommand()) { sqlask = ""; sqlask += " select year, make, model, style trim, squish_vin squishvin, '' vehicleid ed_squish_vin_v3_90 "; //@@sqlask += " @parmvehiclesquishvin = squish_vin "; sqlask += " @parmvehiclesquishvin left(squish_vin, 9) "; dbcommand.commandtext = sqlask; dbcommand.parameters.clear(); dbcommand.parameters.add("@parmvehiclesquish

MySQL TINYINT(1) to BOOL -

what parameter on column's data type do? essentially: i tried tinyint(1), , seemed held 1 or 0. why doesn't display/store @ least 0-9? edit: turns out issue not mysql problem rather unexpected behavior cakephp. read answer details. i've kept original question below helpful answers keep making sense. what i've done: i created mysql table using command create table table_name ( ... irrelevant columns transaction_type tinyint(1) not null comment 'identifier 0-5 (for now)' ); and promptly became thoroughly confused, because unable store values other 0 , 1 in transaction_type column. after research, determined confidently parameter tinyint (or other integer data type) nothing more display width in characters. understood mean 2 things: it should still store entire inserted value, long within tinyint's bounds it display 1 character, should able see values 0-9 when select table. i figure @ least 1 of these assumptions (or unders

asp.net - Format this datetime without seconds or AM/PM -

i have property set "datetime?" this: public overridable property mydatetime datetime? i'm trying hours , minutes without seconds , without or pm. i tried this: mydatetime.value.timeofday.tostring that gives me hours, minutes, , seconds without or pm and tried this: mydatetime.value.toshorttimestring this gives me hours , minutes, gives me or pm. is there way format looks this? 9:10 or 2:40 thanks you looking custom date , time format . try this: mydatetime.value.tostring("hh:mm")

javascript - is this callback structured correctly? -

i want save sections, made updates questions ids saved sections, save questions, , if successful fire function nextpage redirects page. i'm trying confirm correct. seems act funny if don't have anonymous function wrapped around saveallquestions. saveallsections(function () {saveallquestions(nextpage)}); update: on success of saveallsections following: if (typeof(callback) == 'function') callback(); on success of saveallquestions following: if (questionvaluestosave.length>0) { saveallquestionvalues(questionvaluestosave, callback); } else { // once done hide ajax saving modal hidemodal(); if (typeof(callback) == 'function') callback(); } on success of saveallquestionvalues (assuming there some) following: if (typeof(callback) == 'function') ca

css3 - side columns and text in the middle using inline style -

i have html code , inline style applied it, 2 columns text links , vertical images on each side. in middle put post text , content. if post big, text takes whole page width after there no enough images on side columns keep text in middle. i want keep text in middle of these columns. <div style="float: right; text-align: center;"> <p><strong>version.v </strong></p> <p><strong> 999 </strong></p> <p><strong>august 7, 2013</strong></p> <p> <a href="#">news</a> </p> <p><a href="#">updated news</a></p> <p> <a href="#">old news</a></p> <p><a href="#">posts</a></p> <p><a href="#">daily news</a></p> <p>&nbsp;</p> <p>&nbsp;</p> <p><a

javascript - Locu-node TypeError: Cannot call method 'call' of undefined -

i'm using locu-node node.js library found here: https://github.com/locu-unofficial/locu-node , api client locu service. in example code provided, can perform query doing following: do_search = function() { var locu = require('locu'); var my_client = locu.menuitemclient(apikey); my_client.search({ name:'pizza', description:'delicious', locality:'san francisco' }, function(result) { console.log(result); } ); exports.do_search = do_search; this code sitting in handler.js module call via route. when call route, error: typeerror: cannot call method 'call' of undefined @ object.menuitemclient ... \locu.js:179:15 , locu module tries initialize menuitemclient. has used library either or run problem? doing/not doing stupid? use new keyword. var my_client = new locu.menuitemclient(apikey);

php - Add link to echo'd HTML from SQL data -

back quick question. have code below echo's out product names database. want make echoed out product names link page called product.php, each link needs have unique id, example <a href="product.php?id=1">product name</a> how go doing this? many thanks. point out new php. <?php //create ado connection , open database $conn = new com("adodb.connection"); $conn->open("provider=microsoft.jet.oledb.4.0;data source=c:\webdata\northwind.mdb"); //execute sql statement , return recordset $rs = $conn->execute("select product_name products"); $num_columns = $rs->fields->count(); echo "<table border='1'>"; echo "<tr><th>name</th></tr>"; while (!$rs->eof) //looping through recordset (until end of file) { echo "<tr>"; ($i=0; $i < $num_columns; $i++) { echo "<td>" . $rs->fields($i)->value . "

facebook graph api - How can I tell if user has watched 10 seconds or more of YouTube video? -

i'm using facebook's open graph protocol publish "xxxx watched video" message on user's timeline (with permission, of course). according facebook's best practices publishing message, shouldn't until user has watched @ least 10 seconds of video. but, videos hosted on youtube. how can tell if 10 seconds has elapsed? the idea had use youtube's api subscribe event when video starts playing, start internal timer , publish facebook message after 10 seconds. that's complex stuff-- i'd have catch paused event , kill timer, , pause timer during buffering. seems there lot of opportunities in there things go wrong. :-) there easier way? you can channels->list mine=true , contentdetails.relatedplaylists.watchhistory . playlistid of watched videos authenticated user. then can call playlistitems->list videoid , playlistid specified check if video watched (not opened , exited)

php - Converting XML data to ISO-8859-1 for API call POST data -

i've got xml data i'm using post idibu api (job board api in uk). i've done successful call test post data. here is: xml_text=%3c%3fxml+version%3d%221.0%22+encoding%3d%22utf-8%22%3f%3e%0d%0a%3cidibu%3e%0d%0a%3cmethod%3eadd%3c%2fmethod%3e%0d%0a%3cconfig%3e%0d%0a%3cshow_durations%3eno%3c%2fshow_durations%3e%0d%0a%3ccompletionurl%3eemail%3c%2fcompletionurl%3e%0d%0a%3cadvertcompletionemail%3ebob%40bob.com%3c%2fadvertcompletionemail%3e%0d%0a%3clockboards%3eyes%3c%2flockboards%3e%0d%0a%3credirecturl%3ehttp%3a%2f%2fwww.google.com+%3c%2fredirecturl%3e%0d%0a%3cvalidate_level%3ewarning%3c%2fvalidate_level%3e%0d%0a%3c%2fconfig%3e%0d%0a%3cjob%3e%0d%0a%3ctitle%3e%3c%21%5bcdata%5bxml+v+3+test%2c+please+ignore+special+%a3+%24+%26+%25+%40+%21+%3f+.+%2c+%3d+%29+%28+-+%3a+%3b+_+%2b+%27+%22+%80%5d%5d%3e%3c%2ftitle%3e%0d%0a%3creference%3eabc123456789%3c%2freference%3e%0d%0a%3cdescription%3e%3c%21%5bcdata%5b%3cb%3especial+te+%a3+%24+%26+%25+%40+%21+%3f+.+%2c+%3d+%29+%28+%2f+-+%3a+%3b+_+%2