Search found 1253 matches

by caseih
Oct 20, 2018 1:30
Forum: Linux
Topic: Changing to Root & Back within FB
Replies: 15
Views: 143

Re: Changing to Root & Back within FB

So the expect script gives you this error?
by caseih
Oct 16, 2018 20:26
Forum: Linux
Topic: Thread naming & priority
Replies: 4
Views: 112

Re: Naming Threads

Using linux kernel calls, you can set the name of a thread in Linux by using prctl() . However this is not in the C runtime, so I'm not totally sure how to access it from FB. For a C example, see this: https://stackoverflow.com/questions/30453048/using-prctl-pr-set-name-to-set-name-for-process-or-th...
by caseih
Oct 10, 2018 14:24
Forum: Community Discussion
Topic: [offtopic] FreePascal
Replies: 52
Views: 1049

Re: New website

Guess I don't quite understand, jj. That same batch file could be modified to compile and run BASIC programs with FBC. I've done something similar with FBC for years on Linux.

I'm not sure why these tools don't set the errorlevel. They seem to properly set the return code in Linux.
by caseih
Oct 07, 2018 18:22
Forum: Beginners
Topic: Importing C code into a FreeBasic program
Replies: 4
Views: 273

Re: Importing C code into a FreeBasic program

I stand corrected!
by caseih
Oct 07, 2018 15:46
Forum: Beginners
Topic: Importing C code into a FreeBasic program
Replies: 4
Views: 273

Re: Importing C code into a FreeBasic program

You'll also have to use the EXTERN keyword in FB to gain access to the global symbols defined in the C module. Either that, or rewrite the C functions to return information to you, rather than rely on global state. Anywhere where C defines a char array, such as text_buf[], that's the equivalent of a...
by caseih
Oct 05, 2018 18:55
Forum: General
Topic: 64-bit asm woes
Replies: 50
Views: 1358

Re: 64-bit asm woes

I'm not completely clear in my remembrance of significant figures, but I'm pretty sure the correct average of that field should be 16.0%. I'm not sure if the significant figures should be 3 digits or 4 digits. Not that it matters for our case! But doing real data analysis, it might.
by caseih
Oct 03, 2018 19:20
Forum: General
Topic: 64-bit asm woes
Replies: 50
Views: 1358

Re: 64-bit asm woes

( I as much hate the O() platitude as the mindless assembler references. In reality the cardinality (number of items) of many problems never are really infinite, if only because of limited memory, so constant factors do have to be weighted against the cardinality factor. This is specially true beca...
by caseih
Oct 03, 2018 3:30
Forum: General
Topic: 64-bit asm woes
Replies: 50
Views: 1358

Re: 64-bit asm woes

Compilers can outperform hand-written assembler code - in rare cases. And in these rare cases, you can learn from the compiler and re-write the assembler code. Sure, if you're an expert programmer who has a thorough understanding of the architecture and the chip family you are targeting. For everyo...
by caseih
Oct 02, 2018 21:55
Forum: General
Topic: 64-bit asm woes
Replies: 50
Views: 1358

Re: 64-bit asm woes

I'm sure GCC 8 does produce faster code than GCC 5. However, I'd expect it to only be a slight improvement. Optimizations are continually getting better. Better than my assembly code, SSE2 notwithstanding! On modern processors, it's possible that dipping out of a compiled language like FB into assem...
by caseih
Oct 02, 2018 21:37
Forum: Community Discussion
Topic: my best effort
Replies: 56
Views: 1340

Re: my best effort

I got my BS degree in computer science. I was never taught to code in CS at all. They just expected that we already knew how to code (coding used to always be learned in an ad-hoc manner by enthusiastic nerds), and for my class at least, we all did. Instead they were teaching us how to "program...
by caseih
Sep 29, 2018 14:43
Forum: General
Topic: Getting past the 15 decimal place limit of a double in FreeBASIC?
Replies: 11
Views: 368

Re: Getting past the 15 decimal place limit of a double in FreeBASIC?

FreeBasic\bin\win32\ld.exe: cannot find -lgmp I always try to get binaries of third-party open-source libraries from the MingW compiler project project if possible. Here's a link to the mingw page on libgmp: https://sourceforge.net/projects/mingw/files/MinGW/Base/gmp/gmp-6.1.2/ The dll itself is in...
by caseih
Sep 29, 2018 14:15
Forum: General
Topic: Getting past the 15 decimal place limit of a double in FreeBASIC?
Replies: 11
Views: 368

Re: Getting past the 15 decimal place limit of a double in FreeBASIC?

Sure. All third-party libraries, be they open source or proprietary, have licenses that must be abided by and establish firm restrictions. Some are royalty-free, some are not. Open source is not special in this regard. GMP is available under the LGPL license, which does allow for use in proprietary ...
by caseih
Sep 29, 2018 3:43
Forum: General
Topic: Getting past the 15 decimal place limit of a double in FreeBASIC?
Replies: 11
Views: 368

Re: Getting past the 15 decimal place limit of a double in FreeBASIC?

A quick google search reveals that in C, it's possible to do this algorithm with the GMP library, which FB does have a .bi include file for. Should be trivial to convert the code in the example to FB (1:1 transliteration) contained in this article: http://beej.us/blog/data/pi-chudnovsky-gmp/ GMP sup...
by caseih
Sep 26, 2018 13:58
Forum: Windows
Topic: Freebasic interpreter trick
Replies: 10
Views: 1198

Re: Freebasic interpreter trick

Sure. Here it is. Place it somewhere and chmod a+x it. Be sure to set the FBC variable to point to where you have the compiler installed. #!/bin/bash #set -x # Set to somewhere writable and executable if /tmp is not executable TEMP_EXE_DIR= FBC=/opt/FreeBASIC/bin/fbc FBC_FLAGS= if [ ! -z "$TEMP...
by caseih
Sep 22, 2018 14:42
Forum: General
Topic: Where have I gone wrong
Replies: 135
Views: 3008

Re: Where have I gone wrong

Correct. A RAM drive will be of no benefit for such a small amount of data (if each item was 1024 bytes or less, that's no more than 16 MB for 16,000 records). Think about it: it still takes the same amount of time to copy it from the spinning disk into the ram disk as it would for your program to s...

Go to advanced search