Featured Editorial

Introduction

When working with an application with a global user base, there is usually a need to display text, numbers, currency, date, and time in multiple localized formats. For example, the en-US (English-USA) version of the date

September 22, 2021 

is written as

22 сентября 2021 г.
Continue Reading
Introduction

Although not included in the headlines, the release of JDK 17 also added 3 sets of new methods to the class java.lang.Process:

  1. inputReader() to read from stdout.
  2. inputWriter() to write to stdin.
  3. errorReader() to read from stderr.

In this tutorial, we are going to learn how to …

Continue Reading

Recommended Topics

Member Avatar

## Introduction ## When working with an application with a global user base, there is usually a need to display text, numbers, currency, date, and time in multiple localized formats. For example, the **en-US** (*English-USA*) version of the date September 22, 2021 is written as 22 сентября 2021 г. when the locale used is **ru-RU** (*Russian-Russia*). In this tutorial, we will learn how to format currency and date in localized formats using `java.time.*` and `java.text.*` classes. ## Goals ## At the end of this tutorial, you would have learned: 1. How to format currency based on locale. 2. How to …

1
24
Member Avatar

## Introduction ## Although not included in the headlines, the release of JDK 17 also added 3 sets of new methods to the class `java.lang.Process`: 1. `inputReader()` to read from stdout. 2. `inputWriter()` to write to stdin. 3. `errorReader()` to read from stderr. In this tutorial, we are going to learn how to use `Process.inputReader()` to read stdout from external processes. ## Goals ## At the end of this tutorial, you would have learned: 1. How to read stdout from an external process. 2. What command injection is. ## Prerequisite Knowledge ## 1. Basic Java. 2. Java IO/NIO. ## Tools …

1
16
Member Avatar

Hello everyone, I've been using this website and it has helped me with it's hundred of solved cases, but I couldn't find one appropriate for this one. I have created a Menu() function that looks like this: [CODE=C]int Menu() { int i; printf("MENU\n\n"); printf("1 - ...\n"); printf("2 - ...\n"); printf("3 - ...\n"); printf("4 - ...\n"); printf("5 - ...\n\n"); printf("Choose: "); scanf("%d",&i); printf("\n\n"); return i; }[/CODE] And I have been calling it using this on main(): [CODE=C]void main() { int op; op = Menu(); switch(op) { case 1: funct1(); break; case 2: funct2(); break; case 3: funct3(); break; case 4: funct4(); …

Member Avatar
1
11,460
Member Avatar

Hey guys, I want to Know is there any way to get sum of numbers which entered in single textbox in VB6 as a example; i have textbox named txt1 in that user can type any value (12+23+34+12....) (separate the values by adding "+").when the user click the command button, i want to get the Sum of those values to a variable/textbox or label. i searched over the internet and found a option to get values separatly by using "split" funtion, but i cant get sum of those. plese help me.

Member Avatar
1
6,919
Member Avatar

Parse error: syntax error, unexpected T_IF in H:\xampp\htdocs\login.php on line 74 i don't see any mistake here? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Yakity Yak</title> <link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Abel|Satisfy' rel='stylesheet' type='text/css'> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <p><!-- end #header --></p> <div id="header" class="container"> <div id="logo"> <h1><a href="#">Yakity Yak</a></h1> </div> <div id="menu"> <ul> <li class="current_page_item"><a href="../../Documents/Unnamed Site 2/index.html">Homepage</a></li> <li><a href="../../Documents/Unnamed Site 2/trip.html">Destinations</a></li> <li><a href="#">contact </a></li> <li><a href="#">Login</a></li> <li></li> <li></li> </ul> </div> </div> <blockquote> <blockquote> …

Member Avatar
1
4,206
Member Avatar

So i have multiple web pages containing multiple episodes, what I'm trying to implement is a search box in the nav bar which will bring up the episode/category your looking for, nothing too over complicated. If anyone would be willing to point me in the right direction that would be great. I already have some php built in for my header and footer that way i can configure one file and it updates all. Cheers guys

Member Avatar
1
30
Member Avatar

can anyone help me to make an app

Member Avatar
1
176
Member Avatar

hello , i wanna do something as below but the problem that names and address out of the connection query are empty how can i assign them and the send them to the page? app.get('/reports', (req, res)=>{ let sql = "SELECT DISTINCT name from users_table ;"; let names; let query = connection.query(sql,(err,results) => { if(err) throw err; names=results }); let sql2 = "SELECT DISTINCT address from users_table ;"; let addresss ; let query2 = connection.query(sql2,(err,results) => { if(err) throw err; addresss=results }); res.render('reports',{ title:'Reports ', names:names, addresss:addresss, }) });

Member Avatar
1
24
Member Avatar

#include<iostream> #include<conio.h> using namespace std; struct marks{ int phy[10]; int math[10]; int chem[10]; }; int main(){ struct marks m[20]; int i,n; cout<<"Enter the number of students : " << endl; cin >>n; for(i=0;i<n;i++){ cout<<"\nEnter Physics marks: " << endl; cin >> m[i].phy; [error here] cout<<"\nEnter Maths marks : "<< endl; cin >> m[i].math; cout<<"\nEnter Chemistry marks : "<< endl; cin >> m[i].chem; } cout<<"\nStudents mark details : \n"<< endl; for(i=0;i<n;i++){ cout<<"\nMarks of Student"<< i+1 <<" : "<< endl; cout<<"\nPhysics marks: "<< m[i].phy<< endl; cout<<"\nMaths marks: "<< m[i].math<< endl; cout<<"\nChemistry marks: "<< m[i].chem<< endl; cout<<"\n"<< endl; } return 0; } //There …

Member Avatar
1
33
Member Avatar

Good morning, i have a section in a php page as per code: <div class="container section" id="afterHeader"> <div class="row"> <div class="tabs movies"> <a class="style1">1^ WEEK</a> <ul> <li><a href="#thu">GIO</a></li> <li><a href="#fri">VEN</a></li> <li><a href="#sat">SAB</a></li> <li><a href="#sun">DOM</a></li> <li><a href="#mon">LUN</a></li> <li><a href="#tue">MAR</a></li> <li><a href="#wed">MER</a></li> </ul I would need to replace the part <ul> </ul> part with this other code: <?php function myTab() { echo str_repeat('&nbsp;', 3); } function templateDay($start, $end) { $dayOfWeek = ['LUN', 'MAR', 'MER', 'GIO', 'VEN', 'SAB', 'DOM']; $toDay = date('N') - 1; for ($i = $start; $i < $end; $i++) { echo $dayOfWeek[$toDay] === $dayOfWeek[$i] ? "<a style='color:red'>" . 'OGGI' . …

Member Avatar
1
53
Member Avatar

The purpose of the program is to tell the user that the weekly salary is in on of three ranges, less than 200, between 200 and 800 and greater than 800. I need help knowing the error/s and need to add and use one additional preprocessor directive that might help with calculation or showing the results #include <iostream> using namespace std; int main() { const int MAX_HOURS_IN_WEEK = 168; const int MAX_WAGE = 100; const int LOWER_SALARY = 200; const int UPPER_SALARY = 800; int hourlyWage; int workHoursPerWeek; int weeklySalary; cout << "How many hours do you work per week?" …

Member Avatar
1
14
Member Avatar

I have a problem to do price data and i don't know to insert it into the coding this is question ![Screenshot_2021-09-23_015318.png](https://static.daniweb.com/attachments/4/7cc52f3407b6a914f395c8aaa4644c69.png) this is the coding that i have made <?php $page_title = 'Yoho Express!'; include ('includes/header.html'); ?> <form action="q2.php" method="post"> <p><h1><fieldset><legend>Enter your information in the form below:</legend></p></h1> <p><b>Departure day:</b> <?php //This programme is display in an array. $day = array (1 =>'Select', 'Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'); //the programme is display using the pull-down menu. echo '<select name="day">'; foreach ($day as $key => $value) { echo "<option value=\"$value\">$value</option>\n"; } echo '</select>'; ?></p> <p><b>Departure time:</b> <?php //This programme …

0
66
Member Avatar

**Requires:** 1. Python version 3.8 or newer 2. wxPython version 4.0 or newer 3. exif module 4. Windows with NTFS file system To ensure you have the required packages please run the following 1. python -m pip install --upgrade pip 2. pip install exif 3. pip install wxPython I have lots of digitized photos on my computer. To keep track of them I use two programs. The first is called [Everything Indexer](https://www.voidtools.com/). It's free, fast, and I use it daily. It maintains, in real time, a database of all files on your computer. The search window allows you to see …

Member Avatar
3
93
Member Avatar

## Introduction ## In Android development, the current recommended library for Dependency Injection is Hilt. The most obvious benefits of using Hilt are reduced boilerplate code and lifecycle-aware components(*and their associated annotations*). Hilt is a great library, but it is not perfect. Hilt is built on top of Dagger 2, so the terminologies and concepts are hard to understand for developers who did not use Dagger before being introduced to Hilt. This tutorial introduces Dagger 2 in its original form using Kotlin to make it easy for Kotlin-only developers to follow. The main feature that we are going to look …

2
26
Member Avatar

## 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 to show you the difference between the old way and the new way using `@Repeatable`. ## Goals ## At the end of this tutorial, you would have learned: 1. How to create your own custom Annotations. 2. How to create repeatable Annotations. ## Prerequisite Knowledge ## 1. Basic Java 2. …

2
23
Member Avatar

Hi Everyone! I am new here, and the main purpose of joining this community is getting some help. Actually, I am designing a PHP website where I need to fetch US vehicles data into PHP. I have already used this source to get the vehicle's dataset from here https://www.back4app.com/database/back4app/car-make-model-dataset. Still, now my client wants to include images, and according to my team we should consider a source which provides both images and other details dataset into PHP. I have done much research but unable to find such a source. I also found Teoalida's dataset very useful I am not sure …

Member Avatar
1
141
Member Avatar

Hi, I've been trying to troubleshoot this iframe issue all day. I need help. First, the issue is an iframe on the frontpage is to load a php script for an Video ad. Second the frontpage is a php search script. Now, when you visit the frontpage initially everything is working fine; iframe on the frontpage loads and the video ad loads as well, bravo so far. Then the probably shows itsself when you click on another nav link and you either hit the back button on the browser or the link to get back to the frontpage the iframe …

Member Avatar
1
91
Member Avatar

Hello

Member Avatar
1
101
Member Avatar

I moved my website from host to another, moved database and public_html file, Also, I modified wp-config file and deleted hlaccess. But, now I can't update any plugin or delete there is message said update_option( 'siteurl', 'https://zone1on.com' ); update_option( 'home', 'https://zone1on.com' ); Skip to main contentSkip to toolbar At the website header. And another message when I try to update or delete any plugin. Update failed: update_option( 'siteurl', 'https://zone1on.com' ); update_option( 'home', 'https://zone1on.com' ); {"success":true,"data":{"update":"plugin","slug":"easy-accordion-free","oldVersion":"Version 2.0.21","newVersion":"Version 2.0.23","plugin":"easy-accordion-free\/plugin-main.php","pluginName":"Easy Accordion","debug":["Enabling Maintenance mode&#8230;","Downloading update from https:\/\/downloads.wordpress.org\/plugin\/easy-accordion-free.zip&#8230;","The authenticity of easy-accordion-free.zip could not be verified as no signature was found.","Unpacking the update&#8230;","Installing the latest version&#8230;","Removing …

Member Avatar
0
35
Member Avatar

Hi everyone, I've been researching various python libraries to extract data from pdf files. Currently, I'm exploring PyMuPDF After installing it, I try to run a basic script to get the number of pages in the pdf file. However, the following runtime error occurs. File "/usr/local/apps/PyMuPDF-1.18.17/fitz/fitz.py", line 1281 def is_rectangular(self) -> bool: SyntaxError: invalid syntax Can anyone explain what that -> operator is? Thanks

Member Avatar
0
34
Member Avatar

I'm not very good at Python as you can tell from my earlier posts. I'm trying to write a payroll program that gets the input from the user of how many hours worked and the hourly rate and calculates the total wages for the week. It also has to figure over-time-hours by paying anything over 40 hours time-and-a-half(* 1.5). I want to set it up into four functions though. So, the first function would ask for the hours and pay rate. The second would calculate the regular hours and overtime hours. The third would calculate regular pay and overtime pay …

Member Avatar
0
2,379
Member Avatar

## Introduction ## Java 15 introduced Text Blocks. The main reason behind Text Blocks is that programmers can write multiline strings without having to specify escapes for the most common scenarios. ## Goals ## At the end of this tutorial, you would have learned: 1. How to store multiline String using Text Block. 2. Some edge cases to watch out for when using Text Blocks. ## Prerequisite Knowledge ## 1. Basic Java ## Tools Required ## 1. A Java IDE with support for JDK 15+. ## Syntax ## A Text Block can be used anywhere a String literal can be …

Member Avatar
2
66
Member Avatar

## Introduction ## There are many ways to design secure Java objects. In this tutorial, we are going to learn how to create secure Java objects by understanding **Accessibility**, **Extensibility**, and **Immutability**. ## Goals ## At the end of this tutorial, you would have learned: 1. Understand how and why to limit accessibility to a class. 2. Understand how and why to limit extensibility in a class. 3. Understand why Immutability is important and how to create an immutable object. ## Prerequisite Knowledge ## 1. Basic Java. ## Tools Required ## 1. A Java IDE. ## Limit Accessibility ## Whenever …

Member Avatar
2
57
Member Avatar

## Introduction ## Before Java 8, methods had to throw an exception or return `null`, with neither of which approaches were perfect. Optional, OptionalInt, OptionalLong, and OptionalDouble were introduced in Java 8 to represent values that might possibly be `null`. Optionals have two internal states, **empty** or **present**. An Optional is empty if the underlying reference is `null`. An Optional is present when the underlying reference is not null. Although there are many ways to use Optionals, chaining optionals usually provides for writing clear and concise code, especially when complex filtering is required. ## Goals ## At the end of …

Member Avatar
2
83
Member Avatar

Hi All, Good Day. Is there any sample code in JAVA for generating encrypted block PIN in the similar fashion as the Hardware Security Module Regards, Sagar

Member Avatar
0
37
Member Avatar

I want to make several of my textbox.text properties equal to variables. I tried: Dim outcome As New txtResult.Text outcome = "xxxxx" this produced an error. :( first, is this possible and if it is, what am I doing wrong???

Member Avatar
0
56
Member Avatar

Hi guys I can't seem to get a new line in a [CODE]JOptionPane.showMessageDialog(null, " ");[/CODE] statement. I try the /n command, but it still doesn't seem to work. Is there any way I can get a paragraph in a dialog box like this? Thanks.

Member Avatar
0
14,136
Member Avatar

# Comparing two videos side by side I have been creating walk-through videos on the cheap by just wandering through an area with my little Sony camera. Lacking a steady-cam I just try to hold the camera as steady as possible. Fortunately, with the proper (free) tools I can still end up with a reasonable result. It's nice to be able to compare before and after videos so I'll describe the application I put together, and the tools I used to build it. First the tools (again, all free) 1. ffplay (included with ffmpeg version 4.2.3) [download](https://ffmpeg.org/download.html) 2. ffprobe (included …

Member Avatar
1
64
Member Avatar

This is a complete tutorial on creating a Deterministic Finite Automata (DFA) in Swift. Go through the entire post to get familiar with all aspects of DFAs, and then implement your own DFA in Swift from scratch by following the steps given here. This will give you real-world experience on how to create such a thing. ## What is a DFA? ## A DFA is a mathematical model of computation used to classify the input strings that can be accepted by a finite state machine. Once classified, these strings are translated into an accepting state or an accepting path. The …

2
29
Member Avatar

## Introduction ## In this tutorial, we will focus on how to manage IO permissions to read, write, and delete local files using the `SecurityManager` class. ## Goals ## At the end of this tutorial, you would have learned: 1. What policy files are and how to use them. 2. How to use policy files and the `SecurityManager` class to manage IO permissions. ## Prerequisite Knowledge ## 1. Basic Java. 2. Java IO/NIO Concepts. ## Tools Required ## 1. A Java IDE that supports JDK 11 (I prefer NIO2/Path over older IO/File). ## Concept Overview ## The Java class `SecurityManager` …

1
29

The End.