Daily Archives

Articles indexed Friday April 23 2010

Page 23/115 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Computation on db data then list them using either SimpleCursorAdapter or ArrayAdapter

    - by kc2uno
    Hi all, I juststarted programming in android a few weeks ago, so I am not entirely sure how to deal with listing values. Please help me out! I have some questions regarding displaying data sets from db in a list. Currently I have a cursor returned by my db points to a list of rows and I want display 2 columns values in a single row of the list. The row xml looks like this: <TextView android:id="@+id/text1" android:textSize="16sp" android:textStyle="bold" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/text2" android:textSize="14sp" android:layout_width="fill_parent" android:layout_height="wrap_content"/> so I was thinking using simplecursoradapter which supposedly makes my life easier by displaying the data in a list. However that is only true if I want to display the raw data. For the purpose of my program I need to do some computations on the raw data sets, then display them. I am not sure how to do that using SimpleCursorAdapter. Here's how I display the raw data: String[] from = new String[]{BtDbAdapter.KEY_EX_TYPE,BtDbAdapter.KEY_EX_TIMESTAMP}; int[] to = new int[]{R.id.text1, R.id.text2}; // Now create a simple cursor adapter and set it to display SimpleCursorAdapter records = new SimpleCursorAdapter(this, R.layout.exset_row, mExsetCursor, from, to); setListAdapter(records); Is there a way to do computation on the data in those rows before I bind it with the SimpleCursorAdapter? I was trying to use an alternative way of doing this by using arraylist and arrayadapter, but that way I dont know to how achieve displaying 2 items in a single row. This is my code for using arrayadapter which only display 1 text in a row instead of 2 textviews in a row: //fill in the array timestamp_arr = new ArrayList<String>(); type_arr = new ArrayList<String>(); fillRecord(); Log.d(TAG,"setting now in recordlist"); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item,timestamp_arr)); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item2,type_arr)); It's very obvious that it only displays one textview in a row because I set the second arrayadapter overwrites the first one! I was trying to use R.id.text1 and R.id.text2 for them, but it gave me some errors saying 04-23 01:40:58.658: ERROR/AndroidRuntime(3309): android.content.res.Resources$NotFoundException: Resource ID #0x7f070008 type #0x12 is not valid I believe the second method can achieve this, but I'm not sure how do deal with the layout problems, so if you any suggestions, please post them out. Thank you!!

    Read the article

  • Php sessions secure log in

    - by Doodle
    My question is about creating a secure log in routine. After comparing the user name and password to the stored values I set a session variable called logged to true. Then as the user surfs around the web page I just check the logged variable for true or false to determine if the user should have access. This is my first time creating something like this. Is this secure? I feel like there is something else that I should be doing to make sure that users are valid.

    Read the article

  • Two versions of same asp.net app using same server as stateserver - bad?

    - by MGOwen
    We have 2 production web servers for our web app, load balanced to handle lots of traffic. We also have a similar setup for testing. Test pool: [TEST 1]---[TEST 2] Prod pool: [PROD 1]---[PROD 2] When comparing the Web.Config of the app versions (test vs live) I discovered something surprising: both pools have the same value for stateConnectionString. If I understand right, this means they are using the same state server: <sessionState mode="StateServer" stateConnectionString="tcpip=123.123.123.123:42424" cookieless="false" timeout="30"/> Is this a problem? (How does the state server not confuse the two pools)? I was having odd only-sometimes slowdown/errors on the test server, that's why I was looking at this in the first place, but the prod pool runs fine...

    Read the article

  • Google app engine for static files in joomla

    - by vipinsahu
    hi i want to use google app engine for the static data for my joomla website currently my site is http://webkul.com i want to put all the css and js files in the app engine please help i am using google app engine first time if there is any good tutorial please put it here thanks

    Read the article

  • Unintentional concatenation in Bison/Yacc grammar.

    - by troutwine
    I am experimenting with lex and yacc and have run into a strange issue, but I think it would be best to show you my code before detailing the issue. This is my lexer: %{ #include <stdlib.h> #include <string.h> #include "y.tab.h" void yyerror(char *); %} %% [a-zA-Z]+ { yylval.strV = yytext; return ID; } [0-9]+ { yylval.intV = atoi(yytext); return INTEGER; } [\n] { return *yytext; } [ \t] ; . yyerror("invalid character"); %% int yywrap(void) { return 1; } This is my parser: %{ #include <stdio.h> int yydebug=1; void prompt(); void yyerror(char *); int yylex(void); %} %union { int intV; char *strV; } %token INTEGER ID %% program: program statement EOF { prompt(); } | program EOF { prompt(); } | { prompt(); } ; args: /* empty */ | args ID { printf(":%s ", $<strV>2); } ; statement: ID args { printf("%s", $<strV>1); } | INTEGER { printf("%d", $<intV>1); } ; EOF: '\n' %% void yyerror(char *s) { fprintf(stderr, "%s\n", s); } void prompt() { printf("> "); } int main(void) { yyparse(); return 0; } A very simple language, consisting of no more than strings and integer and a basic REPL. Now, you'll note in the parser that args are output with a leading colon, the intention being that, when combined with the first pattern of the rule of the statement the interaction with the REPL would look something like this: > aaa aa a :aa :a aaa> However, the interaction is this: > aaa aa a :aa :a aaa aa aa > Why does the token ID in the following rule statement: ID args { printf("%s", $<strV>1); } | INTEGER { printf("%d", $<intV>1); } ; have the semantic value of the total input string, newline included? How can my grammar be reworked so that the interaction I intended?

    Read the article

  • Playing around with Eclipse features - Project files are now hidden?

    - by Daddy Warbox
    I don't even remember how, but somehow I managed to make all of my project's source files hidden in Eclipse's Package and Project Explorer panels. Go figure. 'Show Filtered Children (alt+click)' temporarily reveals the files, and only in Package Explorer can I double-click to reopen them from this view. They go back into hiding after I select another item, though. Plus, now I'm getting other annoyances, such as all of the folded non-hidden trees altogether expanding when I click on any item, and the entire file folder tree of my project now being shown in these panels (including my .svn subversion folders... which shouldn't be any of Eclipse's business, presently). Long story short, my Package/Project Explorers' just blew up on me, and I want to know how to fix this. Thanks in advance. P.S. What's a good guide I can use to learn my way around this silly contraption, anyway?

    Read the article

  • Applying style sheets in pyqt

    - by Jebagnanadas
    Hello all, If i apply a property to a parent widget it is automatically applied for child widgets too.. Is there any way of preventing this?? For example if i set background color as white in a dialog the button,combo boxes and scroll bars looks white as it lacks it native look(have to say it's unpleasant & ugly).. Is there any way that i can apply the stylesheets only to a parent widget not to it's children??? Experts help please..

    Read the article

  • Request time out error

    - by Neo
    Hi Today i came across strange problem whenever i try to pinging to my server works properly but whenever i send http request from browser the request time out happens. can anybody help me to resolve this issue.

    Read the article

  • computer build for extreme tabbed browsing

    - by David Berger
    I'm interested in building or buying a task-specific computer for my brother. His requirements are ridiculously simple: the machine has to be able to wait in hundreds of web-based virtual waiting rooms at once and not crash. To be competitive, he needs to be able to enter the waiting rooms an dauto-refresh them faster. My question is, what priority do I give the different specs? My initial surmise is this: Connection speed (nothing to do with my build, but I kind of think this will be more beneficial than anything I build for him) Memory size -- I don't usually see firefox taking up more than a gig, even when heavily tabbed, but I think one gig for the operating system and two gigs for the browser are necessary. Processor speed -- I think the processor will affect performance, but even something out of date will do what he needs Memory speed/RAM bus -- I doubt this will matter much, but it seems just on this side of irrelevant. Everything else is a non-issue for him. Does this seem to stack up correctly? Also, since he's looking to stay on the cheaper side, and I might end up recommending a refurb to him, is there anything particularly egregious that Vista would do if it came pre-installed? If I build it myself, I'll give him linux, but if I have it shipped to him, I'm not sure I could walk him through the install process for linux, but I probably could walk him through the process to upgrade to Windows 7, if it were somehow worth it.

    Read the article

  • Why do strace/truss sometimes 'fix' stuck processes?

    - by Emmel
    Sometimes you have a stuck process that's been stuck for a while, and as soon as you go to poke at it with strace/truss just to see what's going on, it gets magically unstuck and continues to run! So from merely 'observing' these programs have some impact in the running of the stuck programs .. what's happening here? Did strace (I guess via ptrace(2)?) send a signal, causing the program to cease blocking, or such? I've seen this several times -- most recently on Linux RHEL 4 (and a Perl script mucking with processes and doing some network IO in that case), but in a few other contexts as well. Unfortunately, I can't reproduce this, as it times to happen ... in times of crisis. But my curiosity remains. :-) Any elucidation appreciated.

    Read the article

  • installing windows on mac mini.

    - by sagar
    Please - please, don't start down voting after reading the question title. Hey ! Please first of read out the question. I brought a whole new mac mini as I am an iPhone developer - I prefer to use it. But most of my family members are not used to with mac osx. They don't know how to operate os x. Managing files Opening documents Browser & many many other issues. It's not their age to learn more, people like us ( computer geek ) can easily get into new systems. I had many attempted efforts to teach them for all these above topics in windows. Summary, Of all these, I know how to use mac, but they don't know. They stair like I am making private & bad usage of mac. In short, I just want to install windows. So, that they can feel that mac mini is for all members not for just me. Original Question Dual Boot windows & os x on mac mini ? Is it possible ? How ? Does it void warranties of apple ?

    Read the article

  • Downloading & Viewing ePub Books

    - by david
    I have the following requirements for an iPad App and would like to know if it's possible to implement them: Download ePub books and view them in iPads iBooks reader Install the downloaded book in the devices itunes library, so that they are accessibly from the iBooks applications

    Read the article

  • LifeRay alternative in asp.net c#

    - by Piyush
    Hi, I have explored some of the features of LifeRay from past few months. But due to high on hardware and development resource I would not want to go with LifeRay. Is there any good alternative to liferay in asp.net c#. I have seen following CMS application similar to LifeRay. Just want to know if someone has used it. AxCMS.Net Umbraco CMS DotNetNuke Thanks, Piyush

    Read the article

  • how to change Dictionary's value when enumerate it?

    - by younevertell
    how to change Dictionary's value when enumerate it? the following code doesn't work, because we can not change dictionary's value when enumerating it. Is there any way to get around it? Or NO WAY? Thanks foreach (KeyValuePair<string, int> kvp in mydictionary) { if (otherdictionary.ContainsKey(kvp.Key)) { mydictionary[kvp.Key] = otherdictionary[kvp.Key]; } else { otherdictionary[kvp.Key] = mydictionary[kvp.Key]; } }

    Read the article

  • User input in perl - Issue with running script in KomodoEdit

    - by golwalkar.rohan
    i wrote this tiny code on gedit and ran it :- #/usr/bin/perl print "Enter the radius of circle: \n"; $radius = <>; chomp $radius; print "radius is: $radius\n"; $circumference = (2*3.141592654) * $radius; print "Circumference of circle with radius : $radius = $circumference\n"; Runs fine using command line.Ran the same code on Komodo Edit: facing an issue i expect first line as output as :- Enter the radius of circle: whearas it waits on the screen i.e waiting for an input and after that runs everything in sequence -- can someone tell me why it runs fine with command line but not Komodo?

    Read the article

  • bjam wih visual studio 2010

    - by ra170
    ok, so I ran into problems with Boost under visual studio 2010, so I decided to rebuild it with bjam: such as: bjam --toolset=msvc-10.0 --build-type=complete After running bjam (successfully?) it created a new directory under boost_1_42_0 called: bin.v2 Inside bin.v2 is directory called: libs. Two issues: 1. there's lot less libs under that new directory (about 13), the old directory libs has 88. Is it supposed to be like that or did something fail? 2. the structure is somewhat different too. What do I do with this exactly? Meaning, do I copy it over to the original libs, delete the old libs, try rebulding it with different flags?

    Read the article

  • String handle in C#

    - by Chelsea_cole
    I don't understand the use of "get" and "set" command, how to add a list of the accounts using the code below and someone give me some example to fix the error? Thanks! :( public class Account { public string UserName {get rerurn textBox1.Test; // error set UserName = textBox1.Text;} // error public string Password { get; set; } public string RePassword { get; set; } public string Name { get; set; } public string bd { get; set; } public string dt { get; set; } public string dc { get; set; } } public class ListAcc { static void Data() { List<Account> UserList = new List<Account>(); } }

    Read the article

  • Not getting content in Excel sheet after exporting using DynamicJasper in grails

    - by Ravi
    Hi. I am new to grails and jasper reports. Please help me with the issue. I am trying one example on how to save in excel format the data that we display in grails. I am able to save as excel but not able to get anything inside excel sheet after opening it, not even columns. Refer the link http://www.wysmedia.com/2009/05/dance-with-dynamic-jasper-report/ for the example I am trying. Many thanks.

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >