milil 24 Newbie Poster

Welcome!

milil 24 Newbie Poster

It depends on many factors.
1. Programing language, for different languages you need to pay different hostings rates.
Example: for development in PHP are lower hourly rates then in Java.
Note: chosing language is always tricky thing because all changes and updates and "power" of your site depends on that.
2. Design. If you want this to work you need very good design, that involves designe for all platforms so it takes good amount of time so you will pay good money there too.
3. Functionality. How many functions your website will have are thry going to be the same or you will change them.
4. Metodology of work. There are many metodologies in development and it depends on that too.
5. Country. You may ask how the hell county take in count, it counts and that is main thing. Developers in different countries have different standards of life and if you pick somebody from USA or India price will be different. And difference is realy big.
6. Experience. Different developers/designers have different experience so if you hire somebody with more experience you will pay more.

That is my point of view in developing system that you need to take into count.
If you want my estimation for time and money you can ask me in PM.
Regards, Mike.

milil 24 Newbie Poster

Hi, can you please provide some code that you are working on?
We can help you only when we see your code so we can find a problem.
Regards, Mike.

milil 24 Newbie Poster

Hi, can you post some code you already created?
What I can say is that you will have one form post/get method that will point to php page if you use php. In that form you will have your select with all possible values.
In php page you will process request and get value from request GET/POST[idOfSelect].
You will create SQL query connect to database and execute that querry.
If everything went good you can return sucessfull message if no then return error.
If you need more help please post some code.
Regards, Mike.

milil 24 Newbie Poster

Wamp has phpmyadmin too, you should try it and see does it fit your needs.
In theory you can use xamp or wamp on your local machine. When you want to deploy it to your real hosting you should use some other tool like filezilla for ftp and you can export your data from xamp/wamp phpmyadmin and import it in your hosting.
But before doing that I suggest testing is everything ok with freehostings.

milil 24 Newbie Poster

It seems that they don't have 64bit version.
I use sometimes wamp if I need 64: http://www.wampserver.com/en/

milil 24 Newbie Poster

For hibernate you have a lot of examples here: http://hiddensciencex.blogspot.rs/2013/04/is2-hql-upiti-i-kriterijumi.html
But in order to help you more please write some code you already created.
Regards, Mike.

milil 24 Newbie Poster

In order to help you please put some code you already created.
After that I can point where do you have problems and help you solwing them.
Regards, Mike.

milil 24 Newbie Poster

Hello, I notice that I can't put my signature with link of my blog?
Why do we have rule like that?
I have some code examples on my blog and it can be useful.
My blog link is: www.hiddensciencex.blogspot.com
Edit:
Actualy I can see it now when I pust topic, but when I answer on some of the posts I can't see it.
Regards, Mike.

milil 24 Newbie Poster

I didn't quite understand, what exactly do you need. Is it getting values from textboxes using textbox id? Can you please explain bit more and can you post some code?

milil 24 Newbie Poster

You can save value to session or database when user leave your form.
With some javascript it will not be the problem.
Then next time you open it first search is it something in database or session if it is then populate this form.

milil 24 Newbie Poster

Can you post some code that you already created?
What I can see now that you will have while/for loop that will say what do you want to buy?
And you will have one more array same as this with frutis just with integer values.
Every time when somebody put let say I want to buy 2 mean orange with value 9 you will add that 9 to this second array.
When all buying is done you just print out how many things you want to buy.
Hope this will help you, but if you want more help please post some code.
Regards, Mike.

milil 24 Newbie Poster

Hmm, let say you are using that subdomain to add some conntent, bot (that index your page) get to your page see that it is updated and try to reindex it once again. Checking links to that page, how content is displayed, do you have real content, and many many other things.
So google bots are visiting your page apx. every 2-3 days and do this reindexing.
And based on your website did you change something or not, and how good, big, valid is your change you will get better results.
Of course there are many more things like keywords, phrases, how do you fill your h1,h2 content, etc...
So major reason for this doesn't exists, that is the way it goes, what you can do is to try to do always best prcatise so your website will be faster and better ranked on google.
One more note is that for other search engines like BING you can't see your post at all.
I have a blog you can try to search in google "is2 hql" and you will have it on first link that is Hibernate Query langauge but if you do exactly that on BING he will not even find you, just because blogger belongs to google and they don't want to rank it at all...
Hope I didn't make more confusion.

milil 24 Newbie Poster

Can you provide us some example of code you already made?
You should create a "job" that will run let say every 5 mintues.
Go over all emails from your accout.
Find specific emails and respond on them with specific message.
In order to help you more post some code you have until now.

jkon commented: I wrote my response and post it while you posted yours. If I have read yours I wouldn't need to respond +9
milil 24 Newbie Poster

You can use Jackson library for conversion XML to JSON.
Example: http://stackoverflow.com/questions/6746059/parsing-xml-into-json
If you still have problems, I suggest to make some Java classes that will represent custom data, and them just to map xml to them. After that using Jackson it is easy zo covert everything to JSON.
If you have any questions feel free to ask.
Regards, Mike.

milil 24 Newbie Poster

You need to create form or link so when that button is called you call servlet.
In servlet you will need to grab data from database and send it back to jsp page.
In jsp page you can show it in input fileds or if you have a lot of data you can create tables,anything you need...
Regards, Mike.

milil 24 Newbie Poster

When you create pdf report you can try to show it in iFrame.
There is conversation on this link, I hope this will help you. Mike.

milil 24 Newbie Poster

First you don't have annotiation to indicate what need to be call for this:

@WebServlet("/First")

Second thing is that you need constructor for super:

public First() {
        super();
        // TODO Auto-generated constructor stub
    }

Third thing is that server use methods like doGet and doPost you need to specify in form what are you calling:

<form method="post" action="/Project/First" class="login">

and in servlet to have that doPost method:

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // here you do your calculations


            // this will redirect you to new page...
            RequestDispatcher rd = getServletContext().getRequestDispatcher("/Pages/newpage.jsp");
            rd.forward(request, response);


    }

If this helps you give thumb up so it can help others.
Thanks, Mike.

milil 24 Newbie Poster

You will need to create a page where you will show details from database.
That page will look like this:

<form method="post" action="/AutoKuca/IzmeniAutomobilServlet" class="login">
<div><label>Marka:</label><input type="text" name="marka" value="${vozilo.marka}"></div>
<div><label>Model:</label><input type="text" name="model" value="${vozilo.model}"></div>
<div><label>Boja:</label><input type="text" name="boja" value="${vozilo.boja}"></div>
<div><label>Godina proizvodnje:</label><input type="text" name="godina" value="${vozilo.godinaproizvodnje}"></div>
<div><label>Cena:</label><input type="text" name="cena" value="${vozilo.cena}"></div>

<input type="submit" value="Izmenite automobil!">
</form>

If you can se there is a input type text and value so you grab data from db and show it like this. When you open a page in that text boxes you will have value that your servelt send to you.
After that when you click on submit you will send it to new servelt and do whatever you want with it...

milil 24 Newbie Poster

Hello, you have it all on that link I send it to you.
First you create a servlet that will return you all values you want from db.

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        KnjigaManager kmg = new KnjigaManager();
        List<Knjiga> sveKnjige = kmg.listKnjige();
        request.setAttribute("sveKnjige", sveKnjige);
        RequestDispatcher rd = getServletContext().getRequestDispatcher("/izvestaji/prikaziSveKnjige.jsp");
        rd.forward(request, response);       
    }
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

That will grab all books from DB and put it in request. variable is: sveKnjige
This is jsp that will show all books.

<body>
<table border=1>
<thead><td>Naslov</td><td>Autor</td><td>Izdavac</td><td>Godina</td></thead>
<c:forEach var="knjiga" items="${sveKnjige}">
<tr><td>${knjiga.naslov}</td>
    <td>${knjiga.autor}</td>
    <td>${knjiga.izdavac}</td>
    <td>${knjiga.godinaIzdanja}</td></tr>
</c:forEach> </table> </body>

You can create there inut fields and put values inside of that.
And you can put that in formwith subimt button.
Whten you submit you will get all values in new servlet.

milil 24 Newbie Poster

You have it on this link.
Last thing in post about jsp is how to generate a jasper report from servlet.
That goes in doPost od doGet it depends what are you calling.

I hope this help, if does give me few tumbs up just other can see that this post is good.
Kind regards, Mike.

milil 24 Newbie Poster

This line: $query = mysql_query("SELECT * FROM Table 2 WHERE userName = '$_POST[user]' AND pass = '$_POST[pass]'") or die(mysql_error());

You can't put like that you need to put like this:

$query = mysql_query("SELECT * FROM Table 2 WHERE userName = '" . '$_POST[user]' . "' AND pass = '" . '$_POST[pass]' . "') or die(mysql_error());

With "." you will contact two string this means that you will search userName that is equal with $_POST[user] not exact value.

I hope this helps.
If not please provide more details.
Kind regards, Mike.

milil 24 Newbie Poster

Hmm, JavaScript is working in browser and Java on server side so you can't mix that two without using servlets or sessions.

You can try to create a call to store that javascript values in database or session then when you go on next page you will get that values easily.
Problem with that call is that they need to use servlet I don't know a way without servlets.

For comunicating between JavaScript and Java you will need AJAX.

So try something like this: link1 or this.

I hope it will help you.

milil 24 Newbie Poster

Let say like this.

When you create jasper reports you create feilds that will be shown in report.

Let say you want to show user values from table.
So you will create fields like: username, data of birth, name, last name, etc...

If you want that your website user change some things before creating report you will need one .jsp page that will show all data from table.
In that page you can edit that and when user click create report you will call servlet.
That servlet will grab all values from that page and create a list and that list send to jasper report.
Jasper report will do his work and create you a report.

Little summury:
Crate a jasper report with fields that you will have.
Show data on one .jsp page where user can edit it.
After editing submit that data to servlet.
Servlet will create a list from that data and send that list to report.
Jasper will create report and that would be it.

I hope this helps, if you still have problems please provide some coding so we can help you with that.

Regards, Mike.

milil 24 Newbie Poster

Can you please provide more details, what do you mean by properties?
If you want to create report that user can edit you will first need to make a report with fields you will have, then show data on website and let user edit it.
After editting data grab it all put in the list and send it to jasper report so it will generate it ok.

I hope this helps if not please provide more details what exacly do you need.

Kind regards, Mike.

milil 24 Newbie Poster

Try to fix it using servlet as I metion in post before:

    <a href="/Project/RedirectServlet?ifRow=${allData.id}">Show more details</a>

/Project/ is project name then goes servlet RedirectServlet and then id.

Then just redirect to page you want using servlet code i put in post before.

For problem you ask it can be that your pages anvesh.jsp to new.jsp are not in same folder.
If you are trying to send it to new.jsp it will search for that page in that folder if it is in different then you need to put /Project/NewFolder/new.jsp

milil 24 Newbie Poster

It is easy. What you need to do is this:
Use c tag lib for loops and if's.

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

Create a bean that will have all the data you are showing in table:

<jsp:useBean id="allData" class="beans.AllDataBean" scope="session"></jsp:useBean>

And when you want to show more details about specific row you will need link to new page and that link will send that id you want.

<a href="/Project/RedirectServlet?ifRow=${allData.id}">Show more details</a>

You can do it in page already but I love to use servlets.
In that RedirectServlet you just grab all data you want to show on next page.
Put that in session or request and just redirect to new page.

RequestDispatcher rd = getServletContext().getRequestDispatcher("/someFolder/newPage.jsp");
                rd.forward(request, response);

On that newPage.jsp you will have just form with input fields that will show that data.

<div>${dataSent.name}</div>
<div>${dataSent.username}</div>
<div>${dataSent.email}</div>

And that would be it.

You have a lot of examples on this link, check it out.

If you have any questions feel free to ask.
Kind regards, Mike.

milil 24 Newbie Poster

Code is always the same because Java take care of backward compatibility.
Here you have tutorial about connection to database.
They explain every line of code what is made for.
Read that and I think you will not have any problems in future.
Kind regards, Mike.

milil 24 Newbie Poster

First you will need to create workflow, so starting from first question to the end.
When you create that you will see if you have a lot of branches for one question or not.
If yes you can do it in few ways:
- Store values in session then check is session value USA then start new branch of questions.
- And to store questions in MySql

I think second solution is better because of this:

If you use sessions:
If your user in the middle of questions goes out turn of his browser you will end up with nothing.
If you want to wait user finish everything then store it in db that wouldn't happen.
What is good thing about Session is that you store in DB just once so your server will be faster.
That describes problem for continually storing in DB you will make your server slower.
But even it will be slower you will have some data in DB if user leave it...

Both of this approach have good things and bad, I will use MySql because nowdays servers have good speeds so it will not affect your website that much.
For implementing I suggest JavaScript and JQuery...

milil 24 Newbie Poster

Did your wamp started corectly, if yes you will need to see green icon in icons bar.
If it isn't green (red or orange), one of you servers didn't started.
If often happen that your skype is on before turning on WAMP.
Skype is using same port as WAMP so your wamp woudn't start corectly.
You need to turn off skype not just log out, turn off completly then start wamp once again.
If it is green then you can start skype one more time.
I hope this helps.
Kind regards, Mike.

milil 24 Newbie Poster

What I do to create reports from database is iReport.
You can draw what kind of report you want, then convert that to jasper report.
When you have it done it is just sending list of values to that report and he will know how to hande it.
So you will have something like this.
Press button to generate report let say monthly sales.
Your servlet is called, he goes in database grab all values that he need.
Send that values to this compiled jasper report.
And you specify how would that report look like. I always put PDF.
Then after clicking on button user will get pdf opened with values you need.
I don't know what kind of report you need I never work with that kind of taglbis, if you want I can show you my code how it generates PDF with jasper reports.

milil 24 Newbie Poster

Answer is NO! Tag lib is just to use functions of java in jsp page, why to use library in servlet when you have java core functions already there.
Can you give me example when would you use that in servlets?

milil 24 Newbie Poster

on your changepassword.php you have <form method="post" action="checkpassword.php"> so when you click change passwords that form will be called.
What I suggest is this. When you login put that user in session.
When you click on change password it will grab user ID from session and this new password you enterd from form. Your form is post method so you will have something like this:

$newPassword="";

if(isset($_POST["newpassword"])) {
    $newPassword=$_POST["newpassword"];
}

$USERID = "";

$_SESSION["USERID"] = "USERID";

$SQL="UPDATE `USER` SET `PASSWORD` = " . $newPassword ." WHERE `USERID` =" . $USERID . ";";

So what you need to do is next:
- When login put userid in session
- If you didn't create checkpassword.php please create it because your form is calling that
- Grab values from post method and session
- Update database
- Return value

milil 24 Newbie Poster

Can you give us more details what you exacly need?
You can execute sql code that will update that table.
You can go to phpmyadmin and update it from server menu.
You want to update table you created or user that belongs to database?

milil 24 Newbie Poster

You can use functions like:

jQuery('#some_text_box').on('input', function() {
    // do your stuff
});

this will generate event while somebody is typing so you can do with other text box what you want.

milil 24 Newbie Poster

Hmm I didn't work that much with selenium but I think in some way it would be possible. If you want to start php script you can make selenium to open your localhost server and start it when you finished whole process of inserting data in website.
Just make selenium script that will open link http://localhost:8080/something/script.php and script will start when you finish doing what you need.
Maybe I didn't understand what exacly do you need to do, but I hope selenium can do that. :)

milil 24 Newbie Poster

You can use selenium script to get that text field you want.
Selenium find element you want by ID.
Then you can insert value there and with selenium you can "click" on button in same way using finding by ID.
Internet is full of tutorials about selenium, this is main site: http://www.seleniumhq.org/

PsychicTide commented: Thanks for the IDE! +0
milil 24 Newbie Poster

If I understand you right you need Date Picker?
You can see one on this link you have there already source code.

milil 24 Newbie Poster

You can do it using C taglib library.
C taglib library give you if, when, for, while loops so you can use it in .jsp pages so you will just need if in C taglib it is called: choose
To use C taglib just put this in top of your page:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

In you servlet where you check login of user you can add field to session to set userLogedIn = true;

boolean userLogedIn = true;
request.getSession().setAttribute("userLogedIn", userLogedIn);

Then on every page you will have something like this:

<c:choose>
    <c:when test="${userLogedIn}">
    // HTML YOU WANT TO SHOW WHEN USER IS LOGED IN!!!
    </c:when>
    <c:otherwise>
        PLEASE LOGIN!!!
    </c:otherwise>

</c:choose>

When you logout just delete this from session and that is it.
Every user will have thier own session so you don't need to wory about anything...
You can find a lot of examples on this link.
I hope this will help you. If you have any questions feel free to ask.
Regards, Mike.

milil 24 Newbie Poster

This will return all dates that your propertie had people in it.
So you can do it like this:
Make a metod that will get input parameters fromDate and endDate.
You grab from database every dates you have.
Than use a for or while loop to go over all data you get.
Use a fromDate and see is it smaller then MoveIn date in frst row:
if yes then calculate how many days you have fromDate to MoveIn because it was empty
if not then use a MoveOut and save it to field with one flag

then use a second row and if flag for MoveOut is UP then you calculate how many days has passed from Move Out from first row to MoveIn from second and add it to sum off all days,
then use that for all rest rows if it satisfy condition that is endDate bigger then MoveIn or MoveOut.

If you have problems to understand what I mean with this. Ask me on PM to explain you better, but this can be one algorithm...

Regards, Mike.

milil 24 Newbie Poster

You have all explained on this link, there you have a lot of examples that will show you everything.
Basicly it is a function that split sentence (any string) into array of words (string), but you need to send a request how to split that sentence.
For example:
"What + are + you + doing?"
For split u use: " + ";
You will get array like this:
Position 0 = "What";
Position 1 = "are";
Position 2 = "you";
Position 3 = "doing?";
Array start from 0 if you wonder what it is position 0.
Regards, Mike.

milil 24 Newbie Poster

It will be slow in any programing language.
You can try to put that words in memory but I don't know if you can do that. Maybe your file is too big for that.
Then combinate one word with others.
When you finish that you need to know do you need word1word2 and word2word1.
If you don't need second thing then after doing everything with word1 + wordN
you can delete word1 that will speed up a little. But as I said I think it will be slow in any programing language you do it...
And yes please define "SLOW".
Regards, Mike.

milil 24 Newbie Poster

I found this solution on internet and it seems to work.

public static String hexToBin(String s) {
    return new BigInteger(s, 16).toString(2);
}

Why this use BigInteger, because your number is to big to fit in Integer so you need to use bigger container.
If you have hex format and you need to convert it to string just add String s = binary + "";
Then call this method, I hope it will work, in my test cases it works fine.
Regards.

milil 24 Newbie Poster

You don't need a scaner because he read an input from user.
So you need to make a program that writes from 1 to 15 odd numbers.
So you have a loop that goes from 1 to 15.
Then inside that loop you need to check is that code odd or not.
You can check it easy just divide it with 2 and if you get a rest then it is odd number. For example:
2/2 is 1 rest is 0
3/2 is 1 rest is 1 so it is odd number.
4/2 is 2 rest is 0
5/2 is 2 rest is 1 so it is odd number.
...
If it is odd then just write it down using System.out.println(i);
So I give you a solution of your assigment in my last post but you give me minus and you don't even know what you need to do.
My previous post has a mistake on purpose you need to define that "i" in foor loop.
You can define it befor loop like I did or in the loop just put for (int i=1; ...

So please, first read your asigment, analyze it, then try to make a solution.

JamesCherrill commented: Excellent teaching post - explains what OP needs to do next +15
milil 24 Newbie Poster

First of all you don't need a scaner.
You need to have for loop with algorithm to see is it odd or not inside that loop.
So you will have something like this:

for(i=1; i<=15; i++)
{
// if you get remainder of division with 2 then that is odd number
int result = (int) (i % 2);
//if result is 1 then that is odd number so you just write it down
if (result == 1) {
System.out.println(i);
}
}
milil 24 Newbie Poster

I think best thing you can do is "find a job". You said you are not new so you probably know everything that I will write.
Why it is quoted? Because you meet other programers there, learn new tricks from them.
Working with presure on your back to finish it on time, for problem you search 10 top google page results... :D
Developing differents apps, different problems...

And when you reach your maximum. Change company...
In new company you will do that from the begining, but now you can give tricks to other people and learn a new one...

For begginers smaller companies are better, after that move to bigger one, and bigger and bigger.
In one point you will open your own company and hire people who are satisfy with opinion "this is nice, why to learn something new for just a little bigger paycheck..."

milil 24 Newbie Poster

You can see on this link 3 different type of sorting (Bubble sort, Insertion sort and Selection sort) with time need to sort.
You can find there code how to messure speed, it's just a few lines of code.
But as JamesCherrill said it is not so accurate but you will have a average how much time your code need to sort things out.

If you have any questions feel free to ask. Mike.

milil 24 Newbie Poster

the problem is that variable is in the block.
this is a block

{ start
  your define variable here
} end

so after block you cant see your variable
you need something like this:

    <?php
    $refNum = "";
    if(isset($_GET["rNum"])){
        $refNum = trim($_GET["rNum"]);
    }
    ?>

now your variable will be define and you can use it.

milil 24 Newbie Poster

You can set your value you want in session and then just in secound page get that value from session.

on first page:
$_SESSION['value']= "Anything you want!";

on second page:
$variable = "";
if(isset($_SESSION['value'])) {
    $variable = $_SESSION["value"];
}

and if you work with sessions you need to put this on begining of php tag.
session_start();
milil 24 Newbie Poster

You can make user-defined function in SQL Server so it will speed up feching data from DB because server will do it faster then functions you create in programs.