Go to advanced search

by enedil
Tue Oct 13, 2020 5:31 pm
Forum: C/C++
Topic: questions to libs having a .h file and a .c file
Replies: 48
Views: 1779

Re: questions to libs having a .h file and a .c file

Alas, there are some inconveniences to this approach. For instance, I read that if your code is in single compilation unit, GCC can optimize your code better by 10-15% (CITATION NEEDED, but still conceivable). Do you mean this? -fwhole-program Assume that the current compilation unit represents the...
by enedil
Tue Oct 13, 2020 4:20 pm
Forum: C/C++
Topic: questions to libs having a .h file and a .c file
Replies: 48
Views: 1779

Re: questions to libs having a .h file and a .c file

Also, out of other reasons of not including .c files, if you're building a bigger project, you'll start noticing that build times get longer and longer. Split that into separate source files, use GNU make (or cmake or ninja or bazel, whatever you like) to compile your project. What will happen is th...
by enedil
Tue Oct 13, 2020 4:11 pm
Forum: C/C++
Topic: questions to libs having a .h file and a .c file
Replies: 48
Views: 1779

Re: questions to libs having a .h file and a .c file

Just avoid putting code in header files. Oh boy... Thing is "header only libraries" are a big thing that many people do on purpose. Especially in the C++ world. The Top 137 Header Only Open Source Projects: https://awesomeopensource.com/projects/header-only And: https://subscription.packt...
by enedil
Tue Oct 13, 2020 2:15 pm
Forum: Networking and servers
Topic: Cannot ping
Replies: 5
Views: 383

Re: Cannot ping

pi-anazazi wrote:
Mon Oct 12, 2020 2:59 pm
169.254.72.x = LinK Local, non-routable IP...
That was it <3
by enedil
Mon Oct 12, 2020 11:12 am
Forum: Networking and servers
Topic: Cannot ping
Replies: 5
Views: 383

Re: Cannot ping

That's a good suggestion, but I would anyway like to discover what was the problem in the aforementioned setup. This has to have something to do with RPi, as packages reach it, but it doesn't respond.
by enedil
Mon Oct 12, 2020 12:04 am
Forum: Networking and servers
Topic: Cannot ping
Replies: 5
Views: 383

Cannot ping

I had a problem, that my home wifi router is situated just on the other end of my house than my desk and connectivity is really low. However I really wouldn't like to have a long cable that goes through whole house, and thus I thought that I might put my RPi 4 in my room (on the other end, where the...
by enedil
Sat Aug 22, 2020 5:04 pm
Forum: Python
Topic: is it possible to compile a Python program into an executable ?
Replies: 30
Views: 1680

Re: is it possible to compile a Python program into an executable ?

On the other hand cython and numba, which are not mentioned, have been very fast - faster than my C on occasion. But they still need to be run using python and the code generally needs to be converted quite a bit. Cython can and does create standalone native executables as described earlier; it is ...
by enedil
Fri Aug 21, 2020 12:18 pm
Forum: Python
Topic: is it possible to compile a Python program into an executable ?
Replies: 30
Views: 1680

Re: is it possible to compile a Python program into an executable ?

satineeraj wrote:
Fri Aug 21, 2020 4:09 am
Yes you can compile the Python Code through the compilers check best Python Compilers here:http://www.techgeekbuzz.com/best-python-compiler/
but they all come with some caveats, that were already mentioned
by enedil
Tue Aug 18, 2020 4:16 am
Forum: Python
Topic: is it possible to compile a Python program into an executable ?
Replies: 30
Views: 1680

Re: is it possible to compile a Python program into an executable ?

The .pyc files are generated automatically, they land in directory __pycache__ (unless you disable it by env variable). So if you run your code multiple times, withouth changing, the first run will generate the byte code and each subsequent will detect the existence of cache and load from there.
by enedil
Tue Aug 18, 2020 12:40 am
Forum: Python
Topic: is it possible to compile a Python program into an executable ?
Replies: 30
Views: 1680

Re: is it possible to compile a Python program into an executable ?

Besides which, can't you just "compile" your Python code into .pyc files? Every Python script before running is compiled to .pyc file so this is a noop (unless you frequently remove the pyc files and rerun your script, which would be wasteless). And, of course, since they are compiled, th...
by enedil
Sun Aug 16, 2020 11:23 pm
Forum: General programming discussion
Topic: Binary search
Replies: 12
Views: 1033

Re: Binary search

I know that there are examples where simple linear scan is faster than a binary search. From my experience though, once your data set has about 100 elements, bsearch is really faster, especially since you're all taking about searching in arrays, while for me, when I actually used binary search, it w...
by enedil
Sun Aug 16, 2020 3:09 am
Forum: Beginners
Topic: Install base image onto SD card without monitor
Replies: 4
Views: 246

Re: Install base image onto SD card without monitor

Oh, that's actually really easy, I was expecting uncompressing some LZMA images that need to be compressed later on. That means maybe I'll stick to Raspberry Pi OS. Thanks for the helpful info <3
by enedil
Sun Aug 16, 2020 1:45 am
Forum: Beginners
Topic: Install base image onto SD card without monitor
Replies: 4
Views: 246

Install base image onto SD card without monitor

Hey, I'm planning on getting a RPI (the latest one specifically) and I thought of not buying microHDMI-HDMI cable. Is there some known method, so that I can build a Linux image (preferably Fedora, but at the end of the day, whatever) so that it 1) doesn't involve any installer, so the stuff I put on...
by enedil
Sun Aug 16, 2020 1:36 am
Forum: General programming discussion
Topic: Binary search
Replies: 12
Views: 1033

Re: Binary search

Interesting. I guess for that to be useful you need your arrays to be sorted before you start. Which might be a lot more processing time that the search itself. Or perhaps one always keeps ones arrays sorted by using the binary search to find the insertion point for new items and moving things afte...
by enedil
Mon Jan 04, 2016 6:45 pm
Forum: Python
Topic: Detect keypress using Python
Replies: 8
Views: 66169

Re: Detect keypress using Python

by enedil
Mon Jan 04, 2016 2:43 pm
Forum: C/C++
Topic: GPIO and serial IF programming with C language
Replies: 3
Views: 960

Re: GPIO and serial IF programming with C language

Try with this - without redundant overhead:
http://www.pieter-jan.com/node/15
by enedil
Sun Jan 03, 2016 6:25 pm
Forum: Python
Topic: ImportError: cannont import name 'IncompleteRead'
Replies: 1
Views: 501

Re: ImportError: cannont import name 'IncompleteRead'

Try

Code: Select all

sudo apt-get remove python3-pip
easy_install-3.5 pip
If there's no "easy_install-3.5", use that which matches your Python version.
by enedil
Sun Jan 03, 2016 6:18 pm
Forum: Python
Topic: hcm5883l split the data
Replies: 9
Views: 1386

Re: hcm5883l split the data

If that's a string, you can use split:

Code: Select all

list(map(lambda p: float(p.split(' ')[1]), string.split('\n')))
by enedil
Sat Jan 02, 2016 2:42 pm
Forum: Python
Topic: Calling app from within app
Replies: 4
Views: 1022

Re: Calling app from within app

Of course it is possible. But if the latter one is made with Python too, you could create module with it:
https://docs.python.org/3/tutorial/modules.html
by enedil
Sat Oct 10, 2015 7:11 pm
Forum: Other programming languages
Topic: Posting a data on a Html page
Replies: 5
Views: 1333

Re: Posting a data on a Html page

I would set up a Ruby Sinatra or NodeJS micro-service, that posts the data in processed form.
How do you collect the data?
Which programming language?
by enedil
Sat Oct 10, 2015 7:05 pm
Forum: Other programming languages
Topic: LISP on RPI?
Replies: 6
Views: 1949

Re: LISP on RPI?

sudo apt-get install clisp #? is that not lisp I've done that too, I was just curious if their was any fix for CCL because a lot of people seem to have chosen CCL for speed and efficiency. It looks like SBCL can be a compiler of choice for a big chunk of Common LISP community that is fast and produ...
by enedil
Sat Oct 10, 2015 7:01 pm
Forum: General programming discussion
Topic: Best way to get code onto pi
Replies: 3
Views: 1162

Re: Best way to get code onto pi

Maybe setup a Git server?
Give Gogs a try. You can leave it working on your Pi, and just sync changes on your desktop.
by enedil
Wed Aug 26, 2015 10:33 pm
Forum: General programming discussion
Topic: What Language to Use?
Replies: 1
Views: 684

Re: What Language to Use?

You mean a controller for your already built car, eh?

Go with Python.
Even though I'm a strong advocate of Ruby. It makes no sense to learn a new language for the sake of learning.
by enedil
Wed Aug 26, 2015 10:31 pm
Forum: Polski
Topic: Analogowe piny GPIO ?
Replies: 1
Views: 2124

Re: Analogowe piny GPIO ?

A kto wie?
Ale, skoro PRi idze do przodu, to czemu miałoby się cofać?
by enedil
Thu Aug 20, 2015 10:35 am
Forum: Other programming languages
Topic: Announcing 8th for the Raspberry Pi!
Replies: 20
Views: 3677

Re: Announcing 8th for the Raspberry Pi!

Apart from the points raised before, which can be shorten to
Image,

where are the Docs?

Go to advanced search