|
It's possible we do - but if we have no idea what you are talking about (because you gave us no information) then it's unlikely that we can tell you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
I'm trying to learn Rx. I have seen a lot of Google results and other resources pointing to this site.
Thing is, I'm just not getting it. What I'd really like to see is a simple, real world example. The code snippets in that site are VERY brief, not too deeply explained, and don't really show real work usage.
Does anyone know of any tutorials or real world usage examples of Rx?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Hi,
I can't help you, but maybe this can.
|
|
|
|
|
Already did that
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
I would recommend starting off here before delving into the Rx book.
"As beings of finite lifespan, our contributions to the sum of human knowledge is one of the greatest endeavors we can undertake and one of the defining characteristics of humanity itself"
|
|
|
|
|
|
Kevin Marois wrote: What I'd really like to see is a simple, real world example
My guess is that is an oxymoron.
If it is simple and you are using reactive extensions then someone is experimenting and not writing good code. It should rather be the case that there is a complex problem that needs a solution and reactive extensions are thus needed (in very limited cases.)
|
|
|
|
|
Hi. I want to know is it possible to play audio though online storage.
I have my website and I see am able to play music from my website form of my server storage what I transfer with filezilla.
I want to know can I do this using winforms
If so is there a source or a link
Thanks
|
|
|
|
|
AnthonyRaven wrote: is it possible to play audio though online storage. That does not really make sense. You play audio through a music application on your PC, reading the audio stream from disk or other connected device. Also what is the connection in your question between your website and a Windows Forms application?
|
|
|
|
|
i have a demo program of Rfid Reader ,from which i saw the commands to be sent to rfid reader in order to initialize rfid reader.and that program is sending 2 commands to Rfid Reader continously ..and the rfid reader is sending response command continously ... i achieve this part ,and i am receiving response command in command prompt . ,. now when i placed a tag in front of rfid reader ,rfid reader detected the tag and send this 33 bytes to command prompt .. how i get the number from 00 00 to 67 (middle portion) , as this is the Epc (Electronic Product code) .i want to get this number and Epcs of other tags also . how can i achieve this ?I have to send these EPCs on Firebase Database .I am stuck here .what i should do now ?
33 bytes
A0-13-01-89-0C-34-00-00-00-00-00-00-00-00-00-00-00-36-67-4B-9B-A0-01-89-00-00-11-00-00-00-01-BA
|
|
|
|
|
|
Hi, Good Evening everyone
I have created two classes namely Shape, Rectangle with Draw() method in both the classes, Rectangle class is a deried class from Shape. I have declared a public variable in Rectangle called num and initialised a value to it.
In the main class I have created an object of type class in following manner.
Shape s = new Rectangle();
Now when I am trying to access num variable of rectangle class it gives error saying “ /Users/apple/Projects/Practice/Practice/Program.cs(33,33): Error CS1061: 'Shape' does not contain a definition for 'num' and no extension method 'num' accepting a first argument of type 'Shape' could be found (are you missing a using directive or an assembly reference?) (CS1061) (Practice)”
My Understanding : The statement new Rectangle(); creates an object of type Rectangle in the memory and its reference is stored in object s of type Shape. So the object s should have access to variable num defined in rectangle class. Please make me understand this concept why we can’t access num variable from Object of type Shape.
Pls find the attached screenshot.
modified 8-Jul-17 13:10pm.
|
|
|
|
|
Because it doesn't exist in Shape.
If I have a toy, my son can play with it. But I can't play with my son's toy.
modified 8-Jul-17 13:24pm.
|
|
|
|
|
Member 13299953 wrote: My Understanding : The statement new Rectangle(); creates an object of type Rectangle in the memory and its reference is stored in object s of type Shape. So the object s should have access to variable num defined in rectangle class. Please make me understand this concept why we can’t access num variable from Object of type Shape.
Wrong. Shape only know what's defined in the Shape class. It knows absolutely nothing about any class that inherits from it.
The reverse is also true. Rectangle knows ONLY what Shape exposes to it since it's inheriting from Shape and what's defined in the Rectangle class. Private members defined in Shape are not visible to Rectangle at all.
Inheritance only goes one way. A base class can NOT and should not know anything at all about the classes that inherit from it.
|
|
|
|
|
So, let's assume you have this:
public class Shape
{
public virtual void Draw()
{
Console.WriteLine("Drawing in Shape");
}
}
public class Rectangle : Shape
{
public int Ratio { get; set; }
public override void Draw()
{
Console.WriteLine("Drawing in Rectangle");
}
}
public class Circle : Shape
{
public int Radius { get; set; }
public override void Draw()
{
Console.WriteLine("Drawing in Circle");
}
}
When you write this:
Shape s = new Rectangle();
s.Draw(); It works; this prints:
Drawing in Rectangle Because the system "knows" that the object instance that s refers to is a Rectangle when it looks at runtime to find the most appropriate method.
Similarly, this:
Shape s2 = new Circle();
s2.Draw(); will print:
Drawing in Circle Becuase it looks at that for the Circle version of the method.
But ... s is a Shape, so it can refer to one of three classes: Shape, Rectangle, or Circle, so if you write
Console.Writeline("{0}", s.Ratio); Or
Console.Writeline("{0}", s.Radius); What can the system do? If s contains a reference to a Rectangle, the first code is fine, but the second fails, and if s contains a Circle then the first fails, and the second succeeds - if s has a Shape, then they both fail!
When you declare a variable, what you can do with it depends on the type of the variable, not what it contains. And because s is a Shape, you can only access Shape methods, fields, and properties via it. Declare your variable as the appropriate type, and you can do what you need:
Rectangle r = new Rectangle();
Circle c = new Circle();
Shape s = r;
s.Draw();
s = c;
s.Draw();
Console.WriteLine("{0}", r.Ratio);
Console.WriteLine("{0}", c.Radius);
Make sense now?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
C# provides flexible ways to constrain a Class to being a provider of data, and methods, to other Classes that inherit from it. These include virtual Methods, abstract Classes, and Interfaces. The inheriting instances of a Class have special semantics for declaring their members that implement the inherit-from Class' members: the use of 'override, and 'new.
If you are confused by this wealth of possibilities, do not feel alone It takes most folks time and effort to master them, and choose which techniques are most useful in a given circumstance/problrm/scenario.
OriginalGriff's example uses a virtual method in a Public Class; in that example you could create an instance of 'Shape using 'new.
A further constraint can be achieved using an abstract Class: you cannot create an instance of an abstract Class. In your case, I think 'Shape is, indeed, an abstraction, and, creating an instance of it would have no purpose.
An example of using an abstract Class:
public abstract class Shape
{
public virtual void Draw(string txt = "Shape")
{
Console.WriteLine(txt);
}
}
public class Rect : Shape
{
public string Name = "Rect";
public int Ratio { get; set; }
public void Draw(String txt = "Rect")
{
base.Draw(txt);
}
}
public class Circle : Shape
{
public string Name = "Circle";
public int Radius { get; set; }
public void Draw(String txt = "Circle")
{
base.Draw(txt);
}
} Let's test this:
Rect newRectangle = new Rect();
Circle newCircle = new Circle();
newRectangle.Draw();
newCircle.Draw();
Shape shapeAsRectangle = newRectangle;
Shape shapeAsCircle = newCircle;
shapeAsRectangle.Draw();
shapeAsCircle.Draw();
Rect rectBackFromShape = shapeAsRectangle as Rect;
Circle rectBackFromCircle = shapeAsCircle as Circle;
rectBackFromShape.Draw();
rectBackFromCircle.Draw();
Console.WriteLine(newRectangle == shapeAsRectangle);
Console.WriteLine(newCircle == shapeAsCircle);
Console.WriteLine(newRectangle == rectBackFromShape);
Console.WriteLine(newCircle == rectBackFromCircle); Notes:
0. to be used by inheriting classes this method in the abstract class must be 'public, which means it can be called on an instance of an inheriting class down-cast to the abstract parent's Type. imho, this is less than ideal.
1. even though we can't create an instance of an abstract class, we can "change the view" we have by casting it to its abstract base Type ... when cast, the data, or methods, specific to the inherited class are not "lost" !
2. here you see we can re-hydrate an instance cast to its abstract base Type back to its "native" Type, and, now we have access again to its data, and methods.
«Beauty is in the eye of the beholder, and it may be necessary from time to time to give a stupid or misinformed beholder a black eye.» Miss Piggy
|
|
|
|
|
Quote: Shape s = new Rectangle();
The short answer is:
You created a "rectangle"; but you are telling the system / compiler to treat it as a "shape"; hence no "num".
If you want to access the "same" rectangle as a "Rectangle" AND as a "Shape", you can do this:
Rectangle rect = new Rectangle();
Shape rectShape = rect as Shape;
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Gerry Schmitz wrote: Shape rectShape = rect as Shape;
No need for the as Shape there, since Regtangle inherits from Shape .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i am trying to access the default font of the printer. can anyone help me on this?
|
|
|
|
|
There is no such thing as far as the driver is concerned and a lot of printers don't even have one. Even if you did get it, chances are good that there is no matching font on the machine, such as "Default".
What's the point of this anyway?
|
|
|
|
|
Printers don't have default fonts - you're thinking of a Typewriter and that has one font only. Printers don't actually print text - they receive information that describes what to print, and where, and the closest analogy to this is that they receive images, which may just happen to represent text.
This space for rent
|
|
|
|
|
Which is why print files are so damn huge...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
In the bad ol' days printers certainly did have default, and other, fonts, in replaceable cartridges. You young people just don't know you're born.
|
|
|
|
|
I remember when you had to change the chain to change the font!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|