Posts

c++ - Getline string input to create a word -

i have program receives input , goes character through character avoid white spaces. need each 1 of characters aren't white spaces , stores them in string word. someone told me getline stores each character, has memory: then create while loop has (!= ' ')condition , use string.append('x') function "add" each character string variable you've created until have word. i understand concept don't know how it. here simple application takes string , filters out spaces. // reading text file #include <iostream> #include <sstream> #include <fstream> #include <string> using namespace std; int main () { string input; stringstream filter; cout << "enter string \n"; cin >> input; for(int = 0; i<input.length(); i++){ if(input.at(i)!=' '){ //chech see space or not filter << input.at(i); //if not space add stringstream filter } } string outp...

sql - TSQL Comparing 2 uniqueidentifier values not working as expected -

i'm trying compare 2 uniqueidentifier values shown in query below. however, if 1 value null , 1 value isn't, result 'same'?! i'm sure both values uniqueidentifiers, , have tried casting both values uniqueidentifier make absolutely sure. 2 values being compared coming different databases different collations. collation make difference? ideas appreciated. select [result] = case when [target].staffid <> [source].staffid 'different' else 'same' end ... if replace <> = query thinks 2 null values don't match. edit: i used: declare @empty uniqueidentifier set @empty = '00000000-0000-0000-0000-000000000000' ... isnull(somevalue, @emtpy) <> isnull(othervalue, @empty) ... null neither equal nor equal nothing. you'd check null values comparing is null . example, somefield null you using coalesce you're trying -- make sure use same data types (in case uniqueidentifier): ......

jquery selectors - call the change event after the SELECT is populated? -

so, have dynamically generated select, gets populated php-mysql table. have on change event select, deals times user changes selected value on page. when change event fired, populate 3 input boxes values select option. it works fine, except, when enter (or refresh) page select, select gets populated, onchange event not fire. sure onchange gets fired, happens before select populated there no values offer. can do? how can call change event after select populated properly php? my code onchange is: $(document).ready(function(){ $('#myselect').change(function(){ var selected = $(this).find('option:selected'); $('#pux').val(selected.data('foo')); }).change(); }); so basically, want input name , id = pux filled data-foo value of select option. mean, structure of options of select like: <option id="1" value="whatever" data-foo="something_important">first option</option> and of cours...

css3 - css, ios, iPad, -webkit-overflow-scrolling: touch bug, large content gets cut off -

i have table thousands of rows (2317 precise) data coming database. putting table inside div scrollable. html: <div class="longlist"> <!-- table thousands of rows --> </div> css: .longlist {overflow: auto; height: 550px; margin: 0 auto; -webkit-overflow-scrolling: touch;} the problem is, list cutting off on mobile safari on ipad (on desktop browsers works fine) @ row number 1900 (half of row shown) , rest of list showing blank. rows not showing after 1900th row. all rows shows if remove '-webkit-overflow-scrolling: touch;' styles. has come across or has idea how fix this? adding position:fixed resolved issue different problem started that, that's story (see -webkit-overflow-scrolling: touch, large content gets cut off when specifying width ). .longlist {overflow: auto; height: 550px; margin: 0 auto; -webkit-overflow-scrolling: touch; position:fixed; }

iOS: Autolayout with child view controllers -

i've been using autolayout couple of weeks now. currently, i'm using 3rd party library called flkautolayout makes process easier. i'm @ point can construct views way want, without problem. however, on past 4 days @ work i've been struggling autolayout once viewcontrollers involved. i'm fine sorts of uiviews... reason, every viewcontroller.view total demon. i've had nothing problems getting viewcontroller.view size way want , ever deeper problem uiviews of child viewcontrollers not receive events when using autolayout. child viewcontrollers work fine when designating frames manually, breaks down autolayout. i don't understand what's different viewcontroller's uiview makes different others... mind melting in frustration. ios messing viewcontroller views behind scenes or something? sample image http://i39.tinypic.com/6qeh3r.png in image, red area belongs child view controller. area should not going past bottom subview (the card says three). sh...

pointers - Lisp, cffi, let and memory -

i've build toy c++ library create qt window lisp. know common-qt exists, i'm trying learn how use cffi. right now, have 4 binded functions : create-application : create qapplication , return pointer create-window : create qmainwindow , return poiner show : show window specified argument exec : qt exec function here lisp code work : (defctype t-app :pointer) (defctype t-window :pointer) (defcfun (create-application "create_application" ) t-app) (defcfun (exec "exec") :void (app t-app)) (defcfun (create-window-aalt "create_window_aalt") t-window) (defcfun (show "show") :void (o t-window)) (defparameter (create-application)) (defparameter w (create-window-aalt)) (show w) (exec a) but if use let or let*...i have memory fault ! (let* ((a (create-application)) (w (create-window-aalt))) (show w) (exec a)) corruption warning in sbcl pid 1312(tid 140737353860992): memory fault @ a556508 (pc=0x7ffff659b7f1, sp=0x7ff...

html - Sticky footer with a variable height -

i know there lot of same topics, there css way stick bottom footer height in % without overflowing body , header because of absolute position ? i'm trying stick 1 : html,body{ height: 100%; } #header{ background-color: yellow; height: 100px; width: 100%; } #holder { min-height: 100%; position:relative; } #body { padding-bottom: 100px; } #footer{ background-color: lime; bottom: 0; height: 100%; left: 0; position: relative; right: 0; } with html : <div id="holder"> <div id="header">title</div> <div id="body">body</div> <div id="footer">footer</div> </div> code here : http://jsfiddle.net/tsrkb/ thanks ! if use display:table base , sticky footer can size , pushed down if content grows. http://dabblet.com/gist/5971212 html { height:100%; width:100%; } body { height:100%; width:100%; ...