Posts

Showing posts from September, 2015

Perl - how to grep a block of text from a file -

it can in xml or text format. how in general grep block of text in perl? <track type="ws"> <range> <rangestart>0</rangestart> <rangeend>146.912</rangeend> <locationindex>0</locationindex> <propertyindex>0</propertyindex> </range> </track> <track type="ps" id="1"> <range> <rangestart>0</rangestart> <rangeend>146.912</rangeend> <locationindex>1</locationindex> <propertyindex>1</propertyindex> </range> </track> i want grep type="ps" , till </range> . one solution open file, read line line , match block. open(fh, "file.txt"); foreach $line (<fh>) { if ($line =~ m/type="cc"(.*?)<\/range>/) { print $1; } } but there more optimal solution without reading file line l

android Nullpointerexception with intent data=null always -

i creating app, contains 3 activities, say, a, b , c. activity main activity, launches when app opens. activity called activity b using startactivityforresult(intent, 1); activity b returns result, captured, , within onactivityresult of activity a, launching activity c using startactivityforresult(intent2, 2); here onactivityresult activity a @override protected void onactivityresult(int requestcode, int resultcode, intent data){ log.d("main","inside on activity result requestcode : " + requestcode); if(requestcode == 1){ if(resultcode == result_ok){ log.d("mainact", "inside result code ok"); if(data.getstringextra("puzzleid")!=null){ log.d("mainact", "inside puzzle has been selected"); string puzzleidresult = data.getstringextra("puzzleid"); intent puzzleintent = new intent(mainactivity.this, trialactivity.cla

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

Image
if set mycoolbar.fixedorder true,only grip on first band hidden. well,if use delphi 7 create vcl forms application,then put coolbar on , create 3 coolbans hold other controls,only grip , top coolbands can hidden setting mycoolbar.fixedorder:=true. i've uploaded picture make things clear. you got fixedorder property wrong. fixed property not allow bands rearranged if set true . setting property of coolbar true keep user changing bands order @ runtime, user can still move , resize bands. can give advice can do, actual solution problem, well, have wait answer. my advice use 3 coolbars in row , setting "fixedorder" property true , bandborderstyle bsnone . way grip hidden on of them. about property, it's not bug of ide, actual preference of property.

mysql - Can PHP 5.4 run on PHP 5.3 configured server -

first of all, novice web developer. my question "a website developed php 5.4 can run on php 5.3 configured server?" (detail description) configure myself apache 2.4, mysql 5.6 , php 5.4.12 on windows. everything's ok. errors occur when changed website folder machine configured wampserver. wampserver configured apache 2.2.11, php 5.3 , mysql 5.1.36. i install mysql 5.6 on machine , database connected. "parse error occur code" such $country = mysql_fetch_row(querymysql("----"))[0]; in addition, showed other errors such "table 'emp.productcateogry' doesn't exist". please, give me suggestions. the short answer is: no, should not expect to, if using new features of php 5.4 within code. the specific error referring with: parse error occur code is because line $country = mysql_fetch_row(querymysql("----"))[0]; is using new feature: function array dereferencing which, prior php

connection - Bluecove : restart bluetooth stack programmically -

i'm trying close bluetooth service, bluecove has bug on connection close method ( https://code.google.com/p/bluecove/issues/detail?id=90 ) , trying workaround restart service. think restarting bluetoot stack solve problem. can programmically? i'am using microsoft bluetooth stack. problem solved in way. i restart application, firstly shut down bluecove manually. bluecoveimpl.shutdown(); if restart application, bluecove shut down, cannot initialize bluetooth stack during start. here restart method: public static void restartapplication(runnable runbeforerestart) throws ioexception { try { // java binary string java = system.getproperty("java.home") + "/bin/java"; // vm arguments list<string> vmarguments = managementfactory.getruntimemxbean() .getinputarguments(); stringbuffer vmargsoneline = new stringbuffer(); (string arg : vmarguments) {

how to use preloader in Grid View in android -

Image
i want use preloader image in gridview images when loading form remote server. while loading server @ time want show preloader image this(same progress bar or progress bar). i want show small progress bar there in gridview image item or preloader image dnt know can use me achieve this. can please me how can thing in android. i want make ios. image form ios. here android layout xml file : activity_image_grid.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" > <include android:id="@+id/title_bar" android:layout_alignparenttop="true" layout="@layout/activity_top_header_bar" /> <gridview android:id="@+id/gridview" android:layout_width="fill_parent" an

javascript - Animating array of divs; only the final element is modified -

this baffling me @ moment. i'm experienced programmer looking throw bit of surprise fiancee on countdown page our wedding. desired effect simulated confetti falling behind main page. setup follows: i have array of divs in javascript. each div absolutely positioned on page. have interval set updates every 50 or milliseconds. on each tick, run loop on array of divs, , calculations , update positions. problem problem having, however, though can see divs created, stored array, , modified (in case, each has slight randomized rotation) during initialization phase, once tick update position starts, div stored in whatever last slot of array gets position updated. tried hard-coding each div index testing purposes, strictly last element update position. upon printing current "left" , "top" style values each div before , after calculations shows value has been changed, no visible change noticeable. here's basic code: javascript var container;

Java endpoint - perl consumer web service -

i've problem calling java endpoint (code below) perl client (activeperl 5.16). code snippets book java web services , running package ch01.ts; import javax.jws.webmethod; import javax.jws.webservice; import javax.jws.soap.soapbinding; import javax.jws.soap.soapbinding.style; @webservice @soapbinding(style=style.rpc) public interface timeserver { @webmethod string gettimeasstring(); @webmethod long gettimeaselapsed(); } package ch01.ts; import java.util.date; import javax.jws.webservice; @webservice(endpointinterface="ch01.ts.timeserver") public class timeserverimpl implements timeserver { public string gettimeasstring() { return new date().tostring(); } public long gettimeaselapsed() { return new date().gettime(); } } package ch01.ts; import javax.xml.ws.endpoint; public class timeserverpublisher { public static void main(string[] args) { endpoint.publish("http://127.0.0.1:9876/ts&

android - how to show inbox messages in list view -

i want show inbox messages in list view. have tried many way's seem there error .. can tell different approach . public class inbox extends listactivity { arraylist<string> listitems = new arraylist<string>(); arrayadapter<string> adapter; protected void oncreate(bundle savedinstancestate) { uri urisms = uri.parse("content://sms/inbox"); cursor c = getcontentresolver().query(urisms, null, null ,null,null); if(c.movetofirst()) { for(int i=0; < c.getcount(); i++) { string body = c.getstring(c.getcolumnindexorthrow("body")).tostring(); listitems.add(body); c.movetonext(); } if(listitems.isempty()) listitems.add(&q

delphi - Show error message that is raised from SQL Server -

i use "adoconnection" connect sql server , use below code in adoquery : begin try ... end try begin catch raiserror(ltrim(str(error_number()))) end catch when call error message : "adoconnection.errors[0].nativeerror" returns "5000" and when call error message : "adoconnection.errors[0].number" returns negative number! how can right error number sql server? all own errors mssql have error_number 50000. can register own messages using sp_addmessage , using them clumsy. mssql 2012 have new keyword throw , want. so can on 2008, assuming recover failure in catch block: you can construct own error message, in exception.message error_number worthless error_severity severity different purposes hey, there error_state, can use :) for stored procedures, can use return value or output parameter passing information success or failure begin try begin tran -- -- code -- if @@rowcount = 0 or @someyourval

iphone - Event handling in subclass of UIView -

as guide event handling guide ios mentions, when create own subclass of uiview: all views process touches expect receive full touch-event stream, when create subclass, keep in mind following rules: - if custom responder subclass of uiview or uiviewcontroller, should implement of event handling methods. - if subclass other responder class, can have null implementation of event methods. **- in methods, sure call superclass implementation of method.** however in "best practices handling multitouch events" part of guide, says: if handle events in subclass of uiview, uiviewcontroller, or uiresponder: - implement of event handling methods, if implementations of methods nothing. **- not call superclass implementation of methods.** if handle events in subclass of other uikit responder class: - not have implement of event handling methods. **- in methods implement, sure call superclass implementation. example, [super touchesbegan:touches withevent:event].

c++11 - How to enable C++ multithreading? -

i've been trying multithreaded c++. installed new dev c++ 5.4.1 , added -std=c++11 compiler options. added #include <thread> somewhere in source code, , std::thread mythread (some_func) . when compile source file, compiler error "thread defined in scope". what have have working? official build of mingw (that compiler dev-c++ uses) has no support standard library threads now. you can use boost::thread drop in replacement (api similiar enough) or use microsoft visual c++, or try programming g++ on linux (this have done recently, using virtual machine).

OCaml standard committee? -

i doing presentation on ocaml, want put if there standard comittee or not. searched internet far , wide , couldn't answer that, asking here. ocaml not follow national or international standard. language whatever gallium (formerly cristal) group @ inria want be.

python huffman coding Exception Unorderable Types -

i trying write huffman coding in python 3 code http://en.literateprograms.org/huffman_coding_%28python%29 doesn't work. if run code in python 2.7, works well. the following lines problem: heapq.heapify(trees) while len(trees) > 1: childr, childl = heapq.heappop(trees), heapq.heappop(trees) parent = (childl[0] + childr[0], childl, childr) heapq.heappush(trees, parent) i typeerror in heapq.heappush(u,parent): "unorderable types: tuple() < str()" so i've searched solution, , think, have implement _ lt _ function. possible 2 or more nodes have same frequency, heapq tries compare tuples , think, can't compare tuple of tuple. dont know , how have create compare-method solve problem? can help? ;-) the reason in python3x can't compare items of 2 different type: >>> "foo" < 1 traceback (most recent call last): file "<ipython-input-5-de2fb49cc8c4>", line 1, in <module> "f

java - Android metadata with manifest file - nullPointerException -

i attempting access metadata activity manifest file. the manifest looks : <activity android:name="co.uk.benbun.nvrrclubapp.mainactivity" android:label="@string/app_name" > <meta-data android:value="newstag" android:name="news"></meta-data> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> the code access it, looks : try { applicationinfo ai = getpackagemanager().getapplicationinfo(this.getpackagename(), packagemanager.get_meta_data); bundle bundle = ai.metadata; string myapikey = bundle.getstring("news"); } catch (namenotfoundexception e) { log.e("metadata", "failed load meta-data, namenotfound: " + e.getmessage());

javascript - How to make time function update itself? -

when load in browser it'll show time when page loaded, won't update every second. how do this? var h = date.gethours(); if(h<10) h = "0"+h; var m = date.getminutes(); if(m<10) m = "0"+m; var s = date.getseconds(); if(s<10) s = "0"+s; document.write(h + " : " + m + " : " + s); use setinterval : setinterval(clock, 1000); function clock() { var date = new date(); var h = date.gethours(); if(h<10) h = "0"+h; var m = date.getminutes(); if(m<10) m = "0"+m; var s = date.getseconds(); if(s<10) s = "0"+s; document.write(h + " : " + m + " : " + s); } although want update html element rather document.write page every second. http://jsfiddle.net/bqnwj/

Can't add member into MongoDB replica-set -

i using mongodb 2.4.3, , following wizard: http://docs.mongodb.org/manual/tutorial/deploy-replica-set/ but when adding other members replica-set, following error: root@vm3:~# mongo mongodb shell version: 2.4.3 connecting to: test rs1:primary> rs.add("vm1") { "errmsg" : "exception: set name not match set name host vm1:27017 expects", "code" : 13145, "ok" : 0 } rs1:primary> rs.add("vm4") { "errmsg" : "exception: set name not match set name host vm4:27017 expects", "code" : 13145, "ok" : 0 } vm1, vm3 , vm4 know each other because configured /etc/hosts files correctly. any idea? don't understand error message mean! after restarting vms, works now. root@vm3:~# mongo mongodb shell version: 2.4.3 connecting to: test rs1:primary> rs.add("vm4") { "ok" : 1 } rs1:primary> rs.add("vm1") { "ok" : 1

sed - How to process only one column and convert unix time in text file in BASH -

i have text file table like 367612510.243586 717.860170 367612512.493918 722.249134 367668441.429983 692.407935 367668479.810461 692.407935 367668482.618858 727.953771 367668515.150386 727.953771 where first column unix time, , second value. want display list human readable date , time in bash. how it? it possible additional script file , xargs, i'm looking way in 1 line. try awk '{print strftime("%c",$1)}' input.txt another approach using while-loop in bash while read d _; date -d @$d; done < input.txt update: bash solution print second field well while read f1 f2; echo $(date -d @$f1) $f2; done < input.txt

html - Is it possible to use the URL to change the CSS being applied? -

i have 2 pages have related topics, , share significant amount of data & text between 2 pages. since these 2 pages both linked same location, side side, wondering if can use argument link change css being applied , have data on 1 page. the original setup: domain.com/subdir/one.page.php domain.com/subdir/two.page.php can use instead? domain.com/subdir/full.page.php?one domain.com/subdir/full.page.php?two and that, have page selectively use css visible attribute change displayed on screen? no, css cannot affected url. instead, should use server-side programming language display appropriate content.

java - Can't get System.exit() to work in dragon12 project -

i have working system.exit(0) . should exit time remaining if button pressed. i'm not sure do. appreciated. /* creates perfect hard-boiled(simulates 12 minutes in boiling water) or soft-boiled egg(simulates 6 minutes in boiling water). both options require 10 seconds of rinsing under cold water after necessary time boiling. allow user exit remaining time. */ import java.io.*; import java.util.*; public class advancedeggmaker { public static void main(string[] args) { mcu mcu = null; try { mcu = new mcu(new communicator(args[0])); } catch (ioexception e) { system.out.println(e); } mcu.println("sw2 - hb egg", 0); mcu.println("sw3 - sb egg", 1); while (true) { int sw = mcu.getswitch(); if (sw == 2) { mcu.println("hard boiled egg", 0); mcu.println("place egg in&

android - fixed header scrolls/drags in jquery mobile -

Image
i working on mobile web app using jquery mobile , phonegap. developed hello world app. has header, footer , contents area. header , footer fixed using data-position="fixed" attribute. problem header , footer is, when scroll down , when contents finished , there not need scroll anymore header drags down(for flexibility or indication , there not more contents). in other ios apps, feature exists in apps header , footer not drags , down contents area drags. please see picture mean as in above picture header dragged towards bottom side not want. want content area have feature. how can make way contents area drags when there no more contents available see? any css, jquery or jquery mobile trick? update html code here <div data-role="page"> <div data-role="header" id="header" data-position="fixed"> <h1>page title</h1> </div><!-- /header --> <div data-

Building relative to src/ directory with SCons -

i have app following (i have thought quite common) directory hierarchy: /src subdir1/ # subdirs more source files. more.c sconscript foo.c # source files. foo.h sconscript /other # other top-level directories no source code. /stuff # however, there other assets may want build. readme # other top-level files. sconstruct the problem when run scons top-level directory, calls gcc directory without cd ing src , this: gcc -o src/foo.o src/foo.c this problematic several reasons: within program, #include files giving path relative src directory. example, more.c include foo.h #include "foo.h" . fails because gcc run parent directory. don't want change includes #include "src/foo.h" . i use __file__ special macro things logging. when built top-level directory, gcc puts " src/ " @ front of filenames, since path given compile. may seem picky, don't want that, because think of sourc

ios - UITableView with complex cells is slow and laggy -

i've finished app , seems work main view. it's uiviewcontroller embedded uitableview . i'm using parse backend, , array of objects need in viewdidload method. each cell contains data i'm fetching in tableview:cellforrowatindexpath , i'm afraid reason why table view laggy, don't know how fetch data need each object in array without having indexpath.row number. i've made each cell element "opaque" suggested in other answers. this code, appreciated: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cellht"; cellht *cell = (cellht *)[tableview dequeuereusablecellwithidentifier:cellidentifier]; if (!cell) { cell = [[cellht alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; } // self.hh nsarray containing objects nsuserdefaults *prefs = [nsuse

css padding an image inside a listitem (navigation bar) -

i have image displayed every listitem on navigation bar, problem cannot use padding left 10px, browser think listitems need padding left instead of background-image. is there way can substract background-image property #menu li selector, without affecting other background-image properties on page? #menu li a{ display:block; font-family:tahoma, geneva, sans-serif; font-size:12px; color:#ffffff; text-decoration:none; background-color: #376596; padding-top:2px; padding-left: 20px; padding-bottom: 2px; background-image:url('http://images.subeta.net/smilies/6398_emoticon_smile.gif'); background-repeat:no-repeat; } you can watch full code here i've been looking on web solution, english isn't sufficient enough search problem because dont know words/terms should ask i'm still rookie. just try background-position. menu li a{ background-position:10px 0px; }

android - Unable to start main activity which has build by maven -

i had 3 proejct: parent, source , library project. problem following: after successful mvn install android:deploy android:run application get`s crash following message: 05-04 17:22:10.564: e/androidruntime(6574): fatal exception: main 05-04 17:22:10.564: e/androidruntime(6574): java.lang.runtimeexception: unable instantiate activity componentinfo{com.fruit.apple/com.fruit.apple.splashscreenactivity}: java.lang.classnotfoundexception: com.fruit.apple.splashscreenactivity in loader dalvik.system.pathclassloader[/system/framework/com.google.android.maps.jar:/mnt/asec/com.fruit.apple-1/pkg.apk] actually don`t know should there problem, appreciate help. thanks, karoly ps part of pom.xml <plugin> <groupid>com.jayway.maven.plugins.android.generation2</groupid> <artifactid>android-maven-plugin</artifactid> <version>3.2.0</version> <configuration> <sign>

android - Save Setting onDestroy -

how save setting after exit app using ondestroy? example: when app start, start main_activity.class button button1; public class main_activity extends activity { super.oncreate(savedinstancestate); ................ } added button named "button1" , give action open new activity when clicked public void button1_newactivity (view v){ button1 = (button) findviewbyid(r.id.button1); button1.setonclicklistener (new view.onclicklistener() { public void onclick(view arg0) { intent secondactivity=new intent (getapplicationcontext(), second_activity.class); startactivity(secondactivity); } }); } added 2 checkbox on second_activity.class, default when app start checkbox1 selected , checkbox2 not selected. but, when checkbox2 selected , checbox1 automatically not selected, after pressed button start third_activity.class. my question how can save setting, when exit app, start app again, automatic

automation - Saving one image to very many resolutions -

for special case of use need resize large image many resolutions, beginning 1080px height down 300px height. so need 1080px, 1079px, 1078px, 1077px, ... in height proportionally scaling down image each time (ideally renaming image-1080, image-1079, image-1078, ...). of course repeat scaling , exporting image 700 times myself, thats not want do. not figure out how automate task in adobe photoshop (or other program). does know solution how solve problem? image scaled down, there should not huge quality loss of these resolutions. using imagemagick's convert utility: for in {1080..300}; convert -resize x$i image.png image-$i.png; done explanation: for bash script loop, loop variable $i {1080..300} range of numbers, 1080, 1079, ... 301, 300 convert im utility modifies file , saves new name -resize xnnn resizes image new height, changing width proportionally so loop run series of commands: convert -resize x1080 image.png image-1080.png convert -resi

charts - WPF Charting toolkit change axis interval labels programatically -

i'd programatically change interval of labels on x axis of line chart. thing i've found how in xaml file: https://stackoverflow.com/a/8944925/2302510 , works fine. can hours/days/months etc. need change according interval i'm displaying. user can choose display 1 week, 1 month, 1 year or other given interval , when leaving default overcrowds x axis dates makes quite confusing. advice. you can assign name axis , call code-behind. xaml: <chartingtoolkit:datetimeaxis x:name="xaxis" orientation="x" intervaltype ="hours" interval="1"> c# xaxis.intervaltype = datetimeintervaltype.days; // month, hours xaxis.interval = 1

javascript - Show more information on hover in a new window as in facebook -

i want show more information when user hovers on link facebook shows names , images of our friends have liked post when hover on it. how can done? can done using javascript? of course can done javascript, there several plugins tooltips: http://calebjacob.com/tooltipster/ http://craigsworks.com/projects/qtip/docs/reference/ http://designshack.net/articles/javascript/25-useful-resources-for-creating-tooltips-with-javascript-or-css/ you can put whatever info want in tooltips.

objective c - iOS Link to external page -

having read this thread , i'm trying insert link external web page calling action upon touch inside on button (button created in storyboard xcode 4.6). this action: -(ibaction)outlink:(id)sender { [[uiapplication sharedapplication] openurl:[nsurl urlwithstring: @"https://www.mysite.com/index.php"]]; } and header file ( .h ): @interface menuviewcontroller : uiviewcontroller <uitableviewdatasource, uitabbarcontrollerdelegate>{ iboutlet uibutton *linktosite; } -(ibaction)outlink; i have linked button element in storyboard, , i've linked action touch inside event, error when click in simulator on button: terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[menuviewcontroller outlink]: unrecognized selector sent instance 0x717d340' change method name in .h class , reconnect outlet touchupinside event. -(ibaction)outlink:(id)sender; hope helps you.

pdf viewer - Android: file not found using android-pdfviewer -

i integrated pdfviewer.jar taken http://andpdf.sourceforge.net/ application. trying view pdf file located in raw folder. showing "file 'android.resource://com.example.pdf/raw/demo.pdf' not found": following code snippet: intent intent = new intent(this, mypdfactivity.class); intent.putextra(pdfvieweractivity.extra_pdffilename, "android.resource://com.example.pdf/raw/demo.pdf"); startactivity(intent); could of tell me whats wrong , whats correct path given?

Java Exception in thread '"AWT-EventQueue-0"' java.lang.NullPointerException -

i've got class called info , it's method load contains piece code: circuito[] circuito=new circuito[19]; for(int i=0;i<circuito.length;i++) circuito[i] = new circuito(nome,immpath,sfondopath,previsioni,giri,tempogiro,carico); i pass correctly parameters (i printed tostring() method check if works). then, in class called new have code: info info=new info(); info.load(); system.out.println(info.getcircuito()[0].tostring()); (the class info contains method getcircuito returns entire array). then, receive error: exception in thread "awt-eventqueue-0" java.lang.nullpointerexception @ new.<init>(new.java:21) the line 21 system.out.print line. i don't understand problem...thank help! the 3 possibilities npe in line system.out.println(info.getcircuito()[0].tostring()); are: info null . not possible because call info.load() before. getcircuito() returns null . getcircuito()[0] null . that's it. in case code

amazon s3 - AWS s3 mp4 not working in Chrome using CNAME -

i have mp4 file hosted on s3 works in firefox not in chrome. have set cname pointing s3 bucket. if link directly using original s3 object url works fine, in chrome. also, if link using cname ssl on, although have invalid certificate warning, if accept works. one more thing, have looked in chrome developer tools, , displays 'resource interpreted document transferred mime type video/mp4: " https://s3.amazonaws.com/media.devmcgill.com/videos/projet/titrevideo2/low.mp4 ".', thought issue, there on url try, succesful or not. here url i'm using s3 link (works) : https://s3.amazonaws.com/media.devmcgill.com/videos/projet/titrevideo2/low.mp4 cname link on ssl (works) : https://media.devmcgill.com/videos/projet/titrevideo2/low.mp4 cname (fails) : http://media.devmcgill.com/videos/projet/titrevideo2/low.mp4 i have set content-type metadata "video/mp4" on video in s3 thanks sorting out what's going on.

web.xml - JSTL error - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved -

first of all, i'm newbie jsp :). i've been trying use jstl today, version 1.2. included info in xml , dependency in pom. there <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> in jsp. the error message is: /index.jsp(3,15) pwc6188: absolute uri: http://java.sun.com/jsp/jstl/core cannot resolved in either web.xml or jar files deployed application i've been rereading previous forum posts, nothing helped far. actually, different posts suggest different things. simple tutorial appreciated :). thanks ton already! web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"> </web-app> my index.jsp <%@ page language="

python - How to make each tweet on its own line? -

i wanting have each tweet on own line. currently, breaks @ each response (i listed response_1...i using through response_10) any ideas? #!/usr/bin/env python import urllib import json response_1 = urllib.urlopen("http://search.twitter.com/search.json?q=microsoft&page=1") in response_1: print (i, "\n") you have parse json python object first, can iterate on it. #!/usr/bin/env python import urllib import json response_1 = json.loads(urllib.urlopen("http://search.twitter.com/search.json?q=microsoft&page=1").read()) in response_1['results']: print (i, "\n")

Column headers misaligned in JQuery DataTables -

this bugging me few days now... i've researched solutions , found few none working me... i've created tabbed table following this example, , works. however, in 2nd tab headers misaligned. this , when should this . to note: have no external css on table, , have tried using solutions including datatables fixed headers misaligned columns in wide tables , , this one . this use initialize both tables. $('table.display').datatable({ "sscrolly": "350px", "bpaginate": false, "binfo": false, "olanguage": { "ssearch": "" }, "aocolumndefs": [ { "swidth": "10%", "atargets": [-1] } ], "bscrollautocss": false, "fnrowcallback": function (nrow, adata, idisplayindex, idisplayindexfull) { var index = idisplayindexfull + 1; $('td:eq(0)', nrow).html(index); return nr