|
Microsoft improved Java, so Sun sued them. The end result is that Microsoft, who already had .NET, simply changed J# to C# and made a better language.
Sun went out of business. Too much spent on lawyers and being anti-MS instead of innovating and working together. Same with Netscape.
MS has had no effect on how Java evolved, except that Sun, and now Oracle, started copying C# and trying to catch up.
MS had .NET and VB.NET in development before the lawsuits. Since in .NET, languages are syntactic sugar over the MSIL, adding languages like C# was not a tough stretch.
|
|
|
|
|
Inspired by witch the codehoney asking about our ugliest code I looked up some of my earliest code.
I was just getting started and wanted to experiment a bit with inheritance.
So I decided to make a (turn based) Final Fantasy like battle game
It's VB so you're warned... (awesome pictures at the bottom)
Somehow I thought BaseMonster was a good idea (especially notice how I check if the type of Me (this) is not of a specific derived type).
The BackgroundWorker is also pretty neat!
Namespace BaseCharacters
Public MustInherit Class BaseMonster
Inherits BaseDefence
Private m_Name As String
Private m_Level As Integer
Private m_HP As Integer
Private m_CurrentHP As Integer
Private m_MP As Integer
Private m_CurrentMP As Integer
Private m_Strength As Integer
Private m_CurrentStrength As Integer
Private m_Defence As Integer
Private m_CurrentDefence As Integer
Private m_Magic As Integer
Private m_CurrentMagic As Integer
Private m_MagicDef As Integer
Private m_CurrentMagicDef As Integer
Private m_Speed As Integer
Private m_CurrentSpeed As Integer
Private m_Image As Bitmap
Public Event Charging(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.ComponentModel.ProgressChangedEventArgs)
Public Event TurnStarted(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.EventArgs)
Public Event TurnEnded(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.EventArgs)
Public Event Killed(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.EventArgs)
Private WithEvents m_Bgw As System.ComponentModel.BackgroundWorker
Public Sub New()
InitializeBgw()
SetMonsterProperties()
If Not TypeOf Me Is BaseHumanoid Then
SetCurrentStatus()
End If
End Sub
MustOverride Sub SetMonsterProperties()
Public Sub SetCurrentStatus()
Me.CurrentHP = Me.HP
Me.CurrentMP = Me.MP
Me.CurrentStrength = Me.Strength
Me.CurrentDefense = Me.Defense
Me.CurrentMagic = Me.Magic
Me.CurrentMagicDef = Me.MagicDef
Me.CurrentSpeed = Me.Speed
m_Bgw.RunWorkerAsync()
End Sub
Public Sub Me_TurnEnded(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.EventArgs) Handles Me.TurnEnded
m_Bgw.RunWorkerAsync()
End Sub
The BaseDefence is just a bunch of properties that indicate elemental defence.
Public MustInherit Class BaseDefence
#Region "Magic Defense"
Private m_AstralDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_DarkDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_EarthDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_FireDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_GravityDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_HealingDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.FullAbsorb
Private m_HolyDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_IceDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_LightningDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_PoisonDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_WaterDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_WindDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Public Property AstralDef() As DefenceDefinition.DefenceEnum
Get
Return m_AstralDef
End Get
Set(ByVal value As DefenceDefinition.DefenceEnum)
m_AstralDef = value
End Set
End Property
A BaseHumanoid is a monster of sorts and unless I'm Barrett from Final Fantasy VII I don't think my main hand is actually a weapon
Namespace BaseCharacters
Public MustInherit Class BaseHumanoid
Inherits BaseMonster
Private m_OffHand As IOffHand
Private m_MainHand As BaseWeapon
Private m_Magic As New List(Of BaseSpell)
Public Sub New()
MyBase.New()
SetHumanProperties()
SetCurrentStatus()
End Sub
Overrides Sub SetMonsterProperties()
End Sub
MustOverride Sub SetHumanProperties()
Public ReadOnly Property GetMagic() As List(Of BaseSpell)
Get
Return m_Magic
End Get
End Property
Time to define my Hero!
Public Class Hero
Inherits BaseCharacters.BaseHumanoid
Public Sub New(ByVal name As String)
MyBase.New()
Me.Name = name
End Sub
Public Overrides Sub SetHumanProperties()
Me.Level = 10
Me.Strength = 10
Me.HP = 100
Me.MP = 10
Me.Defense = 10
Me.Magic = 10
Me.MagicDef = 10
Me.Speed = 4
Me.Image = My.Resources.super_hero
Me.MainHand = New HealingStaff
Me.AddMagic = New IceWhisper
End Sub
End Class And of course an actual monster:
Public Class Imp
Inherits BaseCharacters.BaseMonster
Public Sub New()
MyBase.New()
End Sub
Public Overrides Sub SetMonsterProperties()
Me.Name = "Imp"
Me.Level = 3
Me.Strength = 6
Me.Defense = 3
Me.HP = 50
Me.MP = 5
Me.Speed = 3
Me.Image = My.Resources.images
End Sub
End Class I also need a landscape to fight in:
Public Class Forest
Implements ILandscape
Public Function GetMonster() As BaseCharacters.BaseMonster Implements ILandscape.GetMonster
Dim random As New Random
Dim i As Integer = random.Next(0, 2)
Select Case i
Case 0
Return New Imp
Case 1
Return New Harpy
Case Else
Return New Imp
End Select
End Function
Public ReadOnly Property BackGround() As System.Drawing.Bitmap Implements ILandscape.BackGround
Get
Return My.Resources.forest_wallpaper987
End Get
End Property
End Class And now your wondering what this all looked like?
It looked awesome! The imp never stood a chance![^]
And by simply changing the area from New Forest to New Dungeon I changed the entire battlefield!
So who's going to give me a job in game development?[^]
The images are just random google images for forest, dungeon, imp, skeleton and hero, and I cannot give credit because I don't know the source.
So I admit, my graphical skills have not increased since then.
But oh boy, just look at that code
|
|
|
|
|
Oh it's not that bad. It's like a little puppy. Maybe it makes a mess of things but it's cute.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
Sander Rossel wrote: ... some of my earliest code ...
(Posts VB.NET code)
Damn kids! Get of my lawn!
My earliest code would be more like:
10 PRINT "HELLO "
20 GOTO 10
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
VB.NET, not even VB 1 through 6
Although my very first code was in VB4, some 25 years ago (when I was 7 or 8).
I remember writing a quiz in WinForms with questions like "What is this? [image]" and then answers like "dog, cat, whale".
I kept the score and after 10 questions you'd get a (correct) score.
My dad was so proud he even told his customers about it (who'd later become my customers too)
After that I wouldn't write another letter of code for about 20 years and then I wrote the RPG code (the quiz code has long been gone)
Nowadays, my code just glues all kinds of (Azure) services together.
|
|
|
|
|
Adventures in 3d design: a continuing frustration.
I'm trying to design something - fairly complex, it's a lid for my Sous vide tank - in Fusion 360, and I'm getting the hang of things, I think. But ... I'd like to check my measurements (and in particular the internal radii) before I even think of buying a 3D printer, much let commiting to actual ABS / PLA.
So ... I'll print a one-to-one paper version of the drawing so far and lay it on the physical object. Easy!
Except Fusion 360 doesn't have a "print to paper" option, even for sketches. You can "Print to 3D" really easily, but not to paper.
It does have a "image" creation which asks for dpi, so I'll try that. Load it into Paintshop Pro for printing and ... it's not to scale, or even close.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
man, that would be a cool option though. You could also print patterns and then knit or sew together stuffed versions of your tanks using those
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
in F360 rotate to look down each access,
screen shot -> paint,
in paint expand/shrink to actual measurement.
print
enjoy!
If it's not hard it can't be real work. (I'm sure somebody famous said that.)
Message Signature
(Click to edit ->)
|
|
|
|
|
Well, we all knew that. That's what Excel's for.
BUT (there's always a 'but') surely MS could do better than this:-
3.08 - 3 = 8.00000000000001E-02
Yes, yes, I do know why, but I don't think it's rocket science to fix, and if it is, then it must be the kind that got the Hubble mirror -ed up.
|
|
|
|
|
There will never be anything like it.
|
|
|
|
|
|
You could start using cliches like there's no tomorrow.
|
|
|
|
|
It is amazing how often metaphors and similes are confused.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
When that happens, I settle for a simile.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
People suggesting I stick to similes... what are you like?
|
|
|
|
|
inspired by Bill Woodruff's prev message (and just in case others have the same)
stupid new Android phone kept on losing my calendar entries (old phone was fine for years)
I'd duly re-create the entries, and after some random interval later would disappear again.
today resolved to try and fix it.
(and yes, sync -> google calendar is enabled, entries showed up multiple in gcalendar, but lost from phone)
searching the google (and others): lot's of people same problem (since some android update...)
lots of the same stupid advice (just like microsoft forums): enable sync, confirm on gcalendar, click sync now - you know, all the simpleton textbook responses that never fixes sh*t.
....finally a single reference to another article on something else
turns out in: app permissions -> storage -> calendar: it was disabled. (why??)
so adding entries was fine; and the random lossage? reboot / shut down for sure, but also more often: just because.
Message Signature
(Click to edit ->)
|
|
|
|
|
lopatir wrote: but also more often: just because. [irony]They know better what we need than us. [/irony]
Everytime someone in the family got an update in the last times, something stop working as it used to and I had to get through the full settings again to put the switches as they were, at least the ones I remember / recognise again (it wouldn't be the first time I don't find a setting because it was renamed / moved to other place)
It pisses me off to unexpected limits.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Go to settings, and turn off the "Android shall randomly fail" option.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
in sum: a Win 10 update has, evidently, made all my user folders readonly, and permissions can't be changed.
note: i post this here because i think the issue goes beyond specific code used here to illustrate the issue.
Lo and behold, some serialization code using DataContractSerializer (worked fine two months ago) that creates a file on the desktop throws a "file not found exception" when creating a new FileStream.
using (var writer =
new FileStream(filename1, FileMode.Create, FileAccess.Write))
{
dcs.WriteObject(writer, instance);
} So:
1 verify the directory exists. i know the File does not exist because i delete it if it does exist.
2 try using File.Create to create the Stream, experiment with all the various params to 'new FileStream'
3 scratch my head
4 a suspicion dawns that permissions on the Directory have changed. yep: iit's readonly: i change permissions on the Directory: they immediately revert back to readonly.
5 Turns out that a Win update has made everything on my primary drive readonly.
6 go google and find ... yep ... other people are having the same problem after an update: [^]
7 try the various remedies suggested in the above link: they don't work.
8 post on Lounge
9 scratch head
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
modified 14-Sep-19 0:11am.
|
|
|
|
|
Bill,
You would need to enable or disable controlled folder access[^] to prevent this from happening again in the future.
The problem here is that the operating system needs to protect 80 year old grandmothers, your kids, your lawyer, the scientists in your office building while annoying most of the software engineers and power users.
Best Wishes,
-David Delaune
Scientiæ de conservata veritate.
|
|
|
|
|
Thanks, David, you nailed it !
Disabling the ":controlled access" setting, and re-booting: now, i can write to the file.
i had not thought of a possible Win Defender change as the demon at work, here; my long-term sub to EmsiSoft AV just expired, and i guess Win Defeater took over. Interesting i didn't see any Google hits mentioning Win Defender in my searching.
Also, interesting, the Desktop folder i am using still shows up as readonly, and undoing that setting does not persist: it goes back to readonly
Please come to Chiang Mai, and let me take you for a bowl of the famous northern Thai noodles called kao soi (your choice of beef, chicken, or fish; it's customarily a halal dish, so no pork in the really old establishment i go to)
cheers, Bill
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Hmmmm,
BillWoodruff wrote: Please come to Chiang Mai, and let me take you for a bowl of the famous northern Thai noodles called kao soi (your choice of beef, chicken, or fish; it's customarily a halal dish, so no pork in the really old establishment i go to) The last time I ate Thai noodles... I was out with 5 friends. Then the friend from New Zealand managed to get poked in the eye with an asian chopstick. Pretty soon we'll have to call them 4 eyes.
Best Wishes,
-David Delaune
Scientiæ de conservata veritate.
|
|
|
|
|
BillWoodruff wrote: note: i post this here because i think the issue goes beyond specific code used here to illustrate the issue. And IMHO it is right posted.
I need to upgrade lappie and was a "ok, nice to know" for me
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
|