Share your knowledge at the LQ Wiki.
Go Back > Blogs
User Name



Sockets - UDP RX (recieve/transmit) terminal example

Posted 01-17-2013 at 07:15 PM by rainbowsally
Updated 01-17-2013 at 07:16 PM by rainbowsally

Sockets - UDP RX (recieve/transmit) terminal example
Today's feature:
  • A UDP file server and client using linux sockets.
  • A terminal app for those who don't have libLQ-qt and mc2.

[This is for our LQ-less friends. A libLQ version using a qt gui but NOT qt sockets should be forthcoming shortly.]

This upload is pushing the size limit but it's interesting to see how the broadcast channel is set up (in inc/broadcast-rx.c) and how the parts of the files are picked up...
Posted in Uncategorized
Views 681 Comments 0 rainbowsally is offline

mini-term in qt4

Posted 01-17-2013 at 04:34 AM by rainbowsally
Updated 08-06-2014 at 08:58 AM by rainbowsally

mini-term in qt4.

Today's features:
  • A simple terminal-like application built from a qt4 class that can be used for other stuff too.
  • The present application can run shell commands and has copy/paste (ctrl-c, ctrl-v) capabilitity.
  • Another example of the Windows-like api so that C/C++ code can run in Qt4.
  • Runs the custom code (terminal in this case) inside a QT 'exec' loop... sorta. We call it 'run()'.

Posted in Uncategorized
Views 487 Comments 0 rainbowsally is offline

sed awk tr etc

Posted 01-15-2013 at 07:33 AM by NullTerminator
Updated 01-18-2013 at 07:54 AM by NullTerminator (add sed cmd for non prinitng char)

A couple sample to strip unreadable characters from a binary file
# Translate junk characters into newlines while squeezing
C:\Temp>tr -sc '[\011\012\015\040-\176]' \n < blob_of_data.txt

# Translate and discard single character lines
C:\Temp>tr -sc '[\011\012\015\040-\176]' \n < blob_of_data.txt | awk "length($0) > 1"
# replace a bad character in a file
0xa0 is a 'non breaking space' that appears often when...
LQ Newbie
Posted in Uncategorized
Views 656 Comments 0 NullTerminator is offline

Quick and dirty plotting with Haskell: Supplement

Posted 01-15-2013 at 12:54 AM by hydraMax (Bits and Pixels)

I just wanted to add a brief note to my previous post: It is also quite simple to do a plot with multiple functions. The following code gives the graph seen in the attached PNG:

h> import Graphics.Gnuplot.Simple
h> let f x = 3 - 2*x + 4*x**2
h> let g x = 8*x - 2
h> let h a x = g a * (x - a) + f a
h> plotFuncs [] (linearScale 1000 (-10,10)) [f, g, h (-5)]
f(x) is a function, g(x) is the derivative of f(x), and...
Attached Images
File Type: png plotFuncs.png (49.5 KB, 4 views)
Posted in Uncategorized
Views 515 Comments 0 hydraMax is offline

QT4 -- Having trouble with qInitResouces_<appname>() ?

Posted 01-14-2013 at 04:46 AM by rainbowsally
Updated 01-14-2013 at 05:01 AM by rainbowsally

Having trouble with qInitResouces_<appname>()?

Try this.

#define Q_INIT_RESOURCE(name) extern void qInitResources_##name()
The version of this macro in qglobal.h could never have ever worked.

If you enjoy digging into the low level stuff, I think you'll be amused by the context of this bug. ;-)

- The Computer Mad Science Team...
Posted in Uncategorized
Views 496 Comments 0 rainbowsally is offline


All times are GMT -5. The time now is 09:33 PM.

Main Menu

Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration