samaru 145 a.k.a inscissor Team Colleague

This does not work because clicking one checkbox will send the whole page

If you just want to submit a part of the page (not the entire whole page), then you have to use an XmlHttpRequest object (AJAX).

samaru 145 a.k.a inscissor Team Colleague

It also has to do with how easy it is to use the JS API. Whatever answer you get will be biased, so here it goes (my background is jQuery). I feel like from the JS community, YUI is more bloated, but it's because it comes with more functionality and very thorough documentation and examples. I love their site. jQuery on the other hand, is more minimalistic. I also feel like its notation "makes sense."

My two cents.

samaru 145 a.k.a inscissor Team Colleague

If you have them in your DB, export as TSQL scripts - a TSQL script file per object (sproc/table/etc). Get a file search and replace program (http://www.thefreecountry.com/programming/searchandreplace.shtml) and run through it.

samaru 145 a.k.a inscissor Team Colleague
samaru 145 a.k.a inscissor Team Colleague

Is your question how to get the AdventureWorks db on your SQL Server instance? Your installation might not've installed this sample DB. Get it here: http://msftdbprodsamples.codeplex.com/releases/view/24854

samaru 145 a.k.a inscissor Team Colleague

What version of CF? Clustered? What 64 or 32 bit of JRE? What DB Driver are you using? Microsoft's JDBC? jtDBS?

samaru 145 a.k.a inscissor Team Colleague

Are you CFLocking it?

samaru 145 a.k.a inscissor Team Colleague

Can you be more specific about your question? I would suggest you make the HTML checkboxes' values to whatever you want, either a bit value or some string. Then, on the backend, you capture that value when the form is submitted and inject it into your SQL.

This is as far as I can answer. Not sure if this is specific to your problem.

samaru 145 a.k.a inscissor Team Colleague

What kind of data result do you want back from the query? Do you want a resultset that looks like this?

Example:

ConfID	DateOf
----------------------
1	2010-02-15,2010-01-25
2	2010-02-15,2010-03-15,2010-03-15,2010-04-03,2010-05-26
4	2010-06-15,2010-06-25

Are we dealing with just one table? Also, what flavor of SQL are you using? The first query that you showed that has the UNION statement would not be allowed in TSQL because you're unioning columns of different types (assuming confID is INT).

samaru 145 a.k.a inscissor Team Colleague

Code is correct. It looks like a credentials issue. Are you sure you have the correct rights to where you're trying to login into? I would try another to connect via another client and see if it works with those privileges.

samaru 145 a.k.a inscissor Team Colleague

Look at this:

Tag changes since ColdFusion 5: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags-pt0_21.html

Function changes since ColdFusion 5: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags-pt0_21.html

Of course, there's architectural changes as well. I hope you're testing your application fully.

samaru 145 a.k.a inscissor Team Colleague

What do you mean by "light box"?

samaru 145 a.k.a inscissor Team Colleague

Let me try to understand you. You try to connect other machines to a Windows 7 computer that has SQL Server 2005? Are they all the same version of SQL Server? Have you checked your firewall / DNS settings?

samaru 145 a.k.a inscissor Team Colleague

Hi,I want to generate unique ID in the database that has the combination of characters and digits.
eg. ab111 and next should be ab112 ,ab113 and so on.
Can anybody help me?

What is the max number of characters and how do they increment?

What's after ab999? Is it ab1000? Or ac000? What happens when it reaches zzz999? You can use a composite key for this.

samaru 145 a.k.a inscissor Team Colleague

What will trigger the validate() function? When you tab or switch the cursor to another textbox? This is what this does.

<html>
<head>
  <title></title>

<script language="javascript">

function validate() 
{
  // Verify that both passwords put in match. 
  if ( ( document.getElementById("password").value != document.getElementById("passwordverify").value ) ||
  document.getElementById("password").value.length == 0   )
  {
    alert("Both passwords must match.");
    // return false;  
  }

}

</script>
  
</head>

<body>



<p align="center">To reset your password, provide your current password</p>
<form id="form1"  name="form1" method="post" action="pcq.php">
    
     <table border="0" align="center" class="mytable2" style="margin-left:175px"  >
	 <tr>
         <td>Current Password</td>
         <td>
         
        <input type="password" name="oldpass" style="width:150px;" />
         
         </td>
       </tr>
       <tr>
         	    <? $user=$_SESSION[myusername] ?>
		          <td><input type="hidden" name="usr" id="usr" value="<?php echo $user; ?>"style=" width:150px;" />
         </td>
       </tr>
       <tr>
         <td>New Password</td>
         <td><input type="password" name="pass"  style="width:150px;" id="password" /></td>
       </tr>
	   <tr>
         <td>Repeat New Password</td>
         <td><input type="password" name="rpass"  style="width:150px;" id="passwordverify" onblur="validate()"/></td>
       </tr>
       <tr>
       
       
       <tr>
	   <td>
	   </td>
<td > <input type="submit" value="submit"  >
 <input type="reset" value="Reset"></td>

</tr>

       
       
     </table>
   </form>


</body>
</html>
samaru 145 a.k.a inscissor Team Colleague

Cool, glad it works.

samaru 145 a.k.a inscissor Team Colleague

Oop! @_@ My comment was in regards Chrome OS, not Chromium OS (man, I miss my mod powers). Please school me on the differences if possible. ^_~ Thanks!

samaru 145 a.k.a inscissor Team Colleague

Welcome back! Although I've been a member here for 3.5 years, I've never seen you posting here :) What made you decide to make you re-appearance?

thread72 :D

Just want to learn more about the technology I'm using, and what better way to start posting. I really do miss posting anyways. I used to be a heavy poster back in the day when I used to moderate. I'm also good friends with Dani (I went to college with her and her mom is my landlord).

I'm happy to see the forum grow so much.

samaru 145 a.k.a inscissor Team Colleague

Great review Ken. However, I see it a little different.

I would give it an 8.0 for computer beginners, like the grandmas of the world. It's gets a 2.0 for techies. Why? Two reasons.

  • Needs too many resources for what it delivers.
  • Cannot run executables, not even virtually/sandboxed.
  • Needs the cloud for storage.

Kind of annoying that I can't just run it on any old laptop / netbook. System requirements are too demanding for what it promises and it seems it's needed just to have that 2-4 second boot-up time, which honestly it doesn't mean much to me. There's never a time where I'm in such a hurry that I need my computer that fast, because I'm either doing something else, or I just use my phone.

I some people really care about boot-up time? I'd rather wait 10 more seconds and have the ability to run .EXE files and have it run on old PC's. For a minimalist device, I have my table PC or iPhone already that can do all that stuff, and I don't have to worry about malware on the iPhone. I don't think techies have to worry to much about malware since they're careful about getting them in the first place and have good Anti-viruses.

Lastly, an Internet connection is not ubiquitous yet. I'm on the subway a lot where there's no WIFI and sometimes I travel to places without an Internet connection. I want to be able to …

samaru 145 a.k.a inscissor Team Colleague

I would probably be the 2nd person (2nd to Dani) to post on the Dani's forum when it was Techtalkforums (about 9 years ago) and she tried just about every type of software before settling down for vBulletin.

Fun times. ^_^!

On Daniweb, I suppose my post is: http://www.daniweb.com/forums/thread72.html in 2002, But I swear there were more before then.

~s.o.s~ commented: Okaerinasai ;-) +0
samaru 145 a.k.a inscissor Team Colleague

Depends on what you're willing to do *after* work hours - do you see yourself reading blogs, news sites, reading books, and doing personal projects and experiments about programming? Networking?

It's hard to stay competitive by just doing a 9 to 5 job and not learning extra stuff. Tech moves fast in all areas, and you have to stay current. Does it interest you more reading a book like "Code Complete" or "Network Warrior"?

http://www.amazon.com/Network-Warrior-Everything-need-wasnt/dp/0596101511

http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670/ref=sr_1_1?ie=UTF8&s=books&qid=1266019050&sr=1-1-catcorr

samaru 145 a.k.a inscissor Team Colleague
samaru 145 a.k.a inscissor Team Colleague

What do you mean "halts"? What version are you using? I'm using 3.6 of FF on Windows7 and it runs fine.

samaru 145 a.k.a inscissor Team Colleague

I just signed up for an account. I'm afraid you can't, and if you could it would take a long time. It's not JavaScript; it's Flash. That chat module is an .SWF and it's inside an HTML frame. You can display that frame in its own separate window, but it will not scale to show more text. This means that it'll be bigger, but the text will increase in size and you'll see as much text.

Unfortunately, for this case, Greasemonkey is no good. Sorry.

samaru 145 a.k.a inscissor Team Colleague

Storing a variable length of leading zeros would mean the numeric types (int, etc.) would have to be larger than they, so that's why I think SQL Server doesn't use them internally.

I don't think you can do this. Displaying leading zeros is usually done on the UI's application code, or casting the numeric data type to varchar and appending zeros in the SELECT statement.

I'd be curious to know if there was a possibility.

samaru 145 a.k.a inscissor Team Colleague

Please paste the code you have to further help you. Thanks!

samaru 145 a.k.a inscissor Team Colleague

If you're wondering if it's possible to modify JavaScript on a page that is not yours (the game you're playing), the answer is yes. One tool would be the Greasemonkey add-on for Firefox.

For this though, it seems like you could just resize the window and make the font bigger.

samaru 145 a.k.a inscissor Team Colleague

You can easily Google this. What in particular don't you understand and I'll try to help.

samaru 145 a.k.a inscissor Team Colleague

Look into parameterization with arithmetic operations.

Try this:

Select Field1 = CAST( @Field1 AS MONEY ), Field2 = CAST( @Field2 AS MONEY )
samaru 145 a.k.a inscissor Team Colleague

Maybe I'm not reading you correctly. Why can't you do this (take the logic from the concat UDF and put it above the UPDATE statement?:

DECLARE @s varchar(max)
DECLARE @Name varchar(50)
DECLARE @Actv int

SET @s = ''

SELECT @s = @s + IsNull(',' + Cast(Cycletemplate AS varchar), '')
FROM temp (NOLOCK)
WHERE temp.Descr = @Name And temp.Actv = @Actv
GROUP BY Cycletemplate
ORDER BY Cycletemplate
IF (@S IS NOT NULL) AND (@S <> '') SET @S = SubString(@s, 2, Len(@S)-1)

UPDATE #TempSummary
SET CycleIdList = @S
samaru 145 a.k.a inscissor Team Colleague

To make things easier, please provide some code (at least try it).

samaru 145 a.k.a inscissor Team Colleague

From a quick eyeballing...

In index.html:

Lines 12-19 and 27-34 are repetitive. I would remove them from both functions and put that block of code once above line 9, since you're declaring them global anyways.

Line 26 needs a semicolon.

Line 35, you meant XML not XLM. Typo.

Line 43, did you mean to put a closing button tag? It's one of those funky tags where you need a closing one to render correctly.

samaru 145 a.k.a inscissor Team Colleague

Word order I assume counts? (For example "Adobe ColdFusion" vs "ColdFusion Adobe.") Also, you may want to use <cfqueryparam> to help against SQL Injections.

<cfset searchString = "Immigration Law" />

<cfquery name="Info" datasource="YourDB">
	SELECT * 
	FROM Areas
	WHERE      
	<cfloop list="#searchString#" delimiters=" " index="word">	
  
	  ShortName LIKE <cfqueryparam cfsqltype="cf_sql_varchar" value="%#Trim(word)#%" />	OR 
      
	</cfloop>
  
  (1 <> 1)
</cfquery>

<cfdump var="#Info#" />

If you have to search a lot of text, I suggest you use your database's FTS services or Verity.

samaru 145 a.k.a inscissor Team Colleague

If you're not worried about performance, best way to do this would be to write using a function, in case your logic changes for this "inversion" - you'll change the logic from one central location.

-- Create the Function
CREATE FUNCTION InvertValue ( @value SMALLINT )
RETURNS SMALLINT
AS
BEGIN
	
  DECLARE @maxNumber SMALLINT
  SET @maxNumber = 8
	
  RETURN @maxNumber - @value
	
END
-- Ways to use it:

-- Print It Out
PRINT dbo.InvertValue( 2 )

-- As SELECT statement
SELECT dbo.InvertValue( 2 )

-- Insert into a Table
INSERT INTO TempTable( magic ) VALUES ( dbo.InvertValue( 2 ) )
samaru 145 a.k.a inscissor Team Colleague

For example, I have the following tables:

animal
-----------------------
animal_id | animal_name
-----------------------

owners
-----------------------
owner_id | owner_name
-----------------------

owners_animals
--------------------
owner_id | animal_id
--------------------

I want to find the animals with no owners so I do the query:

select animal_name from (select * from animals) as a left join (select * from owners_animals) as o on (a.animal_id = o.animal_id) where owner_id is NULL

A null owner_id column means that the associated animal has no owner.

Is this way of filtering data using a join acceptable and safe? With the same schema, is there a better alternative to get the same result?

Derived queries, may not best way to this. You can do it with a simple join.

Let's set up the data first (assuming you're running SQL Server):

USE [MrSkittles]
GO
/****** Object:  Table [dbo].[owners_animals]    Script Date: 02/09/2010 18:15:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[owners_animals](
	[owner_id] [int] NULL,
	[animal_id] [int] NULL
) ON [PRIMARY]
GO
INSERT [dbo].[owners_animals] ([owner_id], [animal_id]) VALUES (1, 3)
INSERT [dbo].[owners_animals] ([owner_id], [animal_id]) VALUES (4, 2)
INSERT [dbo].[owners_animals] ([owner_id], [animal_id]) VALUES (3, 2)
INSERT [dbo].[owners_animals] ([owner_id], [animal_id]) VALUES (4, 5)
INSERT [dbo].[owners_animals] ([owner_id], [animal_id]) VALUES (2, 3)
INSERT [dbo].[owners_animals] ([owner_id], [animal_id]) VALUES (4, 4)
INSERT [dbo].[owners_animals] ([owner_id], [animal_id]) VALUES (5, 5)
/****** Object:  Table [dbo].[owner]    Script Date: 02/09/2010 18:15:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[owner](
	[owner_id] [int] NULL,
	[owner_name] [varchar](40) …
samaru 145 a.k.a inscissor Team Colleague

SQL Server 2008 has an import tool. Why not use it?

samaru 145 a.k.a inscissor Team Colleague

The way it would work would be JavaScript creates an XmlHttpRequest object which fires off GET/POST method to a PHP page that has your PHP function. You could also pass variables from JavaScript to your PHP page. I have a meeting right now, so I'll write you some sample code later.

samaru 145 a.k.a inscissor Team Colleague

Is this for academic purposes? If so, this is the quickest way. How you use it, though, can be vulnerable to SQL injections.

CREATE PROCEDURE GetValue ( @ColumnName VARCHAR(50) ) AS 
BEGIN  
  EXECUTE( 'select ' + @ColumnName + ' from Addresses' )
END 

GetValue @ColumnName = 'Zipcode'
samaru 145 a.k.a inscissor Team Colleague

First we need the machine specs, like:

OS version
32 or 64bit?
JRE version?
IIS? Apache?
Database type/name/version?
Clustered environment?

samaru 145 a.k.a inscissor Team Colleague

JavaScript reaches out to more platform than JSP. It can run on the browser, on the Server (http://www.jaxer.org/), and on the desktop via console (http://www.jsdb.org/). From my experience JSP is solely for web development on the server.

Also JavaScript is a language. JSP is a web framework based of the Java programming language.

samaru 145 a.k.a inscissor Team Colleague

You can use JavaScript to load a txt file via the XmlHttpRequest object (AJAX). You can code this yourself, or use framework like jQuery, which makes the process easily, basically use 1 line of code.

For writing, since the txt file is on the server, you need a backend service, like PHP to manipulate the file. You can still use JavaScript to stream the data to the PHP file, nonetheless.

Let me know if you want code.

samaru 145 a.k.a inscissor Team Colleague

Get rid of the the extra stuff befor the event attribute. So it should look like this:

<input name="b1" type="button" value="CANCEL APPOINTMENT" document.apptcalendar.b1.onClick="javascript:PrcsBtn1();">

You also don't need the "javascript:"

So this is what it turns to:

<input name="b1" type="button" value="CANCEL APPOINTMENT" onClick="PrcsBtn1();">
samaru 145 a.k.a inscissor Team Colleague

I figured it out. It was a setting that I turned on accidentally.

Explorer Window -> Organize -> Folder Options -> View Tab -> When typing into list view -> Select the typed item in the view

That wasn't checked. I suppose I did it instinctively without thinking. In WindowsXP, the area is used to trigger Advanced File Sharing, and I guess I didn't realize this in Windows7. Also, I don't think in XP this is an option you can control because it just works.

samaru 145 a.k.a inscissor Team Colleague

Hey everyone! (It's been a long time since I posted!)

I've just upgraded from WindowsXP to Windows 7. One thing I hate is how how when I have an Explorer window open, and I start typing to move the focus to a file/directory name in that directory, it instantly assumes I want to do a Windows File Search recursively in that directory. Is there a way to turn it off? WindowsXP does it and so does Windows 2008 Server.

I still want the Windows Indexing service to run, I just want to turn this annoying feature off. Thanks!

samaru 145 a.k.a inscissor Team Colleague

Life is cruel and unfair. And because it's unfair, people take advantage of that. Sorry to hear that you lost all that cash. One of the rules in life, though, is to not be part of a sweepstake that requires you to shell out cash before you see the dough.

samaru 145 a.k.a inscissor Team Colleague

Happy birthday Dianne! Can't wait till we all go bowling when the place is finished!

samaru 145 a.k.a inscissor Team Colleague

Hey there Dan. How's it going? I'm not sure if you got my IMs just now on AIM because I keep getting booted offline. ;)

Everything's good. Visiting daniweb during my lunch. I can't believe that word association thread is still going... strong... ;)

Hi! I don't know you but you seem great! :lol: lol

Yeap. You got that right. I can see you're a smart individual indeed!

samaru 145 a.k.a inscissor Team Colleague

Thanks. Glad to see you're still in the staff.

samaru 145 a.k.a inscissor Team Colleague

Hey all, glad to see familiar faces around the forums. How y'all been? I hope some of you remember me... I was here when Daniweb was just a baby.... :cool:

samaru 145 a.k.a inscissor Team Colleague

How much PHP do you know? You could just calculate the time length between the last login and registration time (if they've never logged in yet), or between the last two logins. If it equals x amount of time, then delete'em. How complicated is your current script? I could probably help you more if you give me more info on how much you know and what kind of script you're working with.