Killer_Typo 82 Master Poster

you could try pimoPDF lets you print your word documents into a PDF format :D

Killer_Typo 82 Master Poster

determins what you are looking for.

since you have String s you can say if s == what i am looking for

break;

that will terminate the loop and continue.

so

while(cin >> s)
{
if (s == "what i want")
    break;
count++;
}
Killer_Typo 82 Master Poster

i decided that my definition of idle is no activity from keyboard and mouse. is there a way to monitor if there is no activity coming from those input devices?

you may be able to monitor it through the use of a mouse/keyboard hook.

i have no personal experience doing this but that doesnt mean it cannot be done!

look into hooking the keyboard/mouse and see what you can / can't find.

Killer_Typo 82 Master Poster

im not sure if a machine will ever be 100% idle but you can watch process so you could easily watch the System Idle Process which gives the % of system that is idle at the current moment in time.

i cant quite remember the namespace right now but one of them gives you access to watching processes.

Killer_Typo 82 Master Poster

what is the reasoning behind booting someone to the login screen if they dont know the password to an application?

Killer_Typo 82 Master Poster
Killer_Typo 82 Master Poster

sounds like your app is going to be using a lot of loops. not too hard, i wont do your homework. post up some of your code and what you think it should do and we will go from there.

a good starting point

method 1:

Y = starting point
N = new number

determin if number is even or odd (simple division can tell you this)

if EVEN
N = Y / 2
ELSE IF ODD
N = Y * 3 + 1

repeat loop

Killer_Typo 82 Master Poster

oh, I never heard of the truncate method. Do you have a link or an example?

sure do have an example :)

so he opens the file and does what he wants

System.IO.Stream foo = new FileStream("pathToStream", FileMode.Open, FileAccess.Read);
 
//some random code to remove the line he wants removed

now when he goes to open the file stream again and use his newly modified string that has the new file contents he opens using the truncate method

System.IO.Stream bar = new FileStream("PathToExistingFile", FileMode.Truncate, FileAccess.ReadWrite);

this opens the file and clears it out so that new information can be written to the file.

Killer_Typo 82 Master Poster

wont let me edit so here is a double post. sorry about that:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace stringToBinary
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void m_ConvertToBin_Click(object sender , EventArgs e)
{
m_Converted.Text = "";
string _someString = m_String.Text;
if (_someString == string.Empty ||
_someString == null)
{
_someString = " ";
}
ASCIIEncoding _toBinary = new ASCIIEncoding();
byte[] _stringRepresentation = _toBinary.GetBytes(_someString);
foreach (byte _byte in _stringRepresentation)
{
double _preDecimal = 0 ,
_aftDecimal = 0 ,
_num = (double)_byte ,
_binConst = 2;
int _Binary = 0;
/*
* predecimal is the numbers before the decimal place so in 4.9 it would be the 4
* aftDecimal is the numbers after the decimal place; so in 4.9 it would be the 9
*/
//since we are working with a byte of data we have 8 binary digits
for (int i = 0 ; i < 8 ; ++i)
{
if (_num != 0)
{
if (i == 0)
{
//get the before and after decimal places
_preDecimal = (double)System.Math.Floor((decimal)(_num / _binConst));
_aftDecimal = (_num / _binConst) % 1;
//add them to the binary number
_Binary = (int)_aftDecimal * (int)_binConst;
//update the number we are working with
_num = (int)_preDecimal;
}
if (i == 1)
{
//get the before and after decimal places
_preDecimal = (double)System.Math.Floor((decimal)(_num / _binConst));
_aftDecimal = (_num / _binConst) % 1;
//add them to the binary number …
Killer_Typo 82 Master Poster

The binary Reader/Writer used for IO streams to files. i do not believe that they can be used in the manner you wish.

try an ASCIIEncoder as that has the option to get bytes/strings

Killer_Typo 82 Master Poster
Killer_Typo 82 Master Poster

>can you example of a counter please?

counter = 0
  While read in a line
   counter = counter + 1
   writeToConsole + counter + "." + line
 endWhile

>After i put them in a file like this i want to search and delete based on the numbers. e.g.

1. You'd have to read each line of your text file into an array or arrayList.

2. Delete the original File (Using the File I.O Api)
e.g

3. Write the arrayList to another file with the original file name. Obviously you can remove the line number from the arrayList with the appropriate method.
e.g

no i would not do it that way.

his best option would be to read the file into the application itself. use his parsing methods to read the file and then re-open the existing file using truncate method.

this will open the already existing file and empty the file to 0 bytes allowing him to re-write his data back in.

Killer_Typo 82 Master Poster
Killer_Typo 82 Master Poster

Thanks for answer to question two. I figured out the first one though.

glad i could help out.

Killer_Typo 82 Master Poster

I have 2 issues:rolleyes: :

1. I'm creating a combobox from inside code (sort of dynamic, when the user finishes a row, another row appears) and I would like to know how to set the list of items the user chooses from.

is it possible to see a snippet of what you are doing?

are you stating that if they do something in A then a new combo box is created dynamically on the form at point B and you need to know how to modify it?

but the easiest way to add data to a combo box is by setting the range of items to choose from

_MyComboBox.Items.AddRange( new string[] {
"ITEM 1",
"ITEM 2",
"ITEM 3",
"ITEM 4",
....
"ITEM 10" } );

2. How can I block the user from typing custom values into a combobox, but still accept when they select an item from the list?

Thanks;)

change the combobox to a dropdownlist in the dropdownstyle combo box settings and the user cannot enter a string in anymore, just select from the list.

Killer_Typo 82 Master Poster

Hello,
I want to know that how to run or execute the SQL DTS Package in C#.NET. Any person can help me. please...

have you checked out the help and support for your SQL package?

check out this link

http://www.15seconds.com/issue/030909.htm

(looks like its written in some VB though, but easily transferrable to C#)

http://www.c-sharpcorner.com/UploadFile/fbulovic/DTSnCS12062005072324AM/DTSnCS.aspx

and this link

http://www.connectionstrings.com/

which contains a list of known SQL/Database types and how to connect to them via most languages.

just do a google search of

sql dts c#

a lot of excellent links pop up.

Killer_Typo 82 Master Poster

what about pov-ray? it's free, has a great user community & evidently produces great images - although i believe the learning curve is a bit steep.

(note: my 3D imaging experience is relegated to running through a few "Simply-3D" tutorials, so saying that i'm NOT an expert is quite a bit of an understatement. just posting an observation of my own.)

it's been a while since i have looked at pov-ray but i believe it is a powerful rendering engine with only a very simple modeling interface.


it is entirely scripting based too (or at least last time i checked...several years ago :P)

needless to say though if you can become very well with it you can create some very powerful renderings.

look into a piece of software called rhino3d last i remember it was pretty damn cheap and extremely powerful.

it works using NURBS (heheh thats one of the first websites i ever built right there). and has a rendering engine that can produce some sexy images.

its expensive to buy, but if you can prove you or someone you know is a student or teacher and then have the student/teacher buy its only 195...which is a steal for what it is. btw it also has a free trial.

Killer_Typo 82 Master Poster

Hi,

I'm working on an application in Microsoft Visual C# with an embedded webbrowser. After I loaded a page, I'm using the event DownloadComplete to execute an action.

On my computer it works fine, but in some other computers, the event DownloadComplete is never reached, even if the page is totally loaded.
The framework version is the same on both computers.

Is anybody have a clue of what's happening?

Thanks

has debugging returned any usefull information?

any code to look at?

Killer_Typo 82 Master Poster

Thanks a lot.

hey i hope this helps you out some

http://www.daniweb.com/techtalkforums/thread62112.html

its a HOWTO i wrote that covers how to query a database and return all of the information in a particular table.

Killer_Typo 82 Master Poster

http://www.codeproject.com/csharp/CSharpRipper.asp

tutorial covers how to make a cd-ripper in C#, which covers how to eject the drive...etc

this may lead to other discoveries of your own.

hope this was of some help.

Killer_Typo 82 Master Poster

The nice thing about C# and .NET in general is that threads are dead easy to work with. Here is a tutorial introduction, and also a whole website that you should bookmark when working with .NET. :)

thank you very much for that link. it is an incredibly helpful link and may actually speed up my work on my project!!

Killer_Typo 82 Master Poster

programming is a very fun and complex field ;to get into.

I happen to really enjoy and love programming and have been dabling around in it ohhh since i was about 14ish (6th grade, not sure how old i was).

My first language was C, then C++, then i backed off and moved to HTML, then PHP+SQL and then Java-Script, then back to C# and VC++. (touched some actionscripting but did not like it at all).

I have a fairly diverse background in many languages and have a decent understanding of the type of work that one must be willing to start out doing. My father has been programming for many years now (he started around the time when punchcard programming was just going out of style) and is still programming today, he has no degree and makes out very nicely (works in san fran).

They pay range is as varied as the state you live in, you need to look it up online and decide if the money is right. but seriously dont let the money decide your job, if your friend really enjoys writing software or maybe firmware then let them get good at it to the point where they can make good money doing it.

they should be happy to go to work because they enjoy the atmosphere and what they do, the paycheck is nice but if you can learn to live within ones means then you can also learn to …

Killer_Typo 82 Master Poster

Yes I am using Access and Jet

Any other solution?

suppliment his solution a little. what language are you using to build the database. you may be suited to just use that language to get the current date and then pass that into the query.

Killer_Typo 82 Master Poster

I did a little more research and found that I was going about this all wrong. I am going to use a DataSet and that should do what I need done here.

Thanks

another option could be simply running a select statement to grab what you need since you are working with a SQL database.

if you need a specific start date /end date that depends on the SQL server but the generic and commonly excepted way could be

select [some column],[somecolumn],[somecolumn]...etc
from [name of database]
where [name of date column] between 'dd-mmm-yyyy' and 'dd-mmm-yyyy';

my syntax may be off though.

Killer_Typo 82 Master Poster

without thuroughly going through your code the best i can give you is this:

try not to specificy the location of tyour database from the connection string.

(which is what it appears you are doing).

if you are using an SQL server like SQL Server or MySQL it is quite simple to establish a connection.

simply give the driver, the username and the password.

open the connection and then using SQL select the database you wish to use.

have you also tried using break points to see at which point in the code it is actually failing at?

you could just be missing something very simple.

EDIT:

also this seems to be an ACcess database, is this using OleDB or ODBC?

there is a difference in the string used to connect.


ODBC:
Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\mydatabase.mdb;Uid=Admin;Pwd=;


OleDB
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;

Killer_Typo 82 Master Poster

i will respond to this tomorrow but i have a general idea how to :).

Killer_Typo 82 Master Poster

Hey guys,
This is my first time using Daniweb and I think I messed up! I need HELP--- I need a electronic addressbook. I need 8 text boxes:
1) name of contacts
2) company name
3) Address
4) city
5) state
6) phone
7) fax
8) email address
But the problem comes in when I try to write the program to read only partially. For example name of contact, instead of typing the whole name I only want to use partial--- Kim will pull up Kimmy, Kimlok, Kimm.

I want each textbox to read partially.

Please help
CONFUSED

you need an ontextchange event that will popup a list of possible names based on the letter typed.

if your information is stored in a database you could do this very easily.

like when they start to type the letter k an SQL statement would run that would return

SELECT FIRSTNAME FROM [SOMEDATABASE] WHERE FIRSTNAME LIKE 'k%';

but thats the best i can come up with.

or prebuild an array with all of the names sorted by letter and then use the same logic.. :!:

Killer_Typo 82 Master Poster

Dear All

[IMG]http://forums.microsoft.com/MSDN//emoticons/emotion-6.gif[/IMG] I have very bad bug in my program as it's run fine on windows 2000 but can't run on windows xp


I try to run my coding, the system will produce Error.ie)
"unhandled exception of type System.Runtime.InteropServices.COMException occurred in system.windows.forms.dll
Additional information: Class not registered"

with green background on this line --> this.ResumeLayout(false);
whcih is one of windows form designer generated codes

any one could help me please.
thanks in advance

Suresh shanmugam

sounds like you are trying to reference something that is not installed on the xp machine.

not quite sure though. toss in some break points and compile it, watch for what is actually happening and use a try/catch satement to see if you can get more error information.

Killer_Typo 82 Master Poster

Howdy everyone again, Just thought that i would post another snippet for those interested in working with databases and C# in the windows forms environment.

I did some searching on this and found that there was not really any clear concrete answer on how to do this. After some searching i was able to get the general idea and build it into something bigger.

I am using Visual C#.NET Express 2005 from the www.microsoft.com website.

So first thing we need to do is open up our application
[IMG]http://img110.imageshack.us/img110/7967/opencsharpbf2.th.jpg[/IMG]


next we need to create a new project

File>New Project

[IMG]http://img64.imageshack.us/img64/8017/newprojvg7.th.jpg[/IMG]

We are going to build a class library
[IMG]http://img110.imageshack.us/img110/3376/classlibrarybx8.th.jpg[/IMG]


now you should be looking at an empty class. We still need to add some things before we can begin.

First we need to use the system.data.odbc namespace

using System.Data.Odbc;

followed by giving our class a namespace.

I named it System.Data.Odbc.Custom so that when accessing it can be found easily within the Odbc namespace.

namespace System.Data.Odbc.Custom

and finally giving the class a name

public static class ShareSQLSettings

[IMG]http://img64.imageshack.us/img64/3239/usingsystemdataodbcas2.th.jpg[/IMG]

(the class is set to static so that when the variables are assigned they are read only :) ) or so i have been told *cough*

now comes the fun part, actually writing some real code!!

Killer_Typo 82 Master Poster

hello,
I wana show the cards in randomly from the array when I click the start button. ex: I have 12 picture boxes. and if click the button , the randomize cards come out to those boxes. How should I do ? :eek:

use the random function, start the seed at 0 and to end at 11.

use the randome->next function, have a function to check to see whether or not the number generated or not has been used, so you would probably want an array that was 12 long (0-11) to store each random number as it was generated.

if the number generated matches a number in the array generate another and check again, if not break out and allow the random image to be placed.

hows that?

i've done it before but with random letters that i generated for a game i wrote.

Killer_Typo 82 Master Poster

Thanks dude, it's exactly what I've been looking for :cool:

awesome, glad i was able to help someone out.

Killer_Typo 82 Master Poster

well i do hope this helps someone :lol:

Killer_Typo 82 Master Poster

You will not get any editor which will do whatever you want to do with JavaScript. However you may get pre made snippets and certain tool which may generate certain specific things such as Menus, SlideShows etc.... If you just want a JavaScript Editor there are several and generally every HTML Editor supports JavaScript.

i don't need the editor to do what i want, i was just looking for intellisense.

like when programming using visual studio, visual studio will finish the words and names of things when they are recognized.

Killer_Typo 82 Master Poster

Okay, so currently i am working on a final project at my college, i have been tasked with creating a database administration tool.

One of my major hurdles was how to query the MySQL database and return all of the results into a DataGridView object with correct column names.

As of right now it will not use the correct data types, all data inputed into the cells will be assumed default textboxcell, but i am working on that and maybe my application will contain a future update that take into account the data type of the cell.

but here we go, this is only how to do it. i have not included any information on how to contact your server as i assume you have some prior C# knowledge of connecting to sql based servers.

please note that i am working in visual studio C# express and that i am using .NET Framework 2.0

/*
     a possible query to run on the database
*/
     //using System.Data.Odbc;
     OdbcCommand odbcCom = new OdbcCommand();
     odbcCom.Connection = <some odbcConnection to SQL server>;
     odbcCom.Command = "select distinct user, host, grant_priv from mysql.user where usere like '%foo%' and grant_priv = 'N';";
     OdbcDataReader odbcRead = odbcCom.ExecutReader();
dgvBuildMe.Columns.Clear();
/*
     Read the Query into the DGV
*/
     DataGridViewColumn colHead;//create the column
     DataGridTextBoxColumn colStyle = new DataGridTextBoxColumn();  //apply the default textbox column style
     DataGridViewCell cell = new DataGridViewTextBoxCell(); //apply the default cell style
     int intDgvCount = odbcRead.FieldCount; //set the counter to the number of …
Killer_Typo 82 Master Poster

Alternatively you can just hit the win(start)/r key on the keyboard at the same time. Nice tip.

Deffinately my favorite way of doing it. i already have way too many icons on my desktop :lol:

Killer_Typo 82 Master Poster

i believe you can, you can wake the machine through the NIC card (wake on lan)

let me look it up for both ya!

.....done researching


yes you need whats called Wake-On-LAN

http://gsd.di.uminho.pt/jpo/software/wakeonlan/mini-howto/ --miniHOWTO
and sometools

http://gsd.di.uminho.pt/jpo/software/wakeonlan/mini-howto/wol-mini-howto-3.html#ss3.2

'Stein commented: Good find! :) -'Stein +3
Killer_Typo 82 Master Poster

If you want to learn c++ properly, try coding your problem from the command line only- i.e no GUI. (I know it may be hard coming from c# or a java background but if you do it that way you'll pick up better habbits regarding program speed and efficiency. After all isn't that why you wish to learn c++?)

There are of course better suited languaged you can use to parse xml files than c++. However, if you want to do that look at the methods availabe for the std::string class.

cool, i will take that into consideration. Most of what i got to work came straight from the MS website;although, the first language i have ever worked in was C and that was a long time ago. Then i tried out C++, didnt like it, and moved to just HTML (not a language i know!) then to PHP and then onto MySQL; i am currently dabbling in JavaScript and decided it was about time to come back to a real mans language :lol:

Killer_Typo 82 Master Poster

Are you using microsoft's managed extensions for C++ (.NET in VS 2003)? You might want to consider using C++/CLI instead for .NET programming (you can download Visual C++ 2005 Express for free). Keep in mind though, that C++/CLI is really its own language

Already using Microsoft Visual C++ (in .NET 2003)

my school has an academic alliance with MS so i can get access to all of the tools and OS's they offer for free. so to be honest im using what is offered on their site.

the version is
Microsoft Visual C++ .NET 69462-335-0000007-18585

Killer_Typo 82 Master Poster

I have no idea why this old thread was resurrected, but the link in the site is a standard link around a standard image... which was what I suggested since a background image (see original question) cannot be inside a hyperlink. So, yes, this is an old, solved thread.

I had an idea but realized it would probably not be the optimal solution ;)

Killer_Typo 82 Master Poster

short little update!

i have been working on a personal web file optimizer. it does nothing more to optimize than remove the newlines and return cariges along with the tabs from the document to reduce its file size.

this of course would be what you did when it came time to upload it. now how you would work with it on your machine.

right now its not all that smart but its something right!

private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
fldBrowse->ShowDialog();
textBox1->Text = fldBrowse->SelectedPath;
}
private: System::Void button2_Click(System::Object * sender, System::EventArgs * e)
{
//fuck yes, i can read the file now!!! FUCK YOU BILLYGATES
fleDialog->set_InitialDirectory(textBox1->Text);
fleDialog->ShowDialog();
textBox2->Text = fleDialog->get_FileName();
 
//if they didnt chose a file then dont do anything
if(fleDialog->get_FileName() != S"")
{
//read out the file
StreamReader* objReader = new StreamReader(fleDialog->get_FileName());
 
 
//read it to a string
System::String __gc* strReader = objReader->ReadToEnd();
objReader->Close();
//cut the file up
String* delimStr = S"\r,\t,\n";//pull out the return,tabs,newlins
Char delimiter[] = delimStr->ToCharArray();//transform into an array
String* strSplit[] = strReader->Split(delimiter);//split up the file
IEnumerator* myenum = strSplit->GetEnumerator();//get enumerators
lblString->Text = strReader;
//output the file
while (myenum->MoveNext())//enumerate through it
{
txtString->AppendText(Convert::ToString(myenum->Current));//output currentenum
}
//clean up memeory
delete delimiter;
delete strSplit;
 
//save the newly created file
String* newFile = txtString->Text;
StreamWriter* objWriter = new StreamWriter(fleDialog->get_FileName());
objWriter->Write(newFile);
objWriter->Close();
}
}

nothing too incredibly fancy, im learning though :D and...err disregard some of the comments...

Killer_Typo 82 Master Poster

Well, it took a few months but I finally made it into the top 100 in post count. I wonder how hi I'll go?

still gotta beat me!! im in 49th place :P

Killer_Typo 82 Master Poster

im from <sorry dont give home info away unless i accidentally add it to my location>


:D

Killer_Typo 82 Master Poster

Let's not start that debate again. It's been covered here, there, and everywhere already.

:-| i wasnt looking for a debate, i was just looking for a different way to try and design my pages. im always open to different methods, especially if i see an increase in usability and decrease in overall load times and all that jazz.

Killer_Typo 82 Master Poster

just in response to a comment that was made about someone stating that you could not encrypt post and get.


and by data i was referring to the information being passed by the post and get methods.

Killer_Typo 82 Master Poster

hah, nvm i see you were able to solve this.

Killer_Typo 82 Master Poster

I would recommend not using tables for your webpage as well.

i hate to dig up old threads but i was wondering why you dont recommend tables?

Killer_Typo 82 Master Poster

I recently read a post by someone stating that you could not encrypt POST or GET sessions while sending data between pages.

I wanted to know if there was a way.

could one not simply write a script that would encrypt the message before sending along with a key that on the following page was decrypted using the required key?

or something to that effect.

Just wondering what everyones opinions are one this subject and what the standard is for sending data accross pages to ensure security.

i personally was thinking along the lines of writing a bit of javascript to encrypt messages using a custom written encryption algorythim along with a generated key that is generated based on how the string was encrypted, and the recieving page would be a PHP script that would grab the key and based off of what the key said would decrypt the strings and what was needed with them.

anyone else got any ideas?? that are maybe simpler?

Killer_Typo 82 Master Poster

w00t i figured out what my problem was and fixed it.

i needed to include the if(document.getElementById) statement in the restoreNav() funciton as it was also trying to reference the ID before it had been loaded.

problem solved :D

Killer_Typo 82 Master Poster

Have you tried using onload to keep the displayNav function from being read until after the page loads?

i tried using

if(document.onload)

but it didnt work...the mouse over just never seemed to start up!! :lol:

Killer_Typo 82 Master Poster

Hi all i will try to be as clear as possible!

I am currently working on a site for a customer at www.privacymaker.com/gcs/dev/ (where im developing it, the main site location is www.gerbercentral.com)

well here is the issue i am running into.

I have decided to go with mouseovers that change the innerHTML of an element, at first if you tried to mouse over the tags while the page was loading it would cause the page to abort loading and you would get an error message.

I decided that it may be due to me trying to reference an HTML element that had not been drawn yet.

so i inserted the line

document.getElementById && document.getElementById("LEFTNAV"))
{//continue code}

thinking that it would only execute the script if it could find the required element and only if the browser supported it...well i guess i was wrong because i am still getting crashes.


here is a copy of important HTML and the javascript file itself

<div align="justify">
<font class="navigation">
<a href="./networking.php" onMouseOver="displayNav( 'networking', '1' )" onMouseOut="restoreNav()">Networking</a> |
<a href="./hardsoft.php" onMouseOver="displayNav( 'hardwaresoftware', '1')" onMouseOut="restoreNav()">Hardware/Software</a> |
<a href="./viruses.php" onMouseOver="displayNav('virus', '1')" onMouseOut="restoreNav()">Viruses</a> |
<a href="./os.php" onMouseOver="displayNav('os', '1')" onMouseOut="restoreNav()">Operating Systems</a> |
<a href="./helpticket.php" onMouseOver="displayNav('webhelp', '1')" onMouseOut="restoreNav()">Web Based Help Tickets</a> |
<a href="./webdesign.php" onMouseOver="displayNav('webdes', '1')" onMouseOut="restoreNav()">Web Design</a> |
<a href="./training.php" onMouseOver="displayNav('training', '1')" onMouseOut="restoreNav()">Training</a>
</font>
<font id="LOGIN"><font class="login">
<a href="./login.php">Customer Login</a>
</font></font>
</div>

this calls the functions and here are the functions

function displayNav( …