132,723 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for dimitrilc

## Introduction ## In Java 8, `@Repeatable` was introduced and this is the recommended way to create repeating annotations. We still have to create a holder Annotation(*annotation that holds an array of other annotations*), but we no longer have to declare the holder Annotation at the callsite. This tutorial aims …

3
301
Member Avatar for dimitrilc

## Introduction ## Java 14 was released with a new type of expression called Switch Expression. Its syntax is similar to that of the Switch Statement, with a few differences. In this tutorial, we will walk through concepts related to the Switch Expression and learn how to use it. ## …

Software Development github ide java
3
132
Member Avatar for dimitrilc

## Introduction ## This tutorial introduces the `CyclicBarrier` class and teaches you how to use it. ## Goals ## At the end of this tutorial, you would have learned: 1. How to use `CyclicBarrier` to synchronize tasks across multiple threads. ## Prerequisite Knowledge ## 1. Intermediate Java. 2. Basic knowledge …

Software Development github ide java multithreading
3
175
Member Avatar for dimitrilc

## Introduction ## `partitioningBy()` collects a `Stream` into a `Map`. In this tutorial, we will compare the two different `partitioningBy` methods and learn how to use them. ## Goals ## At the end of this tutorial, you would have learned: 1. What `Collectors.partitioningBy` does and how to use it. ## …

Software Development github ide java
3
232
Member Avatar for dimitrilc

## Introduction ## Based on the 2020 Java Ecosystem survey from Jetbrains, 75% of Java developers are still using JDK 8. JDK 11 introduces `HttpClient`, which replaces the legacy `HttpURLConnection` API. For this tutorial, we will build a `HttpClient` that consumes the free Cat Facts API. ## Goals ## At …

Software Development api daniweb-api github ide java json
Member Avatar for JamesCherrill
3
483
Member Avatar for SpiffyCS

Is there a way to search a drive's files only for a specific file format, then display them to the user (and stored somewhere to be used later)? Maybe with the Shell, but I don't know how to use it very well. At the moment, I have a dropdown to …

Software Development microsoft visual-basic
Member Avatar for pritaeas
3
448
Member Avatar for C_Oleyers

So im actually creating a fastfood menu in which save how many times a button been clicked as a variable. So I can multiply it to its value. For example if i click btnChicken a variable will count how many btnChicken been clicked then it will multplied on the amount …

Software Development asp.net c++
Member Avatar for Mike_74
3
450
Member Avatar for tinstaafl

There are times when you need to make sure your counter starts at an odd or even number. Even is pretty simple - `counter = counter + modulus(counter)`. If counter is even it stays, if it's odd it gets incremented by 1. Odd is a bit more complicated - `counter …

Software Development c# c++ java vb.net visual-basic
Member Avatar for holisticgroup19
3
4K
Member Avatar for Reverend Jim

As part of a project to manage my collection of photos, I wanted to add the capability of displaying a series of files as thumbnails. This posed me with three problems: 1. how to preserve the aspect ratio of the original images 1. how to generate the thumbnails without tying …

Software Development gui html-css listview vb.net
Member Avatar for mariopepper
3
3K
Member Avatar for dongtrien

How do I process the xamarin forms that connect to SQL Server and export data to the listView ? I'm looking for this simple example. What do I find on google ?

Software Development c listview sql xamarin xml
Member Avatar for bngwebguru
3
23K
Member Avatar for vegaseat

This simple isprime(number) function checks if the given integer number is a prime number and returns True or False. The function makes sure that the number is a positive integer, and that 1 is not considered a prime number. To find out if an integer n is odd one can …

Software Development python
Member Avatar for amir_19
3
24K
Member Avatar for Bob

[B]Intro[/B] This tutorial provides a brief introduction to the random number functions that come as part of the C++ standard library, namely rand() and srand(). [b]rand() and RAND_MAX [/b] The C++ standard library includes a pseudo random number generator for generating random numbers. In order to use it we need …

Software Development c c# c++
Member Avatar for JamesCherrill
3
53K
Member Avatar for vegaseat

PySide (public license PyQT) is my preferred Python GUI toolkit. Here we explore how to test some of the widgets available and create a digital clock.

Software Development gui python
Member Avatar for Gribouillis
3
2K
Member Avatar for vegaseat

Sometimes when you get a large check from your employer, the value is written out in words. I get those all the time of course. So I wrote this little Python code to convert an integer value to english words. Numbers as high as 999 vigintillion can be used. In …

Software Development python
Member Avatar for Abdullahi_2
3
11K
Member Avatar for Violet_82

Chaps, I wonder if you can give me a hand with this. Here's the brief: "Create a program that draws 10 random filled shapes in random colors, position and sizes. Method paintcomponent should contain a loop that iterates 10 times. In each iteration, the loop should determine whether to draw …

Software Development java java-swing
Member Avatar for Verse_1
3
5K
Member Avatar for deceptikon

I'm sure I've mentioned this type of wrapper class for accessing databases in a provider-agnostic manner before, but never posted a functional implementation. So here it is. Questions, comments, and suggestions are welcome as always. :)

Software Development
Member Avatar for Yushell
3
1K
Member Avatar for Reverend Jim

Sometimes there are functions you want your program to perform in the background while you are busy doing other things. For example, if you are building a picture viewer application you may not want to wait until thumbnails are generated before getting on with the business of viewing the pictures. …

Software Development html-css vb.net
Member Avatar for Reverend Jim
3
4K
Member Avatar for Momerath

[B]Expression evaluation using Emit[/B] This class was designed to evaluate simple mathematical expressions. But instead of developing a routine to do the calculating, we use Emit to dynamically build a method that does the math for us. IMPORTANT: This is done with integer math. 7/2*3 = 9, not 10.5 (or …

Software Development queue
Member Avatar for Jonathan_13
3
1K
Member Avatar for vegaseat

This simple key logger shows any character/special key when pressed.

Software Development python tkinter
Member Avatar for aha67
3
2K
Member Avatar for Megaz221

Hi, I guess I'll post here with my problem as well my introduction. I've coded in Java in high school for 2 years but my teacher was horrible so I decided to wait till college to take another programming class. Well I'm Programming Fundamentals and have been assigned a program …

Software Development c++
Member Avatar for Muhammad_100
3
14K
Member Avatar for arindam31

Here is a weird regular expression for emails . We can have various kind of email addresses [email]string1@somemail.com[/email] [email]string1@somemail.co.in[/email] [email]string1.string2@somemail.com[/email] [email]string1.string2@somemail.co.in[/email] The following regular expression can find any of the mails above email2="santa.banta@gmail.co.in" email1="arindam31@yahoo.co.in'" email="bogusemail123@sillymail.com" email3="santa.banta.manta@gmail.co.in" email4="santa.banta.manta@gmail.co.in.xv.fg.gh" email5="abc.dcf@ghj.org" email6="santa.banta.manta@gmail.co.in.org" [CODE]re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email) >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email2) >>> x.group() 'santa.banta@gmail.co.in' >>> x=re.search('\w+[.|\w]\w+@\w+[.]\w+[.|\w+]\w+',email1) >>> x.group() 'arindam31@yahoo.co.in' …

Software Development email python regex
Member Avatar for Syed Sulaiman
3
10K
Member Avatar for vegaseat

Just a simple exploration of the goslate module (uses the Google Translate API) to translate some common languages. However, some IDE's create character problems. Note: Your computer has to be connected to the Internet to access Google.

Software Development api python seo
Member Avatar for Ekta_1
3
2K
Member Avatar for DragonMastur

I made a little py editor because I didn't want to go to all the troble of installing an idle, but I didn't like notepad either. Here it is!

Software Development python
Member Avatar for DragonMastur
3
319
Member Avatar for deceptikon

If you have any ideas for a code snippet you'd like to see, please post them here. We can't depend on the snippet writers to come up with all of the ideas, can we? ;)

Software Development c
Member Avatar for vegaseat
3
749
Member Avatar for snippsat

It's started (: Find some videos that are interesting,feel free to post link or discuses it here. I was looking most forward to David Beazley talks. Live coding with Concurrency as topic,doesn't get much better than this. [David Beazley - Python Concurrency From the Ground](https://www.youtube.com/watch?v=MCs5OvhV9S4) The main talk David Beazley …

Software Development python
Member Avatar for vegaseat
3
173
Member Avatar for deceptikon

Howdy all. I've recently been considering doing an online meeting or webcast on certain subjects for which I have a lot of experience or knowledge. The idea being that something too long or complex for a Daniweb article can be more easily shown by sharing my desktop and talking about …

Software Development c
Member Avatar for deceptikon
3
176
Member Avatar for Ketsuekiame

This "FakeWebClient" will allow a C# application to send and receive cookies as part of the request. This behaviour is not available by default. Please note that on line 35 there is a possible NullReferenceException, I managed this at a level higher but you may wish to handle it in …

Software Development http-protocol web-browser
Member Avatar for Pavel_47
3
5K
Member Avatar for jeffcogswell

People who know me know that Python has always been one of my favorite languages. And over the years, I've been pleased with the array of development tools that have been created for it, including the different IDEs. I also do a lot of work in .NET, primarily with C#. …

Software Development ide microsoft-windows python visual-studio
Member Avatar for Tcll
3
2K
Member Avatar for vegaseat

One way to find the shortest distance between a series of surface (x, y) points is to let Python module itertools find the non-repeating combinations of point pairs. Now you can apply the Pythagoras' theorem to find all the distances and the minimum distance.

Software Development python
Member Avatar for gerisam
3
2K
Member Avatar for vegaseat

A simple way to find out a Python module's location on your drive.

Software Development file-system operating-system python
Member Avatar for Gribouillis
3
685
Member Avatar for vegaseat

With just about everybody snooping around your emails today with the excuse of hunting the bad guys, coding to keep some resemblance of privacy is getting important. I will start out with some simple encryption examples to get this started. You are invited to give us your thoughts and codes. …

Software Development cybersecurity encryption python
Member Avatar for Lardmeister
3
1K
Member Avatar for vegaseat

Knowing the longitude and latitude coordinates of two cities you can calculate the distance between them. Use the code in https://www.daniweb.com/software-development/python/code/490561/postal-code-zips-and-location-python to find the coordinates.

Software Development python
3
2K
Member Avatar for snippsat

A look at [Dataset](http://dataset.readthedocs.org/en/latest/) and easy and Pythonic way to create a database. Other candidates in this categorie,i will mention [pyDAL](https://github.com/web2py/pydal) and [Peewee](https://peewee.readthedocs.org/en/latest/). I did some test of Dataset in this [post](https://www.daniweb.com/software-development/python/threads/490219/how-can-i-creat-e-text-file-to-use-as-a-database-in-python) to look at. So here a common task some web-scraping of food recipes(just a task i did help …

Software Development dataset github python
3
294
Member Avatar for vegaseat

A dictionary in Python is an unordered set of key:value pairs. I show you how to initialize, create, load, display, search, copy and otherwise manipulate this interesting container. Like the name says, it is the closest thing to a dictionary.

Software Development python
Member Avatar for Babe1
3
1K
Member Avatar for vegaseat
Member Avatar for Lardmeister
3
3K
Member Avatar for divinity02

hey you guys I just want to take this time to wish your guys a merry christmas and a bright and prosperous new year, I know that I will have to do over this programming course in the next semester even though i havent got any result yet. still havent …

Software Development java
Member Avatar for JamesCherrill
3
151
Member Avatar for happygeek

[ATTACH=RIGHT]22389[/ATTACH]CodeToGo is, essentially, an API wrapper around the Ideone.com online compiler and debugger that enables you to use it to compile and run code in around 50 different programming languages on your iPhone or iPad. It has been around for a while but has always been somewhat tarnished with the …

Software Development c++ ipad iphone
Member Avatar for Anton_4
3
883
Member Avatar for vegaseat

With the advent of Python33 the module time has received a high resolution timer/counter. Here we use time.perf_counter() in a decorator to conveniently time two test functions.

Software Development python
3
2K
Member Avatar for oussama_1

Here's a simple game code, open a new vb project and copy paste this code and hit run. the game contains 3 levels, all you have to do is to shoot the smiley faces to earn money using mouse clicks, also there's a boss enemy on level 3. I didn't …

Software Development gaming vb.net
Member Avatar for oussama_1
3
946
Member Avatar for vegaseat

Similiar to the snippet posted at: http://www.daniweb.com/software-development/python/code/449036/display-an-image-from-the-web-tkinter but this time we use PIL to resize the image from the internet keeping its aspect ratio to fit a specific display area/box.

Software Development image python tkinter
Member Avatar for HiHe
3
2K
Member Avatar for Reverend Jim

Please read through the following suggestions before posting in this forum. Questions in this forum are answered by people who generously volunteer their time. Following these guidelines will increase the chances of getting a quick and accurate answer. 1. Use Search to see if your question has been asked and …

Software Development visual-basic
3
203
Member Avatar for vegaseat

This short Python program calculates Euler's number e, the base of natural logarithms, to a precision of at least 100 digits in this case. To get the precision needed, the Python module decimal is used. The result is compared to a published result.

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

A feature of the doctest module can be useful when people copy and paste their idle window in the python forum: the ability to transform an example from the python interpreter into python code without the prompts [icode]>>>, ...[/icode] and the output messages. The script below permits to use this …

Software Development python
Member Avatar for Gribouillis
3
907
Member Avatar for vegaseat

A Tkinter image button that toggles between an up and down button image.

Software Development gui image python tkinter
3
2K
Member Avatar for ddanbe

This is my first try with turtle graphics in Python. It is in fact a sort of "translation" from some old LOGO code. When you run it, this should be the result: ![dbf0a4f76975c5cc4dee5df30139f144](/attachments/small/1/dbf0a4f76975c5cc4dee5df30139f144.png "align-left") Insiders can perhaps play the "Dark side of the moon" record by Pink Floyd :) Any …

Software Development image python
Member Avatar for ddanbe
3
2K
Member Avatar for [NOPE]FOREVER

Is HACK object orientated and what application development is it designed for?

Software Development cybersecurity
Member Avatar for <M/>
3
282
Member Avatar for TrustyTony

I [saw interesting problem](http://www.daniweb.com/software-development/legacy-languages/threads/478323/prolog) of generating spiral of numbers and realized I could reuse [my code for rotation](http://www.daniweb.com/software-development/python/code/371536/rotate-sequences-left-or-right) I posted earlier.

Software Development python
3
778
Member Avatar for vegaseat

If you use the Windows OS, then IronPython allows you to create a GUI program taking advantage of the .NET framework. You also have the option to compile the program into a standalone .exe file (and the needed .dll file).

Software Development gui python
Member Avatar for vegaseat
3
593
Member Avatar for jhai_salvador

Hi! I don't know where to post this, but since this is vb6 thread i'll just post it here. I need all of your support by voting Visual Basic Classic to be improved. here is the link: [Bring back Classic Visual Basic, an improved version of VB6](http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3440221-bring-back-classic-visual-basic-an-improved-versi) To vote: Click …

Software Development visual-basic visual-studio
Member Avatar for sten2005
3
254
Member Avatar for zinnqu

Using the Load and Unload events of the Forms add these subs to handle a simple fade in and out effect. This is not limited to just one form. The subroutine definition can be added to any global class allowing the use on any form or sub-form.

Software Development vb.net
Member Avatar for vaibhav.garg.9484
3
5K

The End.