ndeniche 402 Posting Virtuoso Featured Poster

I think it was called something like "Post Spy" or "Thread Spy", or something spy...

Yes!! That one... Actually, I found it pretty useful :P

I imagined it was pretty resource consuming though... But, yeah... maybe a lighter version could be developed

ndeniche 402 Posting Virtuoso Featured Poster

Remember the umm... What did we call it... Anyway, it was a page where the posts made in daniweb were displayed live, moving in a vertical way fading as time passed by... Remember?

ndeniche 402 Posting Virtuoso Featured Poster

Write her a poem using your favourite programming language! :D

You know, I've done that... It's awesome!! :P (Specially when the girl knows her codes)

ndeniche 402 Posting Virtuoso Featured Poster

I have one question though: Whatever happened with the live feed?

ndeniche 402 Posting Virtuoso Featured Poster

But, of course DW does it better!! :P

ndeniche 402 Posting Virtuoso Featured Poster

Remove the parentheses, and leave it

SELECT TOP 1 room.RoomID
FROM room 
INNER JOIN booking 
ON 
room.RoomID = booking.RoomID AND room.[Room Type] LIKE '"& Room_Typetextbox.text &"' AND booking.[Date of Departure] < NOW()

Try the verification statement in the INNER JOIN condition, so it resolves for it on joining the tables, thus showing the results you need

ndeniche 402 Posting Virtuoso Featured Poster

You know... actually that was the reason I joined Daniweb :P

What you wanna do now is do some research about forks, which is calling two or more processes from a main program at the same time (asynchronously)...

Have fun!!

ndeniche 402 Posting Virtuoso Featured Poster

Good one

ndeniche 402 Posting Virtuoso Featured Poster

what you're trying to do is read the lines in the txt file, right?

Try this solution

ndeniche 402 Posting Virtuoso Featured Poster

Problem solved. Stupid me. Checked the connection string property and i didn't put the ';' between password and Trusted_Connection ... so the connectionString was like this: ...;User ID=User;Password=PasswordTrusted_Connection=True *facepalm*

ndeniche 402 Posting Virtuoso Featured Poster

You can use the operator MAX() to obtain the maximum value in a column:

SELECT Record_id, MAX(Date)
FROM COLUMN
HAVING Date < Now()
GROUP BY Record_id
ndeniche 402 Posting Virtuoso Featured Poster

The error number is 18452, and the message, though it is in spanish, says something like Login failed. The login is being made from an untrusted domain and cannot be done with Windows authentication The thing is, I'm not using Windows authentication to connect. I've already changed SQL's connection settings and configured it to use Mixed login

ndeniche 402 Posting Virtuoso Featured Poster

Hello guys.

I'm building an application that connects to a SQL Server 2008 database via connection string. The thing is, since the computer loading the app (or the user, in either case) is outside the Active Directory domain, I can't use Windows Authentication to connect to the DB. But when I include the database credentials, it won't let me connect either, telling me that since the computer logging in is from an untrusted domain, access is denied.

The connection string goes like this:

connectionString = "Data Source=" + ServerName + ";Initial Catalog=" + DatabaseName + _
                   ";Integrated Security=SSPI;User ID=" + UserID + ";Password=" + Pwd

Any ideas?

ndeniche 402 Posting Virtuoso Featured Poster

Using TOP 1 in a query selects just the first record of the query. Changing the number following TOP will show more records

ndeniche 402 Posting Virtuoso Featured Poster
SELECT TOP 1 Columns /*The columns you want to select*/
FROM Table /*The table you're looking in*/
WHERE args = TRUE /*The arguments you intend to evaluate*/
ndeniche 402 Posting Virtuoso Featured Poster

You can try two separate loops: One to check the existence of a word, and the other one to place the word in the grid.

To avoid having the issue you posted, before placing the word, check if the length of the word doesn't exceed the spaces available:

' This boolean will verify if the word can be posted in the
' selected direction (random)
Dim valid As Boolean

Do
   
   ' Here goes the position randomizing algorithm (x = random, y = random)
   
   If word.Length + x > Grid.GetLength(0) Then 'Get the grid's width 
      valid = false
   Else
      valid = true
   End If
While Not valid

' Here goes the loop to add the word to the grid
ndeniche 402 Posting Virtuoso Featured Poster

IMO, the implementationof a database with an AJAX front-end should do the trick (a little hypocritical, since i've ujust done the same thing in my company, but with Joomla)... But since there's much more content (like news posting and bulletin boards), I kinda needed the implementation of a CMS to solve my problem in a faster way.

ndeniche 402 Posting Virtuoso Featured Poster

Since Java is the one i've got more experience, i'd like to start in J2ME

ndeniche 402 Posting Virtuoso Featured Poster

Hello

Recently I've been started to get curious about mobile development, specially Geolocation applications, how do they work and stuff... Can anyone point me in the right direction? What should I study, any references and things like that... Specially the following:

1.- How to implement the imagery (like, can i take it from google maps or something)
2.- Is there a standard database to connect to to determine the device's location, and how to make the device location-aware
3.- How does the coordinate system work

Thanks in advance!!

ndeniche 402 Posting Virtuoso Featured Poster

could you... umm... post a little bit more of your code?

ndeniche 402 Posting Virtuoso Featured Poster

You could create a struct containing a char and a bool , which will be your 'board'. Then you could randomly assign a position for a word and the direction you want to place it in. Then, check through a loop if another word is positioned in the spaces that the new word will occupy, and if one of the results is true, compare the letter located in that position with the letter of the new word that will occupy that possition, and if there's a match, or the loop query comes out false, put the new letter inside of the board.

ndeniche 402 Posting Virtuoso Featured Poster

I differ on the opinion of renaming the [icode]

[/icode] tags, since the tags for placing a code snippet are [code]

[/code], the 'I' in 'ICODE' menaing the 'Inline'

ndeniche 402 Posting Virtuoso Featured Poster

Hello guys... First of all, I'd like to excuse myself for being away for so long (for those who know me from a while ago), but I've been up to soooo many many things lately, that it's been hard to keep up... but lemme say: "I'm baaaack"

Second, as I've not been around for a while, I couldn't help to notice several changes that have been made around here... For instance:

  1. The new design: TOTALLY LOVING IT!! Who's idea was it and who made it? Love the bar at the bottom, the new logo, the colors, everything is pretty awesome...
    The only thing I don't agree with is the location of the "Start New thread" button... Why was it relocated to the bottom?
  2. The upvoting/downvoting system... I finally see it working the way it should be... Congrats on that

There's been a lot going on, and I agree with a lot of the changes that were made... Like the implementation of a Mobile Development forum, love the tag clouds (and the tag clouds per user)... Hope we keep on changing for good!!

ndeniche 402 Posting Virtuoso Featured Poster

have a counter to count the space char ' ' , so that every 6 spaces it adds a new line

ndeniche 402 Posting Virtuoso Featured Poster

You can set your js to refresh every once in a while to recover the latest data from the database. Create a dataset to read the results from the db, and another one to store the one that was used last, and compare the new one with the last one used. If changed, update the values in your page, else, don't do anything.

ndeniche 402 Posting Virtuoso Featured Poster

why don't you store each line of the textbox into an array, so that, on TextChange, you can count how many words are in the actual index of the array, and when 7 words is reached, you pass on to the next line, and at the end of each index, you add a \n for the line break?

ndeniche 402 Posting Virtuoso Featured Poster

uh huh... As far as you've posted, you've got nothing in your code... try a little bit harder, take some code snippets as a reference, google some tutorials, and come back when you've got a real CODE issue, ok?

ndeniche 402 Posting Virtuoso Featured Poster

ok... corrected all details for an optimized code, but that still doesn't solve my problem... what should i do?

ndeniche 402 Posting Virtuoso Featured Poster

I'm building an AJAX application for my company, and in the main screen there is a login form. The login form has a submit button which calls an ajax function that checks with a php page the validation for the login credentials, and sends back a confirmation message. This message is read by a javascript function, and, if invalid, changes the text in a div tag for an error message. If valid, it submits the form to another php page which does the rest of the operations for login (cookie storage, user validation, etc).

The thing is, whe I try to submit my form from javascript, it doesn't do anything. Maybe i'm doing something wrong. Here's an example of my code:

Javascript functions

function submitClick()
{
	var num; // Employee number
	var pwd; // Password

	num = document.getElementById("num").value; // Get emloyee number from input
	pwd = document.getElementById("pwd").value; //Get password from input

	var response; // xmlhttp response text

	if(window.XMLHttpRequest)
	{
		// IE7+, Chrome, Mozilla, Safari
		xmlhttp = new XMLHttpRequest;
	}
	else
	{
		// IE5, IE6
		xmlhttp = new ActiveXObject("microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			respuesta = xmlhttp.responseText;
			valAnswer(response);
		}
	}
	xmlhttp.open("POST", "login.php?n=" + num + "&p=" + pwd, true);
	xmlhttp.send();
}
function valAnswer(response)
{
	if(response=="no") // response generated by login.php query was successful and no matches were found
	{
		document.getElementById("formHead").color = "#ff0000";
		document.getElementById("formHead").innerHtml = "Invalid credentials. Try again.\n<div color=\"#000000\">To start, insert your employee number and password";
	}
	else if(response=="error") // response generated when …
ndeniche 402 Posting Virtuoso Featured Poster

you can always look for your header files in your library folders. Look for the address in the "Options" or "Preferences" of your c++ compiler, or go to the folder you configured when setting it up.

Once you reached the folder, look for the library you intend to study. That should do it

ndeniche 402 Posting Virtuoso Featured Poster

Besides, you can't declare two variables with the same name... see: int num[] and int num

ndeniche 402 Posting Virtuoso Featured Poster

in line 19, you have a semicolon. That should do it

ndeniche 402 Posting Virtuoso Featured Poster

That did not quite solve it, but i stopped using a URLConnection, and just used a url.openStream(), and that didi it... thank you very much!!

ndeniche 402 Posting Virtuoso Featured Poster

I'm not able to capture the response (apparently), because when i read the InputStream (stored in a BufferedReader rd ), the text in my output JLabel is "" , so i guess i'm doing it wrong.

Did you try the link i posted?

ndeniche 402 Posting Virtuoso Featured Poster

Hello guys... I'm trying to develop an application with a GUI that sends and receives data via http, by sending a url via POST and eading the content generated by the url.

or instance, if i send a nick and order number, the server generates a SessionID via html.

My current code is the following:

import java.awt.TextField;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.ContentHandlerFactory;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import sun.net.www.protocol.http.HttpURLConnection;

/**
 *
 * @author Programador
 */
public class UIMensaje extends javax.swing.JFrame {

    private java.util.Map<String,java.util.List<String>> responseHeader = null;
    private java.net.URL responseURL = null;
    private int responseCode = -1;
    private String MIMEtype  = null;
    private String charset   = null;
    private Object content   = null;

    /**Contador de caracteres máximos en un mensaje, y controlador del texto
     * del mensaje.
     * 
     * @param field Campo de texto de cadena del mensaje
     * @param contador Campo de texto de contador de caracteres
     * @param max Cantidad máxima de caracteres en el mensaje
     */
    public void textCounter(TextField field, TextField contador, int max)
    {
        
        if (field.getText().length()>max)
        {
            field.setText(field.getText().substring(0,max));
        }
        else
        {
            contador.setText(String.valueOf(max-field.getText().length()));
        }
        
    }

    private Object readStream( int length, java.io.InputStream stream )
        throws java.io.IOException {
        final int buflen = Math.max( 1024, Math.max( length, stream.available() ) );
        byte[] buf   = new byte[buflen];
        byte[] bytes = null;

        for ( int nRead = stream.read(buf); nRead != -1; nRead = stream.read(buf) ) {
            if ( bytes == null ) {
                bytes = buf;
                buf   = new byte[buflen];
                continue;
            }
            final byte[] …
ndeniche 402 Posting Virtuoso Featured Poster

you can always check here... There's some pretty good references and excercises

ndeniche 402 Posting Virtuoso Featured Poster

as i said... it only depends on WHERE you want those variables to be useful

ndeniche 402 Posting Virtuoso Featured Poster

remember marking solved threads as solved ;)

tux4life commented: Maybe you should share your bath with a toaster, then you won't have to beg for solved threads anymore. -1
jephthah commented: why? you keeping score? what makes youi think your sloppy snippet is worth a "solved" anyhow? -1
ndeniche 402 Posting Virtuoso Featured Poster

assuming you got column size compatibility between arrays, you must create an array with x quantity of rows, x being the sum of array1's rows and array's 2 rows (I assume you know these sizes, since you had to declare the arrays sizes). After that, you create two nester for loops to go through both arrays one after another. This way:

int sizex = 4, sizey1 = 2; sizey2 = 3;
int array1[sizex][sizey1]={{1,2,3,4},{2,3,4,5}};
int array2[sizex][sizey2]={{3,4,5,6},{4,5,6,7},{5,6,7,8}};
int array3[sizex][sizey1+sizey2];

for (int x = 0 ; x < sizex ; x+=1)
{
   for (int y = 0 ; y < sizey1 ; y+=1)
   {
      array3[x][y] = array1[x][y];
   }
}
for (int x = 0 ; x < sizex ; x+=1)
{
   for (int y = sizey1 ; y < sizey2 ; y+=1)
   {
      array3[x][y] = array1[x][y];
   }
}

this way, array3 would be:

{1,2,3,4}
{2,3,4,5}
{3,4,5,6}
{4,5,6,7}
{5,6,7,8}

WaltP commented: Giving away homework still? You really know better. -2
ndeniche 402 Posting Virtuoso Featured Poster

it depends on what you're trying to do:

when declaring variables in the main() procedure, is because you intend to use them throughout the whole program, though you can't use them in a function (unless you pass them as parameters by reference, not by value); when you declare them in a function, these variables are only useful as long as the function is running (meaning, they "die" at the end of the function); and if you declare the variables outside of any function or main() , they are Global variables, which can be used throughout all the program (meaning, main or functions).

ndeniche 402 Posting Virtuoso Featured Poster

have you tried separating the title from the image with a <br /> ?

ndeniche 402 Posting Virtuoso Featured Poster

Excellent question... has microsoft developed a package or library that would read multitouch inputs, so that these are managed by events?

ndeniche 402 Posting Virtuoso Featured Poster

what anout a function that will break up both strings (the one from the input and the one from the access db) into string arrays and compare them in a double function, constituted by nested for that will go through both arrays, counting the amount of matching words, loops that will return the results from the comparison... something like this:

String 1: "I would love to do that"
String 2: "I love to do that"

Array 1:
| "I" | "would" | "love" | "to "| "do" | "that" |

Array 2:
| "I" | "love" | "to" | "do" | "that" |

Total words in array 1: 6
Amount of matching words: 5

Percetnage of matching words= 5/6 * 100 = 83.33%

83.33 > 60 ? True

printf("true")

ndeniche 402 Posting Virtuoso Featured Poster

Reputation is just like it's real-world counterpart. It's all about what other members of the community at large think of you. Members with more reputation themselves can affect other people's reputation by more. The reputation system also comes armed with a way to comment on why you gave the reputation you did.

Yeah, the thing is, rep points are used to show what the community thinks about you in general, and Up/Down voting is used to see what the community thinks of your post.

Still, I think Up/Down Voting should be used only for the original post, let's call it the thread initiator, since it's not the poster's responsability what other posters respond to hat post. That's what rep points are for.

ndeniche 402 Posting Virtuoso Featured Poster

Well... it's pretty implicit with the whole while([B]getchar() != '\n'[/B]) part

ndeniche 402 Posting Virtuoso Featured Poster

i am new in sql and i would like to ask you if i can make a class in mysql. For example

class test
{
INT AGE;
INT YEAR;
}

CREATE TABLE lol (x test);
can i do this?
Thank you very much

What is it that you want to do?

ndeniche 402 Posting Virtuoso Featured Poster

Hello everyone...

I wanna develop a Java Web Applet that will allow me to check a PC's HW configuration (cpu, HDD, and other hardware information), but I don't know what libraries to use, or where to start looking. Anyone can give me a heads up?

ndeniche 402 Posting Virtuoso Featured Poster

This is because even though you are validating the textboxes' input, you are not stopping the program's progress... what you what to do is separate the FormatCurrency() functions into a separate function, validated by the IsNumer() results. Something like this:

Public Class MortCalc

    Private Sub clearForm()
        txtLoan.Text = 200000
        txtInterest.Text = 5.75
        txtYears.Text = 30
        txtTotal.Text = ""
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
        'New Varables
        Dim txtPrincipal As Double
        Dim txtRate As Double
        Dim txtYears As Integer
        Dim amount As Double
        Dim monthlyRate As Double
        Dim years As Integer

        amount = CDbl(Me.txtLoan.Text)
        monthlyRate = CDbl(Me.txtInterest.Text) / 100 'allows interest rate to be entered whole number'
        years = CInt(Me.txtYears.Text)

        If Not IsNumeric(txtLoan.Text) Then
            MsgBox("Please enter a valid loan amount.")
            txtLoan.Clear()
            txtLoan.Focus()
            Exit Sub
        End If

        If Not IsNumeric(txtInterest.Text) Then
            MsgBox("Please enter a valid Interest Rate")
            txtInterest.Clear()
            txtInterest.Focus()
            Exit Sub
        End If

        If Not IsNumeric(Me.txtYears.Text) Then
            MsgBox("Please enter a valid year")
            Me.txtYears.Clear()
            Me.txtYears.Focus()
        End If


         If IsNumeric(txtLoan.Text) And IsNumeric(txtInterest.Text) And IsNumeric(txtYears.Text) Then
            txtPrincipal = FormatCurrency(amount)
            txtRate = FormatCurrency(monthlyRate)
            txtYears = FormatCurrency(years) * 12
            Dim iRate As Double = monthlyRate / 12
            Dim tTotal As Double = txtPrincipal * (iRate / (1 - (1 + iRate) ^ (-txtYears)))
            Me.txtTotal.Text = Format(tTotal, "$#,##0.00")
         End If
    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
        clearForm()
    End Sub

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        End
    End Sub
End Class
ndeniche 402 Posting Virtuoso Featured Poster

Great! Always a pleasure... (Mark it as solved so it can be useful to others)

ndeniche 402 Posting Virtuoso Featured Poster

Actually, your error is literally what the compiler displays. You _do_ have an error in your SQL syntax. It should be SELECT * FROM engineer .

I don't really know what the ADODB class for row storage is, so i'll just call it RowSet , so, supposing you have a Name column for the engineer's name, when you add the combobox items, it should be something like:

Dim queryStr As String = "SELECT * FROM engineer"
RowSet = SQLSEARCH(queryStr)
Dim count As Integer = 0
While Not RS.EOF Loop
   cmbEngNum.Add(RowSet.Rows[count].Columns["Name"].Value.ToString())
End While

Remember the results of a query are returned in a table format, so you must have an object receiving that value, and you must read through this object to assign the desired value to the combobox items.