|
Most statements about language choice and resulting performance are crap.
Are they referring to "black box" performance (i.e. I know nothing, I don't care, just show me)? or optimal code for each? or something pragmatic in-between?
If you want to solve one problem in 3 languages, you probably are thinking in one language, designing and implementing the code, then porting to the other two. And it is likely the first one will end up to be the fastest.
However, if you know the 3 languages equally well, and would start from scratch each time, the results may already be different. Then the tools and the compiler settings come in.
I have seen Java and C# beat C and C#, and vice versa. It all depends.
If you need to know, for a particular application, and a particular person or team or programming style, find out what the kernel of the app is, and give it a try, everything else is BS.
|
|
|
|
|
devvvy wrote: Or am I mistaken, that .NET really is a [significantly] slower...?
You can optimize your code in any language if you know the internals and other pitfalls. So comparing one language with other language in terms of speed is just pointless. Also the test shown in that web page uses .NET framework 1.1 which is quite old.
I'd say the link you pointed out is just crap.
Best wishes,
Navaneeth
|
|
|
|
|
They tested only .NET 1.1, and clearly only in 32bit mode. The performance characteristics of .NET 2.0 are very different (less boxing/unboxing for example) and the 64bit version is also completely different (which extra optimizations which are not done by the 32bit version, and of course 64bit math is basically twice as fast)
|
|
|
|
|
any more conclusive references online anyone?
dev
|
|
|
|
|
Sadly the best language benchmark out there doesn't include C# properly, that is, they use Mono which obviously has completely different performance characteristics.
Also there isn't really just "1 number" that says how fast a language is of course, for example, C# has unsafe pointers making image manipulation several orders of magnitude faster than in Java, but common Java JIT compilers have more SSE capabilities than the JIT compiler in the CLR, so numerical algorithms may be faster in Java (provided they do not use any trig, which is a disaster in Java) - but then of course C++ will beat both when it comes to raw numerical power (as seen here[^] out of the top 6 fastest languages, 5 are C or C++, Java isn't far behind and C# was tested with Mono so it's result is essentially useless)
|
|
|
|
|
I wanted to crop multiple images at the same time.I tried to integrate the code for cropping single image with my code and got messed up.Can somebody help with this code.....
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;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
namespace batch_image_editor
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
{
}
private void addphotos_Click(object sender, EventArgs e)
{
opend1.Filter = "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*";
opend1.Multiselect = true;
imageList.Images.Clear();
listView1.Items.Clear();
if (opend1.ShowDialog() == DialogResult.OK)
{
listView1.View = View.LargeIcon;
imageList.ImageSize = new Size(50, 50);
for (int c = 0; c < opend1.FileNames.Length; c++)
{
Image i = Image.FromFile(opend1.FileNames[c].ToString());
Image img = i.GetThumbnailImage(256, 256, null, new IntPtr());
imageList.Images.Add(img);
}
listView1.LargeImageList = imageList;
for (int j = 0; j < imageList.Images.Count; j++)
{
ListViewItem lstItem = new ListViewItem();
lstItem.ImageIndex = j;
listView1.Items.Add(lstItem);
}
this.cropToolStripMenuItem.Enabled = true;
this.resizeToolStripMenuItem.Enabled = true;
this.compressToolStripMenuItem.Enabled = true;
this.greyScaleToolStripMenuItem.Enabled = true;
this.save.Enabled = true;
}
}
private void cropToolStripMenuItem_Click(object sender, EventArgs e)
{
listView1.LargeImageList = null;
ImageList imgListNew = new ImageList();
for (int i = 0; i < listView1.Items.Count; i++)
{
if (listView1.Items[i].Checked)
{
frmCropInfo infoForm = new frmCropInfo();
infoForm.cropOK += new CropInfoEventHandler(infoForm_cropOK);
infoForm.Show();
}
}
}
void infoForm_cropOK(object sender, CropInfoEventArgs e)
{
Image img = this.cropImage(Image img, new Rectangle(e.X, e.Y, e.Width, e.Height));
}
private Image cropImage(Image img, Rectangle cropArea)
{
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea,
bmpImage.PixelFormat);
return (Image)(bmpCrop);
}
}
} }
thanking you in advance
|
|
|
|
|
|
without any details on how you check single data and bulk I can't help you.
|
|
|
|
|
What detail u want?
code or database or both?
please tell
|
|
|
|
|
code mostly. maybe it's a bug.
A small table detail like:
Tbl1
=========
ID
Name
..
Tbl2
======
FKID
...
and the code that checks.
I have no ideea what and where it goes wrong.
|
|
|
|
|
OK
when i put single roll no. data in table and get it check than ans. is right.
but when check for all the roll nos. than that same roll no. get wrong ans.
|
|
|
|
|
Will you please elaborate….
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Hello,
I have a textbox in my window application.
I want to be able to write into the textbox even if the application window not in focus (not "first" on the screen).
How can i do it?
If i need to use events for it , i don't know exacly how to write an event and where to put each code piece (the event handler etc.)
|
|
|
|
|
Sounds like a weird requirement. Don't you think it will be weird for the users? I mean you type in something on a form and it is shown at a very different location.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
I am trying to understand what you want to achieve. Is it:
"I have a windows app which contains a textbox. Even if the windows app does not have the focus, but Notepad does, I want user input to go into my textbox"
or
"I have a windows app which contains a textbox. Even if the windows app does not have the focus, but Notepad does, I want my app to be able to insert text into my textbox"
The former is not normal at all - and I don't think it can be done.
The latter happens without any work at all.
If these do not describe what your problem is, then please try to restate it and we'll see what we can do.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
The purpose of it is that i want the program will read data from a barcode reader and then display it on the textbox, even if the window is not it focus
|
|
|
|
|
If the barcode reader emulates a keyboard, then you can't - at least not without hooking into the OS and diverting every keystroke to your app, which may annoy the user, and probably not work in anything with a virus scanner running!
How does your BC reader work? Does it have a serial or USB interface that does not emulate a keyboard?
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Yes,
It works as keyboard amulator...
|
|
|
|
|
Then you have a problem. all the Keyboard emulating BCRs I have seen read teh BC and just provide a datastream as if the barcode data had been typed by the user.
For example, if the BC was 092939201610 then the BCR fakes teh keyboard keystrokes for '0' down, '0 up, '9' down, '9' up, etc. There is no way to tell if the real KB or the BCR provided the data, so would have to feed all keyboard data to your progam. As a user this would: 1) be very annoying and 2) look like a memory resident key logger.
Your best bet is to talk to the manufacturer and see if they have done similar before.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
OriginalGriff wrote: Then you have a problem. all the Keyboard emulating BCRs I have seen read teh BC and just provide a datastream as if the barcode data had been typed by the user.
I feel it's all ok. User such as a cashier isn't supposed to use a keyboard very often. So we can redirect BC stream to the textbox. In the textbox handler we can validate BC/user input. For example - user always start typing session with "A" char, else it's BC's chars.
|
|
|
|
|
I can understand if you are developing a POS system you may want this input
to be directed to the textbox.
You could always try setting the KeyPreview to True on the Form.
Then on the KeyPress you could try
private void YourForm_KeyPress(object sender, KeyPressEventArgs e)
{
ScannerFirstKeyValue = e.KeyChar.ToString();
if (this.ActiveControl != this.YourTextBox)
{
YourTextBox.AppendText(ScannerFirstKeyValue);
}
this.ActiveControl = YourTextBox;
}
This would ensure all input is placed in correct textbox.
Remember if you have multiple textboxes this will be a problem!!
Unless the BC Reader has some sort of prefix that can distinguish it from a keyboard.
Regards
Mick Curley
|
|
|
|
|
doesn't that prevent people from typing anything in any other Control?
|
|
|
|
|
But we still can distinguish BC from user by using prefixes. What do you think?
|
|
|
|
|
Hi,
I need this thing only to read data from barcode reader.
Is there a way so only data from it (COM1 port for example) will be insereted to that textbox or the clipboard even if the application is not in focus (in background)?
|
|
|
|
|
Although it's rather unwieldy task I guess I know a way to perform it.
To interact with an application that is not in focus I recommend you to use windows application log.
Create the window service to handle BC input and write it down to the Log. In the application - check the Log for new entries on timer event and if it exists put it into your textbox. So despite your application might be not in focuse it still can achieve data from BC.
|
|
|
|