Posts

android - Horizontal ProgressBar not showing right -

Image
i created xml file containing horizontal progressbar, displays in image below: here's xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <progressbar android:id="@+id/progress" style="@android:style/widget.progressbar.horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:max="100" android:progress="50" /> </linearlayout> what happening? how can fix it? normally should horizon...

How to modify classpath in Eclipse? -

again, saw sentence: a .classpath file snippet can included in project's .classpath has been provided here(ie, link). please use classpathentry's need (see below details). what these sentences mean , how can add code snippet classpath file in eclipse ? please help. i understand want find classpath file . go eclipse , press ctrl + shift + r . type .classpath , select file in project. note: if you're modifying file , don't know is, advise careful :).

Python : how to append new elements in a list of list? -

here simple program: = [[]]*3 print str(a) a[0].append(1) a[1].append(2) a[2].append(3) print str(a[0]) print str(a[1]) print str(a[2]) here output expecting: [[], [], []] [1] [2] [3] but instead : [[], [], []] [1, 2, 3] [1, 2, 3] [1, 2, 3] there not here ! you must do a = [[] in xrange(3)] not a = [[]]*3 now works: $ cat /tmp/3.py = [[] in xrange(3)] print str(a) a[0].append(1) a[1].append(2) a[2].append(3) print str(a[0]) print str(a[1]) print str(a[2]) $ python /tmp/3.py [[], [], []] [1] [2] [3] when a = [[]]*3 same list [] 3 times in list. the same means when change 1 of them change of them (because there 1 list referenced 3 times). you need create 3 independent lists circumvent problem. , list comprehension. construct here list consists of independent empty lists [] . new empty list created each iteration on xrange(3) (the difference between range , xrange not important in case; xrange little bit better because n...

cross platform - WAMP-like package for Node.js? -

i want try what's hot node.js, user of wamp on local environment. push changes centos production server no sweat. there wamp node.js don't have worry mysql , others? the wap part node itself, has integrated web-server. the m part depends on db want use. don't see problems in installing 2 packages on machine (node , db).

iphone - sectionName TableView - What am I doing wrong? -

i'm having trouble changing colour , font on tableview have split 4 sections names etc., can;t seem work i'm not sure doing wrong? - (nsstring *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section { nsstring *sectionname = nil; switch(section) { case 0: sectionname = [nsstring stringwithstring:@"date"]; break; case 1: sectionname = [nsstring stringwithstring:@"gig"]; break; case 2: sectionname = [nsstring stringwithstring:@"city"]; break; case 3: sectionname = [nsstring stringwithstring:@"country"]; break; } uilabel *sectionheader = [[[uilabel alloc] initwithframe:cgrectmake(0, 0, 200, 40)] autorelease]; sectionheader.backgroundcolor = [uicolor clearcolor]; sectionheader.font = [uifont boldsystemfontofsize:18]; sectionheader.textcolor = [uicolor whitecolor]; sectionheader.text = sectionname; return sectionname; } ...

php - Compare MySQL dates when stored as datetime -

i have tried several mysql queries compare column of dates stored datetime. need create several different queries depending on action taken on form. below example of sql have created: create or replace view franchise_filter select * `c_data`.`franchise_leads` `lead_added` between unix_timestamp(date_sub(now(),interval 3 months)) , unix_timestamp(now()) or create or replace view franchise_filter select * `c_data`.`franchise_leads` `lead_added` <= 2012-06-27 00:00:00 in second example date supplied php using: date("y-m-d 00:00:00", strtotime($date_now, "+6 months")) any appreciated. you close: use ... `lead_added` <= "2012-06-27 00:00:00" (mind quotes) and ... `lead_added` between date_sub(now(),interval 3 month) , now()

ruby on rails - Sinatra route regex constraints? -

i rebuild small rails (too overkill) app in sinatra. have route this: match 'verify/:name/:bundle/:license' => 'verify#index', :constraints => { :bundle => /.*/ } how can rebould in sinatra in terms of constraints attribute? thanks! you can either way: (taken sinatra's documentation ) get %r{/hello/([\w]+)} "hello, #{params[:captures].first}!" end or inside block itself: get '/hello/:name' raise sinatra::notfound unless params[:name].match /\w+/ "hello, #{params[:name]}!" end