16,016,712 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by ninjaef (Top 29 by date)
ninjaef
10-Oct-18 8:27am
View
FIXED IT !!
<meta http-equiv="X-UA-Compatible" content="IE=edge">
at the top of the HTML file, but can someone explain what this is doing. I found the solution just goolging tens of "jquery not working IE"
however, this is legacy stuff for IE11 and so I switched to the following, but it still didnt work. Only the meta tag works:
<!doctype html>
ninjaef
10-Oct-18 8:22am
View
It is running from local disk. Double clicking it. But have also entered the full C:\test\index.html in the nav bar in IE, same behaviour - it doesnt work (in IE) but is flawless in chrome.
I'm using IE11
ninjaef
27-Jun-18 5:59am
View
No. Completely wrong. You miss the point despite my laboured text. I am actually a seasoned C, C#, C++, Java, and OOD/OOP engineer with 28years experience. What I have asked for , specifically, is BEST PRACTICE "Pythonic" way to model this in PYTHON where the constructs , semantics, features, standard library and data models DIFFER and can be the subject of much detabte: e.g. @Property, or getters/setters, or plain defs() for class attributes, "_var" and "__var" conventions, inheritence and passing around of through class types ,class objects , class instances. Python differs and the same problem can be resolved in many ways, more so than other languages I would say.
Note Richard, there is no Python discussion area on the forum, not lesat if one looks a the subforum titles under "Discussions"
I do not need "training" in the regard of OO and I dare say I would learn nothing from you Richard!. Please , remember that sometimes knowledge comes in many guises.
ninjaef
22-Jun-18 8:26am
View
yes, understand C++
thanks for the example
got it now...simple now you explained it that way.
yes, ive heard of python duckduck principles and use-me-dont-abuse me ideology.
EDIT
sorry, my phone hit 4star instead of 5. meant to give you 5*. sorry
ninjaef
22-Jun-18 6:21am
View
Naturall I am reading python documentation, including the section on classes, I felt that was obvious otherwise how would I learn Python - links to a documentation are not really helpful in this instance, I was hoping for an explanation rather than a link to the language docs. Specifically, why is list()[0] allowed to change the "private" __items data ?? I clearly do not understand what is going on despite reading the documentation !
ninjaef
14-Jun-18 7:03am
View
That is not what I asked for.
The example you point to, is about binding which can be done outside of a class hierarchy. My question, was specifically how to implement a "on_<property>" method with callback system
through inhertiance and specfically using method names called "on_" suffixed with the property name
, which is "automatically" created by virtue of simply declaring an object of class MyProperty(), as in my example, which I felt was clear enough. Do you need more clarification?
ninjaef
7-Jun-18 2:26am
View
Gerry, can you please elaboarate on what you mean by "run local - developer mode" ??
ninjaef
6-Jun-18 12:57pm
View
xamarin , conceptually, provid3s a further level of abstraction over .NET (windows) Java (android) all of which of course is an abstraction of, ultimaely, platform O/S APIs.
with xamarin extension to MSVS iy should be possible to easily develop x-platform apps with minimal refactoring.
THANK YOU SO MUCH for those links
ninjaef
6-Jun-18 8:57am
View
Ah, I see. Thank you Nathan. I did see .NET core intermixed with .NET . I'm not fully aware of .NET technologies - coming from a *nix/C background - and I also see a ASP.NET which seems different than .NET core ??Typical MS confusio.
So , does .NET core provide the ASP.NET function and can Xamarin be laid over .NET core for ease of app development - it has a rather good Video rendering class framework ?
ninjaef
13-Jul-17 15:31pm
View
this seems to be a solution perhaps
but I don't understand what's going on here so don't know how to apply this technique to my problem
but it seems I can create methods of a class at runtime
so I could create a Tagtype.newEnum field?
https://stackoverflow.com/a/25256727/7990543
or what about the Expando object...
https://msdn.microsoft.com/en-us/magazine/ff796227.aspx
but sob, I need help to understand this
ninjaef
13-Jul-17 15:19pm
View
sorry
I'm not getting the point across...
which is...
the TagType is used extensively in code we cannot change. for example...
if (tag = TagType.__RESERVED__)....
switch (tag)
__Closed__ :......
and so on
we can't change this object reference
we certainly cannot create a list of a new type and recode
ninjaef
13-Jul-17 12:38pm
View
as explained in the OP
not sure what you don't understand? sorry.
but its simple
we have a Tagtype Enum used in lot of code. we need to introduce a mechanism to allow the list of enumerations to be added to at runtime whilst maintaining code references to Tag type, such as
if (a == TagType.someEnum)...
simple
ninjaef
13-Jul-17 10:20am
View
example of how I might use collection would be nice?
using the TagType example above?
ninjaef
13-Jul-17 10:11am
View
simple and perfect. will give this a go but looks like an elegant solution to extend extant functionality.
Two question though:-
1.the enum.IsDefined() requires a string argument. Is there a simple way to check if an int value is defined within the enum.
2.TagType AnotherEnumValue = (TagType)3 would not "add" the "AnotherEnumValue" to the enum range - in other words IsDefined(3) would yield False? How might we overcome this?
ninjaef
13-Jul-17 10:05am
View
Incorrect assumption
The codebase is plugin orientated, albeit that the plugins can be quite large in terms of SLoC. It is the plugin we are responsible for. So the "interpretation" of "enums" is performed in the plugin but distributed via CallBacks. I don't want to get into the design which is why I purposely requested help on a very specific example , and which is why I also did not want to get into a debate on an architecture and design model that we here have little if any control over.
ninjaef
6-Jul-17 2:15am
View
No, that does not answer the question
I already have coded a Tokenizer and a LL1 Parser. This converts the BNF notation in a text file to a parse tree (a grammar tree to be precise). I am now stuck.
Normally, one would use hardcoded functions that model the syntax of the language, to read the input program text [file] and parse it according to the language definition.
This is different.
I want to be able to change the BNF and the compiler(interpreter) is able to correctly compile(interpret) a new program text without requiring me to change the code of the compiler(interpreter)
So ANTLR isn't the answer
ninjaef
5-Jul-17 9:47am
View
Mmmm. me thinks you obviously didnt read read the question !
ANTLR creates a parser from grammar, the parser needs to be compiled each time the grammar changes.
ninjaef
13-Jun-17 13:23pm
View
oh,
and for the sake of us all, don't come of retirement
ninjaef
13-Jun-17 13:22pm
View
perfect!
that's an insightful helpful response
thank you sir
ninjaef
13-Jun-17 13:20pm
View
that poor uneducated unhelpful response demonstrates all that is bad regarding help forums, and morning that is good.
you have no idea what I have done
please go and "help" someone else. you are not needed on this thread
ninjaef
17-May-17 14:00pm
View
this is it!
terface by now:
public interface IProperty
{
public String Name { get; }
}
public class Property<t> : IProperty
{
public Property(String name, T value)
{
Name = name;
Value = value;
}
public String Name { get; private set; }
public T Value { get; private set; }
public override String ToString()
{
return string.Format("{0}: {1}", Name, Value)
}
}
...
var intProp = new Property<int> ("age", 32);
var strProp = new Property<string> ("name", "Earl");
var enumProp = new Property<colorenum> ("eye color", ColorEnum.Magenta);
but i dont really understand what's going on, despite me reading msdn and online
ninjaef
17-May-17 11:56am
View
ah, hang on
actually
that's not what I need.
in your example, Title prop, i woould want Value prop that either returns a string for a IDENTIFIER token, or an int for an INTEGER token
not quite the same as the example
and
coming from C language, I'm not sure how to do this
ninjaef
17-May-17 10:42am
View
ah. perfect! and better solution than mine as you use compile time type-safe logic. MANY THANKS!
ninjaef
17-May-17 10:28am
View
interesting, could you explain / example please?
EDIT: tokens are consumed as chars, as per the grammar I outlined above, and then converted to int if they are INTEGER (as per code above) etc.
ninjaef
17-May-17 10:17am
View
pretty self explanatory , as above , I am writing a parser and this includes a tokenizer. each token is read (getnexttoken) where the type (int, char, string, other) is determined at runtime because the token definition is a text file with regex clauses, i.e.
ALPHA=[a-z|A-Z]
DIGIT=[0-9]
INTEGER = DIGIT+
IDENTIFIER = ALPHA (ALPHA | DIGIT)+
etc
so at run time, a token type is as per defined by the grammar
so I want to be able to define a "generic" class where the Value can be interpreted at run time. dynamic sort of models untyped langauges such as python etc.
not good as you say, in C#, I agree, but the compiler lets you do it and the CLR lets you run it!
?
ninjaef
17-May-17 9:57am
View
the original ...
public class Token
{
public dynamic Value {get; set;} //compiles
}
Token mytoken = GetNextToken() // works runtime ; token.Value could yield an (int) or a (char) etc
if mytoken.Type = INTEGER then <<treat as int>> else <<treat as char>>
// so polymorphism?
...
as I say, all works as required, arguably easier than your solution, but I was wondering whether my solution was good practice - clearly its allowed in C# and compiles/runs
??
ninjaef
17-May-17 9:03am
View
Deleted
ok, but how do I declare an object of the base class:
MyBaseClass token; //wouldnt compile!
...
token=getNextToken();
if <<token is int>> then ... else <<token is string>> ...
ninjaef
17-May-17 8:58am
View
okay, but how do I declare an object to receive a token:
MyBaseClass token; //wouldnt compile?
...
...
token = getNextToken() // could return a string or an int
if <<token is int>> then ... else <<token is string>> ...
???
ninjaef
17-May-17 8:52am
View
I like this. It also consistent with base/simple types (int, int32, ...) not sure what you call them. Thanks. But, how do I declare an object of MyBaseClass and call .Value for both?
Show More