Select every 5 numbers random

558fe5180e0e8fc922d31c23ef84d240

I have an array list that looks like this.

8.1,6.5,4.4,3.2,1,8.9,5,1.4,0.1,1,8.7,6.2,4.3,3.2,3

I would like that my program selects every 5 numbers randomly.

for example to select

8.1,6.5,4.4,3.2,1,8.7,6.2,4.3,3.2,3

as you can see it selected 5 numbers from the begging and 5 more from the end

and saves them

Random random_method = new Random();

// loop for generation random number
for (int i = 0; i < array.size(); i++)

// generating random index with the help of
// nextInt() method
int index = random_method.nextInt(array.size());

System.out.println("Random Element is :" + array.get(index));

Can I Email…

Category Image 051

While I’m 85% certain you’ve seen and used Can I Use…, I bet there is only a 13% chance that you’ve seen and used Can I Email…. It’s the same vibe—detailed support information for web platform features—except instead of support information for web browsers, it is email clients. Campaign Monitor has maintained a guide for a long time as well, but I admit I like the design style pioneered by Can I Use….

HTML email is often joked about in how you have to code for it in such an antiquated way (<table> tags galore!) but that’s perhaps not a fair shake. Kevin Mandeville talked about how he used CSS grid (not kidding) in an email back in 2017:

Our Apple Mail audience at Litmus is approximately 30%, so a good portion of our subscriber base is able to see the grid desktop layout.

Where CSS Grid isn’t supported (and for device/window widths of less than 850 pixels), we fell back to a one-column layout.

Just like websites, right? They don’t have to look the same everywhere, as long as the experience is acceptable everywhere.

Me, I don’t do nearly as as much HTML email work as I do for-web-browsers work, but I do some! For example, the newsletter for CSS-Tricks is an RSS feed that feeds a MailChimp template. The email we send out to announce new shows for ShopTalk is similar. Both of those are pretty simple MailChimp templates that are customized with a bit of CSS.

But the most direct CSSin’ I do with HTML email is the templates for CodePen emails. We have all sorts of them, from totally custom templates, to special templates for The Spark and Challenges and, of course, transactional emails.

Those are all entirely from-scratch email templates. I’s very nice to know what kind of CSS features I can count on using. For example, I was surprised by how well flexbox is supported in email.

It’s always worth thinking about fallbacks. There is nothing stopping you from creating an email that is completely laid out with CSS grid. Some email clients will support it, and some won’t. When it is supported, a fancy layout happens. When it is not supported, assuming you leave the source order intelligible, you just get a column of blocks (which is what most emails are anyway) and should be perfectly workable.

Progressive enhancement is almost more straightforward in email where there is rarely any functionality to be concerned with.

Direct Link to ArticlePermalink


The post Can I Email… appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

how to convert to vb.net?

558fe5180e0e8fc922d31c23ef84d240

import threading,time,sys
try:
import requests
except:
print("Please install requests module!")
sys.exit()

path=input("File (example: file.m3u) => ")
out=path+"_out.txt"

try:
with open(path, 'r') as file_in:
lines = file_in.read().splitlines()
except:
print("File error or not found!")

file_out=open(out, "w")
#print(str(lines))

all = len(lines)
print(all)
worked=0
print("Scanning {} lists... Worked will write in {}".format(all,out))
time.sleep(5)
def check(i):
global worked
thisline=str(i)
file_out.write(thisline+"\n")
if thisline.startswith("#") == False:

print("Checking "+thisline+"...")

if "m3u8" not in thisline:
if thisline.endswith("/") == False:
thisline=thisline+".m3u8"
else:
thisline=thisline+"/index.m3u8"

try:
req=str(requests.get(thisline, timeout=(2,5)).status_code)
if req == "200" or (req == "302"):
print("OK. "+thisline)
worked+=1
#write here
file_out.write(thisline+"\n")
except:
print("ERROR. "+thisline)

for i in lines:
threading.Thread(target=check,args=(i,)).start()

Top 10 Mistakes Ottawa Businesses Make on Graphic Design Projects

Featured Imgs 23

There is always that one design faux pas you and many Ottawa business owners wish you could forget. Either you were rushing to finish a marketing brochure or you overlooked proofreading or you just didn’t know what to do. These are common mistakes Ottawa companies make on graphic design projects that can easily be avoided if you understand some basic principles. Though it’s always a smart move to hire a professional, knowing what mistakes to avoid will make life a lot easier.

That said, here are the top 10 mistakes Ottawa businesses make with graphic design:

Poor Font Choice

You might see a font that you absolutely adore and want to integrate into your designs. But there is a chance that it could be a poor choice or mismatch for your brand. Remember, there are many fonts out there, but only a few are going to fit the vibe you’re looking for. Also, you want to make sure that you aren’t using too many fonts at once. Having too many fonts on a single page will create visual dissonance. The project will look messy and unprofessional, which isn’t the result you’re going for.

Keep 2-3 font types that are related to one another. One of the best tricks is using one font type but different weights and sizes. It will look cohesive but also pop. Also, avoid certain fonts. Papyrus, Comic Sans, and in some cases even Helvetica will detract from the graphic design.

Also read:

The Top 20 Fonts to Use For Branding – Logos and Graphic Designs

Overly Wordy

Humans have short attention spans. There’s no denying that fact. It’s why people can’t sit through a 20 second advertisement without wanting to skip it. And it’s also why people will lose patience with designs that have too much information. Many graphic designers and businesses tend to make the same mistake on their first few projects—they choose far too many words.

When there is too much text, people are going to say it’s too long and pass it by. Instead, try for brevity. Minimize the text down to the very vital bits then let imagery play a key role. Try to stay below 50-60 characters in a single line.

Poor Colour Combinations

Choosing the wrong colours and complementary (opposite on the colour wheel) shades spells trouble. You want to choose a palette and stick with those colours throughout the entire project. Don’t stray from the shades you choose, because it could ruin the cohesiveness of your work. Also, pay attention to how the background colours work with the font weight and colour choice. You don’t want to lose any of the information you’re trying to highlight.

Secondly, consider how the colour choice will affect the psychology of the viewer. If you choose the wrong colours for a brand, they could end up perceiving your business as cold or clinical instead of welcoming, for example. You will need to find proper balance between all colours, fonts, and images.

Poorly Written Brief

One of the biggest mistakes in graphic design happens before the project even begins. It occurs when the designer doesn’t even understand what is expected of them. Usually, this is due to a badly written creative brief or a lack of communication between the graphic designer and the business. Many businesses expect the graphic designer to comprehend what is desired from a few instructions or an idea, but the truth is that the graphic designer can’t deliver great work unless they have a total understanding of the expectations.

The good news is that it’s an easy fix. For every project, write up an in-depth briefing for everything. Detail the kind of colour scheme, the targeted audience, your branding, and so on. Also, communicate with the designer regularly.

No Responsiveness

Although this is more web design related, graphic design also carries over to the overall look and feel of a website and its media. If you are implementing special vector designs, images, animations, and so on, you are going to want to make sure all that stuff works across all platforms. If the desktop version of a website functions well but the mobile-version has sizing issues or doesn’t respond, it will impact you negatively.

Stale, Overused Content

So many businesses make the mistake of following graphic design trends. Unfortunately, recycling what’s popular could backfire. Your project might look stale or outdated, and it could reflect poorly on your business. While it’s fine to incorporate some trends, creativity is more important.

Using Stock Pictures

You might think that using a free stock photo for your website or blog or flyer is going to save you some money. In reality, it is not always the best idea. If you want to rise above your competition, try to go with original photography rather than using a stock photo that has already been used hundreds of times. You want to minimize duplicated images whenever possible. Having an image designed strictly for your business shows creativity and will even be more advantageous for branding.

Spelling and Grammatical Errors

Sometimes you get blind to your spelling and grammatical errors. That is why it’s so important to have someone review the work before printing it or launching it on social media. Even a small mistake could have a large impact on your business, especially if the information gets skewed. Others may perceive the error as negligence and wonder about the integrity of your brand. People might even discredit your products and services and head to the competition instead. You don’t want that.

The bottom line is that you need to not only be careful with the language and fonts you choose but also the way you communicate through the graphic design project.

Crazy Kerning

Kerning is when the space between letters is adjusted to make text more appealing and legible. Doing so is a delicate procedure. Go too much one way, and your letters could be so smashed together or so far apart that your project loses all meaning. This is bad for branding and bad for your image. When in doubt, have a professional graphic designer work on the kerning for you.

Improper Formats

While most designers will automatically save their work as a Tagged Image File Format (TIFF) or as a Joint Photographic Experts Group (JPEG) or something similar, deciding which one is right for the project can be a challenge. Basically, you need to know how you’re going to be using the final project before you begin.

You can ask the graphic designer for their recommendations. They will generally consider whether the image is going online or if it will be printed then go from there.

Final Thoughts

Graphic design is more than just selecting colours and images. It takes some practice and creativity to make projects into masterpieces. Now that you know some typical mistakes, you can avoid those issues and start creating amazing designs.