Go to advanced search

by Michiel O.
Sun Aug 04, 2019 12:13 pm
Forum: Java
Topic: If else help
Replies: 16
Views: 4561

Re: If else help

knute wrote: equalsIgnoreCase​()
Two flies in one swat :mrgreen:
by Michiel O.
Sat Aug 03, 2019 3:45 pm
Forum: Java
Topic: If else help
Replies: 16
Views: 4561

Re: If else help

Well, did you Google for 'java lowercase'? What did you find out? When I do it, I see at the top of the search results: "The java string toLowerCase() method returns the string in lowercase letter. In other words, it converts all characters of the string into lower case letter." Use .toLowerCase() o...
by Michiel O.
Mon Jul 29, 2019 7:05 am
Forum: General discussion
Topic: Learning Assembler on the Pi
Replies: 51
Views: 1968

Re: Learning Assembler on the Pi

Heater wrote: object oriented programming is not such a good idea as it has been made out to be
Indeed, and I agree with you. See this video for a thorough critique. But we're in a minority :mrgreen:
by Michiel O.
Thu Jul 25, 2019 1:37 pm
Forum: General discussion
Topic: Running to function at the same time with sockets
Replies: 5
Views: 257

Re: Running to function at the same time with sockets

You know strdata[1] means the second character in the string strdata, yes? If you want the first character, use strdata[0].
by Michiel O.
Thu Jul 25, 2019 5:20 am
Forum: Troubleshooting
Topic: Black Screen Total Newb
Replies: 11
Views: 443

Re: Black Screen Total Newb

HawaiianPi wrote: The only issue I'm aware of on Mac OS is how it automatically replaces straight quotes with curly quotes
Where does this happen? The past 8 years I've worked with OS X and macOS and I've never seen this. But on Windows, MS Word does indeed automatically convert double quotes to curly quotes.
by Michiel O.
Thu Jul 25, 2019 5:14 am
Forum: Python
Topic: My program stuck after sometime
Replies: 17
Views: 1084

Re: My program stuck after sometime

What do you use this program for? What is it supposed to achieve?
by Michiel O.
Thu Jul 25, 2019 5:03 am
Forum: Troubleshooting
Topic: Grading app?
Replies: 13
Views: 523

Re: Grading app?

Just out of curiosity, what does the 'grading' mean?
by Michiel O.
Thu Jul 25, 2019 5:01 am
Forum: Deutsch
Topic: USB-Boot PI4
Replies: 4
Views: 3472

Re: USB-Boot PI4

Indeed. In short: you boot from the SD card, and mount root from SSD.
by Michiel O.
Thu Jul 25, 2019 4:58 am
Forum: Python
Topic: bulid map for minesweeper competition
Replies: 5
Views: 283

Re: bulid map for minesweeper competition

What do you mean by 'encoder'?
by Michiel O.
Tue Jul 23, 2019 7:56 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 14074

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

jahboater wrote:

Code: Select all

loop: 
  lodsb 
  stosb 
  test al,al 
  jnz loop
I remember REP STOSB, but then of course you must know in advance how many bytes you want to copy.
by Michiel O.
Tue Jul 23, 2019 7:51 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 14074

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Its good to see someone taking an interest in writing efficient code. I do this out of interest and curiosity. Also, I find pointer-based solutions to data-structure algorithms fascinating ( "move pointers, not the data" ), although I know that it is harder to write, debug, maintain and understand....
by Michiel O.
Tue Jul 23, 2019 6:24 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 14074

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

jahboater wrote: Its much more useful, and the code is simpler, to return the final position of the dst pointer, so you can chain strcpy()'s together.
That sounds a lot more efficient than a strcat() feast.
by Michiel O.
Tue Jul 23, 2019 5:01 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 14074

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

It's incredible what difference -O3 makes. And thanks for showing how to write better inline asm!
by Michiel O.
Tue Jul 23, 2019 2:06 am
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 14074

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

I am also happy to see someone else that likes Assembly Language Yes. And as fine purveyors of the inline variant, lets write strcpy in assembly inside the C code: void StrCpyAsm(char *dst, const char *src) { __asm__( "loop: \n" " ldrb r2, [r1], #1 \n" " strb r2, [r0], #1 \n" " cmp r2, #0 \n" " bne...
by Michiel O.
Mon Jul 22, 2019 10:49 pm
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 14074

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

There are plenty of other things that people could criticize about that code. First and foremost, I was surprised about your implementation of strcpy , since I heard you praising the benefits of pointers on multiple occasions. Yet, you use an extra index variable and array notation: char *StrCpyDav...
by Michiel O.
Mon Jul 22, 2019 9:24 pm
Forum: Off topic discussion
Topic: How broken is the WWW?
Replies: 47
Views: 7109

Re: How broken is the WWW?

rin67630 wrote: You mean a good journalist is a dead one?
That's a strawman argument. I have nothing against paywalls, but I do want an ad-free browsing experience.
by Michiel O.
Mon Jul 22, 2019 7:45 pm
Forum: Troubleshooting
Topic: Let the Pi resize your SDXC card!
Replies: 8
Views: 422

Re: Let the Pi resize your SDXC card!

PeterO wrote:
Mon Jul 22, 2019 6:05 pm
Why ? There is nothing to suggest there is a problem with the card
That was more a reply to klricks' post.
by Michiel O.
Mon Jul 22, 2019 6:02 pm
Forum: Python
Topic: How to create a sub-process?
Replies: 7
Views: 330

Re: How to create a sub-process?

If you can solve your problem using the much-simpler 'call a function when a GPIO pin changes' function in the gpio module, that is the way to go. The simpler the better. Your initial question was referring the multiprocessing lib, I presumed you mentioned that because of a reason.
by Michiel O.
Mon Jul 22, 2019 2:29 pm
Forum: Python
Topic: How to create a sub-process?
Replies: 7
Views: 330

Re: How to create a sub-process?

I can only guess at your exact requirements and use-case, but this is how you could use multiprocessing to have two processes (a main and a switch watcher) which communicate through a queue. This example simulates a switch press and release based on time instead of listening to a GPIO pin. #!/usr/bi...
by Michiel O.
Mon Jul 22, 2019 1:52 pm
Forum: Troubleshooting
Topic: 1 of 6 Pis Not Booting
Replies: 5
Views: 239

Re: 1 of 6 Pis Not Booting

Have you tried booting the RPi from USB?
by Michiel O.
Mon Jul 22, 2019 1:49 pm
Forum: Troubleshooting
Topic: Let the Pi resize your SDXC card!
Replies: 8
Views: 422

Re: Let the Pi resize your SDXC card!

I use the 'F3 tools' for checking that cards are not fake. See http://oss.digirati.com.br/f3/
by Michiel O.
Mon Jul 22, 2019 12:16 pm
Forum: C/C++
Topic: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?
Replies: 303
Views: 14074

Re: I dont get it... Why is everyone from science schools so obsessed with Perl and Python when we got C?

Why do you think lisp is the best? I can imagine not having to worry anymore about some nasty concurrency problems when using clojure , but that's more due to software transactional memory than due to homoiconicity between program code and data, I suspect. PS. If you want to toy with a lisp that has...
by Michiel O.
Mon Jul 22, 2019 11:12 am
Forum: Java
Topic: If else help
Replies: 16
Views: 4561

Re: If else help

That was left as an exercise for the reader :lol:

Hint: Google for 'java lowercase'. :P
by Michiel O.
Mon Jul 22, 2019 6:23 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO: switching between ALT functions
Replies: 14
Views: 32249

Re: GPIO: switching between ALT functions

From the command line you can use my pigs to start hardware PWM on the relevant GPIO. Correction: The link you gave, http://abyz.co.uk/rpi/pigpio/pigs.html , seems to redirect to a website with articles abount all kinds of random things. I think the correct URLs would be http://abyz.me.uk/rpi/pigpi...
by Michiel O.
Mon Jul 22, 2019 6:01 am
Forum: Troubleshooting
Topic: "New" booting problem
Replies: 8
Views: 492

Re: "New" booting problem

Can you boot it from USB?

Go to advanced search