My long overdue venture into the realm of computer programming...

Started by Virgil0211, August 11, 2011, 11:16:31 PM

Previous topic - Next topic
Quote from: Virgil0211 on September 14, 2011, 05:19:40 PM
Is Python the one more vulnerable to buffer overruns, or is it C++?

C++.

QuoteAnd just what is 'big'? Is it a specific file size or a general range of how much of the computer's memory the program uses?

In the eye of the beholder, really.

And I don't know of anyone in the real (professional) world who memorizes formulae. They naturally remember the ones they use all the time, and look up the rest.

Quote from: MrBogosity on September 14, 2011, 06:05:27 PM
And I don't know of anyone in the real (professional) world who memorizes formulae. They naturally remember the ones they use all the time, and look up the rest.

Where were you back when my mother was teaching me Algebra 2? (Home-schooled, you know.) I could've used that little tidbit. :-P

I guess it's just been my experience that one was expected to memorize the formulas for the test. I mean, the instructor kept giving out tips on how to memorize them (write them down every time you do a practice problem and so forth). He also mentioned some familiarity with programming in Python, so he probably knows that programming a TI calculator to do stuff like that isn't that difficult. Although, that mention was when we had to correct a couple sections in the book's answer key as he made an error in the script that put off the answers by a factor of 100 and -100 for the two sections we had to correct, so maybe I'm overestimating him. It just seems a bit contradictory to encourage memorization and then leave this loophole open for those who know how to program their calculators. I remember my brother mentioning that his advanced CS teacher in high school told them that if they found a way to cheat around all of the stuff he put in place to stop them, he wouldn't count off for it as they would already know what they needed to know. Or something like that. It's a second-hand story, so don't take it at face value. :-P

My only problem with C++ is that, so far, most of the material I'm finding on it seems to approach the subject by giving you code and not quite telling you what everything does yet. I mean, with Think Python, the explanations were quite plain and easy to digest, telling you what each part was. Then again, Python's syntax is a bit simpler than C++. At least it's somewhat easier to understand now.

What language do you usually end up using when you write programs, and what's the difference between C++ and C#? Is the choice of one over the other a matter of personal preference, or are there objective advantages to using C# over C++ and vice versa?

Well, most of my stuff has been for the web, so it's been PHP and JavaScript.

Quote from: MrBogosity on September 14, 2011, 08:15:04 PM
Well, most of my stuff has been for the web, so it's been PHP and JavaScript.

I thought javascript was overrated? :-P Lol. J/k.

What are the primary differences between normal computer coding and server coding? Does the idea I proposed in the first post sound like it might need a server?

There are two contexts to that question.

The first is, does the program need client-server components? Meaning, do you need separate programs for user input and for processing. Doesn't sound like it.

The second is, does the program need to run on a separate machine that's always on? That sounds like the best course of action to me. It doesn't sound like users will interface with the program directly, you'll be going through Twitter, right? And it needs to be on all the time.

Oh, and it's Java that I think's overrated, not JavaScript. Two different things.

[Professor Farnsworth Voice]

Good news, everyone!

[/Professor Farnsworth voice]

I finally fixed the video tearing problem on my laptop. At least, fixed it to the point where I can actually watch video on it. It's minimal enough to be ignored when playing video files, though still not up to par with Windows 7 for video playing. I'll keep trying, but it looks like I may have to use Windows 7 for higher quality video. At the very least, this allows me to use Ubuntu for most things I use a computer for. I fixed it by rolling back to release 10.10, as apparently 11.04 has problems with Nvidia cards.

However, there's another problem. My wireless card now won't work. This is proving to be even more stubborn than my video card was. I've tried rfkill unblock all, making sure that network settings thingy had wireless set to true instead of false, network-config, rebooting into Windows 7 and then back into Ubuntu, even this method. Nothing. What the hell is going on?



Quote from: MrBogosity on September 21, 2011, 03:26:15 PM
Did it work under 11.04?

Yup. Perfectly. Which is why I can't figure this out. Everything I've read about changing its settings both through the GUI and the command line hasn't worked. It's almost like there's something else I can't find that deactivates it.

I found something online to try, so I did. Here's what I got.

virgil@virgil-laptop:~$ sudo ifup wlan0
[sudo] password for virgil:
Ignoring unknown interface wlan0=wlan0.
virgil@virgil-laptop:~$ sudo apt-get install ethtool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  ethtool
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 69.4kB of archives.
After this operation, 279kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main ethtool 6+20091202-1ubuntu1 [69.4kB]
Fetched 69.4kB in 1s (62.5kB/s) 
Selecting previously deselected package ethtool.
(Reading database ... 159980 files and directories currently installed.)
Unpacking ethtool (from .../ethtool_6+20091202-1ubuntu1_i386.deb) ...
Processing triggers for man-db ...
Setting up ethtool (6+20091202-1ubuntu1) ...
virgil@virgil-laptop:~$ sudo ethtool wlan0
Settings for wlan0:
No data available
virgil@virgil-laptop:~$


Here's what I got when I used the sudo lshw -C network command:

virgil@virgil-laptop:~$ sudo lshw -C network
  *-network               
       description: Ethernet interface
       product: MCP79 Ethernet
       vendor: nVidia Corporation
       physical id: a
       bus info: pci@0000:00:0a.0
       logical name: eth0
       version: b1
       serial: 40:61:86:18:94:7a
       size: 100MB/s
       capacity: 1GB/s
       width: 32 bits
       clock: 66MHz
       capabilities: pm bus_master cap_list ethernet physical mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=forcedeth driverversion=0.64 duplex=full ip=192.168.1.105 latency=0 link=yes maxlatency=20 mingnt=1 multicast=yes port=MII speed=100MB/s
       resources: irq:22 memory:fae7d000-fae7dfff ioport:c080(size=8) memory:fae7e800-fae7e8ff memory:fae7e400-fae7e40f
  *-network DISABLED
       description: Wireless interface
       product: RT3090 Wireless 802.11n 1T/1R PCIe
       vendor: RaLink
       physical id: 0
       bus info: pci@0000:06:00.0
       logical name: wlan0
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=rt3090 latency=0 multicast=yes wireless=RT2860 Wireless
       resources: irq:19 memory:febf0000-febfffff
virgil@virgil-laptop:~$


And here's what I got when I used ' lspci -nnk | grep -iA2 network'

virgil@virgil-laptop:~$  lspci -nnk | grep -iA2 network
06:00.0 Network controller [0280]: RaLink RT3090 Wireless 802.11n 1T/1R PCIe [1814:3090]
Kernel driver in use: rt3090
Kernel modules: rt2860sta, rt3090sta
virgil@virgil-laptop:~$


Here's iwconfig

virgil@virgil-laptop:~$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     RT2860 Wireless  ESSID:""  Nickname:"RT2860STA"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated   
          Bit Rate:1 Mb/s   
          RTS thr:off   Fragment thr:off
          Link Quality=10/100  Signal level:0 dBm  Noise level:-87 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

virgil@virgil-laptop:~$



And here's lsmod

virgil@virgil-laptop:~$ lsmod
Module                  Size  Used by
ath5k                 122927  0
mac80211              225459  1 ath5k
ath                     8041  1 ath5k
cfg80211              144266  3 ath5k,mac80211,ath
led_class               2864  1 ath5k
binfmt_misc             6587  1
ppdev                   5259  0
snd_hda_codec_nvhdmi     3840  1
snd_hda_codec_realtek   203408  1
snd_hda_intel          22069  2
snd_hda_codec          74201  3 snd_hda_codec_nvhdmi,snd_hda_codec_realtek,snd_hda_intel
snd_hwdep               5412  1 snd_hda_codec
snd_pcm_oss            35308  0
snd_mixer_oss          13746  1 snd_pcm_oss
snd_pcm                70694  3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
snd_seq_dummy           1338  0
snd_seq_oss            26722  0
fbcon                  35102  71
snd_seq_midi            4557  0
tileblit                1999  1 fbcon
snd_rawmidi            19056  1 snd_seq_midi
font                    7557  1 fbcon
snd_seq_midi_event      6003  2 snd_seq_oss,snd_seq_midi
bitblit                 4707  1 fbcon
snd_seq                47263  6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
rt2860sta             498817  0
crc_ccitt               1339  1 rt2860sta
snd_timer              19098  2 snd_pcm,snd_seq
softcursor              1189  1 bitblit
nvidia               9961216  46
snd_seq_device          5700  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
rt3090sta             674216  0
video                  17375  0
uvcvideo               57406  0
snd                    54244  16 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
vga16fb                11385  1
videodev               34425  1 uvcvideo
soundcore               6620  1 snd
output                  1871  1 video
vgastate                8961  1 vga16fb
snd_page_alloc          7076  2 snd_hda_intel,snd_pcm
i2c_nforce2             5199  0
agpgart                31724  1 nvidia
psmouse                63677  0
shpchp                 28835  0
serio_raw               3978  0
v4l1_compat            13251  2 uvcvideo,videodev
lp                      7028  0
parport                32635  2 ppdev,lp
ahci                   32360  2
forcedeth              49556  0
virgil@virgil-laptop:~$


I already checked that wireless settings file to enable wireless networking, but it still says disabled under that lshw -C network thingy. Also, sudo rfkill list doesn't return anything. Just goes to the next line. Is that normal?

Anything you can tell me?

You'll have to look it up, but there's a way to add in the Natty repositories to an earlier version. Basically what you would do is upgrade your wireless drivers--the catch would be that it would upgrade dependencies, too. But hopefully you'd have the upgraded wireless drivers and keep the video drivers (unless it was putsched by something like a kernel upgrade).

Quote from: MrBogosity on September 21, 2011, 04:18:15 PM
You'll have to look it up, but there's a way to add in the Natty repositories to an earlier version. Basically what you would do is upgrade your wireless drivers--the catch would be that it would upgrade dependencies, too. But hopefully you'd have the upgraded wireless drivers and keep the video drivers (unless it was putsched by something like a kernel upgrade).

Okay, I'll take a look. Do you have any idea what's going on?

Probably the new wireless driver fixed the wireless but the new video driver broke the video. The idea would be to try to use the Maverick video driver with the Natty wireless driver.

Quote from: MrBogosity on September 21, 2011, 04:43:11 PM
Probably the new wireless driver fixed the wireless but the new video driver broke the video. The idea would be to try to use the Maverick video driver with the Natty wireless driver.

I guess I did something wrong. I added what I thought were the right repositories, then ran the

sudo apt-get update

and

sudo apt-get upgrade

commands. Once I rebooted, I couldn't get it to boot up even in failsafe mode. One reinstall later, wireless is still broken.

That isn't what I meant. You need to do the update, yes, but instead of running the entire upgrade go into Synaptic and JUST install the upgraded wireless drivers.