I would like to generate permutations of string words that are inputted from a file. I know the count and was wondering if there is an easy way to do this using an arraylist.
I have a text file.
I read each line with sr.readline();
as i read that line, i want to search for it in a List that it should have been added to previously, then add it to a NEW list. How do i do this?
I have two separate areas in my form.
Left side for radio buttons, combo boxes, etc.
Right side for tabs and even tabs within tabs.
For each tab selected, I'd like to display different controls on the left side for use in that tab.
I've tried using many things, including focus, click, etc. Nothing seems to work the way I intend it to. Especially on the tabs within the tabs.
Thank you.
My sapi grammar file looks like
<RULE NAME="SOUNDLOG" TOPLEVEL="ACTIVE">
<O> Please </O>
<O> Enter</O>
<P>
Name
</P>
<P>
<RULEREF REFID="VID_InputType" />
</P>
</RULE>
<RULE ID="VID_InputType">
<L PROPID="VID_InputType">
<P >John</P>
<P>Jill</P>
<P>Gary</P>
</L>
How do I get the name when it is recognized by sapi recognizer?
Can I use compiler from VS 2010 while using VS2008? The reason for that is that VS 2010 really pisses me of with its sluggines and other not less irritating things.
I am about to give up debugging SMTP servers to send email... My code is the following
private void SendMail()
{
SmtpClient mailClient = new SmtpClient("smtp.mail.yahoo.com", 465);
mailClient.EnableSsl = true;
MailMessage message = new MailMessage();
message.To.Add("[email protected]");
message.Subject = "i wish it would work";
MailAddress fromAddress = new MailAddress(Email.Text, Name.Text);
message.From = fromAddress;
mailClient.Send(message);
}
I'm using Nunit for unit testing, and added another project called "Unit Testing" to my current solution. I referenced Nunit, and changed the Namespace to the same namespace used in the main project.
I can't seem to figure out how to get access to all the classes, files, etc in the main project. Is there something I have to do to link two projects?
Can anyone list the specific and detailed steps to configure mc.exe (the message compiler) to compile a .mc file into a .rc file as a custom compiler step in VC++ 2010?
I am really lost on how to do this.
I converted all my other projects fine from VS 2008 to 2010 and they run great. There is one project however for some reason after converting, when I try to run one of the .aspx pages in it, I get nothing...no error, just that it cannot display the page.
Nothing has changed. The path is still the same, and the IIS website is still the same. I even recreated the site in IIS using the VS option to create it in the web project properties.
This is a testing project..only has like one .aspx in it.
Not sure why I get nothing after converting this. I did not convert it to .NET 4.0, it's still in v3.5 in VS 2010.
I have written the following code after creating the CRichEditCtrl
// 06112010 : The following code was added to highlight the textselection in black color instead of the default blue color of CRichEditCtrl. - 1311
{
m_EditControl.SetSel(0,100);
CHARFORMAT2 cf1;
cf1.cbSize = sizeof(CHARFORMAT2);
m_EditControl.GetSelectionCharFormat(cf1);
cf1.dwMask = CFM_BACKCOLOR ;
cf1.dwEffects &= ~CFE_AUTOBACKCOLOR;
cf1.crBackColor = RGB(0,0,0);
m_EditControl.SetSelectionCharFormat(cf1);
m_EditControl.Invalidate();
}
After this I am adding text, but the selection still comes in blue color instead of Black. Could someone please tell me what I am doing wrong??
Thanks,
DeV
im trying to embed flash in my program by placing flash.ocx in my app's folder without having to register it. i found DirectCom.dll and with this code i can show the right version of flash.
but how do i show it on the form and load the movie?
Private Declare Function GetInstanceOld Lib "DirectCom" Alias "GETINSTANCE" (FName As String, ClassName As String) As Object
Dim ShockwaveFlash1 As Object
Set ShockwaveFlash1 = GetInstanceEx(StrPtr(App.Path & "\" & "flash.ocx"), StrPtr("ShockwaveFlash"), True)
MsgBox ShockwaveFlash1.FlashVersion
Hey,
I was wondering, what was a good cross-platform utility for doing audio recording/ playback/ seeking in C++? I was thinking going the route of ALUT (OpenAL), but is there a better way? If not, do you guys know of any good tutorials/sample code for ALUT?
I'm trying to modify a stored procedure used in an ASP.NET page.
By default, the stored procedure returns all of the data, which can be overwhelming for employees in the plant.
I want to add a drop down menu item for the column name and a text box for a value to allow our employees to search the data for their specific items.
What I would like to add is the ability to pass in a Column Name and Column Value to search, similar to the following:
DECLARE @colName nVarChar(50), @colValue nVarChar(50)
SET @colName='EmployeeID'
SET @colValue='007135'
SELECT Column1, Column2, Column3, Column4, Column5, Column6, Column7
FROM viewNum1
WHERE ((@colName IS NULL) OR (@colValue IS NULL) OR ('['+@colName+']'=@colValue))
If all values passed in (@colValue and @colName), all records return; however, if I try specifying that @colName=EmployeeID and @colValue='007135' (a value that does exist in the database), no records are returned.
Next is the problem that I am running an old SQL Server 2000 database that does not allow the stored procedure to access the table column names, and the whole technique looks prone to SQL Injection.
Finally, I don't see how to bind my GridView control to this and still have the ability to display all records.
How would I write such a filtering stored procedure?
I am trying to integrate PJNSMTPCONNECTION CLASSES in my project; they say that those classes do not use MFC.
My project is with the setting like MT, and using standard library linking.
When I try to compile, I am getting
CSTRING not defined and
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
If I include afx.h and remove windows.h,
I am getting iDLLMain already defined errors.
How do I resolve these problems, please?
when i tried to create shared library file using a "cl" command in vc++, it shows a error saying that "fatal error c1083: can't open compiler generated file 'file.obj':permission denied"
can any1 help me...???
I have a problem with this code.
What I am looking for in the code is to get the result of "first" and "second" randomly and put the result in a file.
It works great if I run it without using the file and I get all the correct results, but when I try to save the result in the file, I get only the first node which contains (first, secnd).
Here is the code:
#include<iostream>
#include <fstream>
#include<cmath>
using namespace std;
void main()
{
int first[100],secnd[100];
for (int i=0; i<100 ;i++)
{
first[i]=rand()%500; //random number from to 499
secnd[i]=rand()%500; //random number from to 499
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile <<first[i]<<" "<<secnd[i];
myfile.close();
}
}
Are there any tools/libraries on Windows that can help me tarck down the culprit? This is a fairly large codebase, with multiple threads.
I code for Linux mostly; Windows is unfamiliar territory. Thanks for your input.
Something weird that I've been seeing, a web application written in ASP.Net (C#) that got the source code on the production server and compile that way. So when I deploy to the server I deploy the source code.
Why does .Net have this functionality? Doesn't make sense.
In VS 2010RC I have to specify configuration properties and specifically included path every time I'm creating new project. Is there a way to do it just once for all future projects?
I'm asking this for a reason that I'm starting to use Boost libraries and I have to specify all those paths every time I'm creating project which is bit tedious.
HI Folks,
I have a threaded C++ program where up to three threads are calling select on a three separate socket descriptors waiting for data to become available. Each thread handles one socket and adds it to the readfds with a timeout of 300 seconds. After select returns if there is data available I'm calling recv to read it.
Is there anything that I need to be aware of with winsock and threads because for some reason after a number of hours the select calls all seem to be not timing out. Can a multi threaded program select from a number of threads without issue?
I know that I should have one thread listening to all three sockets however that would be a large change for this app and I'm only looking to apply a bug fix.
cheers,
Martin.
When you right click and do a Select top 1000 rows from a table in sql 2008, it opens a tab and writes the sql and then executes it. This is okay, however I'll erase the sql and use the same tab often to do other sql statements. What annoys me is that I have to go to the database drop-down at the top of the window and change it to the current database I'm in because it says Master.
How can I make sql 2008 update the selected database for this tab automatically when I right click a table and do select top 1000?
On a side note, can I automatically hide the select statement that it generates and just show grid of results?