|
thanks for ur help. i get my solution from ur message.
|
|
|
|
|
How to send sms from internet ?????
Please help me
-- modified at 17:12 Tuesday 30th May, 2006
|
|
|
|
|
How to send sms from internet ?????
Please help me
|
|
|
|
|
Hi,
I've been seeing of lot of Lua everywhere lately and i was planning to use it in one of my C# projects. i found this:
Lua interface[^]
basically what my application does is scrpae some information off a webpage. Since the website pattern could change anytime, i decided to use Lua for do the screen scraping. What would be better -
have my C# application get the source of the wepage and pass it to the Lua interface for data extraction and then have Lua return the extrcated data to my program
--or--
Make Lua, get the source of the webpage itself, extract the data itself, and then pass the data to the C# Program
I'm really confused (like I always am ). Could someone help me out here?
|
|
|
|
|
That depends on the reason why you want to use Lua for this. If it's good for requesting web pages, use it for that, otherwise not.
---
b { font-weight: normal; }
|
|
|
|
|
Well, after all I've read on the Internet my heads ringing with one thing. Thye all say Lua is excellent for small scripting, stuff like AI, data extraction etc. I came across this sotware called FreePOPs[^]. It basically lets you use your email client with email sites such as Yahoo and Hotmail which natively dont support POP access. They use Lua as the Screen Scraping code. When the design of the emil site changes, the software doent work and you can just download a fresh working version of the screen scraping script. Now, would this help you to reach a decision.
|
|
|
|
|
Hello All,
I'm using a BackgroundWorker to check database permissions in the background while my GUI is servicing request from the client. The user enters the db host name, username and password then a BackgroundWorker thread gets kicked off to retrieve the list of databases that are available on the specified host. When the correct information is passed into the textboxes everything works fine. When the user enters wrong information (like a wrong password), I would like to display an error message and disable the combobox that holds the list of available databases.
I'm doing all the database work inside a method called bgWorker_DoWork() which is triggered by the BackgroundWorker.RunWorkerAsync() delegate. It is in this method where I catch an OleDbException that gets thrown when the login to the database fails. Inside my bgWorker_RunWorkerCompleted() method I look at the RunWorkerCompletedEventArgs to see if there were any problem while running the bgWorker_DoWork() method however even when an exception has been thrown RunWorkerCompletedEventArgs.Error is always null. Am I missing something else that I should be doing or is this a bug in the framework ?
|
|
|
|
|
Are you sure your bgWorker_DoWork() method throws an exception? Did you try stepping through the method under the debugger?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How can I open (popup... not in browser) notepad from browser.
For example: I have some .txt file in my database. I want to open it from browser, where user can edit the .txt file and at this time database will be update internally.
OR
I have some file which I want to open in notepad from browser, it will be display on popup.
JUST LIKE:
Windows Platform where we use
System.Diagnostics.Process.Start(@"C:\Documents and Settings\Billah\My Documents\Data Grid.txt"); OR
System.Diagnostics.Process.Start("notepad.exe",@"C:\Documents and Settings\Billah\My Documents\Data Grid.txt");
If I start a process from ASP.NET using System.Diagonistics.Process.Start method. It start in the background (we can see it in task manager), but I can't see it on the browser.
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
System.Diagnostics.Process.Start("Notepad.exe");<br />
}
IIS Admin Service runs as a local system
So, how can I see the notepad which runs at background?
Thank you
BILLAH
-- modified at 4:49 Sunday 28th May, 2006
|
|
|
|
|
Billah wrote: If I start a process from ASP.NET using System.Diagonistics.Process.Start method. It start in the background (we can see it in task manager), but I can't see it on the browser.
Also, you should realise that it is running it on the server, not the client. If you have the client browser running on the same machine as the server then you are obviously getting confused about what is running as part of the server and what is running as part of the client.
You cannot run applications on the client because it is a security risk for the person using the client.
Billah wrote: I have some .txt file in my database. I want to open it from browser, where user can edit the .txt file and at this time database will be update internally.
Create a page with a big text box and load the text in to that. On the post back you can update the database.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Dear Colin Angus Mackay,
Thank you for your reply.
I want a popup notepad which will retrieve data from database. Now it will display in IE. If possible, please Send me a project which display a popup notepad with data or without data where user can edit text and save it in Hard Drive.
Thankyou
BILLAH
|
|
|
|
|
Billah wrote: I want a popup notepad which will retrieve data from database.
Notepad cannot retrieve data from the database. It is beyond the scope of the application.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hi everyone,
I have a set of data(I call it a docket), which I can quite happily represent with an object. Now the data contained in this object has to be sent to various customers - only they all need it in different formats! And worse still, some of the "general" formats change between customers - so for exapmple, one customer needs the data in a fixed width file, whilst another needs it in fixed width, but in a slightly different fixed width format.
So, taking the one problem of multi-version fixed width format (I think the answer to this will enable my to solve the other formatting problems), how can I use OOP technology in C# to implement a writer/formatter type object? I've had a look in the .net framework, and seen many objects called formatters, but I'm not sure how these have been implememnted, or even if their definition of formatter is the same as mine...
Thanks,
Martin.
|
|
|
|
|
Hi all, i posted a msg earlier, but unfortunately nobody happened to know the answer.. so its more like a challange...
can you figure out the algorithm for the following problem:
Consider a = {a , a , a ,...., a } //random values within set a
----------i----0--1---2-----n //these are the sub values
also
b = {b , b , b ,...., b } //random values's within set b
-i----0---1---2------n //these are the sub values
And
S = a + b
-i----i----i //these are the sub values
Find an algorithm O(n), that can return the n largest number(s) using c#..
Thanx soo much in advance..
Elie
|
|
|
|
|
Eliee wrote: but unfortunately nobody happened to know the answer
Perhaps noone knew the question...
The C# language does not use sets. Would that be a set in the same manner as it's used in Pascal? What are the sub values you are talking about? Why are you adding the two sets? Where should the algorithm be looking for the largest numbers?
---
b { font-weight: normal; }
|
|
|
|
|
HEy there Guffa..
Well a set could be intstantialized and taken to be as an array of values.. so take it as in this perspective.. The sub values are the elements of an array..
S is the set where the combinations of values of both {a} & {B} are combined..
What is required is to look in S and to find the greatest value (s) and directly return it with a speed algorithm of O(n)..
Hope i helped u a bit..
Thanx 4 all participating in this question..
Elie
|
|
|
|
|
Eliee wrote: Well a set could be intstantialized and taken to be as an array of values.. so take it as in this perspective.. The sub values are the elements of an array..
So the sub values are the values? Why do you call them sub values, then?
Eliee wrote: What is required is to look in S and to find the greatest value (s) and directly return it with a speed algorithm of O(n)..
What does the two sets and the combining of them have to do with anything, then? Isn't that totally irrelevant?
Unless the values are sorted (which would make the entire question rather silly), you have to check each value to find the largest. Just loop through the values.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa, assume that we have like a dozens of long (sets/arrays), and we choose only two (a and b) out of the collection; i wanna choose two sets (combined into one set/array) and then return the n largest number(s) usuing c#, with an algorithm as efficient as O(n)...
U got me pal?! Hope i cleared things a bit..
//remember the long sets/arrays arent sorted.. so pay attention to efficiency
Elie
|
|
|
|
|
Eliee wrote: so pay attention to efficiency
Gosh! That's a bit of a schoolmarm comment.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Is there any reason you want to combine the sets? If you mean that the combined set should not have duplicates, that seems like a lot of unnecessary work if it only is going to be used to find the largest value.
Otherwise just find the largest value in each set, then pick the largest of those two.
Are you making something that is going to be used for something, or is it just a school assignment?
---
b { font-weight: normal; }
|
|
|
|
|
Okay, if you want to find the n largest numbers in a large array of numbers, here's one way to do it:
(I'm a VB.Net regular myself, and I don't really have the time to figure out how to produce guaranteed-to-work C# code, so I'll do pseudo-code here)
Define a variable smallestSelected to hold the smallest eligable number, and initialize it to zero.
Define an array, say largestNumbers, large enough to hold n values.
Define a variable smallestSelectedIndex to hold the index of the smallest selected number in the largestNumbers array
Define a rolling index variable, say index, to hold an index into the largestNumbers array.
Loop through all your array's elements, and if the current element value > smallestSelected, then:
if the largestNumbers array is full (index == n-1):
replace the element in largestNumbers at smallestSelectedIndex with the current value
if the largestNumbers array is not yet full,
set the largestNumbers array element at index to the current value; increment index;
At this point you should determine the new smallest value from the largestNumbers array will be and to do this you will either have to sort it, or loop over it to find that number.
If you're opting for the sorting approach you could make largestNumbers a sorted list of kinds, and there'd be no need for a rolling index pointer since you could always pick the first element (which is the smallest number), remove it, and add the new value.
The result of this should be O(n) on the original array, but a slight overhead on each iteration that yields a value that is larger than the current smallest eligable number.
This is a bit off the top of my head, so if there's any really bad flaws to the logic, feel free to comment on it ;o)
Hope this helps,
Danny
|
|
|
|
|
Hello people !!. I'm developing in vs 2005 and I've a problem that may be you can help me to solve it.
I have a winform, a boolean attribute for a state and a timer. The timer see the state and if is closing then it start fading out. So the only things I have is a timer to animate fade out on mouse leave event.
The problem is this example run excelent in Visual Studio 2003, but a flick appear in VS 2005 when I leave the form. May be a problem with winfows.form or system.drawing
Any ideas??
I have this very simple code:
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsApplicationTest
{
public class Form1 : Form
{
private bool m_closing;
private System.ComponentModel.IContainer components = null;
private System.Windows.Forms.Timer timer1;
#region Windows Form Designer generated code
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 20;
this.timer1.Tick += new System.EventHandler (this.timer1_Tick);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font ;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(292, 266);
this.DoubleBuffered = true;
this.ForeColor = System.Drawing.Color.White ;
this.Name = "Form1";
this.Text = "Form1";
this.MouseEnter += new System.EventHandler(this.Form1_MouseEnter);
this.MouseLeave += new System.EventHandler (this.Form1_MouseLeave);
this.ResumeLayout(false);
}
#endregion
public Form1()
{
this.SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer, true );
InitializeComponent();
}
private void Form1_MouseLeave(object sender, EventArgs e)
{
m_closing = true;
}
private void Form1_MouseEnter(object sender, EventArgs e)
{
this.m_closing = false;
this.Opacity = 1;
}
private void timer1_Tick(object sender, EventArgs e)
{
if (m_closing)
{
if (this.Opacity > 0)
{
this.Opacity = this.Opacity - 0.01;
}
else
{
Close();
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Thanks a lot !!!!
|
|
|
|
|
Have you tried enabling double buffering?
|
|
|
|
|
yeap, I try that when I start havinf the problem but the problem still there. You'll see that the problem is with VS 2005 but not in vs 2003.
Thanks.
|
|
|
|
|
I found the problem ...
See this link:
http://www.dotnet247.com/247reference/msgs/42/214827.aspx
Yes, that is what I found. I hadn't seen the flickering before because my
form was too small.
However, this is true. The flickering occures when the underlaying window is
switched to "layered mode". Actually it flickers even if you set alpha to
255 (fully opaque).
Switching to layered mode involves three steps.
1. Checking the os version - it has to be NT 5 or latter
2. Set WS_EX_LAYERED window style
3. SetWindowLayeredAttributes this method is not defined in user32.dll for
versions before Win2k that's why first step is necessary.
When a Windows Forms control is created it is not a layered window. And it
switches to this mode when set the opacity to some value less then 1.
So my solution is to switch to layered mode in some early stage of the form
life. As soon as the form is created before to become visible. Otherwise
we'll see the flickering.
Javier is completely correct that the layered window has to be fully
redrawn. But it goes only when the window (form) resizes. You can still
invalidate some portions of the form and it will works how ot supposed to
work.
Layered window could even show better performance in some situations.
How internaly layered windows work is all painting is redirected to
off-screen buffer and when the painting's done alpha blending is applied to
the resulting picture and the result is drawn on the screen. This of course
is done internaly in windows and it uses the video card hardware support for
alpha blending if it has any.
Becuse all winodw is double buffered Windows doesn't send WM_PAINT when the
form is moved for example or when some part of the form is uncovered. In
such cases Windows uses double buffered image.
When children control is moved on the form it updates as much as it is
necessary. So the performance hit is not so big.
Anyway, my first solution that I was planning to post involved P\Invoke and
calling all API functions necessary to switch to "layered mode", but then I
found that if one set Opacity to value less then 1 and then return it back
to 1 the form class doesn't switch to the "normal mode" and leave the window
layered.
So the easiest way to get rid if this flickering is by overriding
OnControlCreated method and adding the following two lines:
this.Opacity = 0.9;
this.Opacity = 1;
No more flickering .
Thanks a lot people !!!
|
|
|
|
|