Posts

javascript - Embed PDF at full height -

my question ... possible embed pdf in html document height 100%. problem actual height of pdf vary , layout needs respond this. there several ways embed pdf in html. one use pdfobject . below example works out of box in firefox, you'll find further instructions browsers on website. <object data="myfile.pdf" type="application/pdf" width="100%" height="100%"> <p>it appears don't have pdf plugin browser. no biggie... can <a href="myfile.pdf">click here download pdf file.</a></p> </object> or use google drive viewer display pdf (and quite few more file types): <iframe src="http://docs.google.com/viewer?url=[http://path-to-your-file.pdf]&embedded=true" width="600" height="780" style="border: none;"></iframe> using drive viewer visitors don't need additional software/plugin view files. you can adjust hei...

windows - C++ Issue with cin and CTRL + Z -

i'm reading c++ primer 5th , have little problem exercise: read sequence of words cin , store values vector. after you’ve read words, process vector , change each word uppercase. print transformed elements, 8 words line. my code this: #include <iostream> #include <vector> #include <string> #include <cctype> using std::vector; using std::string; using std::cin; using std::cout; using std::endl; int main(){ vector<string> words; string wordbuffer; vector<string> output(1); while (cin >> wordbuffer){ words.push_back(wordbuffer); } (string &word : words){ (char &letter : word){ letter = toupper(letter); } } unsigned currentline = 0; (decltype(words.size())index = 0; index < words.size(); ++index){ output[currentline] += words[index] + " "; if ((index+1) % 8 == 0){ ++currentline; output.p...

laravel blade form show me an exception error -

first of sorry bad english. have laravel form using blade template engine show me exception error. if remove code , use php form echo statmente fine , page show up. problem? here code {{ html::ul($errors->all()) }} {{ form::open(array('url' => 'news')) }} <div class="form-group"> {{ form::label('name', 'name') }} {{ form::title('name', input::old('title'), array('class' => 'form-control')) }} </div> <div class="form-group"> {{ form::label('email', 'email') }} {{ form::text('email', input::old('description'), array('class' => 'form-control')) }} </div> {{ form::submit('create nerd!', array('class' => 'btn btn-primary')) }} {{ form::close() }} there no such thing form::title() in laravel. try this {{ html::ul($errors->all()) }} {{ form::open(array('...

abap - What does the syntax ->* mean? -

i have read documents syntax ->* , still don't it. can explain means , in scenarios can use it? i have syntax in example: assign ovs_callback_object->query_parameters->* <ls_query_params> casting. the ->* operator "dereference" operator. turns type ref something type something . in example, ovs_callback_object->query_parameters reference, don't want assign reference field-symbol, want assign actual field reference points to.

excel - Python - Do Logical Comparisons with Different Text Encodings Make a Difference? -

i trying automate task of copying data excel application based on "tagname" column exists in both. i'm having python copy "tagname" , save variable each ("metertag" , "exceltag"). i've thrown tkmessagebox right before compare confirm values same (and are), if statement not being executed, else is. question is: python treat excel formatted text differently other copied texts? (how fix that?) otherwise else problem? click(573,745) time.sleep(.3) click_hold(625,357) win32api.setcursorpos((571,357)) click_release(571,357) ctcopy() time.sleep(.3) click(1116,264) win32clipboard.openclipboard() metertag = win32clipboard.getclipboarddata() win32clipboard.closeclipboard() time.sleep(.1) click(2295, 252) #top of tags excel time.sleep(1) click(2295, 252) #top of tags excel time.sleep(1) x in range (0,499): ctcopy() win32clipboard.openclipboard() exceltag = win32clipboard.getclipboarddata() win32clipboard.closeclipboard() time.sleep(.02)...

javascript - raising onkeypress element when input value is null -

i developing chat application user-typing , user-erasing functionality having difficulties in calling function when textarea chat input null( when user erase typed ) var msg=$("#chat_input").val(); if ((e.which== 8 || e.keycode == 8) && (msg.trim() == "" || msg.length <= 1)) { // call function } when user type 1 letter , erase function not called , if statement false how can fix backspacing last character or having new lines or spaces means this.value return false $('#chat_input').keyup(function(e){ if (e.which == 8 && this.value == false) { } }); jsfiddle demo value false if space, newline etc, don't need trim() ( msg.length <= 1 ) // = true when second last or last

R paste0 2 columns if not NA -

i paste0 2 columns if element in 1 column not na .if 1 element of 1 columns na keep element of other column only. structure(list(col1 = structure(1:3, .label = c("a", "b", "c"), class = "factor"), col2 = c(1, na, 3)), .names = c("col1", "col2"), class = "data.frame",row.names = c(na, -3l)) # col1 col2 # 1 1 # 2 b na # 3 c 3 structure(list(col1 = structure(1:3, .label = c("a", "b", "c"), class = "factor"),col2 = c(1, na, 3), col3 = c("a|1", "b", "c|3")), .names = c("col1", "col2", "col3"), row.names = c(na,-3l), class = "data.frame") # col1 col2 col3 #1 1 a|1 #2 b na b #3 c 3 c|3 as @roland says, easy using ifelse (just translate mental logic series of nested ifelse statements): x <- tran...