Posts

Showing posts from August, 2010

android - how to send search suggestion data to searchable activity using action bar search widget? -

my search working using action bar search widget. want filter search result according input activity invokes search. don't know how send data searchable activity. need please ? in intent, add data: intent intent = new intent(this, displaymessageactivity.class); intent.putextra("filter", filter); startactivity(intent) then read data in search activity: intent intent = getintent(); string filter = intent.getstringextra("filter");

mysql - Get all orders by "shipped" status that wasn't paid for by "wire transfer" -

i'm working directly magento db, trying list of orders order status of shipped , excluding paid via wire transfer ( bankpayment ). here's current query: select * ( select so.entity_id, so.created_at, max(soe.created_at) shipped_at sales_order left outer join sales_order_entity soe on (soe.parent_id=so.entity_id) left outer join sales_order_entity_varchar soev on (soev.entity_id = soe.entity_id) , (soev.value <> 'bankpayment') (soev.value = 'shipped') group so.entity_id) shipped (shipped.shipped_at >= '2013-05-01 04:00:00') , (shipped.shipped_at <= '2013-05-02 03:59:59'); i'm not sql expert, , can see i'm trying select orders not paid wire transfer line: and (soev.value <> 'bankpayment') but doesn't work expected, , suspect has where clause: where (soev.value = 'shipped') i don't know how write query. advice? note - in case, i

ios - How to save PDFs via an In-App Browser on the iPhone -

i'm wondering if knows of easy way allow pdfs opened via in-app browser have created iphone platform opened , saved via other pdf viewer apps. have no problem making in-app browser open pdfs , allowing them viewed, can't open or save them other apps izip. when pdf opened in safari, browser automatically allows me select app want open , save pdf in (such izip). when open same pdfs via in-app browser, cannot save them izip. the ultimate goal allow people view pdfs in in-app browser , let them email pdfs themselves. far haven't heard of way email pdfs directly in-app browser, i'm hoping can @ least figure out how link out other pdf viewers can used save , email files. thanks can give me!

constructor - Difference between Ubuntu scheme and XWin Scheme -

i learning 61a ucb using mitscheme. for first few chapters, have been using windows (first download cygwin, run xwin type emacs & , emacs editor , repl). this has worked fine have switched ubuntu , using mit scheme. has been working ran problem. [i using release 9.1 of mit/gnu scheme on ubuntu , stk interperter version 4.0.1 on windows] i trying write black jack program. i take input hand of cards '(ad 8s 5h) [for ace diamond, 8 spades, 5 hearts]. to access 'a value, ucb lectures , windows version fine with: (first (first '(ad 8s 5h))) ===> a when try on ubuntu mit scheme, error: the object ad, passed argument safe-car, not pair. after testing see mit scheme here use first extract first item of list: (first '(ad 8s 5h)) =====> ad but not use first selector first letter of single word. can give me suggestion? keep learning course on ubuntu because makes life easier in terms of saving , opening files example. thanks, aj

PHP get link to Facebook post -

i successfully post facebook group using: $post_url = '/' . $my_group_id . '/feed'; $msg_body = array('link' => urldecode($link), 'message' => 'new post:'); try { $postresult = $facebook->api($post_url, 'post', $msg_body); if (!$postresult) // handle error... } catch (facebookapiexception $e) { // handle error... } question is: how can permanent link new post in facebook, can point website? i can manually checking properties of new post in facebook, how can within php code , after successful posting above? if have response in $postresult : { "id": "xxxx_xxxx" } the permalink "https://facebook.com/{id}" , it's: https://facebook.com/xxxx_xxxx facebook handle forwarding real final url in group. i tested using graph api explorer , seems work consistently.

html - Customize Color Visualization: Geochart -

i'm making customize visualization: geochart. have figured out how change background color, i'm trying change highlighted color. know how this? var options = { backgroundcolor: '#333', }; currently i'm trying: coloraxis: {colors: ['404040', '8f2424']}, thanks try using mark feature similar this.hope helps. mark { background-color: yellow; color: black; }

confusion about free(pointer) in c -

i trying implement stack using pointers, structure definition in code below. called push() function 3 elements (say: 2, 4, 6) insert. then, call function display() . it's showing 0 . figured out reason because of free() function in push() function. but, don't know indeed happening there. should not use free() free allocated memory used temp in code? if so, why? #include<stdio.h> //#include<unistd.h> #include<stdlib.h> // malloc ,calloc, free avail here void push(); void pop(); void display(); struct stack { int data; struct stack *next; }; struct stack *start = null; void push() { int ele; struct stack *temp, *p; printf("entere element\n"); scanf("%d", &ele); temp = (struct stack *) malloc(sizeof(struct stack)); temp->data = ele; if (start == null) { start = temp; start->next = null; } else { p = start; while (p->next != null) { p

Raspberry pi will not send serial data to an arduino using either minicom or python -

i trying raspberry pi communicate arduino using tx/rx pins. have arduino programmed send ascii code letter received. code: byte number = 0; void setup() { serial.begin(9600); } void loop() { if (serial.available()) { number = serial.read(); serial.print("character recieved: "); serial.println(number, dec); } } but when open minicom , type it, nothing happens. if open arduino's serial monitor , send character minicom displays "character recieved: " , characters ascii code. tried creating python program using py serial, code: import serial ser = serial.serial('/dev/ttyama0', 9600, timeout=1) ser.open() ser.write("testing") try: while 1: response = ser.readline() print response except keyboardinterrupt: ser.close() but nothing displayed. have looked on internet, have found no solution. please help, in advance. you need read on difference between

c++ - What makes enum -> int a better conversion than enum -> unsigned? -

in following code, overload f(int) chosen instead of f(unsigned) . tested clang 3.0 , gcc 4.8. enum e { }; e f(int); int f(unsigned); e e = f(e(0)); my reading of standard lead me think enum -> int , enum -> unsigned identical standard conversion sequences both contain integral-conversion. [conv.integral] rvalue of enumeration type can converted rvalue of integer type. according [over.best.ics], rank of standard conversion sequence containing integral conversion 'conversion'. [over.ics.rank] 2 implicit conversion sequences of same form indistinguishable conversion sequences unless 1 of following rules apply: [...] none of rules mentioned seem apply when comparing 2 standard conversion sequences. what missing? c++11: [conv.prom]/3 a prvalue of unscoped enumeration type underlying type not fixed (7.2) can converted prvalue of first of following types can represent values of enumeration (i.e., values in range b min b max descri

javascript - Issue with jQuery tabs and Slidshow -

i have issue need resolve. includes code jquery tabs , slideshow composition. html <div> <div style="display: block;"> <a href="http://www.implanteperio.com.br/megaimersao/"><img src="images/banner/banner_mega_junho.jpg" border="0" /></a> </div> <div> <a href="http://implanteperio.com.br/cursos2013_estrangeiros.php"><img src="images/banner/banner_extranjeros_cirurgia_plastica_periimplantar.jpg" border="0" /></a> </div> <div> <a href="http://implanteperio.com.br/cursos2013_recobrimento_radicular.php"><img src="images/banner/banner_imersao_recobrimento_radicular.jpg" border="0" /></a> </div> <div> <a href="#"><img src="images/banner/banner_novos_cursos.jpg" border="0" /></a>

c# - Printing DataGrid after cell manipulation -

i want able print out datagrid has been manipulated after header column cell has been clicked. clicked "name" column header sort of names in column , change way data displayed, i've found datagrid printers print out first version of data read in , not sorted version. if has or knows of links appreciated.

javascript - two way databinding in angular not working as I expected -

i'm trying test simple databinding concept after going thru angular documentation. this sample html file <body ng-app> <h1>hello, world!</h1> <div ng-controller="ctrl"> <input type="text" ng-model="count" /> count: <span ng-bind="count"></span> </div> </body> and ctrl function var = 0; function ctrl($scope) { $scope.count = i; inc(); } function inc() { i++; settimeout(inc, 1000); } i expecting count in html keep updating var incremented every sec in javascript. but doesn't work way. i'm trying find wrong code , example demo concept of 2 way databinding (meaning when javascript object changed should reflected in html) two problems: $scope.count = i; not reference global i , thus, regardless of next problem, not update (this not angular problem). your interval function update counter without angular noticing it. overcome problem

ruby on rails - Capistrano postgresql: FATAL: Peer authentication failed for user -

i deploying app digital ocean first time , ran 2 (possible more) issues. 1) can't bundle install after adding gem 'unicorn' gemfile. found kgio not compatible windows. have have gemfile.lock present when deploy via capistrano? how work around issue? group :production gem 'pg', '0.14.1' gem "nginx" gem 'unicorn' end 2) having trouble authentication on postgresql on server. production: adapter: postgresql encoding: unicode database: postgresql pool: 5 username: postgresql password: secret i ran these commands (along other variations): create user postgresql password 'secret'; create database postgresql owner postgresql; every time cap deploy, error: fatal: peer authentication failed user "postgresql" i tried putting invalid username know doesn't exist, database invalid error message same. according postgresql website, should getting different errors those... if can help, that&#

How to change heatmap.2 color range in R? -

Image
i'm using gplot produce heatmap showing log2-fold changes of treatment groups versus paired controls. following code: heatmap.2(as.matrix(seqcounttable), col=redgreen(75), density.info="none", trace="none", dendrogram=c("row"), symm=f,symkey=t,symbreaks=t, scale="none") i output heat map real fold change values (i.e., non row-z score) i'm after, in red-black-green color scheme every biologist's favorite! the actual range of log2-fold change -3/+7, many values in -2/-1 , +1/+2 range, appear dark red/green (respectively). makes whole heatmap quite dark , difficult interpret. is there way of skewing color gradient make less linear? is, gradient black quite bright occurs on smaller range? and / or change color range asymmetric, i.e., run -3/+7, data does, rather -7/+7 scale does, black still centered on zero? i got color range asymmetric changing symkey argument false symm=f,symkey=f,

osx - app crashes when button clicked -

i ios dev background. creating simple mac app in appdelegate adding nsviewcontroller instance window , have button in nsviewcontroller class. when click button crashes. looked @ these posts not figure out whats wrong in app. why app not able "attach" action? here code in app delegate prviewcontroller *pcvc = [[prviewcontroller alloc] initwithnibname:@"prviewcontroller" bundle:nil]; [self.window.contentview addsubview:pcvc.view]; function button -(ibaction)startclicked:(id)sender{nslog@"btn selected";} when click on button, app crashes. following stack trace: producer_consumer[45914:303] -[__nscftype startclicked:]: unrecognized selector sent instance 0x101d07680 producer_consumer[45914:303] -[__nscftype startclicked:]: unrecognized selector sent instance 0x101d07680 producer_consumer[45914:303] ( 0 corefoundation 0x00007fff900deb06 __exceptionpreprocess + 198 1 libobjc.a.dylib 0x00007fff8ce8

php - Method for tagging/calling content without SQL? -

i setting site academic journal. sql not installed on server , don't have permissions install it. each of articles needs have content tags (like blog would). when click tag, should take page articles tag appear. example, there may article under geography page tag of "africa." if click tag, articles africa show up. normally, i'd use php grab articles tag sql database, don't have sql capabilities. thoughts? alternatives? i'm open anything. thanks!

android - NullPointerException on getPurchases() -

i trying purchases of user , , claim billing service null , process running in asynctask ,btw newbie inapp billing service , here parts of code : my service connection : iinappbillingservice billingservice; private serviceconnection serviceconnection = new serviceconnection() { @override public void onservicedisconnected(componentname name) { billingservice = null ; } @override public void onserviceconnected(componentname name, ibinder service) { billingservice = iinappbillingservice.stub.asinterface(service); } }; part of asynctask : @override protected string doinbackground(activity... params) { final activity mactivity = params[0]; bindservice(new intent("com.android.vending.billing.inappbillingservice.bind"), serviceconnection, context.bind_auto_create); connectivitymanager c = (connectivitymanager) getsystemse

php - How to organise an SQL Database Table? -

i developing blog , able organise data stored in database recent rows of data displayed @ top of table , go further in time further down scroll, there way through php or sql? thanks in advance, edit: question answered, - had developed blog decided make changes incorporate learning sql no. databases don't allow sort rows yourself. sort based on available space. rows in specific order, use order by in sql query. using order by , can sort result when retrieving data from database.

sql - How can I retrieve information from two different tables in a stored procedure? -

i have develop db stored procedure used in autocomplete feature. if user types "m" should return people , groups name starting "m". i in way system should need call 1 stored procedure avoid cost of calling db twice. my problem groups , people in separate table (i need , and id), ideally do: select id, name people or group name 'm%' of course not valid sql. thought creating temp table, making 2 selects (one people , 1 groups), inserting in table , returning it. is there simpler/nicer way implement or best approach? just perform union all . 2 separate queries, temp table, multiple inserts, , 3rd query, doesn't sound whole lot of unnecessary work? create procedure dbo.searchtwotables @search_argument nvarchar(255) = n'm%' begin set nocount on; select id, name dbo.people name @search_argument union select id, name dbo.group name @search_argument; end go also assume name column should support unicode st

php - ooyala not syncing description or labels with ooyala's backlot using drupals version 6 module. -

recently on our site ooyala's v1 api stopped allowing sync ooyala's backlot. our site built on drupal, version 6. upgraded latest version 6 ooyala module , made changes our local code. can use drupal_http_request() sync title won't sync description or labels ooyala's backlot. below function i'm using. $request_test = video_update_ooyala_info($embed_code, $node->title, $node->field_video_description[0]['value']); drupal_set_message("-request= ".print($request_test)." -function: </br>--".var_dump($embed_code)." </br>--title: ".$node->title." </br>--description: ".$node->field_video_description[0]['value']. " </br>--failed sync title , description ooyala. please try saving again.", 'warning'); } function video_update_ooyala_info($embedcode, $title, $description) { $ooyala_api = new ooy

asp.net mvc - How to display root subnodes in MvcSiteMapProvider -

is there ways can display root subnodes in mvcsitemapprovider can have menu looking that: |home| |about| |etc| |item1| |item2| i want item1 , item2 appeared index(home) subelements. here sitemap: <mvcsitemapnode title="home" controller="home" action="index"> <mvcsitemapnode title="item1" controller="item1" action="index"/> /**should desplayed submenu element of home <mvcsitemapnode title="item2" controller="item2" action="index"/> /**should desplayed submenu element of home <mvcsitemapnode title="about" controller="about" action="index"/> <mvcsitemapnode title="etc" controller="etc" action="index"/> <mvcsitemapnode /> but in case have |home| |item1| |item2| |about| |etc| instead. take @ one: https://github.com/maartenba/mvcsitemapprovider/issues/160 see

android - Prototik HoloEverywhere import error: duplicate entry 'src' -

i have looked @ : holoeverywhere error: build path contains duplicate entry src i using version of holoeverywhere: https://github.com/prototik/holoeverywhere i have tried has suggested there, nothing has worked yet. person asked question didn't come pick answer either. i'm trying import prototik holoeverwhere eclipse (from androi adt), keeps giving me errors, , unusable. error looks like: http://i.imgur.com/tqb3mw7.png this says: "build path contains duplicate entry: 'src' project 'holoeverywhere library'" ok mentioned in comment: import holoeverywhere using file> import> git > projects git

javascript - Keeping an image in its location when animation occurs -

i have grid of images , when click on image images 1 clicked move down. problem when image remaining pulled top left. think it's because i'm removing images remaining 1 not considered 1 it's placed in position 1 of grid $(document).ready(function() { $('#grid li').click(function() { $(this).siblings().animate({opacity: 0, top:'15px'},1000); $(this).siblings().fadeout(function() { }); }); $('#hidden').click(function() { $('#grid li img').animate({width:'339px',height:'211px'}); $('#grid li').siblings().fadein(); $('#grid li').siblings().animate({opacity: 1, top:'0px'},1000); }); }); html <div class="portfolio"> <ul id="grid"> <li><a href="#"><img src="1.jpg"><span>some text></a></li> <li><a href="#"><img src="2.jpg"><

mysql - Relative frequency by category SQL queries -

i have table columns: date, category, views . i'd write query gives me following output: year, quarter, category, "relative percentage of category views quarter" for example: 2013, q1, blue, 0.15 2013, q1, yellow, 0.05 2013, q1, green, 0.80 2013, q2, blue, 0.20 2013, q2, yellow, 0.05 2013, q2, green, 0.75 2013, q3, blue, 0.10 2013, q3, yellow, 0.15 2013, q3, green, 0.65 note each quarter relative frequencies add 1 across set of categories. is state handle dynamically sql (i'm using mysql)? this have far. it's want, except relative frequencies output sum 1 across quarters. set @total_views = select sum(views) daily_views_by_category; select year(dt), quarter(dt), category, sum(views)/@total_views category_views daily_views_by_category group year(dt), quarter(dt), category order year(dt), quarter(dt), category ; you want join rather variable. idea summarize data year-quarter-catalog , year-quarter , join

actionscript 3 - Extract bitmap (or bitmapdata) from Shape -

i got swf has simplebuttons in stage, , need bitmap or bitmapdata information button states. when load symbol, seems no matter composes button states, shapes, @ least that's in expression panel. so, how can bitmap or bmpdata shape?. thanks. you can use bitmapdata#draw() bitmapdata displayobject . bitmapdata raster, aware lose features of vector shape var bd:bitmapdata = new bitmapdata( shape.width, shape.height ); bd.draw( shape );

php - Capture text between two strings -

i'm trying capture string in text field , between 2 other strings. start string: {"website":" end string: ","referrer":" the complete string this: {"website":"www.domain.com","referrer":"invited on google+"} or: {"website":"www.anotherdomain.com","referrer":""} or perhaps: {"website":"www.about.me/subdomain","referrer":""} i need capture between start , end string , have been trying various string methods mixed results. the start , end string same. any suggestions...? that called json array , can converted in php array json_decode function. $json = '{"website":"www.domain.com","referrer":"invited on google+"}'; $info_array = json_decode($json, true); echo $info_array['website']; you not need preg_match, string split or other stuff.

In Python, is it possible to print exceptions even when they are being ignored? -

i'm aware it's possible ignore exceptions in python using try...except statements. possible ignore exceptions in python when occur, still print them? i tried ignoring exception here, , therefore, exception not printed when encountered: try: num = 0 if num == 0: raise exception("num must not 0!") except exception: pass '''the exception ignored, , not printed.''' i've written simple source-to-source compiler has lot of exceptions these, , i'm not sure how can ignore exceptions while still printing them. how can ensure exceptions printed console when being ignored? you can print exception this. try: x = 1 / 0 except exception e: print e edit: as user1354557, gcbirzan, , jonathan vanasco pointed out, can use traceback , logging modules more precise error messages. error messages printed out these ways more verbose, (usually) thing. import traceback try: x = 1 / 0 except excep

cordova - How to setup Phonegap Build with PushPlugin, Apigee on Android -

i trying setup phonegap (v3.0.0) project push notifications through apigee , build project using phonegap build using command line interface. here have far: i installed phonegap on windows following these directions. http://phonegap.com/install/ i used phonegap command interface create project. http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#the%20command-line%20interface i downloaded apigee phonegap pushplugin github , added plugin project using command line interface. https://github.com/apigee/appservices-phonegap-push-plugin i followed apigee push notifications tutorial setup apigee , google notification service. http://apigee.com/docs/usergrid/content/tutorial-push-notifications this lost... trying follow apigee phonegap android sample app tutorial file structure , file structure of current phonegap project different. https://github.com/apigee/appservices-phonegap-android-push-example which files need use apigee demo app , include them in current phonegap

html - How to set the max-height for a tr or td which is supported atleat IN CHROME -

how set max-height tr or td supported atleat in chrome? here there answer not work chrome: how fix height of tr? i found answer, put here if interested: <td><div style='overflow-y:scroll;max-height:70px;'>...</div></td> but have question; put div td i'm pretty sure huge; , dont put div other tds although coould other tds.now question how can understand largest height other tds, can set max-height td large other tds? thanks

apache poi - how to get resource in a jar file ? (poi && image) -

i using poi apache generate excel file, have add picture file problems when export project runnable jar, not working. inputstream = exceltools.class.getclassloader().getresourceasstream( "./ensao/pfa/opendelib/resources/logoopen.jpg" ); byte[] bytes = ioutils.tobytearray(is); int pictureidx = wb.addpicture(bytes, workbook.picture_type_jpeg); is.close(); drawing drawing = sheet.createdrawingpatriarch(); hssfclientanchor anchor = new hssfclientanchor(40, 10, 65, 20, (short) 0, 0, (short) 0, 0); anchor.setanchortype(1); picture pict = drawing.createpicture(anchor, pictureidx); pict.resize(); the problem launched line : byte[] bytes = ioutils.tobytearray(is); problem in bad path image. ide configured environment ($classpath, file path, etc) in 1 manner, real running operate other environment. find working directory print debug pwd analog. this links may useful: http://www.java-forums.org/new-java/434-how-can-i-

list - Python Iterate over a numbers in a txt file -

i have txt file similar following example.txt 9987.000 2300 23 40 30 9654.988 1234 34 32 19 i iterate on file , rewrite file sample.txt follows each number on own line listed vertically in order in listed horizontally. 9987.000 2300 23 40 30 i new python , not sure best approach doing this. advice appreciated. syntax error file "sample.py", line 64 open('testfile.txt')as infile, open('testfile.txt','w') outfile: ^ syntaxerror: invalid syntax for large files: with open('path/to/input') infile, open('path/to/output', 'w') outfile: line in infile: num in line.strip().split(): outfile.write(num + '\n') for small files: import itertools open('path/to/input') infile, open('path/to/output', 'w') outfile: outfile.write('\n'.join(itertools.chain.from_iterable(line.strip().split(

javascript - Supplying remote data to directives in AngularJS -

when developing directives seems best practice seperate data / model actual directive. for example if have directive called "event" e.g. <div class="event"> <h1>{event.title}</h1> <small>{event.startdate}</small> </div> what best way supply data directives in reusable pattern? through service? there lot can directives. lot of ways can work data. more direct way pass data or references directive. take @ link below reference. example code, following: <div dir-event event-title="context.title" event-start="context.startdate" ></div> in html, context.title , context.startdate objects on controller. directive: app.directive("direvent", function() { return{ restrict: "a", scope:{ title:"=", startdate:"=" }, transclude: true, template: "<div class='event&#

c++ - A way to use the STL to count chars in a vector of std::string? -

so while it's trivial find amount of characters inside of vector of std::string, wondering if there's way use stl of work instead of having 2 loops, 1 loop through vector , loop through string in each index of vector. i've tried using other stl functions (such attempting use std::for_each in few unique ways), of attempts have resulted in no success. int main(void) { int chars = 0; std::vector<std::string> str; str.push_back("vector"); str.push_back("of"); str.push_back("four"); str.push_back("words"); for(int = 0; < str.size(); ++i) for(int j = 0; j < str[i].size(); ++j) ++chars; std::cout << "number of characters: " << chars; // 17 characters // there stl methods allows me find 'chars' // without needing write multiple loops? } to start, not need second loop: for(int = 0; < str.size(); ++i) { chars += str[i].size(); } now standard

html - CSS inline-block not working? -

you can't imagine how frustrating create simple codes , don't work :( want code make nav horiz. , set width each separate between them html: <ul> <li><a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">what</a></li> <li><a href="#">products</a></li> <li><a href="#">support</a></li> </ul> css: body{margin:0;} ul{list-style-type:none;margin:0;padding:0;display:block;} li{float:left;} a{width:60;} i think might wanting links 60px wide. if that's case, change: a{width:60;} to: a { width: 60px; display: inline-block;} '60' on own isn't recognised measurement css width, , need inline-block stop being treated line of text. however if want improve on this, , make each link separated same amo

python - ompi_evesel->dispatch() failed when running OpenMPI process from Java ProcessBuilder -

i trying create java gui control , run mpi process. can run mpi process command line, unable run via java process builder. i following error after process starts: [sci053_vm003:02928] ..\..\openmpi-1.6.4\opal\event\event.c: ompi_evesel->dispatch() failed. i suspect there environment problem, not sure how diagnose it. have printed environment seen java process builder log environment seen mpiexec'd process, see nothing amiss!?!? all code , output log posted on gist i trying run in windows environment using openmpi 1.6.4 packaged mpi4py seems openmpi problem, posted userlist , hoping anywhere can it... david ps - able run java program launch , run same code in macos environment, there use brew installed mpich2. i suspect issue because you're using windows. don't remember when openmpi stopped supporting windows, @ point did. might try using microsoft's port of mpich works on windows , see if need. don't remember url offhand, can find por

asp.net - How do I format a date pulled from a database? -

i trying pull date database , putting on webpage below code: <asp:label id="label3" runat="server" text='<%# eval("traveldate") %>' /><br /><br /> it pulls date no problem, when shows on page, no matter how formatted in database, seems want display date "6/17/2013 12:00:00am". there i'm missing in vs portion have use format date? i'd prefer "june 17, 2013", option close in access adds day of week in front of it. getting rid of time important. <asp:label id="txtdate" width="65px" runat="server" font-size="8.5pt" forecolor="#000f9f" text='<%# eval("how_date","{0:dd/mmm/yyyy}") %>'></asp:label>

android - Does not work when use ProGuard -

the logcat below. wrong? 07-24 10:54:13.529: e/androidruntime(12130): fatal exception: asynctask #3 07-24 10:54:13.529: e/androidruntime(12130): java.lang.runtimeexception: error occured while executing doinbackground() 07-24 10:54:13.529: e/androidruntime(12130): @ android.os.asynctask$3.done(asynctask.java:299) 07-24 10:54:13.529: e/androidruntime(12130): @ java.util.concurrent.futuretask$sync.innersetexception(futuretask.java:273) 07-24 10:54:13.529: e/androidruntime(12130): @ java.util.concurrent.futuretask.setexception(futuretask.java:124) 07-24 10:54:13.529: e/androidruntime(12130): @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:307) 07-24 10:54:13.529: e/androidruntime(12130): @ java.util.concurrent.futuretask.run(futuretask.java:137) 07-24 10:54:13.529: e/androidruntime(12130): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1076) 07-24 10:54:13.529: e/androidruntime(1213

java - How to get size() of initialized ArrayList? -

i have code similar this: arraylist<sometype> togetsizeof = new arraylist<sometype>(); int size = togetsizeof.size(); however, second line giving me nullpointerexception. there way avoid this, tell if arraylist has been initialized has not of yet had added yet? (i have if / else statement dependent on this). thanks in advance! i think perhaps else wrong in code. the following works fine: arraylist<string> togetsizeof = new arraylist<string>(); int size = togetsizeof.size(); system.out.println(size); which gives 0. debug code , check null. suspect it's togetsizeof.

d3.js - Artifacts in Natural Earth Data railroad map -

Image
i ran through mike bostock's let's make map tutorial , pleased results decided add railroad data natural earth data set. most of renders okay, there crazy artifacts seems unrelated meshes somehow being connected together: https://docs.google.com/file/d/0b6e2ropuwmtea3d4ennjy3dsbkk/edit?usp=sharing i separated rail data 3 files see if fix problem: for country in can mex usa ogr2ogr -f geojson \ -where "sov_a3='${country}'" \ railroads_${country}.json ne_10m_railroads_north_america.shp done i'm rendering them using topojson.mesh follows: svg.append("path") .datum(topojson.mesh(na, na.objects.railroads_usa)) .attr("d", path) .attr("class", "railroad_usa"); svg.append("path") .datum(topojson.mesh(na, na.objects.railroads_can)) .attr("d", path) .attr("class", "railroad"); svg.append("path") .datum(topojson.mesh(na, na.objects.rail

objective c - ARC causes a dangling pointer -

ok use arc in main application have ported control not use arc .. every thing compiles etc exc_bad_access error on controls event ... the event initiated delegate method is there way pointers text value hex code value i.e name* 0x00aa0 address ? and standard way of checking arc deallocating? is there way pointers text value hex code value i.e name* 0x00aa0 address ? try play around llvm debugger. after crashes or @ breakpoint use this: expression 0x00aa0

visual studio 2010 - how to debug tsql code that is called from a c# unit test -

we writing quite complicated tsql procedures , calling them complex unit tests written in c#. desperately debug going on in tsql being called c#. possible in visual studio 2010? so far haven't got debug working in visual studio i'm happy push on if available c# code. reading along way leads me believe can done database unit tests of little use me. ok link seems indicate yes can. push on , find out why that's not case me far! http://msdn.microsoft.com/en-us/library/vstudio/kkyhd4yb(v=vs.100).aspx

iphone - Changing the rate at which a method is called -

i'm still new objective c, , feel might basic concept don't know. i'm working opengl , have method glkview of viewcontroller, called when "the view needs updated". method, call method, don't want second method called @ rate specify. how go accomplishing this? understand viewcontroller.preferredframespersecond can set, want 1 specific method work on different timer.. is right way of going this? sounds might want use nstimer

jquery - Creating responsive triangles with CSS -

i trying create triangles in css responsive site today , couldn't find example on stackoverflow, here's how did it. making angular shapes responsive little tricky because can't use percentages border values in css, wrote couple functions calculate page width , resize triangle accordingly. first calculates size on loading page, second recalculates size page width changes. css: .triangle { width: 0; height: 0; border-top: 50px solid rgba(255, 255, 0, 1); border-right: 100px solid transparent; } html: <div class="triangle"></div> js: $(document).ready(function () { var windowwidth = $(window).width(); $(".triangle").css({ "border-top": windowwidth / 2 + 'px solid rgba(255, 255, 0, 1)' }); $(".triangle").css({ "border-right": windowwidth / 1.5 + 'px solid transparent' }); }); $(window).resize(function () { var windowwid

java - Manually downloading and installing maven plugins -

i on proxy network , proxy preventing maven connect central repo is there way download maven plugins manually , installing plugins in local .m2 repo. thanks the simplest way use machine can connect central download repo need copy ./m2 manually machine usage of offline flag every build if solution scalable need install nexus or maven repository on machine can goes outside , configure maven see repo machine. , model solution case

java - Convert doc to pdf using Apache POI -

i trying convert doc pdf using apache poi, resulting pdf document contains text, not having formating images, tables alignment etc. how can convert doc pdf having formattings tables, images, alignments? here code: import java.io.file; import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.outputstream; import com.lowagie.text.document; import com.lowagie.text.documentexception; import com.lowagie.text.paragraph; import com.lowagie.text.pdf.pdfwriter; import org.apache.poi.hwpf.hwpfdocument; import org.apache.poi.hwpf.extractor.wordextractor; import org.apache.poi.hwpf.usermodel.range; import org.apache.poi.poifs.filesystem.poifsfilesystem; public class demo { public static void main(string[] args) { poifsfilesystem fs = null; document document = new document(); try { system.out.println("starting test"); fs = new poifsfilesystem(new fileinputstream("resume.doc"));

Python - How to track (add/remove) lots of class instances over mulitple iterations? -

i building dynamic map of earthquakes, using vtk library. i've made static one, (see here: https://github.com/yacobuk/quakecloud , here: http://www.youtube.com/watch?v=4hvdtci_ozi ) know basic idea works, want try , show quakes on time. i have code examples show me how update frame, , how add / remove objects, i'm stuck on figuring out how spin instance, track few periods, remove it. the basic add/ remove code looks this: for point_and_mag in pm.points_mag: time.sleep(0.5) mag = point_and_mag[1] point = point_and_mag[0] if mag > 2: pointcloud = vtkpointcloud(pm) pointcloud.addpoint(point, math.log(mag)*10) renderer.addactor(pointcloud.vtkactor) renderer.resetcamera() renderwindow.render() time.sleep(0.3) renderer.removeactor(pointcloud.vtkactor) renderer.resetcamera() renderwindow.render() but of course, allows 1 object @

Rails Net::SCP file transfer -

i have rake task set fetch folder remote server using nets/scp gem. gemfile: gem "net-ssh" gem "net-scp" my code: require 'net/scp' desc "fetch hadoop data" task :fetch_data => :environment net::scp.download!("server_name", "user", "/home/dashboard/data", "#{rails.root}/lib/tasks", :password => "password1") end i error: scp did not finish (1) how save folder rails tasks directory, , how can print out more informaiton causing scp error? also, have id_rsa key saved in know i ended using different method scp file over: require 'net/ssh' require 'net/scp' desc "fetch hadoop data" task :fetch_data => :environment date_yesterday = (datetime.now - 1.days).strftime("%y%m%d") date_today = (datetime.now).strftime("%y%m%d") net::ssh.start("server_name", "user",:password => "*****

tcl - How to get rid of the margins between the panes and the sashes in iwidget::panedwindow? -

Image
when using iwidgets::panedwindow couldn't rid of margins between panes , sashes (shown in blue arrows in small picture). there way rid of them, pane next sash, in ttk::panedwindow ? a picture of form using iwidgit::panedwindow : a close picture of "problem": a picture of (almost) same form using ttk::panedwindow : looking through documentation link to, i'd estimate problem mix of default -margin on panes create (8 pixels, according documentation) , -sashwidth , -thickness overall widget options (which default 10 , 3 pixels, respectively). you can either set -margin @ creation time or update paneconfigure method (which missing documentation, shown in example in documentation), , -sashwidth , -thickness options set either @ widget creation time or via configure method (as per standard pattern of tk widgets). setting options mentioned above 0 unlikely produce usable widget, pane margins can reduced 0 without ill effect (they describe

Parsing response from a HTTP web service (JSON) in PHP -

i need consume http web service response in json format. how can achieve in php given url of web service known ? this should do: $data = file_get_contents(<url of website>); $data = json_decode($data, true); // turns array, change last argument false make object this should able turn json data array. now, explain does. file_get_contents() gets contents of file, either remote or local. through http portal, not violating privacy policy using function remote content. then, when use json_decode() , changes json text object in php, since added true second argument, returns associative array instead. then can array. have fun!

Regex to match any single alphabet in string php -

i hate code. take zipcode html pages verifies if zipcode usa or canada. <?php $contents = file_get_contents('853755.html'); preg_match_all('/<td id="u_zipcode">(.*?)<\/td>/s', $contents, $matches); $data = implode("|",$matches[0]); $string = str_replace(' ', '', $data); if(preg_match('/^[1-9][0-9]*$/',$string)){ echo "canada"; } else { echo "usa"; } ?> i tried had search solution it. can't find solution. tried regex should contain numbers not single alphabet. doesn't seem work in way. zipcode given in format, usa: 97365 usa: 97365-97366 canada: j8n7s1 canada: n2l5y6 kindly me solution. thanks since there can 1 element particular id, don't need use preg_match_all() , can use preg_match() . preg_match('/<td id="u_zipcode">(.*?)<\/td>/s', $contents, $match); then don't need use implode

javascript - Hide the header ( link) of accordian from the form -

i creating form consist of 3 parts. want shift other form via clicking 'next' button rather clicking header portion of jquery. had implemented jquery accordion in form , shifting other via next , button. cant hide link or header of accordion. want hide link(header of accordion) in advance <h1 class="top bottom"><span>help me</span> buy , sell house</h1> <h2>this form quick &amp; easy complete - in 3 steps!</h2> <form name="cmaform" id="cmaform" method="post"> <input type="hidden" name="recordrequestprimaryserviceid" id="recordrequestprimaryserviceid" value="100" /> <input type="hidden" name="recordclientservices" id="recordclientservices" value="1,3" /> <ul id="stepform" class="ui-accordion-container"> <li id="sf1"> <a href=&

Conversion Linq result to object type in vb.net -

i need vb.net syntax of below answer(given in c#)- how can convert linq results dto class object without iteration i have tried converting vb.net @ this link , give compilation errors. following output above convertor - public function [get]() list(of user) using db = new mycontext() return (from u in db.usersorder u.firstnamenew user() { _ key .id = u.pkuser, _ key .username = u.username, _ key .password = u.password, _ key .active = u.active _ }).tolist() end using end function well, linq query messed up. , since there's no user class in code tried convert, converter tried use key keyword, used anonymous types. so correct code should like: public function [get]() list(of user) using db = new mycontext() return (from u in db.users order u.firstname select new user() { .id = u.pkuser, .username = u.username, .

If everything in a programming language is an expression, would it be refferentially transparent? -

i've ready somewhere, although not find after much searching, if guy create new programming language, completely referentially transparent expression. some questions referential transparency indicate languages such ruby , perl have almost expression. is possible/does exist? if understand it, if programming language referentially transparent doesn't mean there no side effects @ all, , is possible have complete programming language without side effects? and main question of title, if goal create referentially transparent programming language, go without saying expression? if expression understand returns value, computation not expression must not return value, , referential transparency can safely removed. yes, referential transparency requires expression. but, being expression not imply there can no side effects. example in c language there many expressions have side effects: take expression involving increment , decrement operators ++ , --. there few

Matlab using multiple containers.Map raises an Index exceeds matrix dimensions error -

here sample code: class a: classdef classa properties mapofb end methods function self = classa(names) self.mapofb = containers.map(); = 1:numel(names) self.mapofb(names{i}) = classb(names); end end end end class b: classdef classb properties maptest end methods function self = classb(names) self.maptest = containers.map(); = 1:numel(names) self.maptest(names{i}) = rand(1,3); end end end end main script: names = {'one', 'two', 'three', 'four'}; = classa(names); a.mapofb a.mapofb.keys a.mapofb('one') a.mapofb('one').maptest a.mapofb('one').maptest.keys a.mapofb('one').maptest('one') console output: a.mapofb('one').maptest.keys ans = 'four' 'one' 'three'

intuit partner platform - error: (407) Proxy Authentication Required in the IPP .Net AggCat DevKit -

i'm trying perform basic actions on .net sample app customer account data. problem happens in following code snippet (when i'm selecting bank , expecting details): protected void institutions_selectedindexchanged(object sender, eventargs e) { try { if (institutions.selectedvalue == "pleaseselect") { institutiondetails.visible = false; } else { institutiondetails.visible = true; aggregationcategorizationservice svc = services.aggcatservice.getservice(cache, httpcontext.current.user.identity.name); institutiondetail insutitutiondetail = svc.getinstitutiondetails(long.parse(institutions.selecteditem.value)); i recieve following error: error detail: error occurred while calling getinstitutiondetails: webexception: remote server returned error: (407) proxy authentic

Php checkbox is checked, then mysql update 1, and if not checked mysql update 0 -

echo "<form method='post' action=''><br>"; $query = mysql_query("set names 'utf8'"); $query = mysql_query(" select * pages user_id = '$_session[user_id]' ") or die(mysql_error()); while($pagek = mysql_fetch_array($query)) { $name = $pagek['page_name']; $pageid = $pagek['page_id']; echo '<input type="checkbox" name="page_ids[]" value="'.$pageid.'">' .$name ."<br>"; } echo "<br> <input type='submit' value='adatok frissítése' name ='adat' class='button small radius center black' >"; echo "</form>"; foreach($_post['page_ids'] $page){ if ($page){ mysql_query(" update pages set page_value = '0' user_id = '$_session[user_id]' "

python - most Pythonic way of achieveing these 4 lines? -

i have csv cell value, row[13] contains following text: point (174.29635 -41.60557) i need strip out text , brackets, , convert 2 numbers float, each assigned var:- geo_pair = row[13].replace("point (", "") geo_pair = geo_pair.replace(")", "") self.longitude, self.latitude = geo_pair.split(" ") self.longitude, self.latitude = float(self.longitude), float(self.latitude) i'm pretty sure there cleaner way of doing this, , wondered knows doing do! since format fixed , consists of prefix, data, , suffix, use slicing remove prefix , suffix: map(float, s[7:-1].split()) . this clear , simple @ same time: >>> s = "point (174.29635 -41.60557)" >>> longitude, latitude = map(float, s[7:-1].split()) this works upon sign changes or when number of decimal places changes. and way, long not parsing tons of input, not matter way chose. it's matter of taste , not performance-critical in case.