Re: implementation of 2-dimensional array in bash - kind request

2008-07-06 Thread Kees Jongenburger
Hello Darius,

On Sat, Jul 5, 2008 at 7:54 PM, Darius Jack [EMAIL PROTECTED] wrote:
 and have 2D array inmterpreted as one row.
 so calculating
 array2D ( ) i-th j-th element
 as i + (j-1) x row length

I agree with Igor what using bash or even better a POSIX shell would
be a little
insane. Still Dave Taylor have a serries on  linuxjounral about shell
programming (creating a card game/arrat manipulation)

see http://www.linuxjournal.com/article/8704 I think you might find it useful.


greetings,


P.S. can you stop sending the Send instant messages to your online
friends http://uk.messenger.yahoo.com;  in every and each mail?
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Wrting to a text file in N800 /media/mmc1

2008-07-06 Thread Kees Jongenburger
On Sat, Jul 5, 2008 at 11:09 PM, nisha jain [EMAIL PROTECTED] wrote:
 Hi All,

 I just checked in N800 the following program for writing into a file which

 doesn't work Any clues what is going wrong? I neither get any error not
 it is

 creating a file and writing into it.

 #includestdio.h

 void main()
 {
 FILE *Gfile;
 if ((Gfile = fopen(/media/mmc1/test.txt, wt+)) == NULL)
 {
 printf(Error in file creation);
 }

 if(Gfile)
 fprintf(Gfile,%02x,0x10);
 fclose(Gfile);
 }

Hi Nisha
try printing the error using perror
add include errno.h
and replace the printf with perror(fopen).

The t in the fopen is not documented in my man pages what is it used for?
Do you know what happens when you call fclose on a NULL  handle?


Also remember you might be writing to a FAT file system that will not
support setting all file attributes.


 Regards,
 Nisha

 On Sat, Jul 5, 2008 at 5:34 PM, nisha jain [EMAIL PROTECTED] wrote:

 Hi Gray,

 I checked the file pointer if it is NULL I am printing error message and
 returning too.

 Also i am checking while writing into a file that file pointer is not
 NULL.

 I have tested it on mameo (ARMEL) enviornment and it is working absolutely
 fine

 I am not able to understand while after porting to N800 it doesn't show up
 any file created on flash

 at least it should create an empty file..Does there is some
 restriciton in writing into flash?

 Regards,
 Nisha

 On Sat, Jul 5, 2008 at 2:29 PM, gary liquid [EMAIL PROTECTED] wrote:

 nisha,

 check you have included appended the filename on the end of the path in
 your adjusted program.
 Check the return values of all functions called and do not assume success
 for anything.
 Most importantly, put printf(fn msg/n);  calls around your program at
 relevant points.
 The printfs will help you debug by showing you where your software got to
 and optionally whatever additional information you want to display.

 Gary (lcuk on maemo)

 On Sat, Jul 5, 2008 at 6:54 PM, nisha jain [EMAIL PROTECTED] wrote:

 hi All,

 I wrote a program which is collecting some data and creating text file
 to write into.

 I am successfully able to run and execute it in the VmWare maemo
 enviornment without any problem.

 When i deployed it into N800 I am getting segmentation fault this
 application I checked in ARMEL compiled

 mode on VmWare... I am not sure how to debug it as it is working fine in
 the Maemo enviornment but crashes

 on the actual N800 device... Only change is the file created in

 using like fopen (filename, wt);

 in the Maemo and in case of N800 fope(/media/mmc1, wt)

 I tired checking if file gets created to /media/mmc1 or not but it
 doesn't get created their at all.

 Let me know if some one has idea?

 Regards,
 Nisha

 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers





 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers


___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: implementation of 2-dimensional array in bash - kind request

2008-07-06 Thread William Gordon Rutherdale
C is a good solution.  So is Perl, which comes on OS 2008.  So is 
Python.  Perl lets you construct nested lists, which gives you the 
equivalent in capability to multi-dimensional arrays.  Python gives 
similar constructs.

There is no reason IMHO to be writing shell scripts of any kind on a 
system where Perl and Python are available.

Shell programming is just weak for many reasons including lack of data 
structure capabilities and should be avoided whenever possible.  I say 
this as someone who has accumulated years of shell programming 
experience in a professional software shop as well as other languages.

The strongest of the shell programming languages, namely bash and ksh, 
have this problem.  Perl and Python are practical for exactly the reason 
that they are good replacements for these shell languages.

-Will

Kees Jongenburger wrote:
 Hello Darius,

 On Sat, Jul 5, 2008 at 7:54 PM, Darius Jack [EMAIL PROTECTED] wrote:
   
 and have 2D array inmterpreted as one row.
 so calculating
 array2D ( ) i-th j-th element
 as i + (j-1) x row length

 
 I agree with Igor what using bash or even better a POSIX shell would
 be a little
 insane. Still Dave Taylor have a serries on  linuxjounral about shell
 programming (creating a card game/arrat manipulation)

 see http://www.linuxjournal.com/article/8704 I think you might find it useful.


 greetings,


 P.S. can you stop sending the Send instant messages to your online
 friends http://uk.messenger.yahoo.com;  in every and each mail?
 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers

   

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: 770 info in wiki Re: Has maemo-pc-connectivity been substituted by USB Networking applet (in control panel)?

2008-07-06 Thread Dave Neary
Hi,

Neil Jerram wrote:
 But the rest is arbitrary.  I see no need for separate pages, only
 clear section headings within the page.

Long pages full of technical information (most of which is not useful to
the reader) are intimidating, and give the impression of needing to be
an expert to achieve the task at hand.

It would be a return to the RTFM culture of the 90s when HOWTOs (which
were great if you had a basic idea what you were talking about) were the
pinacle of Linux documentation.

I'd hoped we'd progressed beyond that.

 That is you making a choice for yourself.  In the current discussion
 about wiki content, the debate is whether your proposal is best for
 the whole community, some of whom will have made different choices;
 not just for how you use your ITs.

My proposal is not to exclude people, but to ensure that the main drag
of the wiki stays clean, accessible, readable for a newbie, and
represents the most recent information available. Information about what
was the state of the art 3 years ago has its place, but it's not in the
middle of what is the state of the art now.

Cheers,
Dave.

-- 
maemo.org docsmaster
Email: [EMAIL PROTECTED]
Jabber: [EMAIL PROTECTED]

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: implementation of 2-dimensional array in bash - kind request

2008-07-06 Thread Jason Edgecombe
William Gordon Rutherdale wrote:
 C is a good solution.  So is Perl, which comes on OS 2008.  So is 
 Python.  Perl lets you construct nested lists, which gives you the 
 equivalent in capability to multi-dimensional arrays.  Python gives 
 similar constructs.

 There is no reason IMHO to be writing shell scripts of any kind on a 
 system where Perl and Python are available.

 Shell programming is just weak for many reasons including lack of data 
 structure capabilities and should be avoided whenever possible.  I say 
 this as someone who has accumulated years of shell programming 
 experience in a professional software shop as well as other languages.

 The strongest of the shell programming languages, namely bash and ksh, 
 have this problem.  Perl and Python are practical for exactly the reason 
 that they are good replacements for these shell languages.

 -Will
I agree with you here that perl and python are easier to do complex 
things with than bash or ksh, but I wanted to point out that python may 
be the better choice on the Nokia tablets. Perl is my favorite language, 
but the perl install on the tablets is missing a lot of the standard 
modules. For example, 'perl -e use English;' gives an error. python 
seems to be a more complete install and even includes gtk, so it's 
arguably the best choice of scripting language for the platform given 
what's preinstalled and in extras.

Sincerely,
Jason
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Wrting to a text file in N800 /media/mmc1

2008-07-06 Thread nisha jain
Hi All,

Thanks alot for all your comments and help It finally worked I am not sure
cause of problem but I guess it is due the mini-usb cable issue when I copy
through it and keep it plug in i guess memory card is always in read mode
but i have to still dig into it.. I also did unlock of memory card and now
it is working perfectly fine even with lock mode it worked... I am not sure
what is the issue I will send once complete this checking...


Thanks and Regards,
Nisha

On Sun, Jul 6, 2008 at 1:52 PM, Chris Dobbs [EMAIL PROTECTED]
wrote:

 Should that not be
 fopen(path/filename, wt);

 i.e

 fopen(/media/mmc2/myfile.txt, wt);


 ?


 -Chris


 On 5 Jul 2008, at 19:54, nisha jain wrote:

   hi All,

 I wrote a program which is collecting some data and creating text file to
 write into.

 I am successfully able to run and execute it in the VmWare maemo
 enviornment without any problem.

 When i deployed it into N800 I am getting segmentation fault this
 application I checked in ARMEL compiled

 mode on VmWare... I am not sure how to debug it as it is working fine in
 the Maemo enviornment but crashes

 on the actual N800 device... Only change is the file created in

 using like fopen (filename, wt);

 in the Maemo and in case of N800 fope(/media/mmc1, wt)

 I tired checking if file gets created to /media/mmc1 or not but it doesn't
 get created their at all.

 Let me know if some one has idea?

 Regards,
 Nisha
 ___
 maemo-developers mailing list
 maemo-developers@maemo.org
 https://lists.maemo.org/mailman/listinfo/maemo-developers



___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Problem with SDL on Maemo

2008-07-06 Thread Deepak Kr. Sharma, Noida

Hi,

 

I wrote a maemo application which creates SDL window. But even after
SDL_WM_SetCaption(), I don't get to see anything in title bar of the
Xephyr window.

 

If I run the same program outside scratchbox, I get that title on the
window created.

 

What could be the issue?

 

Regards,

Deepak



DISCLAIMER:
---

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only. 
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates. 
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have 
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and 
attachments please check them for viruses and defect.

---___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers