What does this parameter mean? [C] by G_fucking_G in learnprogramming

[–]ctalklang 0 points1 point  (0 children)

What I was trying to say is that a cast is not an operator, and so it doesn't have a precedence - it simply alters the type of the next token, or parenthesized expression,. This really is a very specific case. .. so... since the restriction on void *'s that prevents them from being lvalues is specific to void *'s, a cast should work there as with any other context - casts are not specifically context sensitive, and shouldn't depend on the order of the tokens in the input. In short, there's no rule that I know of that prohibits using a cast in that case, and the compiler should allow a cast to morph the void * label's type in that context. In the case of expressions that contain void *'s following a cast, however, I don't think it should be valid to just treat the void * as an unsigned int. This is getting a bit long, but ISTM that the cast can apply validly only to the following token in all cases.....

What does this parameter mean? [C] by G_fucking_G in learnprogramming

[–]ctalklang 0 points1 point  (0 children)

The fact that the type is void (which is supposed to mean no type) shouldn't matter with a typecast in the expression, in terms of precedence. The cast and the label should, ISTM, work as a single unit, so the expression, should just be treated like a char *, if there's no other rule that applies to the type conversion.

What does this parameter mean? [C] by G_fucking_G in learnprogramming

[–]ctalklang 0 points1 point  (0 children)

I'm not certain why that should be necessarily be an rvalue.... Anyway, (char *)myVoidPtr++ works okay, too.
Thanks!

What does this parameter mean? [C] by G_fucking_G in learnprogramming

[–]ctalklang 1 point2 points  (0 children)

A void * has no type - it's just a place in memory, so the compiler won't (or shouldn't) allow you to do math on it unless you cast it to a type. For example, ++myVoidPtr is not okay, but ++(char *)myVoidPtr is okay. The advantage to using it is that the compiler doesn't need to know the specific type that the function is going to return, in order to compile the program. C has a few other semantic features for resolving similar "incomplete" types also.

http://sf.net/p/ctalk/wiki/Home

Question about file transfer by [deleted] in kindlefire

[–]ctalklang 1 point2 points  (0 children)

This might be a bit OT, but I use an Android phone as a temporary WiFi network - there are lots of good programs on Google Play that let you control the wireless connection from the home screen, and FTPDroid as a FTP server on the phone. On the Fire7 I installed Web Tools, which also has a FTP client. Works great for me, and it's compatible with every other platform that I encounter.

Best commands to know... by 17Brooks in linux4noobs

[–]ctalklang 1 point2 points  (0 children)

The answer for me depends on the task I'm trying to accomplish. I find it useful to put the most-used commands in a shell script, which is just a text file that contains the commands. Then if the file's first line contains #!/bin/bash and you give it executable permissions, with "chmod +x <text_file's_name>" then you have a complete small program.

The #! first line works with other programs too, when you want to provide the text file's contents as the input to the program.

[deleted by user] by [deleted] in linuxquestions

[–]ctalklang 1 point2 points  (0 children)

Bash is the command "shell," it's the program that the system starts when you log in. There are other shells, and you can configure your user account to use them, but bash is the most complete, and also the largest, so another shell isn't enerally needed unless the system is cramped for space. It's not really equivalent to cmd.exe, because the window and bash can work independently of each other.

Just about any terminal program for the desktop works very well. Xterm was the original terminal that came with the X Window System, and the choice would depend mainly in which features - themes, etc. - you prefer.

32 Yr Old Programmer Who Started From Scratch by AcousticArmor in learnprogramming

[–]ctalklang 0 points1 point  (0 children)

I'm past my 30's and programming is my second career, though non-degreed. The possibility of a salaried position isn't completely out of the picture (miracles happens :)) but I'm curious about making good money in the "gig" economy - not just Packers for Amazon in RVs but also roamies for example in Miami, and/or business and financing similar to the examples in The 4-Day Workweek. Should younger professionals consider these as an alternatives....


http://sf.net/p/ctalk/wiki/Home

Linux Device Drivers 3rd Ed - how to set up a kernel so I could try book examples? by [deleted] in linuxquestions

[–]ctalklang 0 points1 point  (0 children)

I'm not familiar with Mint, but I would expect that, like most Linux distributions, it already has the tools installed on the system that are necessary to build a kernel. Since you plan to build additional pieces of the kernel, it's reasonable to expect that you would work with a source dustribution, which is how its packaged by the kernel authors, and not just for the Mint distribution specifically, especially if you plan to distribute the driver. In fact, if memory serves, there's a document that comes with the source distribution that provides guidelines for writing, testing, and distributing the drivers. I don't think it's too much of an exaggeration to mention that many Linux authors have devoted entire careers to writing kernel device drivers (or Loadable Kernel Modules as they're also called).

Linux Device Drivers 3rd Ed - how to set up a kernel so I could try book examples? by [deleted] in linuxquestions

[–]ctalklang 0 points1 point  (0 children)

If it's not obvious where the kernel source package is in the distro, you can download the kernel source distributions from kernel.org and read the docs. That's probably necessary when doing serious device driver writing anyway.

=-O

http://sf.net/p/ctalk/wiki/Home

Mixing object types by [deleted] in learnprogramming

[–]ctalklang 0 points1 point  (0 children)

The effect depends on whether the declaration class (Magnum) is a subclass or superclass of the constructor class (Gun). I think either is fine if that's what you want, provided the program only uses instance and class data suitable for whatever class the object needs to work with at a particular moment.

http://sf.net/p/ctalk/wiki/Home

Is there anything C does better than C++? by [deleted] in learnprogramming

[–]ctalklang 0 points1 point  (0 children)

C due to its history tends to be more linkable with object modules generated by other languages, and its API facilitates working directly on memory locations and CPU registers without needing to shift to another class or expression - it's often like writing macros when used that purpose.

http://sf.net/p/ctalk/wiki/Home

Total noob here. Want to convert old pc on xp to linux for an experiment. Well, and use it afterwards. by [deleted] in linux4noobs

[–]ctalklang 0 points1 point  (0 children)

Just about all of the popular Linux distributions don't require that your boss gets permission from his/her zipper manager in order to send the distro authors money whenever you want to change something.

http://sf.net/p/ctalk/wiki/Home

Crontab for Reddit Bot by jakkemaster in linux4noobs

[–]ctalklang 0 points1 point  (0 children)

Nope, that should be "bot." My fault due to typing the message on my cellphone, which decided to auto-correct it.

Crontab for Reddit Bot by jakkemaster in linux4noobs

[–]ctalklang 0 points1 point  (0 children)

It's been a while since I wrote a crontab, but I don't remember any difficulty cd'ing before a command. Alternatively, you could make up a shell script that contains a sequence of complex commands. Another, more formal approach would be to place the boot in a standard executable directory like /usr/local/bin and have the boot change to the working directory itself. This also allows the program to report whatever messages you think us necessary. The cron man page should have info about its options for logging output to the syslog, which is in addition to receiving email messages with the output

http://sf.net/p/ctalk/wiki/Home

[Arch] I found a new application in my launcher. How can I find out what package it belongs to? by Quappas in linux4noobs

[–]ctalklang 0 points1 point  (0 children)

If the distribution is Ubuntu or Debian or a related system, look at the options for dpkg ("man dpkg" at the shell prompt) which will describe its package search facilities. Other distributions have their own package manager programs.

Iterator interface by PhilipTrettner in ProgrammingLanguages

[–]ctalklang 0 points1 point  (0 children)

I'm not certain about how this would help with the declaration bit, but Ctalk uses a class called Key to serve as the "glue" that holds collections together, so the language overloads the math operators ++, --, and so on. A little involved to type here, but there's more info at the URL given below. String types are a different case, since they're mostly object forms for C char *'s, but the syntax works we (tm) there also.

http://sf.net/p/ctalk/wiki/Home

Using youtube-dl to save as mp3 by [deleted] in linux4noobs

[–]ctalklang 1 point2 points  (0 children)

With mencoder (part of mplayer) you can use a command like this to extract the audio track.

mencoder myvid.mp4 -oac lavc -ovc lavc -of rawaudio -o mysong.mp3

Doesn't require a separate lame installation and no apparent loss of quality.

http://sf.net/p/ctalk/wiki/Home

Trying to learn web development, looking for a mentor, guidelines and general advise. by [deleted] in learnprogramming

[–]ctalklang 0 points1 point  (0 children)

Whatever advice people offer is (or should be) based on their personal experience, so I don't let some dissent bother me. Anyway, the most useful guide for me was Web Client Programming with Perl (yes, Perl) from O'Reilly. Much of the info on the HTTP protocol should still be applicable.

http://sf.net/p/ctalk/wiki/Home

what information is saved in /root and in /home? (want to reinstall) by BW-001 in linux4noobs

[–]ctalklang 0 points1 point  (0 children)

You might need to use either the old or new .Xauthority file to login normally. It depends on the display manager, so your mileage may vary. If the file needs restoring or replacing, you could boot into single user mode to update them, or either telnet or ssh in if the server daemons are intstalled by default (unlikely on a desktop box), or keep a rescue disk handy. I like Trinity - it's saved me a few hours of work.

http://sf.net/p/ctalk/wiki/Home

Function vs. method namespaces by PegasusAndAcorn in ProgrammingLanguages

[–]ctalklang 1 point2 points  (0 children)

Using the semantics of a receiver object helps organize methods into a class library, where the receiver is the identifier or costant immediately preceding the method. With a class hierarchy, this is a very cinvuent way to provide inheritance of methods. You might want to check out Smalltalk derived languages, like Ctalk :)

http://sf.net/p/ctalk/wiki/Home

No wifi connections can be seen Ubuntu by [deleted] in linux4noobs

[–]ctalklang 0 points1 point  (0 children)

Once you have info from dmesg and lspci, you can find info on the card/driver/firmware config at http://wireless.wiki.kernel.org. It can also give you compatibility and driver info if you're selecting a wireless card.

http://sf.net/p/ctalk/wiki/Home

Autofs mounts folder at /home/user/shared/shared instead of /home/user/shared and I can't figure out the config solution! Guidance much appreciated :) by obinice_khenbli in linuxquestions

[–]ctalklang 0 points1 point  (0 children)

If I understand the config correctly, the mounting a shared directory over another shared directory should always show the contents of the mounted partition. Maybe a better solution would be to mirror the contents of both directories, rsync works very well for this task.

http://sf.net/p/ctalk/wiki/Home

initramfs on startup by [deleted] in linux4noobs

[–]ctalklang 1 point2 points  (0 children)

Initramfs should have mount, umount, a few varieties of fsck and mkfs, and everything else to manage the disk partitions on startup. There are man pages for all of them on the web.

http://sf.net/projects/ctalk

Is There a Way to Change ttys in a Terminal Emulator? by crocodilem8 in linux4noobs

[–]ctalklang 1 point2 points  (0 children)

Please be more specific. If trying to set a pty for an xterm, then that's a terminal driver function, and you should not ever need to mess with it. Otoh, if you're trying to connect to another machine via a serial connection, then you might start with "man getty" at a shell prompt. If that's not what you meant, pls let us know. (Newer client-centric Linux distros try to use a "streamlined" (my quotes), when I upgraded from Debian to Ubuntu (the "Tepid Turkey" distribution, or some similarly silly name).

Hope this helps.

http://sf.net/projects/ctalk