|
Thank you! I just learned something new.
/ravi
|
|
|
|
|
There aren't that many examples out there other than in research papers. Possibly your best bet for getting a head start on things like CLONALG is to have a look at the pseudocode on AISWeb[^]
|
|
|
|
|
Hi,
I am developing an asset management system which needs to print bar code labels for the asset item.
I am using a group id and item id to generate bard code with zero padding
for example :
Group ID: 7
Item ID : 145
Bar Code : 007000145
I would like to ask what's the best bar code symbology to use and which will be readable by most of the bar code readers /. apps?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
Not really anything to do with C#, and information on barcodes is easy to find[^].
|
|
|
|
|
I nearly voted this abuse, and will do so if I come across something similar. You're not "new" here, it ain't the first post.
The "best" is the one that fits your needs the "best".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Depends on a huge number of factors: primarily the physical size of the label you are going to print. If it's only one inch by 1/4 inch, that eliminates a lot of versions.
The link Richard gave you covers a lot of the variants: start there and do some research!
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
Thanks guys
Technology News @ www.JassimRahma.com
|
|
|
|
|
Jassim Rahma wrote: I would like to ask what's the best bar code symbology to use
The one your biggest customer uses.
|
|
|
|
|
I think you are already off on the wrong foot: a "bar code" with "other codes" (e.g. group and item id's).
You should simply use a "non-meaningful" sequential number; assigned to each existing and new item; long enough to hold all possible items.
As soon as you use "codes within codes", you will find that:
1) They are too short
2) A pain to maintain
3) Cannot be changed if an item is "grouped" wrong
|
|
|
|
|
thread th2 = new Thread(new ThreadStart(this.check(int,Char,int, int)));
th2 .Priority = ThreadPriority.Highest;
th2.start();
Error CS0149 : Method name expected
|
|
|
|
|
ThreadStart is wrong. 'check' would need to take a single parameter of type object and you don't specify the parameters in that place (or at all in fact).
Regards,
Rob Philpott.
|
|
|
|
|
What's with the thread priority? It doesn't make the thread run any faster. It Just makes the thread run at the expense of not running others system wide.
|
|
|
|
|
So, we're just guessing, instead of looking at the documentation?
Here's[^] the manual, there's an example at the bottom.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have a C# and Silverlight project with two combo boxes (CB1, CB2)
-CB1 is initialized and populated with few items.
(e.g. car, plane, motorcycle)
-User selects an item (e.g. car) and CB2 gets automatically populated
(e.g. model, year, color) via the cb1_SelectionChanged()
-user selects the item from CB2 (e.g. model) and a datagid is populated accordingly.
Problem:
Once I selected item from CB2 and datagrid is populated correctly, attempting to select a different item from CB1 generates a "Object reference not set to an instance of an object"
To go around just select a different item then back again to the item and that woks but is really annoying. :)
Any ideas will be greatly appreciated
|
|
|
|
|
Post the piece of code for better understanding...
|
|
|
|
|
Yes, I should have done fist. Thank you
public Home()
{
InitializeComponent();
//initilize the combobox
comboBox1.Items.Add("CAR");
comboBox1.Items.Add("PLANE");
comboBox1.Items.Add("MOTORCYCLE");
for CB1
private void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string selec = comboBox1.SelectedItem.ToString();
switch (selec)
{
case "CAR":
{
comboBox2.Items.Clear();
label3.Content = "Select cars";
comboBox2.Items.Add("Model");
comboBox2.Items.Add("Color");
}
break;
case "PLANE":
{
comboBox2.Items.Clear();
label3.Content = "Select Site";
comboBox2.Items.Add("model");
comboBox2.Items.Add("EngineType");
comboBox2.Items.Add("choice 1");
comboBox2.Items.Add("choice 2");
}
break;
}//end of switch
}
FOR CB2
private void comboBox2_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
EclipseMTXDomainContext context1 = new EclipseMTXDomainContext(); //load datagrid from database
string selec = comboBox2.SelectedItem.ToString();
switch (selec)
{
case "model":
{
//GET ALL MOdels
dataGrid1.ItemsSource = context1.Protons;
context1.Load(context1.GetProtonsFilteredQuery(1));
}
break;
case "EngineType":
{
//GET ALL Engine Types
dataGrid1.ItemsSource = context1.Protons;
context1.Load(context1.GetProtonsFilteredQuery(1));
}
break;
}//end of switch
}
|
|
|
|
|
picasso2 wrote: string selec = comboBox1.SelectedItem.ToString(); Comboboxes use to send two SelectionChanged events when the user changes the selection: in the first event, the previously selected item is un-selected, at this moment no item is selected, comboBox1.SelectedItem is null, and consequently comboBox1.SelectedItem.ToString(); causes a NullReferenceException.
Then the new item gets selected and SelectedItem has a value again.
Solution: check SelectedItem for null.
|
|
|
|
|
I understand you aren't going to be able to give me a specific answer, but I am kind of stunned at this point...
I work on a library that has competitors. Our APIs are pretty similar. I call MyLibrary.MethodA() 1,000,000 times. It takes 1000ms. I call MyCompetitor.MethodA() 1,000,000 times and it takes 150ms. Both in Debug / Any CPU.
I'm trying to figure out where my overhead is. So in MethodA() I tried returning just null at the beginning. That was already 16ms. MethodA calls an internal method which calls another one, etc. Basically, the only thing I'm doing at the top level methods is checking the params for null. Then I lock a dictionary and do a TryGetValue. At this point I start getting to the method that starts doing real work. I'm already at 195ms and am returning null.
How is that even possible? The other guy is returning 150ms and actually doing the work. I'm at 195ms and returning null from an empty method???
|
|
|
|
|
For other CPians to help and give you useful suggestions, you have to give more context what the method is doing and what algo it is using and does it access the network to access the DBMS? Does it use LINQ? Does it use reflection? Does it use C++/CLI interop? etc...
|
|
|
|
|
Yes, as I said, I haven't gotten to optimizing the algorithm itself yet .
Just calling EMPTY methods in my DLL is slower then calling the other guys FULL method. That's where I'm confused.
His FULL method is 150ms for 1,000,000x.
I'm just calling 4 pretty empty methods. Method1 does nothing but call Method2 (a generic method calling the non generic version). Method2 calls Method3 which just checks that the param is not null and then calls Method4. Method4 locks on a dictionary and calls TryGetValue() (Key = Type, Value = Info class). If it can't find the Info class in the dictionary, it news one up. Now it calls Method5. At this point, I haven't even done the work yet, just getting set up and I'm already at 111ms. The other guy is already done completely at 150ms. That's what I'm puzzled about. Haven't even gotten to any code that I can optimize yet .
|
|
|
|
|
Have you tried decompile your competitior method with reflector or dotPeek[^] and profile it? Cannot be of any help here. I am more of C++ than C# guy. Here are 2 .NET perf books you can read.
Pro .NET Performance[^]
Writing High-Performance .NET code[^]
I have read the 1st book but not the second because it was just out.
modified 17-Aug-14 22:48pm.
|
|
|
|
|
SV Wong wrote: Have you tried decompile your competitior method
Not a good idea. If this is a commercial product, decompiling it would almost certainly be illegal, even if you didn't use any of the decomipled code.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
SV Wong wrote: Have you tried decompile your competitior method
Really bad idea.
First if you have legal copy of the software it is a possible license violation. Of course if you don't own the code that is a problem itself.
Second if you look at the decompiled code it could subject the code you write to copyright violations or other legal complications.
|
|
|
|
|
He might be caching some data in memory - it could be slower when you call the method only once, but surely speeds up when the method is called a million times.
Are you sure that the competitor's method is thread-safe?
|
|
|
|
|
SledgeHammer01 wrote: Our APIs are pretty similar. But that has nothing to do with what is happening internally.
|
|
|
|