4,305 Posted Topics
The strange title comes from a skit by Benny Hill, where he tells his wife all the facts she shouldn't know, but she always answers "I know! I know!" Anyway, this thread is suppose to be a collection of strange facts. Let's have fun! Here are a few facts to … | |
The bubble sort is slow and I thought it would be interesting to visualize the progress as it sorts an array of integers. | |
When East Germany fell apart, one of the first things people there did was to storm the buildings that housed the much hated Stasi (Ministry for State Security), the ministry that was in charge of spying on their own population. How important is privacy to you? | |
Re: Best to use module os ... ''' file_splitext.py get a given file's extension ''' import os filename = "myfile.exe" name, extension = os.path.splitext(filename) print("name = {} extension = {}".format(name, extension)) ''' result ... name = myfile extension = .exe ''' | |
Re: Clicking Duplicate and then saving it with a different filename isn't that far off. You can also just click Export. I agree, "save as" is more intuitive! | |
Re: Advanced unpacking only works with Python3. Here is an example ... # advanced unpacking ... a, b, *rest = range(10) print(a) # 0 print(b) # 1 print(rest) # [2, 3, 4, 5, 6, 7, 8, 9] | |
Re: There is still room on the roof for stickers! | |
Here lambda is used to create a one-line function for factorials. | |
Re: I recommend ... http://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf | |
| |
Re: My Mac came with Python3 and the IDLE IDE. For scientific work I downloaded the free Anaconda3 package (Python with many modules preinstalled, the Spyder IDE and IPythonNotebook). Apple's Xcode IDE (free download) gives you easy access to C, C++, Objective-C and Swift. Another interesting graphics package called Shoes uses … | |
Re: `9x^6+2x^4+2x+5` would be ... `9*x**6 + 2*x**4 + 2*x + 5` | |
Re: Congratulations! Getting your diploma after five years and finding an interesting job, nice work! | |
| |
| |
Re: If you run a Windows box, you can use this approach ... // change text color in Windows console mode // colors are 0=black 1=blue 2=green and so on to 15=white // colorattribute = foreground + background * 16 // to get red text on yellow use 4 + 14*16 … | |
Re: Probably related to all those belching volcanoes in Chile. | |
Re: C++ has several speech recognition libraries available. | |
Re: Telling the computer what to do! Might be wishfull thinking, but it is a good exercise for your brain. An exercise that could just keep old age Alzheimer's away. | |
Re: My favorite ... Introduction to Algorithms Second Edition by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein | |
Re: Start a code library. As time goes on you will collect code snippets, hints and tricks from all over the internet. So why not use vb6 to store these cut and pasted pieces of code in a file or files. Add a search utility to search and identify these files … | |
Re: Your problem is? Oh, I see, you also added it to the snippet. | |
Re: Maybe of some help ... import datetime as dt # the two measured times in format hh:mm:ss tm1 = "3:00:58" tm2 = "3:01:26" h1, m1, s1 = tm1.split(':') h2, m2, s2 = tm2.split(':') d1 = dt.timedelta(hours=int(h1), minutes=int(m1), seconds=int(s1)) d2 = dt.timedelta(hours=int(h2), minutes=int(m2), seconds=int(s2)) # time difference delta = d2 - … | |
A little experiment with custom sorting the result of a word frequency count using Google's Go language. | |
![]() | Re: My problem with Go is that multiple Scanf() functions in a row seem to pick up an Enter key bounce (?) and skip, very annoying! Haven't found a solution yet. I think I found it, stupid Windows adds a '\n\r' when you press Enter. I am impressed with the speed … |
Just an accumulation of worldly wisdom in question answer format. Q: "How Do You Get Holy Water?" A: "You Boil The Hell Out Of It." | |
Re: "downsizing" means fire a bunch of folks, replaces "pink slipping" | |
![]() | Re: I use both OS Yosemite 10.10.3 and Windows 8.1. Yosemite starts growing on you after you learn how to spell it. |
Re: Whatever you might think, most Doctors are human and allow a very ill patient to pass away in peace. | |
Re: "New and improved", "Userfriendly", "Free" usually mean the opposite. | |
Re: This little tutorial explains data structures very well ... http://www.tutorialspoint.com/cplusplus/cpp_data_structures.htm | |
Re: Better than Linux/Unix? Probably none. Cannot find the "Batter Operating System" anywhere. Interesting name though. | |
Re: You could study Python, a "glue language" for C/C++. It is easy to learn and allows you to develop smaller projects quickly. This might keep you interested in experimenting with some of your own ideas. | |
Re: Appending to either end of a list/array is much simpler than inserting in the middle. Appending to the end of a list has the lowest overhead. | |
Re: The medical field still has lots of jobs and money and so does law and forensics. Another rewarding area to get into is cyber security. | |
Re: With Python2 input() uses eval() internally. The eval function can potentially evaluate a statement to erase your harddrive. With Python3 the former input() has been replaced with the functionallity of raw_input(). | |
Re: Scrambled eggs and mushrooms with a touch of chocolate, very interesting. My sauerkraut cookies turned out well last Christmas. However, the anchovie icecream had only one taker. | |
Re: @Akash_8, nice effort. Works well with Python27 for smaller numbers. | |
Re: You are almost there, just have to create another function. I am not sure where the pen() belongs. Maybe something like this ... import turtle def triangle(tu, size): angle = 360/3 for i in range(3): tu.forward(size) tu.left(angle) def flagline(tu, length, num): tu.pen(pencolor='blue') for i in range(num): triangle (tu, length) tu.fd(length) … | |
This 'sticky' thread is for working examples of Python GUI code. Note that most wxPython examples have their own thread. Please use comments in your code to help the reader. The example code should be usable as a template, so folks get a feel for the toolkit and can use … | |
Re: Yes, some code would be nice! | |
Re: You could download and install the free Anaconda package, it comes with most modules you need preinstalled. See ... http://docs.continuum.io/anaconda/pkg-docs.html | |
Re: Have you asked your computer science teacher for a recommended language? | |
Re: I read that some of the other languages are called **curly brace** languages. | |
The End.