Posts

Showing posts from February, 2011

java - Convert String to Int with Integer.parseInt don't works -

i'm working javaee need convert this: request.getparameter("id") int . value of request.getparameter("id") "9" ( string ). when i'm trying convert int have java.lang.numberformatexception i've tried java.lang.integer.parseint(request.getparameter("id")) , request.getparameter("id",10) donsen't works... any solutions? thank you. a complete full proof code be string idstring = request.getparameter("id"); if(idstring != null) { try { system.out.println(idstring.trim()); // print verify int idint = integer.parseint(idstring.trim()); } catch(numberformatexception nbe) { nbe.printstacktrace(); } }

ios - cfhoststartinforesolution fails. get device name from IP address on LAN -

as part of assignment have scan lan , names of devices connected wifi. went through apples documentation this , many other s.o links this . resolution not happening, error occurs. not networking guy , hence of sounded greek me. same question has been asked here code. have written down error occurring in comments. an alternate answer helpful too. + (nsarray *)hostnamesforaddress:(nsstring *)address { // host reference given address. cfstreamerror streamerror; struct addrinfo hints; struct addrinfo *result = null; memset(&hints, 0, sizeof(hints)); hints.ai_flags = ai_numerichost; hints.ai_family = pf_unspec; hints.ai_socktype = sock_stream; hints.ai_protocol = 0; int errorstatus = getaddrinfo([address cstringusingencoding:nsasciistringencoding], null, &hints, &result); if (errorstatus != 0) return nil; cfdataref addressref = cfdatacreate(null, (uint8 *)result->ai_addr, result->ai_addrlen); if (addressref == nil) return nil; freeaddrinfo(result)

c - Different ways/approaches to how to send notification to every suscriber in a server/client tcp implementation -

so not make question way vague, want show i've thought far, , right have client (subscriber) connect , sends messages server (intermediary between subscribers , editors). i have list store every topic subscriber can subscribe to, , list of subscribers each node of list. as of right subscribers can register or drop out topic. issue notify every subscriber of topic when editor generate event. to thought of, well, go through list of topic of event, , send message each subscriber of said topic, subscriber gets it, he's been notified. but way can think of right have code: int sock_tcp; struct sockaddr_in dir_tcp_srv; sock_tcp=socket(af_inet,sock_stream,0); if(sock_tcp<0) { fprintf(stdout,"error\n"); exit(1); } bzero((char*)&dir_tcp_srv,sizeof(struct sockaddr_in)); dir_tcp_srv.sin_family=af_inet; dir_tcp_srv.sin_addr.s_addr=inet_addr(address_previously_stored); dir_tcp_srv.sin_port=htons(port_previously_stored); if(connect(sock_tcp,

ssh - X11 forwarding request failed to my OS X machine -

i not understand keeping me making x11 tunnel mac @ home, running os x 10.10.2. i'm getting (hostnames redacted privacy): cook47@rcmac (~ ): ssh -y mymac x11 forwarding request failed last login: thu apr 9 11:12:13 2015 xxx.xxx.xxx in sshd_config have set x11forwarding yes, , tried crank debugging loglevel debug3 don't see in system log. also, tried restarting x11.app no changes. suggestions on how troubleshoot this? ok, never mind, found it. using trick (controlmaster) in ssh config file share ssh connections, new connections reusing old connection.

c# - nHapi Patient Referral Message (REF_I12) PID Segment not being parsed -

i have issue nhapi pipeparser not appear parsing pid segment of ref_i12 (patient referral) message. if use exact same pid segment in different message (adt_a01), pid segment parsed. i'm using hl7 version 2.5 the following working code illustrates issue: using nhapi.base.parser; using nhapi.model.v25.message; using system; public class messagetester { public static void test() { var parser = new pipeparser(); var adtmsg = new nhapi.model.v25.message.adt_a01(); adtmsg.msh.messagetype.messagecode.value = "adt"; adtmsg.msh.messagetype.triggerevent.value = "a01"; adtmsg.msh.messagetype.messagestructure.value = "adt_a01"; adtmsg.msh.fieldseparator.value = "|"; adtmsg.msh.encodingcharacters.value = @"^~\&"; adtmsg.msh.versionid.versionid.value = "2.5"; adtmsg.pid.setidpid.value = "1"; adtmsg.pid.countycode.value = &qu

ios - Unable to extract individual script tags with NSRegularExpression regex -

i'm doing regex character except string on html file. i'm writing method remove script tags. the problem looks first <script> tag , last </script> , returns 1 result. i've tried bunch of stuff can't make pick intermediary ones. the regex'es worked out are: "<script[^>]*>((?!script).)*</script>" returns me nothing, believe closer need , "<script[^>]*>.*</script>" returns me single match. here code. str variable string contains 3 matches. should able run code. nsstring *str = @"<script type=\"text/javascript\">function setdisqusurl(){var _loc = window.location.href;disqus_url = _loc.split(\"?\")[0];}var disqus_url;setdisqusurl(); var disqus_shortname = 'rubydocbeta'; var disqus_shortname = 'ruby-doc'; (function() { var dsq = document.createelement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.s

python - Configure Blaze and start Bokeh server from Pyramid web-application -

i have pyramid web-application on customer ability plot large data sets interactively. the application displays sub-set of customer's selected data zoom, pan, hover, etc. capabilities using d3. however, in case user needs see full set same functionality, use bokeh server , use down-sampling. where running trouble down-sampling function can used plots employing serverdatasource. ideally, bokeh server running , push customer's selected data , use source down-sampled plot. however, far can tell, blaze doesn't allow me push data existing server. instead, thought when user requested plot, use 1 of pyramid's views modify blaze configuration file , start bokeh server. @view_config(route_name='startbokehserver', renderer = 'json',permission='view') def startbokehserver_view(request): r""" configures blaze_config.py file create dict containing customer's select reversal data starts bokeh server using modified

php - Can't add Constraint -

i kept getting exception: [illuminate\database\queryexception] sqlstate[hy000]: general error: 1215 cannot add foreign key constraint (sql : alter table `messages` add constraint messages_from_foreign foreign key ( `from`) references `id` (`users`)) [pdoexception] sqlstate[hy000]: general error: 1215 cannot add foreign key constraint here's createmessagestable class: public function up() { schema::create('messages', function(blueprint $table) { $table->bigincrements('id'); $table->biginteger('from', false, true); ... $table->foreign('from')->references('users')->on('id'); }); } and here's createuserstable class: public function up() { // http://laravel.com/docs/5.0/schema schema::creat

java - Cannot create JDBC driver of class '' for connect URL 'null' Error Code: 0 -

i searched , tried lot nothing helps. i getting "well known" -error. (error code: 0 - no more information) my persistence-.xml <?xml version="1.0" encoding="utf-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="jpa_pu" transaction-type="resource_local"> <non-jta-data-source>java:/comp/env/jdbc/jpaconnector</non-jta-data-source> <!-- <properties> --> <!-- <property name="eclipselink.target-database" value="sqlserver" /> --> <!-- <property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.sqlserverdriver" /&

html - Why is my height: 100% property not working? -

i need explained me. thought understood css; haven't bloody clue. body { margin:0; padding:0; } #contain{ position: relative; width: 100% height: 100%; } #wizard{ position: absolute; left: 5%; width:10%; height: 100%; background-color: black; } #main{ position: absolute; height: 100%; left: 15%; border-style: dashed; border-color: red; } <!doctype html> <html> <head> <title>demo</title> <script> //css here, removed purpose of question </script> </head> <body> <div id="contain"> <div id="wizard"> </div> <div id="main"> </div> </div> </body> </html> this 1 of basic examples of css positioning, , i've

Programmatically expire all sessions on Java web application restart -

i need way disable session persistence on tomcat restarts can bundled inside application. so figured out best way programmatically. the problem cannot find way of keeping collection of sessionids property of application scoped serializable bean , iterate on those, retrieving (recovering persistent storage , deserializing) session object corresponding each sessionid in order destroy it. instead seems solution keep same collection whole session objects. how can avoid , still able destroy session objects on application restart or whenever please in way independent of servlet container? this i've ended doing: i've kept indeed serializable application scoped bean serializable property: hashtable keys session ids , values timestamps of creation (i've used long instead of timestamp minimize memory footprint). i using httpsessionlistener implementation populate hashtable , eliminate expired sessions on sessioncreated , sessiondestroyed methods. the bean

php - Facebook OpenGraph GraphObject is returning empty object -

i'm trying read ratings facebook page display externally, using php sdk. have long live access token, , have been able use pull in main page data, when try access /ratings endpoint, receive empty array ( ) class facebookreviews { protected $session; protected $page; protected $ratings; protected $appid; protected $appsecret; function __construct($appid = null, $appsecret = null) { session_start(); $this->appid = '123456789123456'; $this->appsecret = '1234567890abcdefghijklmnopqrstuv'; facebook\facebooksession::setdefaultapplication($this->appid, $this->appsecret); $this->session = new facebook\facebooksession('long live access token generated on graph api'); try { $this->session->validate(); } catch (facebook\facebookrequestexception $ex) { // session not valid, graph api returned exception reason. echo $ex->getm

How compare custom fields date in wordpress? -

i doing task event management, have coded widget display coming or past events in sidebar, can not handle custom fields date. following code, while date being stored "m/d/y". please me resolve issue. in adance $today = date('m/d/y'); $args = array( 'post_type' => 'event', 'post_status' => 'publish', 'meta_key' => 'event_date', 'posts_per_page' => '5', 'meta_query' => array( array( 'key' => 'event_date', 'value' => $today, 'compare' => '<=', 'type' => 'date' ) ), 'orderby' => 'meta_value_num', 'order' => 

android - IM client and servers -

can explain how make basic im client old pc server, client can on ios or android? , please explain how work im , servers simultaniously. for android use google cloud messaging , similar messaging service ios. when client send's message, should sent gcm via upstream service , gcm push message server. server house deviceid's of client's , can push message whenever required client making api call gcm message , deviceid. check documentation gcm , clear idea. there other services gcm can work android ios reason using such service ensures messaging full proof. if client not having internet connectivity or switched off, shall receive message on getting internet connection. not have handle troubles!

Initialize int array with length of a input string in c++ -

this question has answer here: array size @ run time without dynamic allocation allowed? 7 answers i receive these errors 1. cannot allocate array of constant size 0 2. expected constant expression 3. 'numbers' : unknown size #include <iostream> #include <string> using namespace std; int main() { string str; int input_num; int sum; cout << "enter number:" << endl; getline(cin, str); const int length = str.length(); cout << "length:" << length<<endl; //input_num = stoi(str); int numbers[length]; return 0; } replace use of array std::vector , , initialize elements 0 . std::vector<int> numbers(length, 0);

vba - Using parameter from a form as part of a "like" sql statement -

i have query this: select name,label tablename label '*[form]![label search]![searchtxt]*'; i know query works in sense if replace "[form]![label search}![searchtxt]" actual word, query works. when run query is, data form doesn't go query no rows. how can part of query work input form. realize require vba in addition sql. thanks you need concatenate asterisks in. like: select name,label tablename label '*' & [form]![label search]![searchtxt] & '*';

html - 2 php functions have different utf-8 output in the same document -

i have following html 2 php functions render pdf: <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> </head> <body> <div> summary:<?php echo get_post_meta(get_the_id(), 'summary', true); ?> </div> <div class="post-content"> content:<?php utf8_encode(the_content()); ?> </div> </body> </html> they both have same content, output different. the summary prints: summary: let's go out the content prints: content: let?s go out this leads me believe in call affecting utf-8 decoding. both database tables use: charset=utf8 how can content section render properly? check if utf8 encode function can http://php.net/manual/en/function.utf8-encode.php

c - File Path to in memory file -

i have void *buffer instance of file in ram. the file type in format must parsed api given. unfortunately, way open file type through api supply api file path: sample_api_open(char *file_name, ...); i understand shm_open returns file descriptor, api takes file path. is there work around read type of file in memory? instead of using posix shared memory, open temporary file , mmap() it. make buffer end in mmap() -ed region can call api on temporary file.

sql - RPG IV Files processing issue -

i still learning rpg , as/400. coming ms c#.net. moving iseries machine , trying pickup ibm rpg , cl programming more needed company. the iseries version if reading right dspdtaara qss1mri: ==> "v7r1m000 2924" dspsfwrsc+ f11 : ==> 5770999 *base 5050 *code qsys v7r1m0 l00 5770ss1 *base 5050 *code qsys v7r1m0 l00 5770ss1 *base 2924 *lng qsys v7r1m0 l00 ... 5770wds 56 5101 *code qdevtools v7r1m0 5770wds 60 5050 *code qdevtools v7r1m0 here issue. i have flat file generated on old as400 machine , copied new iseries file delimited data (using ";" ) need reformat , export ftp further processing outside company. each record have either 29 or 28 columns. first thing using sqlrpgle program add delimiter records missing one. in flat file itself c/exec sql c+ select c+ max((length(trim(f00001))- length(replace(trim(f00001),';','

how to iterate over a shapefile in node.js -

i have following node.js code reads shapefile based on code ( https://github.com/mbostock/shapefile ) var shp=require('shapefile'); var path="polygons.shp" var encoding="utf8" function readrecords(path, encoding) { return function() { var callback = this.callback; shp.read(path, encoding, function(error, header, records) { callback(error, records); }); }; }; var rs = readrecords(path,encoding) console.log(rs) when execute above code : undefined any idea of how iterate on such object? you need read header before move reading records. bit of code logs entire shapefile console: var shapefile = require( 'shapefile' ), reader = shapefile.reader( 'polygons' ); var logger = function( error, record ) { console.log( record ); if( record !== shapefile.end ) reader.readrecord( logger ); } reader.readheader( logger );

java - Given a number N, can N be expressed as the sum of two or more consecutive perfect squares? -

at recent computer programming competition at, there problem have determine if number n, 1<=n<=1000, palindromic square. palindromic square number can read same forwards , backwards , can expressed sum of 2 or more consecutive perfect squares. example, 595 palindrome , can expressed 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2. i understand how determine if number palindrome, i'm having trouble trying figure out if can expressed sum of 2 or more consecutive squares. here algorithm tried: public static boolean issumofsquares(int num) { int sum = 0; int lowerbound = 1; //largest square root less num int upperbound = (int)math.floor(math.sqrt(num)); while(lowerbound != upperbound) { for(int x=lowerbound; x<upperbound; x++) { sum += x*x; } if(sum != num) { lowerbound++; } else {

bash - AWK matching values in a column and performing calculation -

i'm new @ awk , i'm trying figure out answer problem. have flat file following values: 403 | sanmateo | f | 2015-04-09 18:50:24.38 403 | sanmateo | t | 2015-04-09 18:45:24.36 403 | sanmateo | t | 2015-04-09 18:40:24.383 403 | sanmateo | f | 2015-04-09 18:35:24.357 403 | sanmateo | t | 2015-04-09 18:30:24.355 404 | redwoodcity| f | 2015-04-09 18:35:50.308 404 | redwoodcity| t | 2015-04-09 18:30:50.242 404 | redwoodcity| f | 2015-04-09 18:25:50.245 404 | redwoodcity| t | 2015-04-09 18:20:50.242 404 | redwoodcity| f | 2015-04-09 18:15:50.242 i want use awk compare $1 of current line $1 of next line, , $3 ~/f/. if statement true subtract $4 of next line $4 of current line , write difference in new column of current line , if false nothing. have far this: awk 'begin {fs="|";} {if (nr $1 ~ nr++ $1 && $3 ~ /f/) subtract = nr $4 - nr++ $4; {print subtract}}' allhealthrecords_sorted and that's not working. can please help? sav

sql server - Using SQLCMD in a batch file, how can I parse the response and check for an error? -

i'm using sqlcmd count of rows in table, want aware if query hits error. the sqlcmd i'm using looks this: sqlcmd -s %server% -u %user% -p %pass% -b -q "select count(*) %table%" if works, return: ----------- 10205 (1 rows affected) (note, there blank line above ------- column name i'm not specifying.) if pass in table doesn't exist, following response: msg 208, level 16, state 1, server devserver, line 1 invalid object name 'dbo.no_table'. since have -b flag, can check errorlevel value (in case, 1). to store count variable, i've been using following line: for /f %%i in ('sqlcmd -s %server% -u %user% -p %pass% -b -q "select count(*) %table%" ^| findstr /r "[^(][0-9]"') set /a rec_count=%%i after for, %errorlevel% returns 0. inside do, errorlevel 0. is there simple way run sqlcmd, store count if there not error, , print both lines if there error? commands executed /f implicitly ex

sql server - High extent scan fragmentation but low Logical Scan Fragmentation -

i'm still new sql server, when run dbcc showcontig on table, shows logical scan fragmentation not big extent scan fragmentation big, made me little confused. dbcc showcontig scanning 'user' table... table: 'user' (462624691); index id: 1, database id: 6 table level scan performed. - pages scanned................................: 2638 - extents scanned..............................: 335 - extent switches..............................: 578 - avg. pages per extent........................: 7.9 - scan density [best count:actual count].......: 56.99% [330:579] - logical scan fragmentation ..................: 12.93% - extent scan fragmentation ...................: 94.03% - avg. bytes free per page.....................: 805.1 - avg. page density (full).....................: 90.05% dbcc execution completed. if dbcc printed error messages, contact system administrator. seeing manual on msdn , 1 fragmentation on pages

security - Is there a way to use HP Fortify 360 to scan a single file? -

it takes long process entire project see if you've fixed 1 problem. there way scan 1 page make process quicker while debugging? assuming there no dependencies? can run entire project through after i've cleared of errors listed. thank you! install fortify plug-in ide (eclipse or visual studio). open file in ide , run scan. assuming have bug tracker (bugzilla or jira) associated ide, can post bug later action. i advise against uploaded resulting fpr file software security center not comparable existing project fpr files.

javascript - X-Axis Format in Kendo-UI -

i have started on telerik kendo. have put data display. x axis readable in current format. how format it? <base href="http://demos.telerik.com/kendo-ui/line-charts/date-axis"> <script src="http://cdn.kendostatic.com/2015.1.408/js/jquery.min.js"></script> <script src="http://cdn.kendostatic.com/2015.1.408/js/kendo.all.min.js"></script> <body> <div id="example"> <div class="demo-section k-content"> <div id="chart"></div> </div> </div> </div> <script> var stats = [ { x: 0, y: 0 }, { x: -3.88770423666098, y: 945.987507963258 }, { x: -4.24922990437403, y: 985.985280150689 }, { x: -2.91182688405784, y: 1080.95341

PHP MVC - Is my controller too fat? -

i think put code in controller supposed go in model. this part of controller, i'm not gonna paste since there lot of code. public function ajaxusers() { if($_get["action"] == "listusers") { if(!isset($_post["search"])) { $this->_data['records'] = $this->_model->getusers(); $this->_data['result'] = "ok"; $this->_data['totalrecordcount'] = $this->_model->countusers(); } else { foreach($_post['fields'][0] $key => $post) { if ($post != "" && $key != "reg_date") { $searchterms = explode(' ', $post); foreach ($searchterms $term) { $term = trim($term); if (!empty($term)) { $like[] = $key." '%".trim($term, '\'')."%

How do I write PHP curl code and use proper param formats to pull back Facebook Ads reach estimate -

facebook provides shell curl command example how pull reach estimate. so.. curl -g \ -d "currency=usd" \ -d "targeting_spec=___" \ -d "access_token=___" \ "https://graph.facebook.com/<api_version>/act_<ad_account_id>/reachestimate" how format targeting_specs params correctly , write php curl extension? a couple of things note here. when converting shell curl command php, 1 might assume since targeting_spec have lot of data, best way facebook graph post data. facebook graph graph call not accept post, returns (invalid post error when try) fount out need use param string $postdata = array( 'currency' => 'usd', 'access_token' => $this->_access_token, 'targeting_spec' => urlencode(json_encode($targetingarray)), ); targeting array contain targeting data such genders, age_min, age_max, zips etc, plus advanced demographics might have such behavio

ios - FMDB ResultSet always returns only one row -

i trying use sqlite database in 1 of projects. it working fine; reason, happened , couldn't find bug. the resultset object quit after first record. array has 1 record in it. (probably left while because of error) i created dbmanager class, , dbmanager class contains different inner classes. have private global fmdatabase instance (and initialise somewhere before using it) as see, there 2 different print error line when run, second print line gives error: error calling sqlite3_step (21: out of memory) rs error domain=fmdatabase code=7 "out of memory" userinfo=0x790308d0 {nslocalizeddescription=out of memory} and array should contain on 300 records, has 1 record in it. (last print line 1) this part looking simple. (i have totally similar code somewhere else, works fine) private var database : fmdatabase! class dbmanager{ class element{ class func get()->[dataelement]{ database.open() println( database.lasterr

matlab - How do I convert the whole image to grayscale except for a sub image which should be in color? -

i have image , subimage cropped out of original image. here's code have written far: val1 = imread(img); val2 = imread(img_w); gray1 = rgb2gray(val1);%grayscaling both images gray2 = rgb2gray(val2); matchingval = normxcorr2(gray1,gray2);%normalized cross correlation [max_c,imax]=max(abs(matchingval(:))); after stuck. have no idea how change whole image grayscale except sub image should in color. how do this? thank you. if know coordinates image, can use rgb2gray on section of interest. for instance, tried on image now: im(500:1045,500:1200,1)=rgb2gray(im(500:1045,500:1200,1:3)); im(500:1045,500:1200,2)=rgb2gray(im(500:1045,500:1200,1:3)); im(500:1045,500:1200,3)=rgb2gray(im(500:1045,500:1200,1:3)); took rows (500 1045), columns (500 1200), , rgb depth (1 3) of image , applied rgb2gray function that. did 3 times output of rgb2gray 2d matrix , color image 3d matrix, needed change layer layer. this worked me, making part of image gray leaving rest in co

swing - How to set up a login Jframe with multiple logins with a different frame for each in Java? -

i don't have trouble in making frames themselves. issue stuck on how differentiate between frame pull up.the program writing begins login frame , based off user enters pulls associated frame. instance if user student after login frame see new student frame available options them. or if user instructor after enter credentials new instructor frame pulls there options. said above can make frames no problem unsure how differentiate between them after login frame from explanation, keep frames in sort of map . frames assigned values, frame names assigned keys. then, able call : map.get("student").show(); map.get("teacher").show(); or, logintype user names : map.get(logintype(username)).show(); private abstract string logintype(string username);

Android Rotation (Load Layout) data loss (id and data / Custom Objects etc.) -

i turning view, same horizontally. contains many variables of type textview , progressbar , imageview , etc .. can not load variables when rotated. i tried do: android: configchanges = "keyboardhidden | orientation | screensize | screenlayout" i find methods can save customized classes, progressbar, views "my nothing." http://i.imgur.com/a1ugd3w.png when there anyway load landscape (another layout (with same id's)) of not losing data? to change layout use: http://developer.android.com/reference/android/app/activity.html#onconfigurationchanged(android.content.res.configuration) update code 10/04/2015 (0:45 am) my rotation : @override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); if (newconfig.orientation == configuration.orientation_landscape) { super.onconfigurationchanged(newconfig); setcontentview(r.layout.activity_1); } else if (newconfig.orientation

html - Is this a placeholder link or not? -

html5 specifies <a> elements without href "placeholder links". decent explanation of placeholder link use-cases here . contentious discussion during definition of html5 spec here . there precise definition of or isn't placeholder link. anyway, we're trying figure out whether text not clickable should placeholder link (using <a> ) or regular <span> . we have web app list this: 12/10/2014 invoice #123 12/18/2014 invoice #456 01/19/2014 no invoice 01/19/2014 multiple invoices the first 2 items in list hyperlinks valid urls. latter 2 not clickable. first because there's no invoice. second in theory have been clickable, it's rare use-case our team chose not write code support, show static text instead of making link. because of way list populated in code, technically simpler make these <a> elements , omit href attribute latter two. correct thing do? you're use case doesn't match. intent of pl

Java: Why can't I output a String converted from StringBuffer to the console in it's entirety? -

when debug code below, in "variables" view, both response , this.response show entire 1,779 lines of streamed input http://www.google.com . if, however, want output this.response console system.out.println(this.response.tostring(); , outputs last few lines. initially thought limitation of string class. test copied 1,779 lines , assigned them test string variable. when output test string variable, output 1,779 lines console fine. what missing both this.respponse , response show entire document, when go output either of them, last few lines? public class classc { private string url = "http://www.google.com"; private url url; private httpurlconnection con; private string response; public static void main(string[] args) { new classc(); } public classc() { try { url = new url(url); con = (httpurlconnection) url.openconnection(); inputstream = con.getinputstream();

oracle - SQL error code table doesn't exist...? -

i'm frusterated...i spent 3 hours on , still can't fix these errors... here's sql tables , values. create table order_mys ( orderid number(3) not null, orderdate date not null, custid char(5) not null, primary key (orderid), foreign key (custid) references customer_mys ) ; create table orderdetail_mys ( orderid number(3) not null, productid number(3) not null, productqty number(4) not null, prodcutprice number(6,2) not null, primary key (orderid, productid), foreign key (orderid) references order_mys, foreign key (productid) references product_mys ) ; error code order table sql> sql> create table order_mys ( 2 orderid number(3) not null, 3 orderdate date not null, 4 custid char(5) not null, 5 primary key (orderid), 6 foreign key (custid) references customer_mys 7 ) ; foreign key (custid) references customer_mys

Import python modules given direct path -

i have module __init__.py located in specific path. i: import sys sys.path.append('c:/users/me/dropbox/python/library/moduledir') but when from moduledir.x import classa , doesn't recognize statement meaning wasn't able find module. missing? under moduledir : moduledir __init__.py x.py subdir __init__.py y.py you need add directory containing package subdir path: sys.path.append('c:/users/me/dropbox/python/library') see docs.

objective c - iOS move view above keyboard left black space -

Image
i using uiview button @ bottom of view. want move button right above keyboard when keyboard shows / changes height. the code using is: - (void)keyboardframedidchange:(nsnotification *)notification { cgrect keyboardendframe = [[[notification userinfo] objectforkey:uikeyboardframeenduserinfokey] cgrectvalue]; cgrect keyboardbeginframe = [[[notification userinfo] objectforkey:uikeyboardframebeginuserinfokey] cgrectvalue]; cgrect newframe = self.view.frame; cgrect keyboardframeend = [self.view convertrect:keyboardendframe toview:nil]; cgrect keyboardframebegin = [self.view convertrect:keyboardbeginframe toview:nil]; newframe.origin.y -= (keyboardframebegin.origin.y - keyboardframeend.origin.y); self.view.frame = newframe; } and in viewdidload: [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(keyboardframedidchange:) name:uikeyboarddidchangeframenotification object:nil]; this code works find on iphone6, if in iphone 5 , us

r - how can I use the object of a variable to represent a variable -

for example, name <- c("chlyt1","chlyt2") assign(name[1], 2) assign(name[2], 4) result <- name[1] i want result 2 ,not chlyt1 you could achieve using result <- get(name[1]) but it's unconventional , recipe lot of confusion. there several approaches deal kind of situations. super simple 1 use simple vector named elements : values <- c(chlyt1 = 2, chlyt2 = 4) then can access values with, obviously, name: result <- values["chlyt1"] or position result <- values[1] or position of name (corresponding approach) result <- values[names(values)[1]] in situations, result equal 2 .

ruby on rails - bootstrap-datepicker throws jQuery not defined -

i'm trying use bootstrap-datepicker on rails 4.2. after following instructions datepicker doesn't work , following error in javascript console. uncaught referenceerror: jquery not defined line raising error bootstrap-datetimepicker.js first line reference error thrown. // neither amd nor commonjs used. use global variables. if (!jquery) { throw 'bootstrap-datetimepicker requires jquery loaded first'; } if (!moment) { throw 'bootstrap-datetimepicker requires moment.js loaded first'; } application.js file //= require jquery //= require jquery_ujs //= require turbolinks //= require bootstrap-sprockets //= require moment //= require bootstrap-datetimepicker //= require_tree . $(function() { $('.datepicker').data({behaviour: "datepicker"}).datepicker(); }); any ideas what's causing this? looks jquery isn't loading though it's placed above bootstrap-date

Using Visual Basic to Make Average Test Score Generator in C# -

i'm trying create calculator assignment takes 3 integer inputs , takes average , returns user. i'm using visual basic (it required) make gui. i'm having trouble 2 things, first, cannot aver divide 3 because not integer , second, not know how output average in last textbox. using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace windowsformsapplication1 { public partial class form1 : form { private string userinfo1; private string userinfo2; private string userinfo3; private string aver; private string num1; public form1() { initializecomponent(); } private void button1_click(object sender, eventargs e) { int aver = 0; aver = int32.parse(userinfo1 + userinfo2 + userinfo3); } private void textbox1_textchanged(object sender, eventa

Word VBA: iterating through characters incredibly slow -

i have macro changes single quotes in front of number apostrophe (or close single curly quote). typically when type "the '80s" in word, apostrophe in front of "8" faces wrong way. macro below works, incredibly slow (like 10 seconds per page). in regular language (even interpreted one), fast procedure. insights why takes long in vba on word 2007? or if has find+replace skills can without iterating, please let me know. sub fixnumericalreversequotes() dim char range debug.print "starting " + cstr(now) selection total = .characters.count ' looking ahead 1 character, need @ least 2 in selection if total < 2 return end if x = 1 total - 1 a_code = asc(.characters(x)) b_code = asc(.characters(x + 1)) ' want convert single quote in front of number apostrophe ' trying use numerical comparisons speed if (a_code = 1