132,723 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for ashishkumar008

[B]1.[/B] Right click on your project name in solution explorer. [B]2.[/B] Point the cursor on [COLOR="Green"]Add[/COLOR] then choose [COLOR="Green"]Existing Item...[/COLOR] [B]3.[/B] Now go to the Location of your sound file and select that sound file. [B]4.[/B] Now select your sound file in solution explorer then Right click on it choose …

Software Development asp.net c# file-system
Member Avatar for JOSheaIV
3
5K
Member Avatar for Reverend Jim

[This post](http://joelgrus.com/2013/12/24/why-programming-language-x-is-unambiguously-better-than-programming-language-y/) by Joel Grus is both insightful and highly entertaining. Make sure to read the comments which are also witty and amusing.

Software Development
Member Avatar for mike_2000_17
3
306
Member Avatar for vegaseat

Shows you how to get a Python object's memory size. Notice that there can be a difference between Python versions.

Software Development motherboards-cpu-ram python
Member Avatar for Tcll
3
527
Member Avatar for ShawnCplus

This is just a little something for those of you used to using the Eclipse IDE, it's syntax highlighting almost identical to Eclipse save a bit of enhancement. Eclipse doesn't highlight ints, octal and hex individually but DevC++ can, there are a few other things in there that promote very …

Software Development c++ ide
Member Avatar for Tech_1
3
406
Member Avatar for Gribouillis

This snippet prints a python list of strings in multicolumn format (similarly to linux `ls` command). It uses module prettytable, available in [pypi](https://pypi.python.org/pypi/PrettyTable).

Software Development python
Member Avatar for Gribouillis
3
2K
Member Avatar for ddanbe

A modal dialog is a window that you must respond to. The MessageBox for example is such a window. It is a handy tool for displaying a warning or other kind of message to the user. But, you can configure it only in a limited way. Xcelled194 did a good …

Software Development html-css
Member Avatar for ddanbe
3
973
Member Avatar for Neon Tetras

Hi guys. I decided to post this simple Photo viewer application. Its strictly for beginners, and cab be improved. /** * * @author Neon Tetras */ import java.awt.Image; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import javax.swing.ImageIcon; public class ImageViewer extends javax.swing.JFrame { /** * Class constructor: ImageViewer */ public ImageViewer() …

Software Development image java java-swing oracle
Member Avatar for stultuske
3
5K
Member Avatar for vegaseat

This example calculates timed x, y points of a projectile motion that can be used for plotting or other calculations.

Software Development python
Member Avatar for ddanbe
3
6K
Member Avatar for vegaseat

A Python sort with a helper function to allow for mixed order sort like age descending and weight ascending.

Software Development python
3
495
Member Avatar for vegaseat

Just another loan calculation, this time using a handy function in Python module numpy.

Software Development python
Member Avatar for HiHe
3
4K
Member Avatar for Gribouillis

The syntax of the [icode]str.format()[/icode] method described in [url=http://docs.python.org/library/string.html#formatstrings]the python 2.6 documentation[/url] looks both powerful and complex. The idea of this thread is to start a collection of nice formatting examples which will ease the task of mastering this function. Please post useful examples, and document them :)

Software Development python
Member Avatar for Gribouillis
3
3K
Member Avatar for happygeek

Java vulnerabilities have hardly been out of the news during the last year. Here at DaniWeb we've covered a number of the stories as they surfaced: [Java in the cross-hairs: the security debate rolls on](http://www.daniweb.com/software-development/java/news/445532/java-in-the-cross-hairs-the-security-debate-rolls-on), [Is Java 7 still insecure? Oracle Patch doesn't fix underlying vulnerability](http://www.daniweb.com/software-development/java/threads/432479/is-java-7-still-insecure-oracle-patch-doesnt-fix-underlying-vulnerability), [Update my insecure Java …

Software Development cybersecurity java oracle
Member Avatar for masijade
3
370
Member Avatar for vegaseat

So you want to find out which day of the week you were born. Well at least some of us do. I actually wrote this program because my whole family was born on Sundays, and my friends didn't believe it! An oldie but goodie, moved from DeSmet C to Turbo …

Software Development python
Member Avatar for 1baga
3
2K
Member Avatar for DavidB

Here is a small--complete--program that includes a sub-routine that inputs two matrices and then multiplies them. Notes: * 1) I happen to like taking input from a text file. It eliminates the need to type input from the console, especially when debugging, it prevents the possibility of making typos. * …

Software Development c++ mathematics matrix-multiplication
Member Avatar for Shellback3
3
2K
Member Avatar for DavidKroukamp

I have recently been interested in Java Swing and Game development, so naturally I began creating many different 2D games. During them I found myself having to rewrite much code, but eventually I decided to write some classes that would help me whenever I wanted to make a game. Here …

Software Development gaming gui java java-swing
Member Avatar for JamesCherrill
3
2K
Member Avatar for vegaseat

The wxPython Phoenix project can be used with Python version 2 and version 3. The project applies pretty much the familiar wxPython code. Here we are testing a dragable borderless frame.

Software Development python
Member Avatar for vegaseat
3
1K
Member Avatar for Evenbit

It is about time we start building a Sticky in this forum listing some resources so the newbies will have an easier time finding the information they need. I will start with these valuable links: x86 Assembly Language FAQs Wikipedia: Assembly Language Wikipedia: List of assemblers Links at Webster MASM …

Software Development assembly
Member Avatar for pbj.codez
3
2K
Member Avatar for vegaseat

You can draw a number of shapes directly on the PyGame window, and then save the drawing to an image file.

Software Development image python
3
5K
Member Avatar for vegaseat

A somewhat newer look at Peter Parente's pywin32 based speech engine. It will read text on your computer.

Software Development python
Member Avatar for ZZucker
3
307
Member Avatar for vegaseat

A simple test of PySide's QFileDialog widget and its method getOpenFileNames. Use method getOpenFileName if you want just one file name.

Software Development python
3
3K
Member Avatar for vegaseat

Simple code to show you how to display an image from a Web URL using the Tkinter Python GUI toolkit, the Python Image Library (PIL) and the data_stream created with io.BytesIO().

Software Development image python tkinter
Member Avatar for vegaseat
3
4K
Member Avatar for deceptikon

I was going to post this in a thread, but it turned into something a bit more serious and may be useful as a code snippet. The code shows three files: * menu.h: The header file for the menu library. * menu.c: Implementation of the menu library functions. * main.c: …

Software Development c c++
Member Avatar for deceptikon
3
592
Member Avatar for happygeek

FireEye security researchers are warning that they have [detected a new zero-day vulnerability](http://blog.fireeye.com/research/2013/02/yaj0-yet-another-java-zero-day-2.html) that is being used successfully in the wild against browser clients with both Java 6u41 and Java 7u15 installed. Given that the Java 7 update was only released a couple of weeks ago, this is yet more …

Software Development cybersecurity data-structure java oracle
Member Avatar for jwenting
3
1K
Member Avatar for happygeek

Last week saw the discovery of YAJE: Yet Another Java Exploit. Sadly, Java vulnerabilities are neither new nor uncommon and the bad guys are quick to exploit them in the wild. Some claim that Oracle is in too much of a rush to extricate itself from this unholy mess and …

Software Development cybersecurity java oracle
Member Avatar for gyno
3
563
Member Avatar for vegaseat

So you want to find out which day of the week you were born. Well at least some of us do. I actually wrote this program because my whole family was born on Sundays, and my friends didn't believe it! An oldie but goodie, moved from DeSmet C to Turbo …

Software Development c
Member Avatar for jnawrocki
3
1K
Member Avatar for Reverend Jim

If you have any particular topics that you'd like to see a code snippet for then please post your requests here. In order to avoid duplication of effort, if you feel inclined to respond to a request then please post here indicating that you will create the requested code snippet …

Software Development vb.net
3
114
Member Avatar for vegaseat

This snippet allows you to find the number of ordered permutations of items taken from a population of known size. It uses the well know algorithm with factorials. For very large populations you may want to use an approximation of factorials.

Software Development algorithm python
3
3K
Member Avatar for vegaseat

If you want to know the number of combinations of x things taken n at a time, you can use the Python module gmpy. The module gmpy is a C-coded Python extension module that supports fast multiple-precision arithmetic, very handy if x things reach a large number.

Software Development python
3
476
Member Avatar for deceptikon

As the title says, it's a simple trie class written in C++11. The only operations implemented are insert, remove, and search (both prefix and exact matches). I sort of abandoned the test/debug process, and while I'm somewhat confident that there aren't any serious bugs, I can't guarantee it. Use this …

Software Development c++
Member Avatar for deceptikon
3
406
Member Avatar for vegaseat

Just a different way to extract desired data from an xml code string.

Software Development python xml
Member Avatar for HiHe
3
642
Member Avatar for HiHe

Explore the Python module bisect to search a sorted list and insert elements in the proper location in a sorted list.

Software Development python seo
Member Avatar for TrustyTony
3
636
Member Avatar for vegaseat

A short code to show you how you can download and display an image from the internet on Python's Tkinter GUI toolkit.

Software Development image python tkinter
3
330
Member Avatar for vegaseat

Just a simple Jython code to test drawing on the canvas.

Software Development java python
3
601
Member Avatar for A Haunted Army

hey, just looking for a bit of advice on code readability, i've figured out a new and i hope better way to handle collisions but the when reviewing the code it all just blurrs together for me so is there some format teckneuqies i can use so its easier for …

Software Development c++
Member Avatar for A Haunted Army
3
265
Member Avatar for bumsfeld

There seems to be many ways to create a dictionary, which one do you prefer?

Software Development python
Member Avatar for Umar Suleman
3
410
Member Avatar for vegaseat

You may want to call Python's list the answer to other computer languages' arrays. Here we take a look at the things you can do with lists, create an empty list, list the attributes and methods, load, append, count, insert, join, pop, remove, remove duplicate items, reverse, search, sort, establish …

Software Development python
Member Avatar for vegaseat
3
416
Member Avatar for vegaseat

This PySide (PyQT) code sample shows you how to apply a StyleSheet to a GroupBox containing a number of RadioButtons.

Software Development python
3
3K
Member Avatar for vegaseat

A little fun drawing with the Python module turtle. Well commented to help the beginner.

Software Development python
3
289
Member Avatar for Begginnerdev

Upon aiding a friend - I have decided to post the example used here. The following is a snippet that shows basic class inheritance. The source file as well as a test case can be found attached. You can test these classes with the following code: Dim cNew As New …

Software Development oop vb.net
3
220
Member Avatar for JamesCherrill

Just a quick heads-up, especially for anyone using Java in their web browser. There's a "widely exploited" vulnerability in Java that could allow bypassing normal security when a Java applet is run silently upon visiting a web site. (ie It's a bad one). Users are being widely advised to disable …

Software Development java oracle web-browser
Member Avatar for harinath_2007
3
177
Member Avatar for vegaseat

Explore Python's sqlite3 database module, create, write and read a database file.

Software Development python sql sqlite
3
345
Member Avatar for vegaseat

This snippet shows you how to create a list of class instances. The class itself cannot be pickled, but the list of instances can. To use the pickled data file in another program, you have to recode the class in that program.

Software Development python
3
2K
Member Avatar for AutoPython

[B]!USING PYTHON 3.1![/B] Hello DaniWeb! Today I'm going to be posting a [B]simple[/B] threading tutorial. First of all, what is threading? Well, threading is just another way of doing a side task without interrupting the main program. Now here's a simple example. Let's say we are going to make a …

Software Development multithreading python
Member Avatar for nytman
3
1K
Member Avatar for vegaseat

This Python code allows you to get selected statistics of a story text. It will count lines, sentences, words, list words and characters by frequency, and give the average word length. It should be easy to add more statistics using the dictionaries created.

Software Development mathematics python
Member Avatar for Ene Uran
3
804
Member Avatar for vegaseat

You can alternately show one of two lines drawn on the Tkinter canvas by simply moving them on and off the canvas screen. This beats a cumbersome create and delete cycle.

Software Development python tkinter
3
535
Member Avatar for Gribouillis

This python 2.7 snippet adds a thin layer of sugar on the itertools module's api, allowing many of its functions to be used as decorators and adding some new functions. Enjoy !

Software Development api python
Member Avatar for Gribouillis
3
331
Member Avatar for vegaseat

There is always room for optimizing primelist functions. Here is an assortment timed with Python module timeit ...

Software Development python
Member Avatar for rubik-pypol
3
396
Member Avatar for Momerath

Below you'll find a small program. The challenge is to predict the output of the program, then explain why it gave the output it did. using System; using System.Collections.Generic; namespace Sample { class Program { static void Main(string[] args) { MyStruct a; a.a = 1; a.b = 2; Dictionary<MyStruct, int> …

Software Development c c# c++
Member Avatar for f.khansaheb
3
149
Member Avatar for vegaseat

Just a few more explorations using a Python class to mimic a C Structure or Pascal Record. Loading the record from a csv type data file, displaying the data and sorting and searching the data in various ways.

Software Development data-structure pascal python
Member Avatar for hughesadam_87
3
366
Member Avatar for mike_2000_17

Hi all! This is a simple piece of code that I wrote about a year ago, in response to a question on Daniweb. I decided to infuse it with some C++11 magic, which led to a pretty sweet code snippet, full of neat little techniques you might want to use, …

Software Development c++
Member Avatar for mike_2000_17
3
1K

The End.