This forum is in archive mode. You will not be able to post new content.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Xires

Pages: [1] 2 3 ... 19
1
C - C++ / Re: Interface Programming using C's gtk libraries
« on: February 25, 2016, 10:07:32 PM »
Structs and classes are very different things.  A structure is just a contiguous spot in memory allocated such that different sections can be accessed as different variables.  I can provide some examples if you need them.

As for GTK+..make sure that you have pkg-config installed(it should be, but it might not be).  Once you're certain it's installed(which can be tested via "pkg-config --version") then you'll want to make sure that it can provide you with the cflags(compilation flags) and libs needed for compiling & linking your project(using "pkg-config --cflags --libs gtk+-3.0"; note there are no backquotes).  Next you'll throw together a simple test program.  Note that the test program need not be an elaborate example(which the documentation-provided 'hello world' is, IMHO), but rather just need something that will compile & link properly with the selected package.

Code: (bash) [Select]
xires@Synthesium:~/proj/code/c$ pkg-config --version
0.26
xires@Synthesium:~/proj/code/c$ pkg-config --cflags --libs gtk+-3.0
-pthread -I/usr/local/include/libpng16 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cair
o -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/i
nclude/libpng12  -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 
xires@Synthesium:~/proj/code/c$ cat gtktst.c
Code: (c) [Select]
#include <gtk/gtk.h>

int main(int argc, char **argv) {
    gtk_init(&argc, &argv);

    return 0;
}
Code: (bash) [Select]
xires@Synthesium:~/proj/code/c$ gcc -Wall -Wextra -W -ansi -pedantic -o gtktst{,.c} `pkg-config --cflags --libs gtk+-3.0`
xires@Synthesium:~/proj/code/c$ ldd gtktst | grep gtk
        libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f8a1e107000)
xires@Synthesium:~/proj/code/c$

If you've made it to this point successfully, then you can start working on more elaborate examples and stepping through the documentation.

Personal notes:
Honestly, I've worked with GTK quite a bit in the past and I have to warn you, it's a bit of a horrific mess.  You can certainly get through it but be sure you understand the language properly.  If GTK starts bringing in questions about how C works due to a specific feature or something then it's time to step back and make sure you really know C.

I love C, but I personally feel that GUI development is a better task for C++.  C++ provides the necessary features to help facilitate not just OOP, but also proper event-driven design.  There are also more(and some might say 'better') frameworks available with C++.  GTK is still an option(with gtkmm) but you also get Qt(a FAR better framework to learn, especially if you're just starting out), wxWindows(which is also great, by comparison), and FLTK(which I like, but research it first).  Of the C++-available options, I'd suggest learning Qt first as it has a large following and you'll find it more useful professionally(as in, it's worth putting on your CV).

With GTK often comes Glib, which is its own mess.  It's useful in some ways and provides common data structures, but it lacks...grace.  The documentation for both GTK & Glib is also lacking, in my opinion.  Of course, GTK & Glib are both worth learning, eventually, but be aware that it takes some tenacity to get through.

2
C - C++ / Re: Interface Programming using C's gtk libraries
« on: February 19, 2016, 11:36:15 PM »
Don't install GTK from source on Ubuntu.  Use the already-provided packages.  There are development packages available, find them.  Having gtk libraries installed for use is different from having them installed for development.  You should probably be looking for 'libgtk-3-dev', I believe, but I don't run Ubuntu 15.10 so I can't be positive.

3
Hardware / Re: What kind of tools do you guys use?
« on: November 05, 2015, 12:50:42 PM »
Mind powers and minions are my tools.

4
C - C++ / Re: What to use?
« on: November 04, 2015, 02:48:14 AM »
@rogue.hackz & ArkPhase - I've been programming for 20 years, I started on the C88, with vi, on a console based bare bones 0.3 Red Hat. I was taught embedded systems design by a 30+ year senior embedded programmer for NASA. I see absolutely no point in using any of the flashy bullshit most n00bs use these days. The truth is, N00Bs have to use those plugins, and all those "extras", cause they are too busy being too new, to keep track of simple bullshit... If you are incapable of keeping track of your program's execution without needing "documentation", you're a n00b, if you can not deduce your mistakes without needing some "auto error finder", you're a n00b. More importantly, if you can not code in a manner, that is self-secured, and hard to exploit; you are a n00b. Period. So, in other words, you are kids... I am a kid.

Let's get the credentials out of the way, since they appear important.

I've been coding for roughly 27 years.  I'm a 'qualified expert'(meaning my aptitude has been tested and verified) in multiple languages and have taught/tutored several, especially C & C++.  I've done quite of a bit of embedded development on multiple platforms and have implemented code for systems run by NASA JPL as well as the United States Navy.  I have created custom hardware and written drivers for numerous devices.  I have assisted in the development of operating systems, kernels, bootloaders, system libraries, service daemons, and more.  I have been asked to edit more than one doctoral thesis and assisted with writing the firmware for an MIT robotics project.  I have even told genuinely humorous assembly jokes after half a bottle of jager in the middle of the woods with no computer nearby for miles.

Now for the shock & awe: I use so-called 'n00b' features.

I don't personally need it, but I do tend to make use of it when available and properly implemented.  Being well-versed or even highly proficient in a language and using features such as auto-completion, object browsers, class maps, flow monitors, etc. are not mutually exclusive.  I'll admit that I sometimes find myself fighting with auto-completion specifically when I find it to be less than adequately implemented but that does not mean that I do not find use for such features.  Typically, the speed at which usable, functional, efficient, and secure code can be written is improved when using such features.  This is true for 'n00bs' as well as for more experienced developers.

I also document my code.  I do this for multiple reasons, not the least of which is so that others can more easily understand my methods and reasoning.  I also use documentation to indicate the expected state of values at certain points in the code, to remind myself of interfaces, to denote future plans and intentions, and even to supplement the features provided by things like auto-completion.

I also attest to the capabilities of ArkPhaze.  ArkPhaze is one of the few people here from whom I accept critical criticism.  I respect ArkPhaze as a developer and hacker.  You should too.

More importantly; you should consider not just the words you speak(type) but also the wisdom(or lack thereof) behind the message that they provide.  One would expect someone of your supposed experience and proficiency to be more aware.

5
C - C++ / Re: What to use?
« on: October 19, 2015, 01:31:07 AM »
Dude how do you get shit done with nano on Linux? Lol.

I mean I use vim with tons of plugins to get clang complete (autocompletion), and other IDE like features (auto compile and dynamic error detection) working.

Can't imagine doing the same with nano, does it have plugins for c++?

Not everyone really needs/wants autocompletion.

6
Actually, Mytosus's approach is valid, except that the "array to store the chars" should store pointers to char instead.  Given the base of an array, the index stored in the first array acts as an offset.  The first string will be at offset 0, the next at  *(baseAddressOfArray + arrayOfIndices[1]), then *(baseAddressOfArray + arrayOfIndices[2]), and so on.  The char* array can store pointers to these locations directly, effectively producing an array of C-style strings.

7
General discussion / Re: Easiest programming/scripting language
« on: September 19, 2015, 04:40:28 PM »
@Josiah23; how's it coming?  Still dedicated?  Anything causing serious roadblocks?

8
General discussion / Re: secure messaging service
« on: September 06, 2015, 08:25:14 AM »
Can you be more specific about the message type?  Are you looking for an active connection between two clients or the ability to send a message to be read later(like via e-mail)?

PKI tends to work very well so I would strongly suggest looking into that.  If you're wanting to build the service yourself, there is plenty of documentation available.  If you're looking for an existing service, you may be able to locate one that uses PKI already.  You may also consider looking into I2P.

9
General discussion / Re: Easiest programming/scripting language
« on: September 02, 2015, 02:26:13 PM »
'Cookies' are one of the ways that we keep track of how useful someone's posts have been to the community.  Someone with a positive cookie count is seen as being useful/helpful; their advice is generally given more merit and their opinions are generally better respected because, overall, they have been a positive influence in the community.  Someone with a negative cookie count is considered to have less value to the community; their opinions are not considered to matter, much, and their advice is usually ignored because it is often completely useless.

For now, you can probably just ignore the cookies thing.  Just concentrate on learning.

How's that coming, by the way?  You haven't given up yet, have you?

10
Hardware / Re: What mobo is this?
« on: August 28, 2015, 08:16:41 PM »
You're welcome.

11
Hardware / Re: What mobo is this?
« on: August 28, 2015, 08:11:09 PM »

12
+3 cookies for the amazingly important & useful information, thank you.

This is very unfortunate.  I would be interested in a list of all the companies that have been the cause for this drastic, but entirely necessary, action.  Those companies, and their actions, should be brought out into the spotlight for all to see.  What's more, I wouldn't be sad if their efforts were proven to be inadequate through a number of attacks that proved why grsec's standards are important.

I remember the call for copyright lawyers going out some time ago and checked with the lawyers that I knew at the time.  Unfortunately, they specialized in musical copyrights and despite my attempts to explain that software copyrights also fall under the realm 'artistic rights to license', they were unwilling to handle such a case.  Perhaps they knew what kind of assholes they'd be dealing with.

Although some of us will remain unaffected, for the most part, due to the fact that we port our own patches from testing or write our own patches from scratch, I expect this may have some far-reaching impacts that aren't easily predicted at this time.  I would not doubt that another project that claims to do similar work would pop up in the next couple of years.  I could see such a thing being started specifically to gain the interest of a number of people in the FOSS community and get new patches submitted by new people, effectively abusing a different subgroup for free work.  However, I also expect to see quite a few new 0days circulate in the next year or so.  Perhaps the latter will prompt the former; we shall see.

Update: it looks like VeriFone, producers a very popular credit/debit card processing system, are involved.

13
Hardware / Re: What mobo is this?
« on: August 28, 2015, 06:34:38 PM »
Images aren't very clear.  Try taking pictures of the sections that appear to have any identifying information(like where stickers exist).  Also look on the back of the board.  The model number of the PackardBell system you pulled it from might be helpful, if it was the original board it came with.  I'm guessing this may have come out of one of the old PackardBell 'Legend' series, but I'd need you to confirm that.  Information on the board can potentially be narrowed down, but due to the system age you're probably going to have to go through historical information on the PackardBell model information rather than information directly on the board.

14
General discussion / Re: Easiest programming/scripting language
« on: August 26, 2015, 05:15:40 AM »
+1 cookie for determination.  Keep it up.  You can never learn too much(unless it's that your parents have a cam site).

15
General discussion / Re: Easiest programming/scripting language
« on: August 25, 2015, 05:08:31 AM »
Some very good pros and cons there and quite the list of known languages you have. Almost got the "brainfuck" one by me... nearly missed it. Really though I enjoyed reading these. Thank you.





Are you implying that brainfuck is not a real language?

Pages: [1] 2 3 ... 19


Want to be here? Contact Ande, Factionwars or Kulverstukas on the forum or at IRC.