|
This is the way to do it.
You could cast it, but it's never going to be as easy, safe and predictable as using a struct.
|
|
|
|
|
This is the way. :RemovesHelmet:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
My other option was
struct MyLong {
int hi;
uint lo;
}
You only need the sign in one spot. Am I right?
:Reapplies Helmet: ?
:Puts Helmet on head and fastens chin strap and lowers visor: ?
What is the opposite of “Removes Helmet” that is just as concise?
|
|
|
|
|
englebart wrote: What is the opposite of “Removes Helmet” that is just as concise? "Equips helmet"?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I like it. Reminds me of a text based dungeon game!
|
|
|
|
|
your reasoning is sound, for one type of bit ordering
I'd personally stick to int and unit test the conversion logic instead
the details are easier to work out that way
|
|
|
|
|
Your long is actually a pointer. A pointer is unsigned 4 bytes or 8 bytes on 32-bit and 64-bit platform respectively. Long is always signed 64-bit integer on .NET. And you are not supposed to use a native file pointer in .NET to read/write to a file. Restrict your file operations to native code.
extern "C" { __declspec(dllexport) void* GetCurrentFileRawFilePointer (void); }
Declare Function GetCurrentFileRawFilePointer Lib "GeoMon4D_iMX7.dll" () As IntPtr
|
|
|
|
|
Hi,
lastly I found a working solution and its far from zipping data, thanks for that really good idea, but it was not April 1st, (and gives insight into your mindset).
The embedded framework didn't support passing 64 bit values between managed and unmanaged code. A little workaround is needed.
Fist create a new IntPnt object and pass this object to unmanged code by reference as parameter of some function. In unmanaged code use this pointer as any other pointer in C/C++, and assign the data you need.
Return from this unmanaged function and use the 'Marshal' class to readout the value.
Use a 'try finally' block to clean up memory in any case.
Managed code:
Private Shared Function ReadFilePointer() As Long
Dim ptr As IntPtr = Marshal.AllocHGlobal(Len(New Long()))
Try
GetBookmark(ptr)
Return Marshal.ReadInt64(ptr)
Finally
Marshal.FreeHGlobal(ptr)
End Try
End Function
Unmanaged code:
extern "C" { __declspec(dllexport) void GetBookmark (intptr_t*); }
void GetBookmark(intptr_t* bmark)
{
*bmark = ftell(outFile);
}
Hope this can help someone someday.
With best regards
Gerhard
|
|
|
|
|
Following is from the CodeProject newsletter
Live Coding Interviews[^]
I couldn't agree more with what is said there.
If a company is looking for a senior developer does one really expect it to matter how they set up a method signature? I want them to be able to design a sub-system. A real sub-system. So I want to hear about a real problem that they designed and implemented in the past. I absolutely do not want them to code a binary search algorithm because a senior developer should never code that - there are already existing solutions and they should know to use them.
And if the position in a junior developer then I expect that they will not be able to program in the first place. They can't design, they can't correctly create objects, they will introduce errors. Which is why they must always have a mentor (not half-a** either but basically at 50% utility.)
Most of these tests are basically ludicrous. At one point when I was looking for a job 3 different companies used an online IQ test to screen. Guess what - same IQ test for all three.
Adhoc tests by developers are even worse since they do not even understand how testing works. And certainly have never considered creating/determining a baseline for the test that they are giving.
Another company decided to start using a touchy-feely psy test which they came up with an 'ideal' category for new programmers. Then they gave it to the large (about 300) set of developers already working in the company. Of the top developers in the company already formally recognized by the company as being the best none of them tested into the 'ideal' category.
|
|
|
|
|
When I applied for a job as a computer operator back in 1965, I knew nothing about computers. The interview itself started with about a dozen of us in a classroom. It was explained that we were to be given a test which was used to measure suitability for the job. The test itself consisted of about 10 questions which all involved moving numbers from a starting box to a finishing one. Along the way there were one or two calculations to be done. Though I had no idea what the basis of the questions was, the answers all seemed logical to me, and I got the job. Later when a friend taught me the basics of the machine's instruction code I realised that the test was just about writing programs, and a few years later I switched jobs to actual programming. From that early start I managed to bluff my way through 40+ years of pretending to be a programmer.
|
|
|
|
|
I once had an interview for a large bank.
No formal tests, just a chat with two developers who asked me technical questions.
One question was about Entity Framework, which I've used for years and know quite well.
I don't remember what the question was, but I remember knowing giving the correct answer.
Their reply was "No, that's not how you do it. We do [some improper use of EF]."
Basically, I got rejected because I was right and the interviewers were a bunch of bunglers.
After that interview I didn't want to work there anyway
At another company I got a pretty large test.
Putting numbers and symbols in boxes, writing a small web page, designing a database...
I don't think I did very well on the test, but well enough for them to hire me.
Once I worked there I realized none of them would be able to complete the test.
Biggest bunch of bunglers I'd ever seen.
Their HTML was crap, their CSS was crap, their database was full of unneccesary YAGNI recursion, their C# functions consisted of 1000+ lines of code.
At one point I told them "why are you guys minimizing your JavaScript? It can't be minimized the way you wrote it because everything is public."
I even showed them how to properly encapsulate it using a simple module pattern, but one of the guys started shouting (literally) because he didn't understand it and I had to revert my changes.
About a year later we got an issue from a pen test, our JavaScript wasn't minimized (mind you, it was).
After some investigation, the team lead was shocked by the quality of our JavaScript.
Needless to say, everything else wasn't much better
Yeah, those tests mean nothing.
|
|
|
|
|
lol.
I had forgotten one interview long ago...
The interviewer came in and started with some basic C++ questions. And then one that was rather specific related to how C++ handled virtual methods and static method calls internally.
I answered it.
Then I remarked what a coincidence that question was because I had answered exactly the same question several days ago in an online forum. At that moment I really did think it was just a coincidence.
The interviewer immediately seemed to get flustered and the interview ended quickly after that.
It wasn't till I was walking back to my car that I finally realized he had found my answer on the forum and used it as an interview question for me. Didn't of course admit it. I didn't hear back from them.
|
|
|
|
|
I hate pecker heads like that. Went into an interview a long time ago. Fixed the development team's problem they had been struggling with for 2 months. Then met the "architect" - a serious prick of an individual. Went to lunch with the PM. He was worse than the architect which I thought was nigh impossible.
a few years later a head hunter called me about an open opportunity - he described it - I asked, "This is Scientific Atlanta, isn't it?" Yes it is why? Cause I won't work for those $#%%&^&^%. Talk about leaving the HH sputtering
These tests are so ridiculous with one exception - new developers - 5 or less years in the trade. If you claim you know C - you better be able to explain to me pointers. C++ - just tell me the difference been a class and an object. You'll be amazed how shallow the knowledge it.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Weeding out people who think and plan before hitting the keyboard sounds like a great way to get the workers they deserve. And they're probably the ones who complain that they can't find workers.
I have no problem speaking to an auditorium full of people, but I do *not* want people to watch me type.
|
|
|
|
|
Ewww - that's cruel Paul. I like it. I like to follow up with "What do you use for source control? Can you briefly elaborate on your build process?" The answers will tell you all you need to know about the managers and senior developers.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
XBoot Emulator screenshot[^]
I got XBoot building for ARM. I found a copy of xfel for windows. I got the emulator working on my machine.
This is amazing. I still have a ways to go, but I'm making steady progress here.
To err is human. Fortune favors the monsters.
|
|
|
|
|
If you happen to try a Windows 11 clean install with the latest installer, you may run into an issue: The installer will report that you have no drives suitable to accept the new Windows system.
The cause of this issue is that the installers used to be equipped with default drivers for SSD drives (both SATA SSDs and NVMe SSds.) Because of issues caused by these default drivers, Microsoft stopped including them with the installer. No drivers means that the installer cannot see any SSDs in your system. The installer will offer a link to browse for the drivers - But where are they, what are they called? You get no hint how to find them.
It took me a lot of research to figure out how to proceed:
You need to download the Intel-Rapid-Storage-Driver****** for your particular machine from the manufacturer's website and run it. It will offer you the option to install or extract the drivers. Select the option to extract the drivers and select a folder where they can be saved. Assume you select the folder: "F:\Driver\", you will find the SSD drivers in the VMD folder. The full path will be created as: "F:\Driver\production\Windows10-x64\15063\Drivers\VMD". Note that these comments apply to my Dell XPS machine. On a different manufacturer's machine the path may be different.
Point the Windows installer to this VMD folder and it will find the SSD drivers and the installation will proceed.
Note: I recommend you install the VMD folder on the flash drive that holds the installer. It just makes it easier to point the installer to the drivers.
Get me coffee and no one gets hurt!
|
|
|
|
|
This isn't a new issue with the Windows Setup programs. Before I image any new machine I go to the manufacture's support site and download and extract the hard drive drivers.
Since you mentioned Dell, also download the current version of Dell Command Update and install it first. Then run the option to install all the Dell drivers. Do this before doing any Windows Updates.
|
|
|
|
|
Quote: This isn't a new issue with the Windows Setup programs
As far as I am concerned it is new. I have done dozens of clean installs and only came across this issue with the very latest Windows 11 installer. All previous installers had default drivers that worked for me.
Get me coffee and no one gets hurt!
|
|
|
|
|
I've run into this with Windows XP, Vista, 7, 8, 8.1, 10, and 11. The problem is Microsoft doesn't update the setup program but once in a blue moon while new hardware is released frequently.
Dell and Microsoft Surface both happen to be very easy to get the drivers ahead of time.
|
|
|
|
|
obermd wrote: This isn't a new issue with the Windows Setup programs
Correct, it sounds an awful lot like the procedure I had to follow back in the NT4 days (!) to get some SCSI disk going.
I hadn't run across that sort of thing again until a few years ago, when a buddy of mine bought a laptop that came with an NVMe drive.
|
|
|
|
|
Had this exact same issue when I clean installed Windows 10 (because my new laptop came with 11), that was a fun couple hours of my life
|
|
|
|
|
This isn't new. It's been this way for years in Windows 10, Windows 7, Vista, XP. If you have an unrecognized AHCI/SATA/RAID controller, you need to load the "F6 driver" This term itself goes back at least twenty years. Dell has frequently over the years shipped computers with drive controllers that weren't recognized by the basic driver set included on the Windows installation media.
Also, Dell changed (many times) the default bios settings. Sometimes they come set to IDE (which will always work with default drivers). Other times, they have the controller set to AHCI or RAID mode (which will typically require a driver).
|
|
|
|
|
This is interesting! My Dell XPS (where I ran into this problem) BIOS does not have an IDE option, only RAID or AHCI. If you select AHCI you better have a SATA drive attached, or the BIOS will freeze (hang). If you only have NVMe drives, you absolutely MUST select RAID or the machine will not start. From your comments I conclude that because RAID is compulsory for me, I have to provide the appropriate drivers for the installer.
Thanks for your input!
Edit: There's a new development. A couple of days ago, after the clean install, I upgraded the BIOS to the latest version. Now I notice that the drive config options have changed in the new BIOS: There is still no IDE option, but the options now are:
- RAID
- AHCI / NVMe
That NVMe addition is new. Maybe the installer drivers will work if I set the BIOS to that option? Pity I don't have to repeat the setup!
Get me coffee and no one gets hurt!
modified 27-Apr-23 22:16pm.
|
|
|
|
|
This level of difficulty and the complications of the solutions others have provided for Microsoft products are why Apple is the most successful company in the world. Mac sales are increasing because most people don’t need this extra hassle in their lives.
|
|
|
|