445 Topics

Member Avatar for vegaseat

Sooner or later a Csharp snippet had to appear. This one builds a form containing a set of buttons. A bitmap drawing area is used to draw a series of circles with random color, radius and center location. Your creation can be saved as a jpeg image file. You can …

Member Avatar for borjelewin
0
3K
Member Avatar for vegaseat

Short little sound files of chicken, horses, dogs, cars, trains and other annoying things is the realm of the wave file (.wav). These are easy to play and guaranteed to confuse grandpapa. Again, we are using Windows' sound workhorse winmm.lib file. Ze function this time is PlaySound(). Here is ze …

Member Avatar for danibootstrap
1
225
Member Avatar for vegaseat

Many of you know how I like to use sound to make the old computer box more interesting. The midi file packs a lot of neat instrumental music. It is very simple to play, even in a console application, using the winmm.lib file that comes with just about any Windows …

Member Avatar for evilsilver
0
242
Member Avatar for vegaseat

You can have fun and learn something too. Not too much fun though! Here we take a lighthearted look at C++ string, various ways to assign a string and substring, spell forward and reverse, find characters and substrings, append, insert, replace, remove characters, separate a sentence into words and more.

2
199
Member Avatar for vegaseat

This Delphi procedure sends the text contained in a multiline editbox (memo in Delphi lingo) to a printer. The font and font size can be specified.

0
247
Member Avatar for vegaseat

Just to give you an idea what Delphi can do, here is a plot of the ever popular sin(x). I have put enough information into the code comments so you can build the form. The PaintBox Paint Event takes care of the plotting.

0
972
Member Avatar for vegaseat
Member Avatar for vegaseat

The Standard Template Library (STL) vector is tempting. The burden of dimensioning an array is removed, and there are many wonderful functions to explore. The learning curve is a little steep, it will make your head swell, but in the end it's all worthwhile. Take a look at some of …

Member Avatar for vegaseat
1
178
Member Avatar for vegaseat

Let's expand the decimal to binary converter to include, amongst others, octal and hexadecimal conversions. Also shows how to exert some input control. Simple stuff!

1
185
Member Avatar for vegaseat

Let's say you worked in the White House and had to keep two lists, one for the friends and one for the enemies. The boss came to you and said: "The Almighty talked to me out of a burning bush last night, telling me that I shall make my enemies …

2
191
Member Avatar for vegaseat

Another experiment with the Standard Template Library (STL). This time we are taking a look at map. Map is a Sorted Pair Associative Container (a mouthful). The pair is -- const Key, Data --, where Key has to be unique. It is Key that is sorted. In this code sample …

1
169
Member Avatar for vegaseat

Using the C++ Standard Template Libraries (STL) can be easy, once you know how to do it. No need to putz around with doubly linked lists anymore! Here is code showing how a STL list allows you to add, insert, remove, sort, splice, merge, display, and clean-out-duplicate strings.

2
164
Member Avatar for vegaseat

Get simple information like serial number, bytes/sector, sectors/cluster, free and total disk space of your hard drive using Windows API calls.

Member Avatar for sytheron
2
155
Member Avatar for vegaseat

What is so easy to do in HTML gets quite involved in C. Once you learn to look past the standard GUI overhead it becomes more obvious. This example shows the effect of the mouse cursor moving across a label by changing foreground and background colors.

0
216
Member Avatar for vegaseat

This program shows how to display a JPEG (also GIF,BMP,WMF etc.) image using some Windows Graphical User Interface C code. The program uses the uuid.lib file that comes with many C compilers.

Member Avatar for ashutosh_singh
2
1K
Member Avatar for vegaseat

This snippet shows how to draw a red circle on a Windows form. Original code via BCX, modified to compile with Dev C++. The GUI code looks a little complex. Gets simpler, once you get past the required overhead. For those who need some hand holding with the Dev C++ …

0
2K
Member Avatar for vegaseat

Use a Windows API call to add some color to your text output. A rewrite of an earlier C++ snippet for the C crowd.

2
566
Member Avatar for vegaseat

The continued fraction expansion gives us the answer to life's most persistent questions, like what is sin(x) or even tanh(x). This surprisingly short code allows you to estimate SIN, COS, TAN, EXP, SINH, COSH and TANH fairly accurately. Careful, this code is not for the usual TV crowd! You should …

Member Avatar for bumsfeld
2
193
Member Avatar for vegaseat

I just read that the Microsoft Windows 7 OS may appear on PCs by October 22 this year. That is seemingly good news for those of us who are sitting on aging XP desktop PCs in the hope of skipping the dreadful Vista OS. The hope is also for the …

Member Avatar for kaninelupus
0
637
Member Avatar for vegaseat

I recently bought the book "Beginning Python" Norton, Samuel, Aitel et al published by Wrox/Wiley in 2005. Has anybody else bought this book and actually found the source code at the website they list in the book? I don't want to sound vinegarish, but this has got to be the …

Member Avatar for vegaseat
0
217
Member Avatar for vegaseat

Apparently the big collider will not be back in operation until late this year, but Hollywood has been busy making a film about it. A conspiracy film staring Tom Hanks to steal antimatter from CERN and to use it blow up the Holy City in Rome. [url]http://news.yahoo.com/s/nm/20090212/sc_nm/us_science_antimatter_3[/url] Holy Antimatter!

Member Avatar for sneekula
0
148
Member Avatar for vegaseat

This post by [B]s7plc[/B] was moved from the Starting wxPython (GUI code) thread ... [QUOTE]I've been working with various widgets from the wxPython demo library, and am making pretty good progress. But I just ran into a problem that I am sure has a simple answer, but I just can't …

0
84
Member Avatar for vegaseat

I keep hearing that Python is about as slow as Java. Does anybody have experience with speeding things up?

Member Avatar for Gribouillis
0
491
Member Avatar for vegaseat

This was a comment from ee_programmer in reference to one of the Python code snippets. [code=python]""" I was expecting the first class instance to only have one dictionary entry {'person0': 0} rather than two dictionary entries. Similar expectation with second class instance. How do I create and assign value to …

Member Avatar for a1eio
0
212
Member Avatar for vegaseat

I am keeping these to 100 pixel height thumbs so the JPEGs range between 5 and 15k (trying to safe Dani some disk space). You give me an educated guess what plane it is. I will (or you should) acknowledge the first correct guess.

Member Avatar for jwenting
1
1K
Member Avatar for vegaseat

Things are getting quiet around the shop, seems like all the coding is done in foreign lands. Any way, let's get a thread started, a multilingual coding spree showing how to display "Hello World! (computer language used)". The code has to be a full program! Make sure you have the …

Member Avatar for sgssergio
0
1K
Member Avatar for vegaseat

Did you know C# has its own scripting language based on Lisp, here is an example ... [code];;; Scripting a 'C#'' GUI with Lsharp, free from [URL="http://www.lsharp.org"]www.lsharp.org[/URL] (reference "System.Windows.Forms") (reference "System.Drawing") (using "System.Drawing") (using "System.Windows.Forms") ;; Create a form (= form (new System.Windows.Forms.Form)) (set_text form "Hello from Lsharp") ;; Create …

0
69
Member Avatar for vegaseat

I have read complaints about the limited types of files that can be attached to threads. This is a test to attached newer and better compression files past the silly .zip file extension limits. Note, remove the final .zip from this file ...

Member Avatar for KevinADC
0
55
Member Avatar for vegaseat

sharky_machine Offline Posting Whiz in Training Join Date: Oct 2006 Location: New York City Posts: 253 Rep Power: Re: Starting Python Today, 1:41 pm | Add to sharky_machine's Reputation | Add Infraction | Flag Bad Post | IP | #86 -------------------------------------------------------------------------------- Vegaseat: I have been reviewing this code you had …

Member Avatar for mattyd
0
306
Member Avatar for vegaseat

I am trying to post a Python code snippet and get this: [QUOTE]vegaseat, you do not have permission to access this page. This could be due to one of several reasons: Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's …

Member Avatar for Dani
0
201
Member Avatar for vegaseat

The code portion of one of my snippets does not always show. [url]http://www.daniweb.com/code/snippet451.html[/url] It's there when I check with edit. I resubmit and it's there for the moment only. Need help!

Member Avatar for iamthwee
0
123
Member Avatar for vegaseat

In case you are curious, I just posted a new tutorial "Python and Multimedia, Part 1, The amazing Webbrowser Module" on DaniWeb at: [url]http://www.daniweb.com/tutorials/tutorial47392.html[/url] I would love some input from our Linux and Unix friends to see how much cross platform the module is. Post any comments in this thread!

Member Avatar for vegaseat
0
201
Member Avatar for vegaseat

The DaniWeb community is pretty worldly, so I though it would be interesting to post the price of beer in your local pub. Be somewhat informative: Here in the state of Nevada I like to go to Barley's Casino and Brewing Company. A pitcher (60 ounces) of Red Rock lager …

Member Avatar for GriffIT34
0
420
Member Avatar for vegaseat

Dani, I just put up a tutorial about "Python and Multimedia" [url]http://www.daniweb.com/tutorials/tutorial47392.html[/url] I need to add just a small paragraph at the end, explaining how to play movies. Multimedia is a little incomplete without that. I don't seem to have editing privileges.

Member Avatar for vegaseat
0
105
Member Avatar for vegaseat

Does anybody know the limit of nested for loops in C or C++? If there is a limit, what is the reason?

Member Avatar for Narue
0
212
Member Avatar for vegaseat

I parked a little code snippet called "A Taste of Boo" at: [url]http://www.daniweb.com/code/snippet429.html[/url] It's under Python so the code field would show the indentations properly.

0
90
Member Avatar for vegaseat

[B]Intro[/B] In part 1 we learned mostly about the header of the JPEG file. In this part we get to display the image and also extract and show any embedded comments. [B]wxPython[/B] To display the image we use wxPython. The raw JPEG image information is first pushed into a data …

0
120
Member Avatar for vegaseat

[B]Python and the JPEG Image File, Part 1, The Header[/B] [B]Intro[/B] The JPEG image file format (.jpg) is very popular on the internet because you can pack a lot of picture information into a relatively small file. There are competing file formats like GIF and PNG. GIF is rather limited …

0
680
Member Avatar for vegaseat

[B]Intro[/B] When you declare an integer variable in C, the variable is assigned a fixed memory location with enough space to hold the type integer. When you then initialize the variable with a value, the value is put into that space. Take a look at the C code sample below: …

0
6K
Member Avatar for vegaseat

Does anybody know the weight of a grain of rice? I am into Ethiopian cooking.

Member Avatar for YoungCoder
0
682
Member Avatar for vegaseat

Just want to get ideas on which modern language could replace good old Basic, so the learning curve isn't too galling. I am partial to Python. The reasons: 1. It is an interpreted language, but can be compiled. 2. It has a very efficient memory manager built-in. 3. Lots of …

Member Avatar for Puckdropper
0
154
Member Avatar for vegaseat
Member Avatar for DeFrog777
0
264
Member Avatar for vegaseat

I am not shamelessly promoting this book, I just happen to like it and use it a lot! "Standard C++ Bible" by Stevens and Walnum, published by Hungry Minds. This 800 page plus book is loaded with samples and comes with a CD-ROM containing all the samples and a nifty …

Member Avatar for wbk
0
177
Member Avatar for vegaseat

Why are the standard header files in C++ so non-standard? Particularly iostream seems to be the most dialectal. Enough to make the whole language a mess to work with!

Member Avatar for vegaseat
0
146
Member Avatar for vegaseat

I found this neat little GUI calculator program on the net. It uses a function called _gcvt(double val,int limit,string cBuf), which seems to be used to convert a double val to a string cBuf, with some formatting and limiting. I replaced it with sprintf(), but the output looks rather crude …

Member Avatar for vegaseat
0
301

The End.