Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

251.

Solve : can anyone improve on this? (VBS)?

Answer»

I have this little bit of vbs that starts a number of PROGRAMS, here email and web. At work it's x 7. I was hoping to find a way to economise on the code.
Code: [Select]strProgramPath = """C:\Program Files (x86)\Mozilla Firefox\firefox.exe"""
SET objShell = CREATEOBJECT("Wscript.Shell")
objShell.Run strProgramPath

strProgramPath = """C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"""
SET objShell = CREATEOBJECT("Wscript.Shell")
objShell.Run strProgramPath
SET objShell = Nothing
thanksYou only need to call 'CREATEOBJECT' once.
Code: [Select]strProgramPath = """C:\Program Files (x86)\Mozilla Firefox\firefox.exe"""
SET objShell = CREATEOBJECT("Wscript.Shell")
objShell.Run strProgramPath

strProgramPath = """C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"""
objShell.Run strProgramPath
SET objShell = Nothing

Or you COULD PLACE the paths in an array and use a for loop:
Code: [Select]arrPgm = Array("""C:\Program Files (x86)\Mozilla Firefox\firefox.exe""","""C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe""")
SET objShell = CREATEOBJECT("Wscript.Shell")
For Each pgm in arrPgm
objShell.Run pgm
wscript.sleep 1000
Next
SET objShell = Nothing
Quote from: oldun on March 31, 2012, 05:03:20 AM

SET objShell = Nothing

If pruning lines is your aim, you can omit this line as well. The script engine automatically clears variables when they go out of scope, so clearing them manually just before then (i.e. at the end of script execution) is pointless and UNNECESSARY.


Thanks...
252.

Solve : PHP cURL (Scraping a website)?

Answer»

Hey guys,

I need a little help scraping a no-frills website. The main problem I have is sending headers or cookies to set a store. If you've never been to the website, the first time you visit it asks you to select Province, City, and the Store. Then I have access to viewing ITEMS and prices of that store. I've tried using various methods using cURL but I get "Received HTTP code 403 from proxy after CONNECT" error.

Here is the LINK: http://www.nofrills.ca/LCLOnline/flyers_landing_page.jsp - you can select any province, city and store for testing.

Please help me. Thank you in advance,

- ultimatumScreen-scraping is often a breach of the terms of use of a particular website.  This makes it an activity that I'm cautious about supporting in detail.  If you have genuine reasons for doing this, you'll find Fiddler absolutely invaluable in analysing the "conversation" between your browser and the web server.  Having examined this, it is easier to replicate the web transaction through cURL.

Cookie management is documented in the PHP manual.  Have a LOOK in particular at the cURL options array.  Here's an example of a cURL constructor I use in one of my projects:

Code: [Select]  /**
    * Default Constructor
    * Set up cURL session with cookies
    *
    */
  function __construct($cookie_serial=''){
    $this->_ch = curl_init();
    curl_setopt($this->_ch, CURLOPT_POST, 1);
    curl_setopt($this->_ch, CURLOPT_FOLLOWLOCATION, false);
    curl_setopt($this->_ch, CURLOPT_COOKIEJAR, '/tmp/cookies/cookie_'.$cookie_serial.'.txt');
    curl_setopt($this->_ch, CURLOPT_COOKIEFILE, '/tmp/cookies/cookie_'.$cookie_serial.'.txt');
    curl_setopt($this->_ch, CURLOPT_HEADER , 1);
    curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($this->_ch, CURLOPT_TIMEOUT, 60);
    curl_setopt($this->_ch, CURLOPT_CONNECTTIMEOUT, 60);
    $this->_html = '';
  }

Note the use of a parameter for the cookie jar, to avoid collision between multiple cURL instances. Quote from: ROB Pomeroy on March 26, 2012, 06:39:57 AM

you'll find Fiddler absolutely invaluable in analysing the "conversation" between your browser and the web server
Thanks for that! See the problem is that you have to manually make a selection before post variables are sent and these variables are processed through javascript. I understand and have used cURL + cookies for login and such but I here the script needs to save cookies before it will send them back on another page.

Thank you for the tips and quick response (for sure) but I found a SOLUTION to this problem.

- ultimatum Quote from: ultimatum on March 26, 2012, 08:03:49 PM
See the problem is that you have to manually make a selection

No - that's what the "scraping" bit is about.  Pull in the first web page and use a regular expression to extract the variables from the SELECT/OPTION form controls.  Then you do your post.
253.

Solve : Syntax Analyzer for Your PL?

Answer»

- all programs must start with “begin” and end with “end”
- all commands must be ended by “;”
- all variables must be declared just after “begin” in the following format;
int: i num;
float: fl;
- three types exist; “int”, “float”, “char”
- variables names may be any alphanumeric string, but they must start with a letter
- statements between “begin” and “end” can be either a variable declaration or an assignment
- an assignment includes four type of operators; +,-,*,/.
- the NUMBER of variables or constants in an expression is unlimited
- the presedence of operators given as..............
- ........
- .etc

 Your PL should include a  well-defined regular GRAMMAR for variable names, rules for
variable declarations including their type, at least 4 arithmetic and 3 logical operators with
their precedence and associativity rules with and without parenthesis, INDEFINITE number of
assignments with expressions having unlimited number of operands.


How can i do? I have to use C language and ANTLRWe don't do HOMEWORK here.  How will you learn if people do the work for you?All the statements are either false or not universally true.
Entire programs can be written without a single semi colon.
Entire programs can be written with using C or any part of it.
Operators are not always needed. Just nice to have.

The is a very real limit to the number of variable. The number of variables must be less that the numb er of atomic particles in the universe. In practice, even much bless that that.

Ect.? No, ect.  ? No, etc can not be used to DEFINE a language structure.

254.

Solve : vb6 find system drive??

Answer»

hello!
need help in vb6. I starting to study vb6 and I want to know if what is the code in identifying the os drive? (like in  batch FILE, it uses %systemdrive%)
is there a substitute code for that in vb6?use the GetSystemDirectory Windows API function:

Code: [Select]Public Declare Function GetSystemDirectory_API Lib "kernel32" Alias "GetSystemDirectoryW" (ByVal Buffer As Long, ByVal BuffSize As Long) As Long
Public Function GetSystemDirectory() As String
    Dim usebuffer As String, nsize As Long
     'first retrieve LENGTH of required buffer..
    nsize = GetSystemDirectory_API(StrPtr(usebuffer), 0)
    usebuffer = String$(nsize, vbNullChar)
    GetSystemDirectory_API StrPtr(usebuffer), nsize
    GetSystemDirectory = Mid$(usebuffer, 1, INSTR(usebuffer, vbNullChar))
   
End Function

You can use Left$() to TAKE only the first CHARACTER to find the drive letter of the OS installation.

255.

Solve : C# Textbox to Email??

Answer»

I'm a BEGINNER of C# CODING and I need some help. What I want to is allow someone to send an email, by typing in their own email into a text box.

What I have so far is

Code: [Select]           
            MailMessage mail = new MailMessage();
            SmtpClient SmtpServer = new SmtpClient("smtp.mail.yahoo.com");
            mail.From = new MailAddress("[email protected]"); //Do you need this?


            mail.To.Add(textBox2.text);


            mail.Subject = "New Email";
            mail.Body = "INFO goes here";
            SmtpServer.Port = 465;
            SmtpServer.Credentials = new System.Net.NetworkCredential("GmailInfo", "PASS***");
            SmtpServer.EnableSsl = true;
            System.Net.Mail.Attachment attachment;
            attachment = new System.Net.Mail.Attachment(textBox1.Text);
            mail.Attachments.Add(attachment);
            SmtpServer.Send(mail);

The part I need help on is isolated
Code: [Select]mail.To.Add(textBox2.text);

How could you type into a text box and put that as the mail recipient?

256.

Solve : See score in visual basic.net?

Answer» HI, I made a game and it count your score in the title balk. The thing I LIKED to do was enable that people can submit there score online. I should have a message box where you you can enter your name (if you don't know how to do this, I will give you the code) and then the possibility that the computer SUBMITS the score (for that part I liked to have help)

any help would really be appreciated



greetz


blackberry  Ant it
That would be great if some one ACTUALLY reply Have you been on http://www.codeguru.com they have lots of tutorial there
257.

Solve : Anyone Who Can Use Action Script in Flash?

Answer»

ok so i am making a dance dance revolution game on FLASH and i need to know if somthying is possible to do. ok so the arrow in my avatar is animated to scroll that is a movie clip. in another movieclip i have a song i need to know if i can PLAY the movie clip without having to paste many frames of movie clips(which is what i am doing temporaraly) i have attached a swf file and only easy temp. works (partialy) because it is taking so long to do the copy and pasting of frames from movie clips.

thanksThats may be the only way to do it
I think you might need Movie clip SYMBLE and control it with action script
At least the frame doesnt show up in the main screen which looks horriblethanks.
ps why cant i get into an old topic i made its in drivers "cd-rom DRIVE error"Because YaBB MESSED up. Again.

258.

Solve : C# dll usedin COM environment?

Answer»

I know, I know...  The web is full of posts similar to this.  But none of them really give me an answer to my question so I figured ONE more wouldn't hurt...

I have a dll that I have written in C# using the 2.0 .NET framework under VS2010.  Inside the project properties I have set Register for COM Interop to true (Checked the checkbox). I created a class and an interface to define the functionality.

The interface:
Code: [Select]
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace MyClassLibrary
{
    [Guid("29C614FE-6DA1-4817-A111-B483D710D661")]
    [ComVisible(true)]
    interface IMyClassLibrary
    {
        string goodByeStr
        {
            get;
        }

        string SayHello();
    }
}


The class:
Code: [Select]
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace MyClassLibrary
{
    [Guid("2C87C0CE-47E9-4C89-A553-E10E1F4FC8B8")]
    [ProgId("MyClassLibrary.MyClassLibrary")]
    [ClassInterface(ClassInterfaceType.None)]
    [ComVisible(true)]
    public class MyClassLibrary : IMyClassLibrary
    {
        // Default Constructor.
        public MyClassLibrary()
        {

        }

        // Implement interface property.
        public string goodByeStr
        {
            get { return "Goodbye!"; }
        }

        // Implement interface method.
        public string SayHello()
        {
            return "Hello!";
        }
    }
}


And the Assembly file:
Code: [Select]
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. CHANGE these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MyClassLibrary")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MyClassLibrary")]
[assembly: AssemblyCopyright("Copyright ©  2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// SETTING ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6191a078-1d98-4a49-9c0f-7027ab71824c")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


This is pretty basic stuff as far as creating a COM Interop goes.  When I build this, I get a .tlb file that I can access inside a VB6 form application.  However, when I use the OBJECT viewer in VB6 to look at the methods and properties, the only ones visible are the ones inherited from mscorlib.dll.  The two public objects from the class are not visible.  I am still not sure why VS2010 does not RECOGNIZE them as types that can be registered for COM interop.  The resulting TLB is shown below...

Code: [Select]
// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: MyClassLibrary.tlb

[
  uuid(6191A078-1D98-4A49-9C0F-7027AB71824C),
  version(1.0)
]
library MyClassLibrary
{
    // TLib :     // TLib : mscorlib.dll : {BED7F4EA-1A96-11D2-8F08-00A0C9A6186D}
    importlib("mscorlib.tlb");

    // Forward declare all types defined in this typelib

    [
      uuid(2C87C0CE-47E9-4C89-A553-E10E1F4FC8B8),
      version(1.0),
        custom({0F21F359-AB84-41E8-9A78-36D110E6D2F9}, "MyClassLibrary.MyClassLibrary")
    ]
    coclass MyClassLibrary {
        [default] interface _Object;
    };
};


Any thoughts on this?well, ComVisible is set to false in the Assembly, and that would make the types in the assembly invisible.

259.

Solve : gwbasic to vb?

Answer»

i have a gwbasic program that i need re written in vbasic but can do it myself is there anyone who could do it for me.
it is short.
i have screen capture of this gwbasic program only about 30 lines but dont know how to post it.Is this is because you:
A. Want to play the game as it is.
B. Want to see if it works better in Visual Basic.

Games written in GW -BAISC work best in the same.

You should be able to LIST the game program send to a file.
(I used to know how to do that.)

Quote from: topsy99 on April 05, 2012, 11:08:06 PM

i have screen capture of this gwbasic program only about 30 lines but dont know how to post it.

Save the proram on a floppy in ASCII format, then put the floppy in a Windows computer, open the program text in Notepad, and finally copy and paste the program text here.

Anyhow, what does it do?
the program adds up figures in a dat file.  gwbasic wont work in 64 bit but would like it to do so. so needs to be in vb or perl.
i cant WRITE either but did write the original gwbasic. it is small. i cant open it

[year+ old attachment deleted by admin]this posting is part of it the rest is here.     this is a handy program that i use regularly but now i have to use two computers to research.  i know it is old buyt used to do all my programming in gw basic. but got to old to manage the smarter stuff.   vb or perl would be great if any one can do it. dont want to break any rules but could always send a christmas CARD for a working version.
 64 bit doesnt allow gw basic      when i bought my computer it was set up in 64 bit and didnt realise gwbasic wouldnt work.


[year+ old attachment deleted by admin]it is only small  not a games programming but for text reading and adding up.
Not many people (a) understand GW-BASIC and (b) know Perl and (c) will enjoy squinting at those screen dumps and retyping your program. You are much more likely to get an answer if you post the program as copiable/pastable text. If you can LIST it, you can save it as ASCII. SAVE "progname",A saves the file progname in ASCII format. So type SAVE "MYPROG.BAS",A and then get the program text in an editor such as Notepad and copy and paste it in your next post. I am willing to try to create a Cscript version if you do what I have suggested.

it is quite readable if you double clik on them. i cant lift the text off the interpreter with copy or printing with notepad.
will try your suggestion and come back to you10 INPUT "filename ";ME$
20 DIM X$(3900),A$(4900)
30 INPUT "Search Name or XXX to end";S$
40 R(I) =0
50 IF S$="xxx" THEN END
60 OPEN "i",#1,ME$
70 IF EOF(1) THEN 230
80 INPUT#1,A$(I)
90 Q=Q+1
100 IF LEFT$(A$(I),LEN(S$)) < > S$ THEN 220
110 PRINT A$(I),Q
120 X$= RIGHT$(A$(I),1)
130 J = VAL(X$)
133 F$=LEFT$(A$(I),9)
140 Y$=RIGHT$(A$(I),2)
145 E = E+1
150 Z=VAL(Y$)
160 IF Z>0 THEN Z=9-Z
170 J = 9-J
180 IF J = 9 THEN J = 0
190 R(I) = R(I) +J+Z
200 PRINT R(I),E
210 N=N+1
220 GOTO 70
230 CLOSE#1
232 PRINT F$,R(I)
235 E=0
240 GOTO 30


there we go     hope someone can help.What is it supposed to do? Some COMMENTS (REMs) would be nice. Also an example input file.


sample data  from the actuall  dat file

"arena(good)(2000)(randwick)27-09-98)2"
"sharscay(good)(2000)(randwick)27-09-98)5"
"yippyio(good)(2000)(randwick)27-09-98)6"
"turridu(good)(2000)(randwick)27-09-98)6"
"sunline(good)(1600)(randwick)27-09-98)1"
"camarena(good)(1600)(randwick)27-09-98)2"
"confer(good)(1600)(randwick)27-09-98)2"
"dodge(good)(1600)(randwick)27-09-98)1"
"super slew(good)(1600)(randwick)27-09-98)2"
"iron horse(good)(1600)(randwick)27-09-98)2"
"sedation(dead)(1417)(flemington)27-09-98)7"
"mossman(dead)(1417)(flemington)27-09-98)8"
"cooktown(dead)(1417)(flemington)27-09-98)8"
"aerosmith(dead)(2000)(flemington)27-09-98)3"
"gold guru(dead)(2000)(flemington)27-09-98)4"
"our unicorn(dead)(2000)(flemington)27-09-98)4"
"inaflury(dead)(1625)(flemington)27-09-98)3"
"rose of dane(dead)(1625)(flemington)27-09-98)4"
"astralita(dead)(1625)(flemington)27-09-98)4"
"rebel(dead)(1200)(flemington)27-09-98)5"
"dantelah(dead)(1200)(flemington)27-09-98)6"
"classic day(dead)(1200)(flemington)27-09-98)6"
"our dynamic lady(dead)(1417)(flemington)27-09-98)5"
"cannyanna(dead)(1417)(flemington)27-09-98)6"
"misomai(dead)(1417)(flemington)27-09-98)6"
"pepinello(good)(1200)(belmont)27-09-98)7"
"kim angel(good)(1200)(belmont)27-09-98)8"
"bar screamer(good)(1200)(belmont)27-09-98)8"
"chamoix(good)(1600)(morphettville)27-09-98)7"


the gwbasic program checks for a name and the number of times it appears and deducts the end number from 9 and adds it up and prints a final name and total score.
in some case the number has an a or b attached which program  then checks the second last character on the end.


the data in the dat file is created and appended by a different gw-basic file.
5 rem input "horse.dat"
10 INPUT "filename ";ME$
20 DIM X$(3900),A$(4900)
25 rem  input horse name to search
30 INPUT "Search Name or XXX to end";S$
40 R(I) =0
50 IF S$="xxx" THEN END
55  rem  open horse.dat
60 OPEN "i",#1,ME$
70 IF EOF(1) THEN 230
75   rem input names for checking if they exist
80 INPUT#1,A$(I)
90 Q=Q+1
100 IF LEFT$(A$(I),LEN(S$)) < > S$ THEN 220
110 PRINT A$(I),Q
120 X$= RIGHT$(A$(I),1)
130 J = VAL(X$)
133 F$=LEFT$(A$(I),9)
140 Y$=RIGHT$(A$(I),2)
145 E = E+1
150 Z=VAL(Y$)
155  rem   deducts end number from 9  e.g. 9 minus z
160 IF Z>0 THEN Z=9-Z
170 J = 9-J
180 IF J = 9 THEN J = 0
190 R(I) = R(I) +J+Z
195 rem  horse name   and total score 
200 PRINT R(I),E
210 N=N+1
220 GOTO 70
230 CLOSE#1
232 PRINT F$,R(I)
235 E=0
240 GOTO 30


some  rems
Oh, right it's for Oz horseracing.
yes have been playing with it for years.   the idea is to record best performances and give them a number and then tally them . sort of to try to sort the wheat from the chaff if you forgive the pun.
have it automated in a perl program that does the searching and matching when doing race meetings but to do recreational research the gwbasic score program is invaluable but cant take it to windows 7 64 bit.  so am seeking some help.
260.

Solve : IEEE short real floating point format?

Answer»

Hi!

I have a decimal number (e.g 6433) and would LIKE to see the process of converting this to IEEE short real floating point format!

Any help is appreciated Sorry, we don't help with homework.The rules for converting a decimal number into floating point are as follows:

A. Convert the absolute value of the number to binary, perhaps with a fractional part after the binary point. This can be done by converting the integral and fractional parts separately. The integral part is converted with the techniques examined previously. The fractional part can be converted by multiplication. This is basically the inverse of the division method: we REPEATEDLY multiply by 2, and harvest each one BIT as it appears left of the decimal.
   
B. Append × 20 to the end of the binary number (which does not change its value).

C. Normalize the number. Move the binary point so that it is one bit from the left. Adjust the exponent of two so that the value does not change.

D. Place the mantissa into the mantissa field of the number. Omit the leading one, and fill with zeros on the right.
   
E. Add the bias to the exponent of two, and place it in the exponent field. The bias is 2k−1 − 1, where k is the number of bits in the exponent field. For the eight-bit format, k = 3, so the bias is 23−1 − 1 = 3. For IEEE 32-bit, k = 8, so the bias is 28−1 − 1 = 127.

F. Set the sign bit, 1 for negative, 0 for positive, according to the sign of the original number.

Read this for more INFO:
http://en.wikipedia.org/wiki/Decimal_floating_point

And you can Google a bunch of convertors that you can use.The IEEE 754 is not the ultimate floating point format. But it is CALLED a standard and has been adjusted and modified.
http://en.wikipedia.org/wiki/IEEE_754-2008
If using Intel based systems, one should read this:
http://www.intel.com/standards/floatingpoint.pdf
Read it! Impress your teacher!
The link below is only for Math Majors.
What Every Computer Scientist Should Know About Floating-Point Arithmetic
The best way to convert a number to floating pewit is with a computer.
Tell your teacher I said that.

261.

Solve : I need help reformatting my internal HDD to a windows format?

Answer» HI, i USED to have a linux(ubuntu) and now i regret ever trying to use it and i just want my windows vista back...but when i ran windows installer off of my usb flash DRIVE it said "Hard drive must be ntfs format for installation" but i have no clue how to re format my hard drive so i can re install windows...any help or suggestions?For beginners not familiar with GRUB you can always install Ubuntu within Windows, via the "Add or Remove" programs section:   http://www.ubuntu.com/download/ubuntu/windows-installer
In case you ever plan on trying Ubuntu again... don't be afraid to experiment with your computer...

In the Windows installer there is an option to manage your partitions... just delete all the partitions, and you will be left with unallocated space, then create a new partition and format it as NTFS.when i installed ubuntu i completly erased windows vista...and now im trying to get it back,there are no traces of windows left to go and uninstall ubuntu So you have already messed up your installation without any NTFS partitions, and your Linux partition is unreadable by the Windows installer. Do not fear.
http://dban.org/
Download and burn to a DVD. If you don't have a DVD http://www.pendrivelinux.com/install-dban-to-a-usb-flash-drive-using-windows/ and boot it on your problem computer.
It will wipe ALL, I REPEAT ALL the drives attached to your computer, including their partition tables. Do not have any other drives plugged in EXCEPT your flash drive that you are booting from or your DVD drive. If you have another hard drive/SSD inside your computer disconnect it, as it will also be wiped.
After you wipe the hard drive a block of unallocated space the size of your hard drive should show up in the Windows installer, and you should be able to proceed.Just curious...
Quote
...but when i ran windows installer off of my usb flash drive...
What sort of Vista installer runs off a flash drive? I thought you alwasy install Vista off of the DVD. Is there a USB version?

I remember once setting up Windows SETUP (Vista I think?) to run off of a flash drive, and it couldn't detect ANY harddrive on the system. Booted off a DVD and it worked fine. BTW you can completely format the harddrive within the Windows Setup DVD, if there is no option to do so then just CTRL+SHIFT+F10 to get to command prompt, where you can use both format and diskpart utilities..
262.

Solve : Stabdard I/O in C++?

Answer»

At my age I have to use other people's CODE to do even simple things. I want to read and write from and to the standard I/O using C++ instead of C. Is that reasonable?
After that, a bit of code that just sends a short string to the standard output. Please?
And how to make it a executable with no run time. Please not NET STUFF. Is that too much to ask?

THANK you.this what you looking for Geek? SEE links below:

http://www.cplusplus.com/doc/tutorial/basic_io/
http://www.cplusplus.com/reference/clibrary/cstdio/
http://pages.cs.wisc.edu/~hasti/cs368/CppTutorial/NOTES/IO.htmlThanks. Now I can give it a try.   

263.

Solve : basic c language?

Answer»

i want to download genuin C lang  tutorials.  where i can GET them.


thanks
http://einstein.drexel.edu/courses/Comp_Phys/General/C_basics/
http://www.cprogramming.com/tutorial.html

Hi here are some more;

http://www.cprogramming.com/tutorial/c/lesson1.html
http://www.friedspace.com/CProg.html
http://www.cplusplus.com/files/tutorial.pdfi want whole c and c++ LIBRARY functions description where can i get it form NET.

264.

Solve : Dot Net that uses a com server?

Answer»

HI

I need to know how to USE a dot application that uses a COM server.

I require that the Com Server Throws an EXCEPTION which is caught by the dot NET application. The dot net application then displays the exception.

Also when the dot net application displays the exception I would like to control the level of detail on the exception.

Please HELP :-?

265.

Solve : SQL?

Answer»

is there a free SQL Database programmer thats newb friendly.. i'm going to be adding password protection to my site and i need to use SQL To get it to function properly. Quote

is there a free SQL Database programmer thats newb friendly.. i'm going to be adding password protection to my site and i need to use SQL To get it to function properly.


and possibly a good tutorial (Whether a book or website.)

I need a good User friendly and FREE Sql program... to make a database for my server...

then I'll probably need some .NET coding help .... yes I suck.hey why dont u try out mysqlI BELIEVE you can get a free version of SQL server on their official web site. And the book I recommend for newbs is "SAMS, Teach yourself SQL server in 24 hours" They use a real user freindly writing STYLE, and they show screen shots of almost everything that they are talking about. And they don't charge out the *CENSORED* for it, I think it was like 25$ or something.It really DEPENDS on what you want to do and how much you're willing to pay.

For free, probably your best option is MySQL (as kareem said) running on Windows or Linux, with a PHP-enabled webserver that has phpMyAdmin installed.  There are lots of MySQL tutorials out there, and the latest MySQL is fairly ANSI-compliant, so whatever you learn will be relatively portable to MSSQL, PostgresSQL, etc.

If you want to program with a SQL database, you will have to learn SQL, so get used to that idea.
266.

Solve : Vb 6.0?

Answer»

Hi
1.Please give the code for FINDOUT the running vb APLLICATION(exe) name.
2.code for whether particular printer(dot matrix) is on or off.
3.Code for get FILE SIZE like (*.exe, *.mdb,*.exe,*.txt,...)
  THANKSI did a little search this is what i have found

This is for get files size

'This project needs
' -a Command Button (Command1)
' -a CommonDialog (CommonDialog1)
' -a Label (Label1)
Private Const OF_READ = &H0&
Private Declare Function LOPEN Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Long) As Long
Private Declare Function lclose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long

Private Declare Function GetFileSize Lib "kernel32" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long
Dim lpFSHigh As Long

Public Sub GetFileS(FilePath As String)
    Dim Pointer As Long, sizeofFile As Long
    Pointer = lOpen(FilePath, OF_READ)
    'size of the file
    sizeofFile = GetFileSize(Pointer, lpFSHigh)
    Label1.Caption = sizeofFile & " bytes"
    lclose Pointer
End Sub

Private Sub command1_Click()
    CommonDialog1.ShowOpen
    GetFileS CommonDialog1.filename
End Sub

Private Sub Form_Load()
    With CommonDialog1
        .DialogTitle = "Select a file"
        .Filter = "All the files|*.*"
    End With
    Command1.Caption = "Select a file"
End Sub__________________

267.

Solve : Dumping?

Answer»

I would LIKE to know how to dump a ROM BIOS image from a pc so I can set up an emulartor.

268.

Solve : I need help in a C++ problem?

Answer»

Well, thanks to everybody for having this excelent forum where we the prentices can learn a lot of things about this programmer world.

I have the problem that follows:
I must to build a PROGRAM in C++ that has two classes, cars and customers, each one with some cars and some customers, a a third class of orders, who references the before classes by references. Its is need to join one car object with one client object, but I can´t do because I don´t know how do it.

Because I have the truly code which has 11 pages with code, I have simplified the original code and problem to this other code that follows, but it compiles but it doesn´t execute because I must have made a MISTAKE in it.

I ask for your help, and I need the necesary code to see how it works joining the client and the car in one order and how the data of both is printed.
Thanks.


#include
#include
#include
#include
class car_c //
{
 int number;
 char brand [10];
 public:
 car_c();
 ~car_c();
 void registry();
 void print();
};

class client_c //here we give register to a new customer
{
int number;
char name [10];
public:
client_c();
~client_c();
void registry();
void print();
};

//Here we build the class order, we build a link by reference
//to the other before classes, and it´s need to do an order with the client we
//have and the car we have.

class order_c
{
 client_c &clients
 car_c &cars
 int order_numbers;
 public:
 order_c();
 order_c (client_c &client, car_c &car);
 ~order_c();
 void registry();//Here it´s need to build a function to join our client with
                               //our car and building our first order.

 void print();//here it´s need to build a function that prints our client and
                               //car data.
};


void main()
{
car_c car;
client_c client;
order_c order;
//order.registry();
car.registry();
car.print();
client.registry();
client.print();
cin.get();
cin.get();
}

order_c::order_c (client_c &client,
      car_c &car):clients (client), cars (car)
{
order_numbers=0;
}

void client_c::print()
{
cout &LT;< number;
cout << '\n' << name;
}

void client_c::registry()
{
cout << "INSERT the client´s name: ";
cin >> name;
}

client_c::~client_c()
{
cout << "Destroying clients... Push one key ";
cin.get();
}

client_c::client_c()
{
number=1;
}

void car_c::print()
{
cout << number;
cout << '\n' << brand;
}

void car_c::registry()
{
cout << "Insert brand of the car: ";
cin >> brand;
}

car_c::car_c()
{
number=1;
}

car_c::~car_c()
{
cout << "Destroying cars... Push one key ";
cin.get();
}I´m WRITTING to give thanks, because I have got link the two external classes in my true code in C++.

Thanks again.

269.

Solve : assertion error?

Answer»

im running xp home edition sp 2
im getting this error and it is causing all kinds of havoc, lost setting, no internet connections and my cable modem is fine, curtin ERRORS, crashes, ect.. and all i have to do is be on computer for a couple hours before error appears.
the message error reads as follows
C++ error

ASSETION FAILED
Program:cast\securitymanager\app\curtainsSysSvcnt.exe
File:d\commdev\grisc\filterdllold\grintercept.cpp
Line 896
Expression:ipintercept->pathmtu!=0

to debug the application jit must be enabled

im no programmer\ i do have an old 3.12 netware certification but this is far beyond my skill level and im going crazy trying to solve this so please help me !!!
AND PLEASE DONT ASK ME TO DO A COMPLETE NEW INSTALL AS I PUT MY XP DISK IN A SAFE PLACE AND CANT REMEMBER WHERE...DUH
i recently install a new virus program (norton) and i didn't have this problem before i
installed it but i did disable it and still got the error
i have also tried system restore several times, and it comes back saying system restore could NOT restore and to try another restore point, which i have to no avail.As you are running win xp have you try System Restore yet?
Service pack 2 is not even that good mate because it limit your action, i did not installed it because i cant do stuff that i wanted to do so i will probably uninstalled that as well. = is your choice
But i dont think Service pack 2 has any cause to it.
Google showed curtainsSysSvcnt.exe comes from Comcast and is part of their security suite. Is Comcast your service provider? If not this could be malware posing as a valid application. Try checking your startup (msconfig) and see if you can turn off launching this program.

Elixir:

Quote

Service pack 2 is not even that good mate because it limit your action, i did not installed it because i cant do stuff that i wanted to do

Such as :-?1.Blocking most of legal action
2.Change some computer setting that i dont need
3.An extra memory is wested by having them on
4.It crash my computer when i had them on

But i dont really need more of this because i like the way my computer is protected:
It provides better protection against viruses, hackers, and worms, and includes WINDOWS Firewall, Pop-up Blocker for Internet Explorer, and the new Windows Security Center.

Help protect your PC from harmful attachments. [smiley=thumbup.gif]

By alerting you to potentially unsafe attachments, Windows XP Service Pack 2 (SP2) helps guard your computer from viruses that can spread through Internet Explorer, Outlook Express, and Windows Messenger. [smiley=thumbup.gif]
 
 Improve your privacy when you’re on the Web.  [smiley=thumbup.gif]

SP2 helps protect your private information by applying the security SETTINGS that guard your PC to the files and content downloaded using Internet Explorer. [smiley=thumbdown.gif]
 
 Avoid potentially unsafe downloads. [smiley=thumbdown.gif]

Internet Explorer download monitoring and the Internet Explorer Information Bar warn you about potentially harmful downloads and give you the option to block files that could be malicious.
 
 Reduce annoying pop-ups.  [smiley=thumbdown.gif] weste of memory

Internet Explorer Pop-Up Blocker makes browsing the Internet more enjoyable by helping you reduce the unwanted ads and content that pop up when you’re browsing the Web.
 
 Get firewall protection from startup to shutdown.

The powerful, built-in Windows Firewall is now turned on by default. This helps protect Windows XP against viruses and worms that can spread over the Internet.  [smiley=thumbup.gif] [smiley=thumbdown.gif]i got enought as it is
 
 Take control of your security settings. [smiley=thumbdown.gif]

The new Windows Security Center allows you to easily view your security status and manage key security settings in one convenient place. [smiley=thumbdown.gif] i got enought as it is
 
 Get the latest updates easily.  [smiley=thumbdown.gif] [smiley=thumbup.gif]

Enhancements to Windows XP’s Automatic Updates feature make it even easier to access Windows updates. Plus, new technology has been added to help dial-up customers download updates more efficiently. [smiley=thumbup.gif]
 
 Help protect your e-mail address. [smiley=thumbup.gif]

Improvements to Outlook Express help reduce unwanted e-mail by limiting the possibility of your e-mail address being validated by potential spammers. i dont use them
 
 Take action against crashes caused by browser add-ons.  [smiley=thumbup.gif]

The new Add-On Manager in Internet Explorer lets you easily view and control add-ons to reduce the potential for crashes and enjoy a more trouble-free browsing experience.  [smiley=thumbup.gif]
 
 Go wireless without the hassle. i ant got it

 
I guess all of those are good for your computer but i just dont need them because i a enought software protection
270.

Solve : Is it possible to .....?

Answer» HELLO  

I am new to this form, so I hope I am doing this right.

I just need to know if it is POSSIBLE to search a folder and all its subfolders for a type of file (like .pdf, .exe, etc...), and then copy them to another folder, or drive.
Sorry, the OS I am using is Windows XP and it NEED to be in a batch file. So, if anybody can help me PLEASE reply.

ONE KEY THING is that I only want the files (like .pdf, .exe, etc...), not folders.
I have tried XCOPY

ThanksNot really sure why you NEED batch with XP but hey, it's your call:

Code: [Select]echo off
for /f "delims=" %%v in ('dir /b /s c:\*.pdf') do copy %%v destdir
for /f "delims=" %%v in ('dir /b /s c:\*.exe') do copy %%v destdir

Change the path of the destdir to something meaningful. Also point the path of each file type to the correct directory.

You can ADD as many FOR statements as you need. XCOPY works also, but it's so d*** messy.

Good luck.  8-)Thank you!

The whole reason I NEEDED a batch because some people I work with don't know how to work a computer that well.

Nick
271.

Solve : VB.NET?

Answer»

OK. I got a decimal value from a division. I want only the two NUMBERS after the decimal -- no period, no numbers before or after that -- and I want it in a VARIABLE. The variable part is easy but I'm not sure how to do the first part. Any suggesstions?Just a THOUGHT, but if you have no integer value, multiply the decimal portion by 100 and STORE the results in an integer, then FORMAT to two whole number POSITIONS. This probably works in almost any language.

 8-)

272.

Solve : Game programing?

Answer»

Does anyone know of a good FREE program that I could download to make a little game?Hi, I know nothing about it but my son has experience in game programming, so here is his reply to you:

Well, it depends upon how much experience you have in programming and with what languages, and also what kind of game you wish to make.

For beginners, a great program to make games is "Open Legends". It is a program for making snes (Super Nintendo) Zelda type games. It uses "small" as a programming language, but you don't even need to USE that if you are making a very basic game. The website is:

http://openlegends.sourceforge.net/


A more advanced program that uses it's own language is "Game Maker 6.1". I never really liked this program, but it has some interesting features such as a particle system and the ability to make games similar to "Wolfenstein 3D". There are two versions, the free one is good, but if you want to GET some of the more fancy features, you'll have to pay The website is:

http://www.gamemaker.nl/


But the most advanced game making tool, which can also be used for other THINGS such as 3D art and movies, and my personal favourite, is "Blender 3D". It can do heaps of things, and it's potential is huge. And it just so happens to be completely free . If you do want to make good 3D games, you will need to use the Python language. But, it is definately worth all effort. The website is:

http://blender.org/cms/Home.2.0.html


If you want to get back to raw code, Python, in conjunction with Pygame, is pretty good. Not good for beginners, but it will let you make a game that is completely to your LIKING. It is highly recommended that you get someone with experience with at least Python (even better if they have experience with pygame), as the learning curve can be quite steep, and will take a fair while to get good at it. The website is:

http://www.python.org/

And for pygame it is:

http://www.pygame.org/news.html


I hope all of this helps, I recommend you start with Open Legends if you have little or no experience.That's an IMPRESSIVE collection of free game makers. KJD, tell your son I'm impressed. I say VB or Flash is fairly easy if you know it, but what you just said are worth knowing and i never heard of python language before--------------------cool----------------------

273.

Solve : C++ Builder 6 - Getting a value from a DBGrid?

Answer»

Hi,

How can I do the following?
I have a DBGrid and I need to get values that grid.
When I click on a cell in the grid, I need to get all values in the selected row.
If for example there are 3 columns named ID, NAME and age.
If I click a cell in the grid, the value for the Id is displayed in a textbox, the value for name in another one and also the value for age in another textbox.
That is I need to display individual column values for the selected row in a TEXT box for each one.

Can anyone help me?

Thanks.
RowinThis is a logical question
You are saying how can i PROGRAM this method
I naver done this before, but if you look in the grid function (grid.?) it should show all the possible action.
If you dont know what to look for then just copy and peste the name in to a google and it should explain what they mean.

274.

Solve : DOS Batch - Create Text Files?

Answer»

Hello,

I'm currently using DOS batch FILES to create nightly backups of misc files across a local network.  I would like to have the batch file also create a .TXT file that is generated upon completion of the backup which includes the date and time.  In addition, i would like to have the name of the TEXT file use the SYSTEM Date as the name of the file.  Is there a way of doing this?

Many thanks

FeoleYou didn't mention an OS. This will work in the XP cmd environment. There are other ways to do this in other OSes.

Code: [Select]ECHO off
for /f "tokens=2-4 delims=/ " %%i in ("%date%") do set thedate=%%K%%i%%j
echo Backup created on %date% at %time% > Backup%thedate%.txt

Happy Computing.  8-)

275.

Solve : C++ Builder 6 and Crystal Report?

Answer»

Hi,

I have an C++ Builder APPLICATION. I want to PRINT a report with the VALUES appearing in my application. I GET these values from my database.
I ALREADY have a crystal report format of how the report should be printed.

How to do this?

Kind Regards,
Rowin

276.

Solve : Assembly LoadType error in VB.NET?

Answer»

Here's my problem...
http://www.valter.be/other/problem.txt

I'm really stuck on this as I've tried:

-completely rebuilding the projects
-removing everything and starting over

I'm on a deadline here..(wednesday)

Any help is very MUCH greatly appreciated..

TrevalProblem solved. I just referenced to the other project too early. I referenced before the CLASSES were CREATED so, it was pointing to nothing (NULL).Hey welldone

277.

Solve : do solve this!?

Answer»

hi,
i would like to know how a program written in a server SENT to a client( or  clients) then after solving the answer,client(clients) send the result back to server.like in a server a factorial program is written in C language,would you please guide me,how to do this.
thanks in advanceI THINK you NEED to search after an OPEN source program, because writing such thing is extreemly difficult

278.

Solve : need help with bat file?

Answer»

Hello..
I am new to programming but I would like some help with creating a bat file that will do some basic changes..
The problem I am having is I would like to write a bat file that will open a certain TXT file in windows 2000 and convert the text to certain information needed by another program.  An example would be..
the first line of text would read...
goto/4.9087,6.9879,8.4567
next line would read..
goto/4.9113,7.8765,9.9876
and so on..
what I need to do is convert the goto to g01 and and an X to the first dimension and Y to the next dimension and z to the next dimension having the first line of text on one line ex.    G01 X4.9087Y6.9879Z8.4567  this would be on one line and then the bat file would look at the next line of the TXT file and do the same thing over and over again until it reaches the last line of the TXT file and also be able to save the new TXT file under a different name or the same name under a different directory.
There is more that I need to do to this to make it work automaticaly but if you COULD please help me it will give me a good start on the areas I am not sure about..
Thank You again for any help you could give me..For reading a text file line by line try uisng the FOR instruction with the /F switch and defining the delimiters as /, comma and dot. This will parse each line according to the parsing rules you set up:

Code: [SELECT]echo off
for /f "tokens=1-7 delims=/.," %%i in (file.txt) do (
   echo %%i %%j %%k %%l %%m %%n %%o
   )

The resulting output line would be

goto 4 9087 6 9879 8 4567

You would have to the use the set instruction to recombine them as you see fit.

The following code will make a one dimensional array. Continue nesting the FOR statements  with the /l switch to build more dimensions.

Code: [Select]echo off
set idx=0
for /l %%x in (1, 3, 52) do (
            for /l %%y in (1, 3, 52) do (
                        call set /a idx=%%idx%%+1
                        call set array.%%idx%%=%%y
            )
)      

Happy Computing.

 8-)Thank You very much Sidewinder..
I was able to change the coding to produce the correct output..Could you please tell me how to save this output to a different txt file. The problem is that the correct output shows in the dos window but now I need to be able to save that output to a different txt file.
Also can you tell me how to search the txt file for a certain word (EX. color) and delete it before saving the new txt file.
Thanks Again for all your help...To save a file under a different name, simply redirect the echo instruction to a specific file.

Code: [Select]echo off
for /f "tokens=1-7 delims=/.," %%i in (file.txt) do (
   echo %%i %%j %%k %%l %%m %%n %%o > newfile.txt
                   OR
   echo %%i %%j %%k %%l %%m %%n %%o >> newfile.txt
   )

As for SearchandReplace, this is more problematic:

This little snippet will change "green" to "white", but DELETING the "green" would necessitate changing, say "green" to nulls (as opposed to spaces) which I'm not sure you can do in DOS batch.

Code: [Select]echo off
setlocal enableextensions
setlocal enabledelayedexpansion
for /f %%x in ('dir /a:-d /s /b') do (
      for /f "tokens=* delims=" %%i in (%%x) do (
            set input=%%i
            set input=!input:green=white!
            echo !input! > %%x.chg
      )
)
endlocal      

Data manipulatiion and string operations are not really what batch language was designed for. There are many scripting languages (vbscript, jscript, perl, python, even Rexx) which are better tools for these operations. While batch language can actually be faster for some jobs, in the long run you're better off with a real scripting language.

Thanks for reading my rant. Every once in a while I like to get on my soapbox.

Good luck. 8-)

279.

Solve : is there a way.......?????

Answer»

is there anyway at all to gain acess to the code on a PS2 disc and edit it? i think it WOULD be awesome to be able to edit the games somehowI can say with a good degree of confidence that SINCE it is difficult (if possible!) to even access PS2 discs, then it is impossible to edit them on a PC. Of course, the game had to be programmed somehow, but I don't think PS is going to GIVE up their secrets anytime soon. Of course you can gain access to PS dics somethime i copy a game that was rent from blockbuster for my little bro but you cannot reprogram it because you NEED the program that they use to program it.

280.

Solve : C++ Builder 6 - Printing?

Answer»

How to print using CODES in C++ Builder?I think is
Printer.Print _________? = _ what EVER you variable is
But this code is from VB i think they are nearly the same TRY it out

281.

Solve : batch check for connection and control programstar?

Answer»

Hi all,

PROBLEM:
I am using the same internet connection with two other persons. In order to not overuse our shared bandwith i would like a script/batch file, etc that checks if any of the two is ONLINE. if non of them is online, a download should start automatically (via program target.exe).

if on the other hand one of them goes online(meaning they start their computers) the download manager should stop (i wouldn´t mind just killing the process, if that makes it any easier.).

so this script/or batch file would need to check every ~15 min if one of them is online.

I THOUGHT about realizing it with a small batch script and just use a successful ping as a sign of them being online. unfortunately my programming skills - even with batch files - are very limited. so i would really appreciate your help on this.

In case I am trying to invent SOMETHING, that already exists, please point me to it.

FIRST TRY:
so far i have reached this solution for my problem.

process is a little tool i used to kill a process from commandline. and the last ping is just to put a little delay in the whole thing. the rest should be self explaining.

But: It sometimes hangs, e.g. when i pull out my network cable. i don´t know why, but it would be great if in case of hangup the program would restart itself.
also, as you may have noticed, in case of "dead" the target application will start every time the check is performed succesfully. does anybody know how to tell the batch file not to start a process if it is already running?

And one last thing, would it be possible to run this as a background process, without appearing in the taskbar.

I would really appreciate any support on this. thanks in advance.


Code of Batch file es.bat

Code: [Select]ECHO OFF

cd %windir%  > nul

:pingfabi
ping 192.168.2.10 -n 1 > nul
IF ERRORLEVEL 1 GOTO pingtobi
IF ERRORLEVEL 0 GOTO alive

:pingtobi
ping 192.168.2.118 -n 1
IF ERRORLEVEL 1 GOTO pingnils
IF ERRORLEVEL 0 GOTO alive

:pingnils
ping 192.168.2.150 -n 1 > nul
IF ERRORLEVEL 1 GOTO dead
IF ERRORLEVEL 0 GOTO alive

:dead
C:\programme\target\target.exe  > nul
GOTO end

:alive
process -q target.exe  > nul
GOTO end

:end
ECHO *
ping 127 -n 1
es.bat
I think making a program that allow what you want to do is more effective but with the lac of knowlege it is hard to make it come true.
Try some network monitoring softwareThanks for your answer.

The Batch file is up and working. But since it is not really a nice solution, I decided to get into programming with c++ to figure out a nicer solution. This is not gonna HAPPEN anytime soon, but its always nice to have something to look forward to... ;-)

Quote

Thanks for your answer.

The Batch file is up and working. But since it is not really a nice solution, I decided to get into programming with c++ to figure out a nicer solution. This is not gonna happen anytime soon, but its always nice to have something to look forward to... ;-)


Yes, you can do this with C++.  Once you learn some BASICS, google winsock tutorials
282.

Solve : Help With C# Program?

Answer»

I need help with my program. Here is the SOURCE code. It is in C#. My problem is that it is submitting after I click the submit BUTTON but it continues to submit. I want it to submit once and then stop. I don't want it to close. Just kind of pause/ be finished. Please help me out. Thanks!

Code: [Select]using SYSTEM;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void webWeebly_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            webWeebly.DocumentText.Contains("Comment");

            webWeebly.Document.GetElementById("input-705652889195239588").SetAttribute("VALUE", txtFirst.Text);
            webWeebly.Document.GetElementById("input-705652889195239588-1").SetAttribute("value", txtLast.Text);
            webWeebly.Document.GetElementById("input-959379682711960375").SetAttribute("value", txtEmail.Text);
            webWeebly.Document.GetElementById("input-574159613867142544").SetAttribute("value", txtComment.Text);

            HtmlElementCollection WebElements = webWeebly.Document.All;
            foreach (HtmlElement SubBtn in WebElements)
            {
                if (SubBtn.GetAttribute("value") == "Submit")
                {
                    SubBtn.InvokeMember("click");
                   

                }
            }

        }

        private void btnSubmit_Click(object sender, EventArgs e)
        {

            webWeebly.Navigate("http://firecactus.weebly.com/contact-us.html");
            while (!(webWeebly.ReadyState == WebBrowserReadyState.Complete))
            {
                Application.DoEvents();
               
            }
           
        }
    }
}In the submit button event HANDLER you could put something like
Button Name.visibility = False;
(It would help if you posted the other file of code (partial class)

283.

Solve : C#.NET Combo Box - Text not displayed?

Answer»

Hi

I am using C#.Net. There are 2 combo boxes in the interface.
The items in these combo boxes are loaded during run time.

The information is in the combo box but you can't see it. You can scroll through and after you just blindly select the text is displayed at the top. You could highlight the text in the top and use the mouse button to scrol through it and select.

The point is that the data/item is in the combo box list but you CANT see it. Only after you select it can you see it.

How do I get the items to be displayed in the combo boxes collection of items?
The combo boxes work perfectly in every other way. How do I get rid of the problem of the invisible items?? Help!! :-?Have you try the propertise box for combo boxes_check the bit where it say VISIBLE, if its not there then i have no clue what you have done or you can just make a new oneThanks But that is not the problem.

I will try ADDING another onesometime in VB or C++ will creat these sort of wrong function or error because the user have created a glitch or did somthing vagully.
i think the last time i had problem it was a little help icon that is stuck in a form and i cant delete it i think i done by copy something and try to paste it in VB
Well anyway good luck with your programThanks again

I just replaced it with a new one and it still does the same thing.

So it must be some silly MISTAKE somewhere else

284.

Solve : SEtUP Deployment using C#.Net?

Answer»

Hi

How do I CREATE a setup or DEPLOYMENT apllication.
I am using C#.net

:-?If C# is anything like the rest of the NET languages, you can PUBLISH your project to a CD,  a network share, or to a FTP site. You can find the PUBLISH option on the TOOLS menu.

Hope this is what you're looking for.  8-)

285.

Solve : I need help with a C++ code?

Answer»

Hello everybody:

I´m a student of first year Networks Systems Management Course and I must to finish a little homework my TEACHER has said.
I have almost all the code written but there is a function I can´t do noting with it, for more and more I have tried to solution.

Please, I need to solve this. The code is that follows:

#include
#include
#include
#define MAX_TAM 1000
class array_c
{                             // (Author)
 int array [MAX_SZ];
 int num_elements;
 public:
 array_c(){num_elements=0;array[num_elements]=0;};
 void insert (int position, int element);
 void print ();
 void DELETE (int position);
 void sorting ();
 int search (int element);
 int operator [] (int position);  /*This is the line I dont know what to do with it . This lie in the fact you can pass the position of an element of the array, then the function give back the element of that position.*/
};

main ()
{
array_c array;
int element, position=0, k;
do
      {
      cout << "Put a number for the array " << "\n";
      cout << "(To finish put 0): ";
   fflush (stdin);
   cin >> element;
   cout << "\n";
   if (element!=0)
         {
            array.insert (position, element);
         position++;
      if (position >= MAX_SZ)
               {
             cout << "There is no room for more elements.";
             elemento=0;
            }
         }
       }
while (element!=0);
cout << "This is the array: " << "\n" ;
array.print();
cout << "\n\n";
cout << "Put the element position you want erase: ";
fflush (stdin);
cin >> position;
cout << "\n";
array.delete (position);
position--;
array.print();
cout << "\n\n";
cout << "Now, the elements of array are going to be sorted. ";
cout << "\n";
array.sorting();
array.print();
cout << "\n\n";
cout << "Put the number of the element you want to look for: ";
fflush (stdin);
cin >> element;
cout << "The position of this number is:" << array.buscar (elemento);
cout << "Put the position of the element ypou wanna look for in the array: ";
fflush (stdin);
cin >> position;
k=[](posicion);       //This is the wrong call to the function and the main problem of this code in C++
cout << "The number of this position is:" << k;
getch ();
return 0;
}

int array_c::operator[](int position)// And this would must be the function.
{
 return array [position-1];
}



void array_c::insert (int position, int element)
{
array[position]=element;
num_elements=position+1;
}

void array_c::delete (int position)
{
int i;
for (i=(position-1); i      {
      array=array[i+1];
   }
num_elements--;
}

void array_c::print ()
{
 int i;
 for (i=0;i<num_elements;i++)
 {
 printf ("%d, ", array);
 }
}

void array_c::sorting()
{
int aux, i, CHANGE;
do
       {
   change=0;
   for (i=0;i<num_elements;i++)
   if (array>array[i+1])
         {
       aux=array[i+1];
       array[i+1]=array;
       array=aux;
       change=1;
      }
       }
while (change==1);
}

int array_c::search (int element)
{
int i;
 for (i=0;i<num_elements;i++)
       {
       if (element==array)
             {
       return (i+1);
         }
      }
 if (i==num_elements)
       {
    cout << "Not exist this number in the array " <<"\n";
    return 0;
   }
}
Nobody can help me a little, please?you need to STATE what problem it is - more info is needed:
which part of the code do u think is faulty or needs replacing?
or rather which function are you not SURE of?Thanks very much for your response!!
Well, the problem is that follows:
I have written all the functions declared in header and the all the main code, but when I have arrived to this 'class array_c' line who say:

 int operator [] (int position);  

And I have written the function call I have understand is good:

k=[](position);

And the function itself:

int array_c::operator[](int position)// (And this would must be the function).
{
 return array [position-1];
}
Then, when I compile, Borland returns me a error message like this:

Call to undefined function what is refered to the 'k=[](posicion); ' line.

I have tried to change it like:

k= operator[](position);

But it doesn´t work neither.

I´m desperated.

Help please.



Sorry for the html code of this web, when I say:
int array_c::operator[](int position)// (And this would must be the function).

I want to say:

 int array_c::    operator[](int position)// (And this would must be the function).  

286.

Solve : C++ Builder 6 - DBGrid?

Answer»

Hi,

How to COUNT the NUMBER of ROWS in a DBGrid?
There are not such methods or properties as ROWCOUNT.

Kind Regards,
ROWIN

287.

Solve : can i ???

Answer»

can write codes that write protect the hard disk in visual basic 6? can any BODY taech me how to? any sample?Making the entire drive write protected WILL CRASH your system (unless you're TALKING about a second drive made just for file storage, but even then...). Windows does more behind your back than you think. So I don't think ANYONE has/will try/tried.

288.

Solve : VBScript help?

Answer»

Hello Everyone.

I'm new here. my name is Nurul. Sorry for my bad english. I need a favor from all of u. []
Currently I am doing a project of landmark tracking AGV. I used Roborealm for the image processing. In my project there are 8 red shapes represents as landmark. All the landmarks are STICK on the floor.

in roborealm I use:
1) Flatten module
2)RGB Module
3)Mean module
4)SHAPE matching module
5)VBSCript module.

Each of the shape landmarks are at their position or coordinate. the sequence and coordinate of the shape landmarks are:
SQUARE (0, 0) -> circle (0, 100) -> triangle (0, 200) -> pentagon (100, 200) -> octagon (200, 200) -> cross (200, 300) -> hexagon (200, 400) -> star (200, 500)

In this project the AGV are require to navigate based on this shape sequence.
For example: when AGV at landmark square  coordinate (0, 0). The AGV must know current position at square and the AGV must know that AGV must move toward circle at coordinate (0, 100) no matter what. Incase there is other shape (e.g triangle or others) interrupt  the path from sqaure to circle, the AGV must ignore it because the AGV know that he must go toward circle no matter what. When AGV reach circle, AGV know that he already at landmark circle.

This condition GOES on same for others shape. When the AGV at cirlce, the AGV know that AGV must go toward triangle at coordinate (0, 200).   When AGV reach triangle AGV know that AGV position is at TRAINGLE, the AGV know that AGV must go toward pentagon at coordinate (100, 200).

My problem now is I don't how to pogramming it in VBScript. [&o]
bellow is what I have done in my VBScript. Hope everyone can help me. I'm dumb in programming. Thank You.
-------------------------------------------------------------------------------------------------------------------
shapeLabel = GetStrVariable("SHAPE_LABEL")

if shapeLabel = "square" then
coordinate_i = 0
coordinate_j = 0
next_shapelabel = "circle"

else
if shapeLabel = "circle" then
coordinate_i = 0
coordinate_j = 100
next_shapelabel = "triangle"

else
if shapeLabel = "triangle" then
coordinate_i = 0
coordinate_j = 200
next_shapelabel = "pentagon"

else
if shapeLabel = "pentagon" then
coordinate_i = 100
coordinate_j = 200
next_shapelabel = "octagon"

else
if shapeLabel = "octagon" then
coordinate_i = 200
coordinate_j = 200
next_shapelabel = "cross"

else
if shapeLabel = "cross" then
coordinate_i = 200
coordinate_j = 300
next_shapelabel = "hexagon"

else
if shapeLabel = "hexagon" then
coordinate_i = 200
coordinate_j = 400
next_shapelabel = "star"

else
coordinate_i = 200
coordinate_j = 500
end if
end if
end if
end if
end if
endif
end if

SetVariable "coordinate_i",coordinate_i
SetVariable "coordinate_j", coordinate_j
SetVariable "next_shapelabel", next_shapelabel

289.

Solve : Oracle SQL problem?

Answer»
I'm having trouble putting the finishing TOUCH to this SQL statement...........

I have 3 locations (location 2, location 3, location 4)  and each location offers 3 services. I want the query to show each location grouped together with the revenue highest, so that you can see the highest service for each location LIKE so.....

location 2 - Service 2 - £50
location 2 - service 1 - £30
location 2 - service 3 - £10
location 3 - service 3 - £40
location 3 - service 1 - £20
location 3 - service 2 - £10
location 4 - service 2 - £45
location 4 - service 3 - £30
location 4 - service 1 - £20

So far the statement i've got is this -

SELECT location.location_id, location.location_name, service.description, SUM(price) AS REVENUE
FROM location, service, service_line
WHERE service.location_id=location.location_id
AND service.service_id=service_line.service_id
GROUP BY location.location_id, location.location_name, service.description
HAVING SUM (price) > 0
ORDER BY revenue DESC;

Which shows the revenue in descending order but this mixes up the locations.

Can anyone point me in the right direction ? Code: [Select]ORDER BY location.location_name ASC,  revenue DESC;
Quote from: Rob POMEROY on April 26, 2012, 07:56:33 AM
Code: [Select]ORDER BY location.location_name ASC,  revenue DESC;

ah, of course, Thanks Rob  No problem.
290.

Solve : Checking for file size?

Answer»

Hi! Is there a way aside from "DIR" to display the size of a file? I am trying to WRITE a script that reads a .error file. If this file is 0kb, that means there is no error. If the file is not 0kb, then there is an error. I APPRECIATE your help on this. Thank you. Hi
this is subathra

you can use a utility called SIZEOF to find the size of a file
i have downloaded it from net
if you want pl mail me at [email PROTECTED]
 So what eles does that program do
Does it just check the files size and thats it ?
I wouldnt MINE installing it

291.

Solve : VB .NET 2008 Embedded Libraries?

Answer»

I am developing an application that I wish to be portable, so that it can be run from a single executable binary. However, I use a number of LIBRARIES, and I have tried relentlessly to search Google for a way to embed them into my compiled binary. I can find nothing, and I suspect the gurus here have a better idea of how to do this. If anyone has any suggestions, please say so, and I thank you in advance for your assistance. If you need any more information, please let me know. I am working mostly in VB .NET 2008 using the .NET Framework 3.5.Reading lour post I nan STILL confused. You use the term embedded to mean a singled binary file. Is that right?

For years the Visual Basic deployment would consist of two parts. One is the code created directly from the stuff you write. The other a library of things that are needed to make the program run. Early versions of Visual Basic had a way of putting it all into one package.

To my limited knowledge, the .NET programming platform does not had this kind of option.   Even if the whole thing is put into one big clump of stuff, after installation it is INDIVIDUAL,  separate blocks of things. This allows updates to be made to the parts of the library without the need for you to  do your stuff over.

Please explain. Do you really want to write portable code? You may need to use a non-Microsoft development platform. Or use one of thee older, deprecated compilers from Microsoft. Which is not always a bad idea.
Yes, by embedded I mean a single binary executable. Generally, I would use a zip file and temporarily extract the files on startup but then delete them on shutdown. This could prevent problems for storing user settings, however, and I'm looking for a separate solution there. But I would consider older compilers, if I could find a way to make my code acceptable for them.First a reference fer the benefit of others.
Visual Basic
From Wikipedia, the free encyclopedia

I trust you already know much of that. I put it here to that others reading this we get the drift of what we are talking about.

Early versions of Microsoft Basic are very different from the current versions of Visual Basic. You could deploy your code to other versions of Windows with almost no issue. However, the free versions presently available are not full development packages,  But he perform very well. They lack some features  needed for commercial deployment. One such feature is to provides a smooth install for the end user.

Are you using a free version of VB 2008, or did you buy the developer version?

What did you find in a Google search?
I used "VB without NET" and got some hist that look intersecting. But I have not tried any of them, so I won't recommend any.

That's about all I know. I gave up on VB6. I needed the money so I sold lit. So now I play with the free version of Visual Studio 2010. Which requires a user to allow the install of the .NET framework  libraries.I mostly use Visual Studio 2008 Express, so I have the free version. I will check the Google results for VB without .NET, but I'm most familiar with the .NET platform. Quote from: bobsklarservices on April 24, 2012, 08:21:13 AM

I mostly use Visual Studio 2008 Express, so I have the free version. I will check the Google results for VB without .NET, but I'm most familiar with the .NET platform.

Visual Basic 6 and earlier are useless now. More importantly, you would have to rewrite the application from the ground up, re-implementing the swathe of missing features of the earlier version, and attempting to do so with incomplete OO features and a haphazard standard library that provides a barely usable collection class, but somehow manages to include a half-dozen financial functions that nobody ever uses.

In this case, you don't want an application that can be "all in one" executable. You want it to be portable. having a portable application does not require the entire thing to all be in an executable. With .NET you can plonk all the required libraries in the same FOLDER. Then the program would run on any system with the appropriate version of the framework installed.

The trouble is of course the CLR. .NET executables are not really windows applications, but rather .NET assemblies that need to be run via the Common Language Runtime. There are two implementations of a run-time: Mono, and of course the Microsoft CLR.

Mono actually includes a tool that sort of does this, mkbundle and mkbundle2 but I'm not sure exactly how wide a scope it is (It places all the required assemblies in a single file, but I'm not sure whether the result includes any run-time).
292.

Solve : Parsing with VBA in Excel?

Answer»

Hello all, I received a .csv file containing the HTML code generated from running a web-based REPORT. I need to parse the file to get rid of all the HTML, leaving only the viewable text. I would like to  just run a macro to perform this but if someone knows another way, say in VB.Net, that will be fine also. Unfortunately I cannot attach the file due to the sensative nature of the data. THANKS in advance for any help provided.
Mark OiumI found this little VB program you MAY be able to use or modify.

Strip HTML

Once you get rid of the HTML tags with the resulting csv text, you can use the SPLIT function to build a zero-based, one dimensional array (use the comma as a delimiter) and go from there.

Hope this gives you some ideas.  8-)How about the extremely easy method of loading the fileup into a browser?  (RENAME to .html first.)  Copy and paste from the broswer to Notepad.  All HTML and formatting will be gone.I have the impression this is a one-time situation.   If so, why not just use the Text to Column command or the Text Import WIZARD in this case?  Isn't all the data in a single column when you first import or copy it into Excel.  If so, then you just select the whole column and parse it.  For a one-time situation, there's not point in even recording a macro to do this.

293.

Solve : C++ Builder 6 - Opening a File?

Answer»

How to open a FILE (for READING) in C++ Builder using codes?

294.

Solve : poor laptop?

Answer»

I was given a toshiba satellite 2595 xdvd. It won't boot up, as soon as i turn it on it says ( invalid system disk                       )
          ( replace the disk and press any key)

Any ideas? :-/Is there a CD or FLOPPY in a drive?  If not, it sounds like the laptop needs reinstalling.  No big deal if you have the disks.There are no discs in it ANYWHERE. I tried to install windows xp on it but i get the same message, i can"t even get it to bring up DOS.Thanks for the help though.So you've tried a DOS boot disk?  Have you set the BIOS to boot from the floppy drive?Try a Win98 book floppy. If you can get into Dos from that, I think it's a bad HARD drive. I had one that crashed on my old MICRON lappy and it did the same thing to me.[highlight]Self extracting bootdisk image
Boot CD ISO image[/highlight]It is a bad hard drive. PERHAPS that was why it was given away?

295.

Solve : security settings wont allow downloads?

Answer»

I keep GETTING the message "your CURRENT SECURITY settings do not allow this file to be downloaded".  I was trying to download some clipart but I have gotten this message before. Can someone TELL me what I need to change?  It's been awhile but I have downloaded this clipart before. ThanksWhat browser are you using? meme.... If your using IE 6 , click tools/Internet Options ...... security Tab ....
then in each of the Web Content Zones ...... click DEfault level .....then Apply and ok ...... ( do this in each of the 4 Zones )   Then try your d/l again ......
BTW , your not using a college or university network are you ?


dl65

296.

Solve : C++ Internet Explorer Fullscreen (F11)?

Answer»

You might have read my other post here.

I now understand that I can't PUT any script in my .html documents that would manipulate the browser's window to fullscreen automatically. Now I want to try giving my friend an .exe file or if I can a .vbs file that would start internet explorer go to my webserver, maximize the screen (F11), and autohide the BUTTONS at the top.

What kind of code could I use to achieve this for a C++ or Visual Basic Script? :-?http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/vcrefchtmlviewsettheatermode.asp

I don't know enough about C++ to tell you how to implement it, but it should help you get started. Quote

I now understand that I can't put any script in my .html documents that would manipulate the browser's window to fullscreen automatically

Using both the Screen OBJECT and the Window Object, you should be able to calculate the client's screen size, the current browser window size and resize the window accordingly.

Note: Write a Window_Onload routine using any script language you like.

Good luck. 8-)THANKS, I'll get started.
297.

Solve : Visual FoxPro: Remove Duplicate entries?

Answer»

I have a table called signoff in Visual Fox that looks something like this:

id_code      rostdate      usrid      date      time      status      changed      unit

WIL4512      18/08/03      JS1      25/08/03      07:36:51      A      FALSE      4T
WIL77812      25/08/03      JS1      08/09/03      07:53:02      A      FALSE      4ST
WIL122      01/09/03      JS1      08/09/03      07:53:02      A      TRUE      4ST
WIIA12      08/09/03      JS1      22/09/03      07:57:43      A      FALSE      ST
WILLA12      15/09/03      JS1      22/09/03      07:57:43      A      FALSE      4EST
WLIA      22/09/03      JS1      03/10/03      09:06:03      A      TRUE      4EST
WILLIA12      29/09/03      JS1      03/10/03      09:06:03      A      FALSE      4EST
WILLI485      06/10/03      JS1      20/10/03      07:57:24      A      FALSE      4ST
WLIA12      13/10/03      JS1      20/10/03      07:57:24      A      FALSE      4T
WI8992      20/10/03      JS1      03/11/03      08:33:17      A      FALSE      4T
                                                   :
                                                   :
                                                   :
                                                   :


Some of the entries in the table are duplicated.

I want remove the duplicated record such, that only the records with the least data is deleted.

I have this much code so far:
Select Id_code, Rostdate, Usrid, Date, Time, Status, Changed, Unit, count(Id_code) from signoff order by id_code GROUP by id_code, Rostdate, Unit
(I want code to use from the command prompt)

this shows me which records are duplicated (ie have the same Id_code, Rostdate and Unit). In the duplicated records, are like this:

id_code      rostdate      usrid      date      time      status      changed      unit

WIL4512      18/08/03      JS1      25/08/03      07:36:51      A      FALSE      4T

WIL4512      18/08/03            - -                  TRUE      4T


the code above gives me the secound LINE and the number of times it was duplicated, but I want the 1st line so that, I can remove all DUPLICATE entries of the original table and use a command to get the 1st line so that I can append it on after the duplicate entries have been deleted.

Can SOMEONE please help me?What is the best way to go about it?

Please find tables attached.





298.

Solve : Borland Delphi Runs Slowly?

Answer»

i started programming in delphi environment for days when i run it it takes some time that is not acceptabale,and when compiling and calling the help file it takes some time,for finding that what's up i headed to Performance console
,i saw that the cpu usage is maximum on 60% (my cpu is Amd 64 bit 3000+)

but to options are almost on 100%:
1.Pages/Sec
2.Avg. Disk Queue Lenght

i want to know what the exactly are and if i need to upgrade a hardware what would it be?
(and i have 512Mb of Ram Memory)
THANKS alot  OK, I do not have that particular language, but I should be able to at least start helping here.

When you say "programming in delphi environment for days" do you mean the computer is on for days? If so, that'll make any machine run slowly, and thus the compiler as well. Also, the amount of time it takes to compile is directly related to the length of the code. If I WROTE a huge HUGE program in Basic or C++ I could expect to start compiling and go to lunch while it compiles. How long is your code?

As for the help file taking a while, I feel your pain. That's because there's so much info that it takes time to load it all. Really bugs you when you just want to look up a syntax, doesn't it? what i mean by days is i started programming in delphi for days(i USED to use PASCAL)
,ok after all this what are the system requirements for programming?(code an application like msword)
what's you'r idea?

299.

Solve : VHDL?

Answer»

hi,I would like to know that what is VHDL and verilog.thanks for ur time. A quick GOOGLE search turned up this ....... You should really GET USED to GOOGLING

VHDL....... http://www.vhdl-online.de/tutorial/      ( plus about 8 million other results)

verilog...... http://www.verilog.com/


dl65  

300.

Solve : Calculator Program?

Answer»

I realize a calculator isn't really a computer, but I thought I'd give it a shot anyway.

Does ANYONE know how to make a program in a calculator so that when you execute it numbers just show in the screen and KEEP changing? Like in the matrix when the rows of numbers keep going and going. I saw it on someone else's calculator but that person didn't code it himself so I was WONDERING if anyone here knew..That program would vary with each programmable calculator. Each has its own "language".So would it help if I told you it's a TI-84 Plus Silver Edition?If there is a random function on the ti-84, you could generate a line of random numbers and just print them out. It would scroll by itself as each line got full making it look like it was dropping down. It'd be a cool effect. Quote

That program would vary with each programmable calculator. Each has its own "language".

I thought they'd all use C++
So I assume no ONE really knows how to code it?just thought i'd make my first post count

go to make a new program, type in a name for it, now at the program screen enter the code

: Disp rand                                     (the rand key is in the math section, press math, left one time, and there u go
: prgm (thenamegoeshere)           the namegoeshere MEANS enter the prgm name u made up and place it there, without ()Is there a way to make it so that there are no decimals in front of the numbers?In case anyone cares, here is the correct way to make a "matrix" program:
:Lbl 0
:Disp randInt(1000000000,9999999999)
:Goto 0

Then executeCool amando

This work on Flash
I made a matrix animation