|
BobJanova wrote: Programming isn't something you should just hack around and hope something works
I actually know a couple of well respected developers that have mastered the ability to "just hack around". A sort of meta-p.o.c. type development. The things that work correctly, stick, while the things that do not, changes until it works correctly. QA/QC would be obsolete if everything worked the first time -which is realistically known as inconceivable. The type previously described is one way to make it to QA. I take a different approach personally but, it really doesn't matter as long as the code functions as required, is maintainable, and is complete in the allotted time. What are "best practices" anyways other than socially acceptable opinions? Don't get me wrong, I do tend to agree with development best practices but when it comes down to it, it is merely an officially accepted opinion on how things should be.
|
|
|
|
|
DataGridView is filth and shouldn't be used for "real work".
missoby wrote: I want to ... manage user profile
Write a proper Form for doing that -- your users will thank you.
|
|
|
|
|
Hi
How load image with dat format in csharp?
|
|
|
|
|
|
A "DAT" file can be anything. It's a generic extension that just means "Data". You have to examine the file contents directly if you want to figure out what is in the file.
You can try to load the file with the Image.FromFile class, but if it isn't a image standard that's known, it's not going to work. Then you'll haev to use your eye balls and examine the contents byte-by-byte to figure out what kind of file it is.
|
|
|
|
|
hi, i am interested in making a simple software to download data from usb port from device such as a finger print reader, or those finger print software.
anyone know the basic and can point me in the right direction to read the relevant required programming class in vs.net c#?
|
|
|
|
|
|
There should be an SDK for such a device. Try to get it from the manufacturer. Ideally, the SDK has an example program in a .NET language, but it could be that you have to figure it out from plain C code.
If no SDK is available, things become complicated, and I cannot tell you how to do that.
|
|
|
|
|
You don't talk to the "port" like you do a serial or parallel port. Look at the name: USB. Remember what it stands for?? Universal Serial BUS.
It's a bus, not a port. It's no different than try to talk to the expansion slots inside your computer. You can't. You talk to the devices plugged into them, not the slots themselves.
The best option you have is to get with the manufacturer of the device and get the SDK for it. If there isn't one, your project just got a whole lot more complicated.
|
|
|
|
|
I am working on a series of projects that will share several libraries/assembies. Some projects will be part of shared solutions, some will not.
I am looking at the best way to setup my SCC server (TFS 2010). My current thought is have a shared Assemblies folder that each project has a branch of. The problem is after a while (months, years, ect.) that Assemblies folder will get pretty big, as well as contain several versions of DLLs.
How do you guys go about doing this? I've seen suggestions to have each project have it own Assemblies folder, but I would really like SCC to have the Assemblies folder out of project level as well.
Any ideas? P.S. Sorry if it doesn't make too much sense, I am over tired and took a sleeping pill for good measure.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I don't know anything about SCC, but it sounds dreadful.
Are these third-party DLLs? If so, I agree with keeping them together.
|
|
|
|
|
Have a separate project in source control that contains nothing but common dependencies, and include that in all the other projects (either by a direct reference mechanism if TFS supports that, or just by checking it out adjacent and referencing things by ../ paths).
|
|
|
|
|
Expert Coming wrote: Any ideas?
Depends on what you mean by "projects".
I work on 'deliverables'. Each of those represents a discrete business grouping of functionality which can and does include groupings like the following
1. One or more dlls.
2. A single executable (console or windows service)
3. Several executables.
When each is delivered it is labeled in source control (vendor does not matter), built from that label, and only that label, and then delivered as a single module/release.
Each deliverable is independent from the others and the expectation is that each can have their own project timeline, etc.
Since the deliveries are independent each deliverable MUST be contained within itself. That requirement means that if a single deliverable is using some sort of "shared" functionality (such as a library dll) that that shared functionality MUST be represented as its own deliverable.
This is true whether I produce the shared code or if I am using a 3rd party library.
That is the only way to insure that the code is written to match what it will be delivered with and tested against the same.
|
|
|
|
|
how to convert file bmp to array binary. aray with values 0 and 1
lieu_li
|
|
|
|
|
|
You can use a BinaryFormatter .
E.g,
MemoryStream ms = new MemoryStream();
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(ms, bitmap);
|
|
|
|
|
It really depends on what you mean.
If you convert the BMP file to a byte array, then it is in a binary format, however this is not a "0" and "1" value set by pixcel.
MemoryStream ms = new MemoryStream();
imageIn.Save(ms,System.Drawing.Imaging.ImageFormat.Bmp);
return ms.ToArray();
If you are actually trying to convert a image to "this pixel is a '1', this pixel is a '0'" monochrome then that is quite a bit more work. If this is what you want, then there is a solution here:
How to convert a bitmap file to monochrome format (1 bpp)[^]
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
|
You're welcome!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
hi to all
I need a function have a parameter talking by user return writing this text on rich text box (c#)
i installed speech lib but this file SAPI.dll is not installed
please i'm very need necessary for this function
Thanks for the continued
|
|
|
|
|
|
Hi, I have the code:
using System;
delegate void MyEventHandler();
class MyEvent
{
public event MyEventHandler SomeEvent;
public void OnSomeEvent()
{
if (SomeEvent != null)
SomeEvent();
}
}
class EventDemo
{
static void Handler()
{
Console.WriteLine("Event occurred");
}
static void Main()
{
MyEvent evt = new MyEvent();
evt.SomeEvent += Handler;
if (evt.SomeEvent == null) Console.WriteLine("Ev. nu are nici o metoda in lista");
evt.OnSomeEvent();
}
}
Why in the case of the second if (from Main) I have compiler error: error CS0070: The event ‘ConsoleApplication2.MyEvent.SomeEvent’ can only appear on the left hand side of += or -= (except when used from within the type ‘ConsoleApplication2.MyEvent’)
And in the case of te first if it is OK ?
<div class="signature">tom</div>
|
|
|
|
|
Because that's how events work in C#.
Only the class that defines the event can access it that way; other classes can only add and remove handlers.
However, a common practice with events is for the class to declare a Raise method that will check for null and raise the event. Ideally this method would be private or protected, but you could make it public if you really wanted to. If you are just learning about events that may make some sense, but it's generally not a good idea as it pretty much violates the whole idea of events.
Furthermore, if that does make sense, maybe you just want a regular delegate rather than an event.
We would need to know more about what you are trying to accomplish.
|
|
|
|
|
And how I test the null handler list in Main :
if (evt.SomeEvent == null) Console.WriteLine(“Event refered the null list”);
|
|
|
|
|
you don't.
think what you are trying to do here, you have a class called MyEvent which owns and exposes an event. That class is solely responsible for managing that event, other classes interacting with it are merely listeners
The only point at which an event being null should matter is if you are about to invoke it. The only thing that invokes an event is its owner class and therefore only MyEvent needs to care about SomeEvent being null.
Therefore if you want a console output for an attempt to invoke an event for which no event handler has been attached it should go in the OnSomeEvent method of the MyEvent class
Pedis ex oris
Quidquid latine dictum sit, altum sonatur
|
|
|
|