Go to advanced search

by stephj
Fri Feb 23, 2018 2:31 pm
Forum: Other programming languages
Topic: mono C# handling external .dll
Replies: 3
Views: 3552

Re: mono C# handling external .dll

It all depends on what's in that .dll file. If it contains x86/x64 code that you have just copied over from the Windows 10 machine then it will not work at all. If it was created as a .NET or Mono dll, then it should work, as it contains CLR byte code not native machine language.
by stephj
Tue Nov 14, 2017 12:26 pm
Forum: Other projects
Topic: In search of a larger case
Replies: 12
Views: 5472

Re: In search of a larger case

This one looks close to what you want. It doesn't have an internal power supply, but it does have a power-switch. http://uk.farnell.com/element14/pi-desktop/element-14-pi-desktop-hatencl/dp/2687142?ost=raspberry+pi+desktop&categoryIdBox=&selectedCategoryId=&iscrfnonsku=false I am currently running ...
by stephj
Fri Mar 17, 2017 10:57 am
Forum: C/C++
Topic: How to use 100 percent of the raspberry pi cpu in C programs
Replies: 7
Views: 2338

Re: How to use 100 percent of the raspberry pi cpu in C prog

Let’s use a practical example, although whether you consider number bashing a worthy cause is another matter. This code calculates pi to a defined number of places, in this code example 10,000 places, using the Taylor series expansion of 16*arctan(1/5) - 4*arctan(1/239) There are quicker ways to cal...
by stephj
Tue Mar 14, 2017 10:34 am
Forum: C/C++
Topic: How to use 100 percent of the raspberry pi cpu in C programs
Replies: 7
Views: 2338

Re: How to use 100 percent of the raspberry pi cpu in C prog

This will probably require an awful lot of thinking about first, before you decide whether it is actually worth the effort. Can the problem be broken into tasks that can run completely independently of each other? You could have four threads each processing its own quarter of the file concurrently b...
by stephj
Tue Feb 14, 2017 12:17 pm
Forum: General programming discussion
Topic: Build Own Program For Raspbian
Replies: 2
Views: 1400

Re: Build Own Program For Raspbian

The bare bones tutorial of using the button widget in GTK 2.0 is here:

http://zetcode.com/gui/gtk2/gtkwidgets/
by stephj
Wed Nov 09, 2016 12:36 pm
Forum: General programming discussion
Topic: Can i extract an OS from another linux device?
Replies: 8
Views: 4074

Re: Can i extract an OS from another linux device?

r3d4 wrote: Can qemu run this arch ?
QEMU can emulate an SH4, but I still reckon you would have a fight on your hands getting it to work.

Even then it would be running on an x86/x64 Windows or Linux box.
by stephj
Wed Nov 02, 2016 11:13 am
Forum: General programming discussion
Topic: Can i extract an OS from another linux device?
Replies: 8
Views: 4074

Re: Can i extract an OS from another linux device?

It might be running a version of Linux, but the 32 bit CPU running in the STI7105 SOC is STMicroelectronic's own ST40 architecture.

So, an ARM processor it isn't. Even if you could get it out of the MAG250, it won't work on a pi.

Don't waste your time and effort trying, it's all for nought.
by stephj
Mon Oct 24, 2016 9:17 am
Forum: C/C++
Topic: How would you ...... in C ? (+ other C discussions)
Replies: 187
Views: 23491

Re: How would you ...... in C ?

My suspicion was correct. GCC in 64 bit mode defaults long integers to 64 bits. The above code allows 32 bit unsigned numbers to overflow into the 64 bit unsigned 'temp', before correcting things later. If long integers are 64 bit not 32 this breaks the logic. The moral of this tale is: Do not assum...
by stephj
Thu Oct 20, 2016 5:20 pm
Forum: C/C++
Topic: How would you ...... in C ? (+ other C discussions)
Replies: 187
Views: 23491

Re: How would you ...... in C ?

PeterO wrote:Running your code on a 64 bit machine gives a different answer, which is not a good sign :shock: :o
Good point, Peter. I've got a machine running OpenSuse Leap. I'll try and get to the bottom of it. It may be because longs on a 64 bit system default to 64bit.

More later.
by stephj
Thu Oct 20, 2016 3:15 pm
Forum: C/C++
Topic: How would you ...... in C ? (+ other C discussions)
Replies: 187
Views: 23491

Re: How would you ...... in C ?

Well done to anybody who managed to figure out the 50 digit Fibonacci number challenge earlier, whether you used a math library or not. It was probably beyond the scope of 'beginners', as you need to either use math libraries or arrays, using them to store parts of the answer. As always thinking abo...
by stephj
Wed Oct 19, 2016 4:43 pm
Forum: C/C++
Topic: How would you ...... in C ? (+ other C discussions)
Replies: 187
Views: 23491

Re: How would you ...... in C ?

Here's one for the number bashers. We'll take a problem along the lines of some of the early Project Euler ones. (This is derived it's not one of theirs.) What is the smallest Fibonacci number with fifty digits, printed out in full? In Python it's a stroll in the park! f1=0; f2=1; while(len(str(f2))...
by stephj
Thu Oct 13, 2016 2:40 pm
Forum: C/C++
Topic: The MagPi does C :-)
Replies: 124
Views: 24666

Re: The MagPi does C :-)

Being a salty old ‘C’ dog myself, this book is a very nice piece of work. The original K&R “The C Programming Language” book has all you need to know about ‘C’, but it is rather terse if not outright ‘crusty’ for the beginner. This book adds proper working examples to present the topic of each chapt...
by stephj
Tue Sep 27, 2016 11:12 pm
Forum: Other programming languages
Topic: Run a Mono WinForm app with no Desktop environment installed
Replies: 3
Views: 2798

Re: Run a Mono WinForm app with no Desktop environment insta

Good stuff! I'm glad you got it going, stephj.
by stephj
Tue Sep 27, 2016 4:35 pm
Forum: Other programming languages
Topic: Run a Mono WinForm app with no Desktop environment installed
Replies: 3
Views: 2798

Re: Run a Mono WinForm app with no Desktop environment insta

You will probably need some form of X-Server running on your client machine. Xming server can be run under Windows which will allow graphical programs to run using PuTTY as an SSH client providing the option to allow X-11 forwarding is checked in the connection setup. PuTTY.PNG 5x5.png 5x5 is a GTK ...
by stephj
Thu Sep 22, 2016 11:31 am
Forum: Other programming languages
Topic: ARMv8 instructions.
Replies: 86
Views: 17204

Re: ARMv8 instructions.

The Microsoft Embedded C++ and Visual Studio C++ cross compilers were once used to develop for Windows Mobile devices. Remember those before Windows Phone wrecked everything? These compilers used to just churn out executable code as ARM4 or ARM4I, the ARM4I being able to run Thumb code. It was proba...
by stephj
Tue Aug 23, 2016 10:39 am
Forum: Other programming languages
Topic: C# - How to send data to raspberry pi.
Replies: 4
Views: 4623

Re: C# - How to send data to raspberry pi.

If you have reasonable skills in C#, you could install Mono on the Pi and use a named piped between your C# program on the PC and a C# program on the Pi. Andras Nemes has blogged the bare bones of it here: https://dotnetcodr.com/2015/06/16/basics-of-working-with-pipes-in-c-net-part-1-send-and-receiv...
by stephj
Mon Jul 04, 2016 3:45 pm
Forum: C/C++
Topic: Mouse coordinates with mouse0
Replies: 5
Views: 1185

Re: Mouse coordinates with mouse0

The bare bones of a GTK 2.0 application to detect when a mouse has been clicked within the application window is included below. The x and y values presented to the callback by the GdkEventButton object are relative to the top left of the window. The value of y increases as the mouse cursor moves do...
by stephj
Thu Jun 09, 2016 9:38 am
Forum: C/C++
Topic: What is the best IDE for C++?
Replies: 17
Views: 7106

Re: What is the best IDE for C++?

To run an executable .NET program compiled and created on your PC you will need the mono runtime installed on your Pi $ sudo apt-get install mono-runtime If you want to compile C# programs on the Pi you will need the full installation: $ sudo apt-get install mono-complete To compile on the Pi use $m...
by stephj
Sat May 14, 2016 4:45 pm
Forum: C/C++
Topic: new Geany version 1.27
Replies: 6
Views: 1811

Re: new Geany version 1.27

If you really must have the latest version, then your only option is to drag down the source code from the official Geany site and compile it on your Pi. Possible, but not for the faint hearted. For reasons of stability some of the packages in Raspbian are a version or two behind the curve. It makes...
by stephj
Wed Apr 20, 2016 8:17 am
Forum: C/C++
Topic: Multi-Threading, RPi performance
Replies: 4
Views: 1911

Re: Multi-Threading, RPi performance

Have a read of Chapter 4: Threads of the Advanced Linux Programming manual, which can be downloaded from here: https://archive.org/details/ost-computer-science-advanced-linux-programming As a downloadable .pdf file, the entire book is a 2.7Mb download. Not a bad reference volume even if it is 15 yea...
by stephj
Wed Apr 06, 2016 12:23 pm
Forum: Troubleshooting
Topic: Raspberry Pi 3 Wifi Setup
Replies: 71
Views: 329776

Re: Raspberry Pi 3 Wifi Setup

My Pi 2 has not worked on Wifi since the first release of Jessie. I have changed anything and everything to try to get it to work, but the router steadfastly refused to show up on a search. The router is a BTHomeHub mk2. On the Wifi setup screen of the router, there is a throwaway remark that settin...
by stephj
Tue Mar 15, 2016 12:45 pm
Forum: General programming discussion
Topic: Mysql query with difference
Replies: 12
Views: 3287

Re: Mysql query with difference

Good point! This returns the correct value of 233 from the above table like the RPG code does. SELECT (SELECT MIN(UNITS) FROM POWERCON WHERE DATE(TSTAMP) = '2016-02-21') - (SELECT MIN(UNITS) FROM POWERCON WHERE DATE(TSTAMP) = '2016-02-20') FROM SYSIBM/SYSDUMMY1 It works, but it is not particularly e...
by stephj
Wed Mar 09, 2016 11:42 am
Forum: Other programming languages
Topic: COBOL on the Pi.
Replies: 7
Views: 1650

Re: COBOL on the Pi.

My career in IT started off learning COBOL on both IBM 370 midrange mainframes and DEC VAX 780 machines. Nearly all the systems were written in it, with only a handful of research analysts who knew enough FORTRAN to do the required number bashing on the IBM. After serious structural changes to the c...
by stephj
Mon Feb 29, 2016 5:44 pm
Forum: General programming discussion
Topic: Mysql query with difference
Replies: 12
Views: 3287

Re: Mysql query with difference

SELECT * FROM POWERCON Produces Position to line . . . . . ....+....1....+....2....+....3....+... TSTAMP UNITS 2016-02-20-01.00.00.000000 833 2016-02-20-02.00.00.000000 837 2016-02-20-03.00.00.000000 850 2016-02-20-04.00.00.000000 855 2016-02-20-06.00.00.000000 866 2016-02-20-08.00.00.000000 870 20...
by stephj
Mon Feb 29, 2016 3:25 pm
Forum: General programming discussion
Topic: Mysql query with difference
Replies: 12
Views: 3287

Re: Mysql query with difference

The Max() - Min() method makes the SQL server agent read all the records that match the select, but then throw away all but the first and last records. This could potentially be hundreds if not thousands of records. On an IBM iSeries machine you would probably do something like this in RPG: H DATFMT...

Go to advanced search