|
YOU are the one who doesn't understand. You seem to think that Text and Image data are somehow magically different.
WRONG!!
The data that makes up an image is nothing but BYTES. The "text" you're talking about is also NOTHING BUT BYTES in a limited range of values!
Huffman does NOT work exclusively on these values. It works on ALL POSSIBLE BYTE VALUES!
|
|
|
|
|
Because research is the basis of what we do, and it's important to learn several things about it:
1) How to do it, and how to understand what you read when you read it. For example, finding a discussion of an algorithm that tells you how to do something, even if it isn't set up for exactly what you are trying to use it for.
2) That research does not give you exactly the solution you want: this is "development" not "copy'n'paste"! For example, you don't find C# code for compressing images using Huffman compression because nobody does it - you will find code for using Huffman compression on other data types however.
3) The sometimes the research shows you are going down a blind alley and need to change your whole approach because it isn't going to work. For example, you may have the bright idea to run cars on Powdered Cheese but research shows you that cheese doesn't burn very well and tends to clog the fuel injector system - so it isn't going to work in the real world.
Asking the same question over and over again because you don't like the answers so don't want to think about them doesn't change the answer - the cheese still blocks the injection system and the car only ever gets 100m before the engine is trashed.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hi Experts..
Is there any way, I can convert Decimal (18 Digit) MEID to hexadecimal?
Thanks
|
|
|
|
|
Yes.
If you look at Wikipedia: Mobile equipment identifier - Wikipedia[^] it explains the 56bit (hex) format, and also describes the decimal (18 digit) version under "display formats".
It should be pretty trivial to reverse the decimal version to hex.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Go to Parentis there anyone who can provide me the code?
|
|
|
|
|
I tell you what: you show me the code you wrote to do it, and explain what it does right, what it does wrong, how you tested it, and I'll help you fix it.
But we aren't a code-to-order service: It doesn't quite work like that, we do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there.
But be aware: you get what you pay for. Pay peanuts, get monkeys.
The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." What is development? definition and meaning - BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".
So either pay someone to do it, or learn how to write it yourself. We aren't here to do it for you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
is there anyone who can provide me the code?
|
|
|
|
|
No language should even be able to do this but it works (complies and runs).
public class BaseClass
{
public string Value { get; set; }
public BaseClass(string val) { Value = val; }
}
public class Derived : BaseClass
{
public Derived(string val)
: base(new Func<string>(() =>
{
if (String.IsNullOrEmpty(val))
{
throw new ArgumentNullException("val");
}
else
{
return val;
}
})()){}
} And the error message when the Derived class constructor is passed a null value is equally confusing:
System.ArgumentNullException: Value cannot be null.
Parameter name: val
at TestingApp.Derived.<>c__DisplayClass0_0.<.ctor>b__0()
at TestingApp.Derived..ctor(String val)
at TestingApp.Program.Main(String[] args)
This looks more like a way to program hard to find errors, deliberate back doors, or the hard-to-trace magic self-destruct method then a useful code addition.
Is there any instance this could be useful other than a hack or workaround?
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
If the base class constructor is doing too much, or allocates a lot of memory, this could prevent that work from taking place if the argument isn't valid. If you move the throw into the Derived constructor, the base class constructor has already run by the time the argument is validated.
It would definitely be cleaner with the validation code extracted to a real method - possibly in a separate class, if it's the sort of thing you use a lot:
public static class Requires
{
public static string NotNullOrEmpty(string value, string parameterName)
{
if (string.IsNullOrWhiteSpace(value)) throw new ArgumentNullException(parameterName);
return value;
}
}
public class Derived
{
public Derived(string val) : base(Requires.NotNullOrEmpty(val, nameof(val)))
{
}
}
System.ArgumentNullException: Value cannot be null.
Parameter name: val
at TestingApp.Requires.NotNullOrEmpty(String value, String parameterName)
at TestingApp.Derived..ctor(String val)
at TestingApp.Program.Main(String[] args)
With C# 7, I believe you'll be able to do something like this:
public class Derived
{
public Derived(string value) : base(string.IsNullOrEmpty(val) ? throw new ArgumentNullException(nameof(val)) : val)
{
}
}
C# 7 Additions – Throw Expressions – Structured Sight[^]
I'm not sure if that makes it any more readable, though.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi
I am developing windows application with MDI form.
if multiple user is using the applicaiton
and any change made by the one user,should be reflected as alert for another user while working in application immediately.
Both user using the same applicaiton with seperate instance.
Please help me sir.
Thanks and regards
Ram
|
|
|
|
|
This would require both users to have access to some common file which the application uses to synchronise.
|
|
|
|
|
"Immediatly" is not possible, there will always be a delay because the information needs to be processed. Usually people work on stale data, and you will be complicating stuff a lot with this 'idea'.
What happens if we both are editing your account? I update your name, you your email-address. What will you save?
There's a good reason most applications don't show live values.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I would expect that a cardiac care unit would like to see "live values"...
How about a nuclear reactor?
The alternative being "dead values"?
|
|
|
|
|
Gerry Schmitz wrote: I would expect that a cardiac care unit would like to see "live values"...
How about a nuclear reactor? Running C#?
Don't go near that hospital, you could die of a NullReferenceException
Gerry Schmitz wrote: The alternative being "dead values"? No, information as it is retrieved on the moment.
He is not building a nuclear system but probably displaying something from a datasource. You may have noticed that most applications display the information as it was the moment they retrieved it.
It is impractical, adds no value and adds a lot of cost. Feel free to write an article proving otherwise
--edit
Implement INotifyPropertyChanged[^] on your BO's, have them send any changes to a central server, and make sure all instances poll said server to get any recent changes.
How to: Implement the INotifyPropertyChanged Interface[^]
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
modified 23-Nov-16 14:11pm.
|
|
|
|
|
I've noticed the opposite:
- the "categories" of apps that would BENEFIT from "real-time" (or near real-time) UI updates is greater, and expanding at a larger rate, than "static" views.
Yes, there are a "larger number of apps" where someone is looking at last years numbers; but that's of limited interest to most consumers. Most consumers expect more than "maybe it's now in the system (?)".
With a little imagination and stepping away from "accounting apps", one can think of any number of apps that would benefit from "more current info". (And it's a skill worth learning)
And yes, I use C# to write mission-critical, including SCADA. What, you have a problem with C# now for writing anything but "accounting apps"? Write an article.
Oh, and regarding: "both editing your account" .... Perhaps you've heard of: "transactions"? "Commits"? Roll-backs? optimistic updates / locks? pessimistic updates / locks? No?
I think OP would like to expand his knowledge base instead catering ONLY to the lowest denominator.
|
|
|
|
|
Gerry Schmitz wrote: Yes, there are a "larger number of apps" where someone is looking at last years numbers; but that's of limited interest to most consumers. Most consumers expect more than "maybe it's now in the system (?)". Most consumer don't refresh each dataset in the hope that there is a change. I was not talking about last years numbers, but the numbers as they are the moment you retrieve them - that is relatively close to what you meant with "real time". In my book Windows is not a real-time OS.
Gerry Schmitz wrote: With a little imagination and stepping away from "accounting apps", one can think of any number of apps that would benefit from "more current info". Lets fantasize what we could do with unlimited memory, bandwidth and bug-free software while we're at it.
Before you dream up benefits, also prepare to take a look at some downsides and potential pitfalls.
Gerry Schmitz wrote: Perhaps you've heard of: "transactions"? "Commits"? Roll-backs? optimistic updates / locks? pessimistic updates / locks? No? Yes, and the DB server can actually inform you of changes. CodeProject has articles on it
Gerry Schmitz wrote: I think OP would like to expand his knowledge base instead catering ONLY to the lowest denominator. That's prolly why he is on the forum.
Enjoy.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You need to describe your "environment" in more detail:
- Where are the "windows apps" running?
- What "transport" facilities are available between the apps? e.g. Web services; messaging; VPN.
Depending on the environment, the Windows apps may not be able to communicate "directly"; but would utilize some intermediate service; e.g. message queues.
|
|
|
|
|
Hi
I am using C# with dot net framework 4.5
and seperate database server sql server 2008.
can you please tell me windows services or any other technology
can be used?
Instant reply to the receiver if values are modified in database.So
the server should be always alert that any modification in database table.
Thanks and Regards
Rama
|
|
|
|
|
You failed to answer the first and most important question:
- "Where" are the Windows apps running?
You want to know "what to use" (boat? plane?); but won't say where you're coming from; or going to.
Or are you looking for a "one size fits everything" solution?
|
|
|
|
|
Ah that old chestnut again, it has been a while since I have seen this particular bit of nonsense.
You are trying to solve a non problem (unless you are building a truly real time system, trading, nuclear power plant management).
The reality is that 99% of the time 2 people will not work on the exact same bit of data. Therefore 99% of the time it is safe to ignore the problem.
If the other 1% is going to blow up the city or kill someone then worry about the problem. If you are talking about updating a customer details then go find another problem to solve.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
As others have pointed out, there are many instances where notifying of changes isn't the best idea. Imagine this - both people are editing the same record and the first one saves her changes. What are you going to do now? Do you overwrite the edits the second one is making? Does he have to abandon his changes to see if they are no longer relevant and then re-enter because the first persons changes don't matter to him?
You need to decide what problem you are really solving first. Don't try to invent solutions to problems you haven't fully investigated yet.
This space for rent
|
|
|
|
|
Unfortunately, the whole point of OP's post (how to pass an alert between Windows apps) is getting derailed (again) with "side-bars"; this time to do with "update contention".
That's good though; usually it's SQL injection.
|
|
|
|
|
Gerry Schmitz wrote: to do with "update contention". But that really is the key, and it's a reasonable bet that the OP has not given it enough thought. Pete's comments are (as always) very relevant.
|
|
|
|
|
I disagree.
Update contention is a valid point, but not good enough to discard the original question, as I understand it.
(OP NEVER said he was dealing with updates from MULTIPLE sources).
And instead of simply telling OP he's out to lunch (maybe), I prefer he find it out for himself (based on any discussion).
|
|
|
|
|
You are correct. I should have re-read the question first.
|
|
|
|