castajiz_2 35 Posting Whiz

For the last 5 months I've tried to organize myself and my friends in order to collect some relevant information on news sites (information about global warming, pollution, ecology etc.)
The only solution that I've found was to use a local search engine from the news site and type in adequate keywords which are mentioned inside the parenthesis above. After that, articles would appear and the only way to collect some relevant sentences is to read the whole text or again use the CTRL+F and type in the criteria words.

Unfortunately, it worked only for a few days because we were getting tired of doing this. I've calculated that it would take us a long time to achieve what we wanted.

Before the project had started I was thinking that the best thing would be to come up with an artificial intelligence algorithm which would save us 80% of our time. I don't see any other good programming approach apart from looping through the text and getting the senteces with the relevant words, but the same thing is done with CTRL+F.

I don't want to make this post too long. I would be very glad if someone could tell me how to approach/tackle such problem (efficiently collect data on news site). Is AI worth it? If yes what type of AI would I use to do this or should I use another approach.
I would also consider tagged languages to solve my problem. If there is a better …

castajiz_2 35 Posting Whiz

Hi there,
I' ve got some data in my database and I' m using PHP to fetch it and would like to transport it to client side via JSON.
The problem that I'm facing is the folowing:
I have a timeline which was built in html and css and I would like to store the data from the database to the timeline. What is the best approach on tackling such a problem?
please consider that I have to do some sorting on that timeline (I would like to store the data on the timeline depending on the year, going from the latest to the oldest year).

I'm not asking for any code or so just to give me some suggestions on how to tranfer the data from server to the client, manipulating at the client side ect.

castajiz_2 35 Posting Whiz

On what platform are you building your app? Are yout trying to move your data from the datagrid into a list or from a list to a datagridview?

castajiz_2 35 Posting Whiz
castajiz_2 35 Posting Whiz

But, make sure you hold on to your sanity and don't become detached for reality like many of those uber-intense SO members.

Your last sentence is absolutely true. I feel like this reality detachment is slowly rising in me.

castajiz_2 35 Posting Whiz

Tnx to all of you for replying to my post.
@Dani, I'm aware of the reward points and the money, but I can't help myself. StackOverflow (StackExchange) just took me.... Altough I think you and your team made this community so much better than it was 3 years ago not to mention the repliers who give wonderful answers.

castajiz_2 35 Posting Whiz

I've started here at DANIWEB almost 3 years ago. Helped a lot of people altough most of them did not give any feedback (votes, mark question solved ect.). I must say that DANIWEB created me as a programmer in one way. I still remember spending 3 and half hours on a thread helping someone whom I don't know and eventually made a solution. These type of threads put a lot of knowledge into my mind. I would rather have spent my time solving threads at Daniweb than building some kind of project for someone or myself. Every spare time I had was given to this forum.

Things have changed, more and more projects came, university tasks which were related and non-related to programming, less time for solving online forum problems.

Going back in time, time when I actually started actively programming (4 years ago, altough first encounter was long time ago, done some html, css as a kid). Today, every thing seems so trivial (built a lot of big projects for various platforms, made "impossible algorithms for me" possible and still not thinking that I'm a great programmer and never became ridged (full of my-self) in any way, but I can definetly say that I can build things.

Sorry for the introduction and Of course, this is not what the question is about.

Someting bothers me. I ve switched to Stackoverflow, the most popular programming Q%A. Things are hard there, I believe that most of you know how things function …

castajiz_2 35 Posting Whiz

I believe everyone heard the news from November the 11th-"Opening up Visual Studio and .NET to Every Developer, Any Application: .NET Server Core open source and cross platform, Visual Studio Community 2013 and preview of Visual Studio 2015 and .NET 2015".

Maybe some people will disagree but I think that Visual Studio is the best IDE ever developed. I was never a fan of Microsoft but Microsoft is always present (software, programming languages) at universities, high schools, aditional education ect... For this reason I've chosen C# to be my primary language (sorry for going of topic).

After I read this I asked my self a reasonable question. Does this mean that most of the developers will switch to Visual studio? Also, since you can now develop for IOS, Android from Visual studio, does this mean that Eclipse and other IDE-s will eventually go down? And my last question, Does this mean that ASP.NET will take web apps and more&more Developers will switch to Visual studio since there will be no license and therefore save their money?

Please state your opinion.

castajiz_2 35 Posting Whiz

This could as well help you http://www.dotnetperls.com/datetime-parse

castajiz_2 35 Posting Whiz

Instead of

 where (dtCutOffDate.Subtract(dt.Field<DateTime>("Date")).Days) >= iStartRange
                 && dtCutOffDate.Subtract(dt.Field<DateTime>("Date")).Days <= iEndRange

Just add a '?' character.

 where (dtCutOffDate.Subtract(dt.Field<DateTime?>("Date")).Days) >= iStartRange
                 && dtCutOffDate.Subtract(dt.Field<DateTime?>("Date")).Days <= iEndRange

You should avoid the exception now.

castajiz_2 35 Posting Whiz

Hi,

I have developed a application for students that retrieves data (eating menus) from a official eating website of the whole University (13 restaurants located around the city). Actually I spend a month and a half of doing some reconnaissance and programming (getting information of that site) so that I could develop strong algorithms so that if they somehow change the html tags, position or anything else, my app will still work. There have been previous attempts of other people that had the idea (and programmers behind which had knowledge) of providing real time eating menus to students but they would't give them a contract to get raw data which would be easy to implement into an app with maybe not more then 50 lines of code. No one had the courage, to fetch the html data and said that this would be a never ending story and almost imposible and that the app would quickly fail.

The app (windows phone, android) works perfectly and I have put in on windows phone store but have hidden until next monday waiting to solve some bugs and release the official version (wp8+, android 2.3+)

My question is. Is this legal? and will their servers crash more frequently due to frequent html downloading from the app users? Could I get into trouble?

My app is completely free and I' m expecting 5000-10 000 users to dowload and use the app since there is a high interest for the app and since it is …

castajiz_2 35 Posting Whiz

Thank you Mike for putting so much effort to answer my question!

castajiz_2 35 Posting Whiz

For the past 3-4 years I can say that I m very active in programming (programming on daily bases and trying to compesate my education wich is not 100% related to programming). After this 3-4 years of daily programming I can say that I feel like I can make anything but would never call my self a excelent neithger a good programmer because I know that out there are guys which are insane programmers...
Neverless, I wanted to ask when can someone call himself a programmer or someone say that he knows some programming language, I now guys that had lectures in c# and have done NOTHING in therms of projects and say that they know c# or some other languages which makes no sense what does actually mean when someone says I know a programming language? How can you measure programming knowledge or can you?

castajiz_2 35 Posting Whiz

What you want to achieve can sometimes be highly complicated. I recently made a useful aplication for students which allows them to see the current eating menu. other people tried to do that as well but couldn't get a permission to access their "database" which is the easiest thing to require rather then exploring the website. First I spend two weeks on their website to see how the data is presented and what is the best way to fetch this kind of data and ensure that the app doesn't crash. My app is now fine but if they change something drasticaly then I would have to make a big remake. So first download the html data use async, task, await, for such operation (have a look at async programming in c#, this is a must learn topic!) than try to point to the specific keywords to retrieve your data and then fetch out the inside content of the html tags...

castajiz_2 35 Posting Whiz

Hi,
I was wondering if anybody is willing to share some information on how much can you earn from implementing add ons to your application? I know that I can not find such info on the web so I want to ask people who actually earn from app advertising. And one other thing, wich I found more important, can anyone provide some info or calculation on how much would I earn by 1000 app downloads and implementing advertisment.

castajiz_2 35 Posting Whiz

Try to google first if you are having any problems. The code is quite large... When you get stuck wiht some piece of code that repost and everybody will be glad to help you...

castajiz_2 35 Posting Whiz

You should be following the advice of Oxiegen and see the behaviour after the iteration. Otherwise, please post a little bit more of the actual code. Also on every postback your list variable is destroyed (there are no public variables in ASP.Net) I'm talking about webforms (do not have expirience with MVC, but i think that this is not the case with MVC) but that shouldn't be the problem here. One other thing, which object are you actually using to display your list??

castajiz_2 35 Posting Whiz

Correct!, I've found what I needed.
Click Here

castajiz_2 35 Posting Whiz

I would like my app to go to another page when i slide it horizontaly. I don't know the appropriate name of such an action and therefore am not able to find any refference on google. Can anyone point out the keyword that I missing and give some links for Android and Windows Phone primarily so I can have some insight on the acutal code which allows such actions to be done.

castajiz_2 35 Posting Whiz

Try with putting the Listener_button event in the OnResume() method, and then see if it works...

castajiz_2 35 Posting Whiz

I'm sure You will figure it out with in depth given explanation. Have an attempt and then if you are still not sure and if you still get errors, come back with the piece of code instead of entire class and help will be surely given to you.

castajiz_2 35 Posting Whiz
  1. Error--> I do not see a method called IsString
    2- Error--> Method IsWithinRange accepts only four arguments so you have to assign 4 arguments once you call your method, not six as you did it.
    3- Error--> if you have a method that is NOT void then you have to specify the return keyword! so I suggest to put some return keywords inside your Calculation method.
castajiz_2 35 Posting Whiz

Use the free packet and download a sql server managment studio. https://somee.com/default.aspx
Once you create your webiste you can you use login information from the website and manipulate with the database program which you have to install on your hardrivev (sql server managment studio),

castajiz_2 35 Posting Whiz

I'm sorry I thought that you have a database involved. Just use a for loop and inside your for loop check if the id matches the user-input, if it does then print out the information or whatever you want to show to user.

for(int i=0; i < Oeuvres.Length ;i++)
{
   if(nb_element==your_id)
   {
      Console.WriteLine("Info");
   }
}  
castajiz_2 35 Posting Whiz

Well convert it then, I don't see where the problem is. Once you are done with the conversion, use that same variable (converted) to pass it into your query. You have plenty of examples online, one of them:http://www.dotnetperls.com/sqlparameter
when you attempt something, then post your code here if you run into trouble.

castajiz_2 35 Posting Whiz

No errors are shown, all the instructions have been folowed this is fourth app that I have uploaded, everything worked fine previously. The thing is that I'm reading HTML from a webpage. I don't get any erros whatsoever on the emulator, but it seems that I can not fetch the data on the actual device. I'm stuck in a deadpoint where I don't know how to move on since no erros are show (as mentioned before).

castajiz_2 35 Posting Whiz

The title says everything, I was searching through google why this is the case but haven't been able to find any answers.
Any reference would be greatly apreciated...

castajiz_2 35 Posting Whiz

I did that tnx

castajiz_2 35 Posting Whiz

I ve made an windows phone app in c# and now I m making equal android app. I ve come to the problem where I have to compare some times. In c# there is a well known TimeSpan class but I see that java(Android) does not have such class.
Could anyone tell me how could I approach such problem. The thing is that I m running out of time and I would like some decent answers if possible.

castajiz_2 35 Posting Whiz

How is such code implemented in a device?. I suppose i could implement this only in Windows phone device or am I wrong.

castajiz_2 35 Posting Whiz

Then try with both. Install eclipse and write some code, install VS. and write again some code. See which suits you better. The thing is that you can not make a decision at first but after a few months you'll be able to tell by yourself. For me Java is better compared to c# but the sourouding (Eclipse) is not. I can not think of a software development software which would beat Viusal studio... that is why I sticked to C#.

castajiz_2 35 Posting Whiz

Thank you for all of your responses, you really helped a lot of time. I ll see what I can do, I m gonna take a look at responsive web design...

castajiz_2 35 Posting Whiz

I developed a website actually a simulation of a program on my 17.3 inch laptop. When I come to another machine for example a 15 inch laptop witch has a different screen size(diagonal) my html tags won't compensate, so I have to scroll through the website to see all my html tags(for example boxes etc...) Is it because i applied absolute positioning and should I change it to relative or is there something else that I should take care and be aware?

castajiz_2 35 Posting Whiz

have a look at this:
Click Here

castajiz_2 35 Posting Whiz

This shouldn t be too hard to do. Altough I m not sure what do you have to do in the end. Do you have to have the html in your PDF with the tags included or is it just the output of your html that you have to have in your PDF?.
Have a look at this link to get you started
Click Here
and type itextsharp into youtube to see how it works in action.

castajiz_2 35 Posting Whiz

Well once you get your data you can also improvise like this

foreach (DataRow row in name.Table.Rows)
{
Response.Write("<tr>");
                Response.Write(String.Format("<td>{0}<br/><br/></td>", row[1].ToString().Replace(Environment.NewLine, "<br/>")));
                Response.Write("</tr>");

Try to rearrange the code using your desired html tags..

castajiz_2 35 Posting Whiz

Maybe you should put your images into a list or a array and then loop through them once the paint event fires. Other than that I can not find any bug in that code. I suppose that you are developing something for tablets and you have a sdk equivalent to that. It is hard to reproduce the code as I don't have access to dll's. Anyways, try the list thing.

castajiz_2 35 Posting Whiz

You have to post more code for sure. At first I tought that you previous image is covered by the next image but i see that you have a "dynamic" variable i witch actually makes the other images next to the previous images(you are changing the position for the drawing point if I m correct). Please post more code.

castajiz_2 35 Posting Whiz

Yeap, I don't know how i missed that.
If starting from the top to bottom wouldn't then this be the most accurate way to rephrase your sentence, or is there a more accurate way since all the numbers are sorted. Am i missing something?

castajiz_2 35 Posting Whiz

I m sorry, my for loop had to start at i=2;
-Would'nt the output be the same if i reverse the list and start from top element?

castajiz_2 35 Posting Whiz

I ve been searching for various algorithms for the past few days and I came accross this one.
Is this the right solution to it (Greedy algorithm), or am i missing something.

 static void Main(string[] args)
    {

        int[] array = new int[71]{
        72, 79, 84, 46, 14, 4, 62, 88, 58, 21, 16, 27, 13, 52, 96, 70, 28, 75,
        76, 45, 5, 71, 43, 87, 64, 95, 72, 22, 43, 15, 25, 70, 64, 93, 56, 90,
        84, 31, 49, 71, 29, 46, 6, 17, 81, 21, 75, 44, 2, 45, 67, 57, 93, 72,
        39, 74, 43, 53, 40, 45, 87, 23, 44, 52, 1, 56, 32, 26, 32, 67, 41};
        Array.Sort(array);
        List<int> lista = array.ToList();
        List<int> A = new List<int>();
        List<int> B = new List<int>();
        A.Add(lista[0]);
        B.Add(lista[1]);
        for (int i = 0; i <lista.Count; i++)
        {
            if (A.Sum() > B.Sum())
            {
                B.Add(i);
            }
            else 
            {
                A.Add(i);
            }
        }
        Console.WriteLine(A.Sum());
        Console.WriteLine(B.Sum());
        Console.ReadLine();
    }
castajiz_2 35 Posting Whiz
 private void button1_Click(object sender, EventArgs e)
            {

            string constr = @"Data Source=PRAVEEN\\SQLEXPRESS;Initial Catalog=travelbooking;Integrated Security=True"; ;
            conn = new SqlConnection(constr);
            conn.Open();
            cmd = new SqlCommand(@"SELECT * FROM travelregi
                                   WHERE name=@im and password=@prezim", conn);

            cmd.Parameters.Add(new SqlParameter("im", username.Text));
            cmd.Parameters.Add(new SqlParameter("prezim", pwd.Text));
            reader = cmd.ExecuteReader();

            if (reader.HasRows)
            {
                reader.Read();


                if (this.username.Text ==reader.GetString(0).Trim() && this.pwd.Text == reader.GetString(1).Trim())
                {
                    MessageBox.Show("login sucessful");
                }
                else
                {
                    MessageBox.Show("failed login");
                }
                reader.Close();
                conn.Close();
            }

        }

If the above does not work then thid definitely should!

castajiz_2 35 Posting Whiz
private void button2_Click(object sender, EventArgs e)
        {
            string constr = @"Data Source=PRAVEEN\\SQLEXPRESS;Initial Catalog=travelbooking;Integrated Security=True";
            conn = new SqlConnection(constr);
            conn.Open();
            cmd = new SqlCommand("select *from travelregi where name='" + username + "' and password='" + pwd + "'", conn);
            reader = cmd.ExecuteReader();
            if(reader.HasRows)
            {
               reader.Read();
                if (this.username.Text == "name".ToString() && this.pwd.Text == "password".ToString())
                {
                    MessageBox.Show("login sucessful");
                }
                 else
                {
                    MessageBox.Show("failed login");
                }
                reader.Close();
                conn.Close();
            }
        }

The problem is the loop thing. You don't need it here but you NEED and you MUST read AT LEAST once through the database to get your data. The database won't read for you automatically you have to give it orders(code)xd.
-I just added a reader.Read();
-you may have to use the trim function to remove extra spaces but first just try the code above and then reply here...

castajiz_2 35 Posting Whiz

I ve been trying for the last 3 hours to get my autocompletetextbox working and tryed all sort of code. My Web service is working from wich I m actually fetching all the stuff but the jquery seems not to work, I m always getting the error when typing the first letter inside the textbox:

Here is the code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Fpz_simulation.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>None</title>
    <link rel="stylesheet" type="text/css" 
href="http://ajax.googleapis.com/ajax/libs/jqueryui
        /1.8/themes/base/jquery-ui.css" />

<script   type="text/javascript" src=
  "http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js">
    </script>  

<script  type="text/javascript" src=
  "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js">
    </script> 
    <script type="text/javascript" >
        $(function () {
            $('#<%= txtStudentName.ClientID %>').autocomplete({
                source: function (request, response) {
                    $.ajax({
                        url: "WebService1.asmx/GetNastavnik",
                        data: "{ 'searchTerm': '" + request.term + "' }",
                        type: "POST",
                        dataType: "json",
                        contentType: "application/json;charset=utf-8",
                        success: function (data) {
                            response(data.d);
                        },
                        error: function (result) {
                            alert('There is a problem processing your request');
                        }
                    });
                },
                minLength: 0
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <asp:TextBox ID="txtStudentName" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    </div>
    </form>
</body>
</html>

I have also downloaded the jquery code and made a refference to it but that didn't work so I chose to get the code with the URL's above.

castajiz_2 35 Posting Whiz

So in other words you re saying that I have to upload my default.aspx along with other files that are needed for the default.aspx to function and then I can add all the other folders(other pages that are linked to default.aspx) But with the correct path(towards these folders) SPECIFIED inside the .cs files?

castajiz_2 35 Posting Whiz

Actually what I did, I uploaded all the files to the root directory without the folders which i had before. Now I m able to see my page but can you please give me a suggestion at least why doesn't the folder thing work. I m sure that it used to work before when uploading everything with the folders along...

The reason why I m asking for this is because i have a Huge project to upload and it would take time and also it would be messy to have everything in the root folder

castajiz_2 35 Posting Whiz

Thank you guys for your quick answer, here is the directory so that you can see and maybe point to towards the error.

castajiz_2 35 Posting Whiz

Hy guys, haven't been here for a while, and I m having a problem that I didn't use to have before.
When I was uploading via filezilla ftp client program a month ago a asp.net built website I didn't have any problems whatsoever.
Now I'm facing problems and always getting the same error altough I did everything(the upload to the correct path) as i used to do before!
Here is the webiste, so please any suggest, some possible modifications that could solve the problems will be greatly appreciated!
http://fpzmobile.somee.com

castajiz_2 35 Posting Whiz

This is an option. It is widely used.
I happened to use it a day ago..

WebRequest request = WebRequest.Create("url");
WebResponse response = request.GetResponse();
Stream current_data = response.GetResponseStream();
string content = "";
using (StreamReader sr = new StreamReader(response))
{
    content = sr.ReadToEnd();
}
castajiz_2 35 Posting Whiz

yea yea i figured it out by now but tnx for the further explanation!