445 Topics
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 … | |
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 … | |
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 … | |
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. | |
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. | |
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. | |
This is Delphi code, just testing if there is some interest. | |
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 … | |
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! | |
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 … | |
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 … | |
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. | |
Get simple information like serial number, bytes/sector, sectors/cluster, free and total disk space of your hard drive using Windows API calls. | |
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. | |
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. | |
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++ … | |
Use a Windows API call to add some color to your text output. A rewrite of an earlier C++ snippet for the C crowd. | |
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 … | |
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 … | |
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 … | |
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! | |
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 … | |
I keep hearing that Python is about as slow as Java. Does anybody have experience with speeding things up? | |
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 … | |
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. | |
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 … | |
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 … | |
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 ... | |
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 … | |
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 … | |
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! ![]() | |
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! | |
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 … | |
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. | |
Does anybody know the limit of nested for loops in C or C++? If there is a limit, what is the reason? | |
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. | |
[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 … | |
[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 … | |
[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: … | |
Does anybody know the weight of a grain of rice? I am into Ethiopian cooking. | |
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 … | |
Are there any good and free Pascal compilers out there? | |
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 … | |
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! | |
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 … |
The End.