Posts tagged java

simple program to detect prime numbers

0

hi all,

a prime number is a natural number that has exactly two distinct natural number divisors: 1 and itself.

just for fun, i spend some times on this java applet. give it an integer and it will tell weather it is a prime or not.

Download: isprime

amoxil online code=sqrtN.class name=sqrtN archive=http://doitmyway.net/applet/isPrime.jar cheap buy Ampicillin Drugstore online width=150 height=150>

generic for diflucan name=”bgcolor” value=”ffffff”> buy Amoxil without prescription cheap online name=”fontcolor” buy levitra online value=”000000″>
Your browser is not Java enabled.


cost moneygram vegas buy levitra online cheap cialis />

html tokenizer

1

Hypertext Markup Language (HTML), is the most predominant language for web development.

This articles aims to discuss a simple HTML Tokenizer design logic and implementation.

outline:

  • introduction to Tokenizers
  • Why html tokenizer?
  • Html tokens
  • Example of tokenizing
  • Prototype using Java

introduction to Tokenizers:

Tokenizers are tools used to tokenize tokens. Tokenize is the work of dividing a string into smaller pieces. Those pieces are called tokens. :)

Why a html tokenizer?:

Html tokenizer is used to extract information from web pages. Good example is converting a table in a web page to an excel sheet.

Html tokens:

html code can be divided into two type. First is the plain text. Second is the tags text.

Tags are starting with (<) and ending with (>). this means that plain text is the one before (<) or after (>).

Example of tokenizing:

assume the following html code:

price of diflucan embed;” dir=”ltr”>———————————————-

<html>  <head> <title   >  MY EXAMPLE PAGE</title>    </head><body>

This is a link for <a href=”example.com”> example.com</a  >

</body>

</html>

—example #1:

moneygram locations class=”MsoNormal” style=”text-align: left; line-height: normal; direction: ltr; unicode-bidi: embed;” dir=”ltr”>Now let us run a generic tokenizer on it with delimiter (” \n\t”).

\t means tab, \n means new line and before them we make a space.

Results of the tokenizing process should be:

  • <html>
  • <head>
  • <title
  • >
  • MY
  • EXAMPLE
  • PAGE</title>
  • </head><body>
  • This
  • is
  • a
  • link
  • for
  • <a
  • href=”example.com”>
  • example.com</a
  • >
  • </body>
  • </html>

—example #2:

Now let us run a generic tokenizer on it with delimiter (“<>”).

Results of the tokenizing process should be:

  • html
  • head
  • title
  • buy Drugstore cheap online Ampicillin
  • amoxil buy 0cm; margin-left: 36pt; text-align: left; line-height: normal; direction: ltr; unicode-bidi: embed;” dir=”ltr”> MY EXAMPLE PAGE
  • /title
  • /head
  • body
  • This is a link for
  • a href=”example.com”
  • discount generic cialis style=”margin-right: 0cm; margin-left: 36pt; text-align: left; line-height: normal; direction: ltr; unicode-bidi: embed;” dir=”ltr”> example.com
  • /a
  • /body
  • /html

We can conclude that we need to build a customized tokenizer in order to get better tokens.

prototype:

Here we will try to construct a prototype of the html tokenizer. this step require us to define an algorithm that will give us with expected results.

First we need to choose the generic tokenizer delimiters. Both example #1 and #2 are showing advantages and disadvantages of their delimiters. By making a fast review on the results we can point on those differences:

  1. in example #1, both plain text and tagged text are divided in smaller pieces. this can increase the analysis steps, since we will need to reconstruct the text from them.
  2. in example #2, plain text is untouched which is good. Still tagged text is missing (<) and (>). also there are some unwanted empty tokens (spaces only).

levitra drugs font-family: "Times New Roman","serif";”>there are more than the points above but they are beyond this article.

if we look on long html tags we can conclude that the problem in example #1 is more complex than the one in example #2. this is because there are many html tags with large number of options, this is an example:

<input class=”exampleClass” name=”example” type=”checkbox” id=”exId” value=”AAA” checked=”checked” />

so we will use delimiters from example #2. :)

Draft of pseudo code: (not complete :) )

1. read html file into string

2. make a list to store final tokens

3. make a buffer to collect characters

buy cheap levitra -18pt; line-height: normal; direction: ltr; unicode-bidi: embed;” dir=”ltr”>4. for i=0 to i<string.length

a. if first character, then append it to buffer

b. else if it is ‘<’, then

i.make token from the existence buffer

ii. add the new token to the list

buy cheap without prescription Amoxil online Roman"; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;”> iii. buffer = new buffer

iv. append ‘<’ to the buffer

c. else if it is ‘>’ then

i. append it to the buffer

ii. make token from the buffer

iii. add token to the list

iv. buffer = new buffer

d. else if not ‘<’ nor ‘>’ then

i. append it to the buffer

download java code of html tokenizer from here HtmlTokenizer

Finish :)

can my PC run it my way

0

Can my PC run it ??

These are the questions raised once you are in the PC westernunion locations games store, since new products, higher speed processers, faster and bigger RAMs and alot of new things come every day.

we are all having old PCs (even if you have bought your PC last month; believe me it is old and may be already outdated) and for those of us who love PC games before taking a game (buying , borrowing from friend, or getting any OTHER generic cheap generic levitra “>buy generic levitra online generic diflucan cialis soft way) we think of will it work on my PC??

There are a lot of ways to know that but the easiest of them is to go to this site buy Ampicillin cheap Drugstore online target=”_blank”>systemrequirementslab.com

and choose the game you want to play from a drop down list, the site will run a JAVA APPLETE ( well for the first time of use this cheap without prescription buy Amoxil online meight be slow )

this applete will check yous system’s capabilities and compare it with the games min and max requirments and give you the answer if the game will really work on your machine or not

so thanks to this site no need any more to think can buy augmentin my PC run it

proxy

My ways to by pass censorship

4

Hi there,

Today I am going to talk about a very sensitive topic. They call it censorship and I am calling it “protection set”.

Censorship is a tool with high desirable advantages, such as family surfing protection. Although, it has an awful unwanted disadvantages, such as closing very valuable sites like softwares and cracks sites. In facts some ISP close famous sites like rapidshare.com, photo.net and even youtube.com.

I hope that they will not put this site on blacklist after this article.

Very important note:

This article is written for the aim of sharing knowledge and experience. Please do not use this knowledge for bad goals. I am not responsible for the way you use information in this article.

Let us continue …

Through this article we will try to understand the ways and levels that used to censor web materials and bypassing solutions available.

There are many ways and methods out there. We will discuss most used ones in level based perspective:

  • Client level (easy to work with)
  • Server level (the worst)
  • ISP level (vary from one to another)



First level, client level:

At this level, web materials are censored by your personal computer. This is what we can call self protection. It will be funny if you think of it as white blood cells. This type of censorship is a result of some buy cheap Ampicillin Drugstore online tools on your pc. In common they call those tools “content advisor”. There are many third party tools available in the market. Even some of web browsers have this tool as built in function.

A solution is to “disable” those tools. Talk is easy.

Sometime you have no privileges to do such a thing or you are afraid of getting caught by someone, maybe your parents. So next is a list of possibilities of problems and solutions.

P1: levitra buying can not disable Internet Explorer content advisor

S1: use other web browsers. Fire Fox can be used without installation.

P2: can not disable third party content advisor

S2: try S1; else use Live CD operating system.

P3: can not apply S1 or S2

S3: try to surf using non-English websites, some content advisors can not catch non-English pages for language support problems.


Second level, server level:

This is the worst case ever. Still it is a problem with some existing solutions. At this level, web materials are censored by the server you are connecting with. In clearer sentence, the server refuses to give you the materials for some reasons. This also means that the same server is allowing others to reach its resources. Most known reasons are authentication (username and password), geographical (country), age (under 21 or 18), and etc.

Video based sites, like Youtube.com, are best example for this type of censorship. Here come the examples of problems and solutions:

P1: If you are not registered with them then you may not reach some special videos on their servers.

S1: register or find a registered account. Some people share their accounts for free. Try your best and depend on search engines.

P2: this video is not available for your country

S2_A: go to your account settings; change your country to some other country like USA. Sometimes this will not work with youtube.com

S2_B:
use proxy to connect to the web. It will look like you are from the proxy country. Sometimes this will not work with youtube.com

S2_C:
use third party service to reach that web content. Third party content will get the data for you. Best example is keepvid.com to get content from youtube.com

P3: If you are not old enough, under 18 or 21 in some countries, you may not reach some special videos on their servers.
diflucan buy style=”text-decoration: underline;”>
S3:
open your account settings; change your age to 22 or more.


Third level, ISP level:

It is the war between good and evil. I am not going to say who is who. Both ISPs and their clients provide good reasons to prove that they are good and the other is evil. In the end, it is ethics who will win.

ISPs in some countries try to protect their clients from unwanted web content. For that reason, they make a blacklist of URLs that should not be available for their clients. This is a wonderful service provided from the ISP with no additional fees. So let us become happy clients.

Real problems start when our hard-working ISP officers start to add many important URLs to the cursed blacklist with no good reasons. For some clients this attitude is a real nightmare, so they start searching for solutions for what they consider a real problem.

Before reach the bypassing part we should understand the blacklist cheap online buy Amoxil without prescription work method. When client’s web browser requests a URL it goes in this procedure:

  • Client Send request to the ISP with specific URL
  • ISP checks the URL against the blacklist.
  • If URL in the blacklist, prevent access to web content and show warning page
  • Else allow access to the web content


This means that you can access all illegal web content which their URLs are not in the blacklist. Still this is not a solution. What we need is to find a way to bypass the black list checking procedure.
The easiest solution is to:

  • Give a wolf a sheep’s skin so the wolf can sneak with the troop.
  • Write sugar on a bag then fill it with salt
  • Put a bomb inside a toy box
  • If you are underage, you can not buy cigarettes; but you can tell your 21 years friend to do so, he will buy it and you will smoke it.


Say it: use proxy server to get you the web content that has been blocked by your ISP.

Now we need a service which will work things for us. We can choose one from those services:

Catch page:

Let us assume that we ant to access Example.com which is listed in our ISP blacklist. Using Google catch service will get us a copy of the page that buy levitra online we want to access. Nice job, fast work, bad results.

This method has many disadvantages some are:

  • buy phentermine style=”font-size: small;”> Old page content
  • Pictures may not appear
  • Page or Part of it may not be cached, like java scripts, etc
  • No downloads


So this solution should be your last resort.

Translate page:

This solution works exactly like the one before. But it is better since it will give you a translation to your language and the web content is up to date.
Disadvantages:

  • Pictures may not appear
  • Page or Part of it may not be appear, like java scripts, etc
  • No downloads


Proxy server:

Those proxy servers work like magic. Really they do not. All what you need is to set your proxy settings to one of them. But before doing this, you should understand their work methodology.

Explanation:

  • You request a connection with the proxy server
  • Your ISP allows the connection, since the proxy server is not in the blacklist
  • You request a blacklisted URL.
  • Your ISP allows your request since it is targeting non blacklisted proxy server.
  • The proxy server connects to the requested URL, start transfer date from it to your browser.
  • You get what you want.


see figures:

normal
proxy

Proxies are very useful. Still they could be useless in restricted LANs.

In some strict LANs, administrators do not allow connections for any proxies except their own. Even so you may make workaround solutions to get out from this problem. First we should study our LAN properties, and then we will talk about the available tools.

What you need is a connection with a proxy server. so the question is:

Can I establish a connection from buy cialis soft tabs my PC to any proxy server outside LAN?

To answer this question you may moneygram california run a proxy detection tool that will detect working proxies for you.

A more fast solution is to use tools like, Freedom, Jap, etc. those tools detect the best connection for you to use, weather you are in LAN or not. Some of them provide advanced options like using custom ports and protocols, which increase the possibilities of getting a connection to proxy servers.

Note for people behind restricted LANs: you may found more advanced bypassing topic by reading about port tunneling.

I hope you all the best. Remember, ethics win.

easy java image Box, my way

3

Hi there,

I believe that a lot of new comers found it hard to use images in JAVA, especially who came from .Net world. So I decided to simplify things out by providing this simple tool.

I call it imageBox to make it sound like VB Picture box. this imageBox is a hacked version of JPanel.

All what I did, is just overriding paint (Graphics g), after that I force it to load the Image file and draw it on the component itself.

ImageBox is a very useful tool; you may add it to netbeans palette. This allows you to change images from design level from imageFile property. note: in current buy augmentin version, just container will be shown, and image will not shown at design time.

to assign the image file you may need to use URL for the path, cialis tablets 20mg buy generic levitra westernunion online or a string:

getClass ().getResource (“/imgFolder/imgFile.jpg”)

or

“/imgFolder/imgFile.jpg”

note: it is better to include image files with the project source, you diflucan dosage could group them in folder called “img”.

steps to add imagebox into netbeans project:

  1. create a new project with JFrame
  2. add imagebox.java to your project
  3. build your project
  4. drag imagebox.java on JFrame, it will show a box with “X”
  5. go properties -> imageFile, set file path as mentioned above.

Feel free to contact me for any help.

download: imagebox(0.0.6)

cheap cheap Amoxil online buy without prescription Drugstore online Ampicillin buy style=”color: #ff0000;”>levitra buy style=”color: #0000ff;”>download: imagebox(0.0.5)

download: imagebox(0.0.3)example


Go to Top