Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1451.

Solve : Leap from NT4 to Windows 10 and QBasic to VB Script idea?

Answer»

About 3 years ago Foxidrive helped me greatly with a need that I had to be able to change some config FILES that had a value of N to switch to Y. The situation was that my employer does not allow external programs on media to be installed to these tightly controlled systems, BUT I am allowed/approved by my boss to code directly to the systems in their clean secured environment. So I can code/script openly or reading off of a piece of paper typing it all into notepad etc and saving it to run it etc.

The systems originally were Windows NT4 and I needed to be able to change a value from N to Y in a bunch of config files on a weekly basis. I figured this might be able to be handled in batch. Foxidrive pointed out issues with pure batch to pull this off and suggested that instead the batch itself generates a QBasic program and runs that. That worked awesome until I heard that the NT4 systems that have been running since the late 1990s ( Pentium 3 700Mhz systems ) are to be replaced in the near future with modern computers running Windows 10 64-bit.

Knowing that 64-bit Windows 10 does not handle 16-bit programs, instantly I KNEW that I need to work on the next solution. ( Its too bad that Windows 10 64-bit doesnt support 16-bit programs because a solution could have been to connect the old and new system to their network and transfer over a file share QBasic from the NT4 system to Windows 10 and not have to rewrite a program all over again that is no longer supported by newer OS. ) I have done this sort of thing in the past where older Windows versions had programs that newer OS lacked and copy copying them forward you could legacy support older stuff on newer OS.

So the next solution is to once again pull this off without installing any external programs, it all has to happen within the natural environment of Windows 10 64-bit and I have to manually key in the program or script(s) within Windows environment. I was thinking that VB Script might be the best solution for this however looking for suggestions on a suitable replacement for the batch that generates this QBasic program below given the limitations? It kind of stinks that I cant do this using any languages I am ok with and to pull this off involves scripting that I rarely dabble in. If allowed to create this in C++ I would do it up and compile it and bring it in as a EXE, but thats not allowed.

Below is the .bas program generated and run from within batch that runs for as many files exist at the root of where it is run. It searches for "LS: N" and "$LASTSORT N" and it changes the N's to Y's for "LS: Y" and "$LASTSORT Y" and saves the change to config files with .piv and .stf file extensions.

Quote

dir /b /a-d *.piv *.stf >tempfile.tmp

set "file=edit.bas"
>"%file%" echo OPEN "tempfile.tmp" FOR INPUT AS #3
>>"%file%" echo DO WHILE NOT EOF(3)
>>"%file%" echo LINE INPUT #3, file$
>>"%file%" echo OPEN file$ FOR INPUT AS #1
>>"%file%" echo OPEN "temp.txt" FOR OUTPUT AS #2
>>"%file%" echo DO WHILE NOT EOF(1)
>>"%file%" echo LINE INPUT #1, a$: y=1
>>"%file%" echo if not INSTR(ucase$(a$), "LS: N" ) = 0 THEN ? #2, "LS: Y" : y=0
>>"%file%" echo if not INSTR(ucase$(a$), "$LASTSORT N" ) = 0 THEN ? #2, "$LASTSORT Y" : y=0
>>"%file%" echo if y=1 then ? #2, a$
>>"%file%" echo LOOP
>>"%file%" echo CLOSE #1, #2
>>"%file%" echo KILL file$
>>"%file%" echo name "temp.txt" as file$
>>"%file%" echo LOOP
>>"%file%" echo SYSTEM

qbasic /run %file%




Why doesn't anyone comment their code? I know memory was scarce but...

VBScript should be fairly easy, would look very similar, and you probably won't need a temp file.

But first... is this a fair summary of what you want to do?

Batch:
List all files in current folder
with extensions piv OR stf
into a temp file

Create QBasic file:

' This is the QBasic file
' Read temp file line by line
OPEN "tempfile.tmp" FOR INPUT AS #3
DO WHILE NOT EOF(3)
' Get a FILENAME from list
LINE INPUT #3, file$
' Open that file for input
OPEN file$ FOR INPUT AS #1

' Open a new temp file for output
OPEN "temp.txt" FOR OUTPUT AS #2

'Read listed file line by line; each time setting y flag to 1
DO WHILE NOT EOF(1)
LINE INPUT #1, a$: y=1

' *** Isn't this double-backwards logic? ***
' if line *contains* "LS: N" THEN write "LS: Y" to temp file; flip y flag to 0
if not INSTR(ucase$(a$), "LS: N" ) = 0 THEN ? #2, "LS: Y" : y=0

' if line *contains* "$LASTSORT N" THEN write "$LASTSORT Y" to temp file; flip y flag to 0
if not INSTR(ucase$(a$), "$LASTSORT N" ) = 0 THEN ? #2, "$LASTSORT Y" : y=0

' if y flag is still 1 then the the last 2 tests were failed
' write the input line unchanged out to temp file
if y=1 then ? #2, a$

' Finished with this file
LOOP
' Close input & output streams
CLOSE #1, #2

' Delete original file
KILL file$
' 'Rename temp file to original file
name "temp.txt" as file$

' Keep going until finished with file list
LOOP


'Done; quit
SYSTEM
Quote
Why doesn't anyone comment their code? I know memory was scarce but.
You read my mind.
.. and thank you for the nice Qbasic code.
The 32bitversion of Windows 10 will Qbasic to run.
Hey Salmon ... sorry about no comments ... typed it from printed form as for I cant use any media to share it from the system so I got lazy in not wanting to type so much and from printing it I typed it as short form as I could to show the important parts if its entirety.

The situation I have is basically I have a folder with a bunch of text files with .piv and .stf file extensions, and just need to have a script that runs through all of these files and when it finds LS: N it changes that to LS: Y and when it finds string of $LASTSORT N it changes that to $LASTSORT Y ... BUT I have to type it into notepad and then save it as a script to run it as for there are very tight restrictions on no media brought into a heavily controlled environment of automation controls where there is an over paranoia of malware so being completely isolated they protect themselves. Nothing like supporting systems feeling like your hands are tied knowing a way to do it if I could do it up in C++ but I cant write and compile it and bring it in on media, so my boss has allowed for me to whatever I can type within the limitations of the Windows OS as allowed because no malware risk. Prior to this weekly we had to manually edit like 40 or 50 config files and that was a pain. I have used this qbasic generating and launching batch that foxidrive gave me as a solution for about 3 years now and it was working sweet to make the weekly config file edits a 5 second process vs 30 minutes of manually editing files. The software that is used to generate the config files needs to be edited by engineering to allow the person who sets these up to select Y or N ... BUT while an engineer helped me with how to get the machine to run the way we need it through manually editing these config files, they are hands off with updating their software because they require orders to spend time/money on that. Our site runs different than others so we have been given exception to run outside of normal operating parameters when I chatted with an engineer who was cool and pointed out how to get the machinery to BEHAVE as we needed it to. Basically its so strictly enforced no external media brought in that I can be fired if I brought in a program that would be a solution on a disc, but whatever I can key in at the local computer is allowed. I work as an electronics technician for industrial automation controls and because I have computer science skills/background I am the go to guy there for IT stuff and I work between engineering and local plant operations as well as their IT department and operations in which I am given some limited privileges of approval with tight restrictions beyond what other ET's get there to bend rules within limitations.

The way that all files were written from output of dir /b /a-d *.piv *.stf to the temp file was foxidrives original design for solution for this.

With comments added it looks correct.

Going from QBasic to VB Script I was thinking might be the easiest... further thought is that powershell might also be a solution as for that should be built into Windows 10 64-bit as well.

Its about time that they replace the old Pentium 3 computers running NT4 as for I have been frankensteining guts from other Pentium 3 donor systems of the same hardware flavor for the last 3 years as well as for they also have tight restrictions on what hardware has been approved by engineering for the machinery. So when a different machine with a computer with different part number I knew had the same internal hardware and was getting thrown away, I gutted it to have some spare parts on hand "mainly the motherboard" being the most important due to integrated network adapter use etc. Its kind of crazy that just about any computer could replace the Pentium 3 700Mhz with 384MB RAM but because of hardware restrictions imposed by engineering I cant use a healthy Pentium 4 or Pentium D system I have in place of it and need to play with strict hardware use rules which at times can be frustrating when a system is down and the solution is right in front of me, to replace the computer with another and add necessary drivers to make it communicate over the network, but everything gets its own part numbers and only can replace with same part number.

Prior to this career I was given full privileges to keep a food store chain running for 7 sites as system admin / IT guru for 6 years and any creative solution that worked and was legal was allowed in which I added all kinds of parachute solutions of redundancy and automatic fail-overs to get whatever failed service back up and running asap as for a point of sale system down is a VERY BAD thing for a business especially a food store that is busy.
From your description it sounds like you effectively just need to do a string replace? Replace "LS: N" with "LS: Y" and "$LASTSORT N" with "$LASTSORT Y"?

If I understand CORRECTLY this should do what you want. Reads in a file, then replaces the text in every file specified in that file, writing the result to the same file.

Naturally, you should try it out before you go having it run amuck on the system(s) in question, but I'm sure that is your intention.

Code: [Select]ForReading = 1
ForWriting = 2
InputFile = "D:\fileslist.txt" 'Set Input file. can be set to first argument provided with = WScript.Args(0)

Set FSO = CreateObject("Scripting.FileSystemObject")
Set FileListStream = FSO.OpenTextFile(InputFile, ForReading, False) ' Open the File List file.
InputFilesStr = FileListStream.ReadAll
FileListStream.Close

InputFiles = Split(InputFilesStr, Chr(13) + Chr(10)) 'Split file list file contents we read in into an array.

For Each ReadFileName In InputFiles

'read the contents of the file, close the file, replace the text, then write the replaced text back to the same file.
Set InputStream = FSO.OpenTextFile(ReadFileName, ForReading, False)
InputText = InputStream.ReadAll
OutputText = Replace(Replace(InputText, "LS: N", "LS: Y"), "$LASTSORT N", "$LASTSORT Y")
Set OutputStream = FSO.OpenTextFile(ReadFileName, ForWriting, False)
OutputStream.Write OutputText
OutputStream.Close

Next


Thank You BC

Tested it on my Windows 10 64-bit home computer after just changing path to C:\w10\fileslist.txt, saving as a .vbs, and making some test files. It replaced the correct strings in the files and fast.



[attachment deleted by admin to conserve space]
1452.

Solve : Code blocks IDE?

Answer»

This will ake me look like a RETARD but id rather start somewhere than give up and throw my laptop across the room.

I'm using a NICE simple IDE - code blocks for writing c programs.

The prblem is not the language at this warm up stage when i'm writing simple programs to build calculators and stuff but the software is proving a bit annoying and fiddly for me but probably nobody else. Enough of feeling sorry for myself.

Does anybody know what i'm doing wrong. When I try to add a new program like calc.c , save it, buid and then run, code blocks overwrites the HELLO world name to calc.c but runs the hello world program instead of the new program that I tried to add. Any ideas anyone?Did you build your project again (gear icon) before running it (play icon)? If you just run it, the executable will not be re-built. Make sure to click the gear again to build the executable with your updated source code.Ajax Hurts,
Hello, welcome to CH.
Are you new to computer programming?
Do you have any FORMAL training?
Please proved some info about what you are using.
Are you using a C compiler? Not a good idea for novice.

IMO, and others, a good place to start might be an interpreter.
Interpreters have a more friendly IDE.
A good place to stat might be Python.
You might like to READ this:
https://lifehacker.com/how-i-taught-myself-to-code-in-eight-weeks-511615189
Quote
To a lot of non-developers, learning to code seems like an impossibly daunting task. However, thanks to a number of great resources that have recently been put online for free— teaching yourself to code has never been easier. I started learning to code earlier this year and can say from experience that learning enough to build your own prototype is not as hard as it seems. In fact, if you want to have a functioning prototype within two months without taking a day off work, it’s completely doable.
Hope that is of some help.
1453.

Solve : Control what a CPU places in the L3 cache area with C++??

Answer»

Might not be possible, but curious for performance increasing reasons.

Can you write a program in a way that it checks a CPU to see whether it has L3 Cache and if it does to run the program in the fast L3 cache space vs off of system RAM which is slower to address?

I have 4 systems with L3 Cache ( two newly acquired Phenom II x4 945 3Ghz with 6MB L3 cache CPU's that I installed into systems that use to be a Sempron 145 2.8Ghz single-core and another that use to be a Athlon 64 4450B 2.3Ghz dual-core ) + ( FX 8300 3.3Ghz and FX 8350 4.0Ghz 8 core systems with 8MB L3 cache. )

Maybe it its purely left to the CPU itself to decide what it places into the fast L3 cache vs system RAM but curious if there is a way to control this to get even better performance in a number crunching program?

Maybe "shaping" ( data length restrictions ) need to be performed to get something to fit within this 6MB or 8MB cache space so that the CPU places it there vs system RAM like a square peg that can fit the square hole so its then allowed and runs with it?

*Instead of buying a decommissioned quadcore xeon server that I was warned is noisy in the 1U rack mount flavor, I decided to upgrade 2 slow systems I hadn't been using to Phenom II x4 945 3.0Ghz CPU's for $40 per CPU used, and the power consumption isn't all that bad for performance to power cost ratio and they are relatively quiet and cool running, plus I could have two completely different windows environment operations with keyboard/mouse at the same time for automation stuff. So my need to have a data cruncher server, I sort of satisfied with pairing two desktop systems to run side by side with the best CPU the motherboards could handle inexpensively which was the Phenom II 945's. Now I am curious if I should write my programs in a way to utilize the L3 cache or it just does it all on its own hands off. My prior server was a HP Server tower that had two Opteron 2216 2.4Ghz dual cores acting as a quadcore server. This server was beyond its useful life as number cruncher as for it was too slow. For a short while I gutted it down to get rid of unneeded features to drop the power consumption as low as I could go, but it was a space heater that wasn't very efficient at number crunching. ( I removed the HDD and dual video Quadro FX4600 video cards and installed a Geforce4 mx 440 64mb video card and a 60GB SSD drive, but that was all that could be done to reduce wasted power consumption with it as for the fans were needed for cooling. ) https://www.cpubenchmark.net/cpu.php?cpu=AMD+Opteron+2216 Other benefit of a pair of systems to be used as servers is that I can also set up a small cluster with the pair if ever needed as well to combine their crunching, however just giving each system its own task is easier and more efficient most of the time as for communications over a cluster is limited to the speed of network etc and it makes sense for a single system of combined computing where you have more than just 2 systems but more working together as a team.General reference:
https://en.wikipedia.org/wiki/CPU_cache
Quote

All modern (fast) CPUs (with few specialized exceptions[2]) have multiple levels of CPU caches. The first CPUs that used a cache had only one level of cache; unlike later level 1 caches, it was not split into L1d (for data) and L1i (for instructions). Almost all current CPUs with caches have a split L1 cache. They also have L2 caches and, for larger processors, L3 caches as well. The L2 cache is usually not split and acts as a common repository for the already split L1 cache. Every core of a multi-core processor has a dedicated L2 cache and is usually not shared between the cores. The L3 cache, and higher-level caches, are shared between the cores and are not split. An L4 cache is currently uncommon, and is generally on dynamic random-access memory (DRAM), rather than on static random-access memory (SRAM), on a separate die or chip. That was also the case historically with L1, while bigger chips have allowed integration of it and generally all cache levels, with the possible exception of the last level. Each EXTRA level of cache tends to be bigger and be optimized differently.


Have you already looked in the Intel place?
https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/cache-allocation-technology-white-paper.pdf

https://software.intel.com/en-us/forums/software-tuning-performance-optimization-platform-monitoring/topic/745751

For 64 bit CPU there are specific things you need to know.
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-optimization-manual.pdf

For the AMD there's some variation, but I have not read the manual.
https://support.amd.com/TechDocs/24593.pdf

Does that help any?

EDIT: From AMD:
System Resources
45
24593—Rev. 3.29—December 2017 AMD64 Technology
See “Page-Protection Checks” on page 145 for information on the page-protection mechanism.
Alignment Mask (AM) Bit.
Bit 18. Software enables automatic alignment checking by setting the
AM bit to 1 when RFLAGS.AC=1. Alignment checking can be disable
d by clearing either AM or RFLAGS.AC to 0. When automatic alignment checking is enabled and CPL=3, a memory reference to an unaligned operand causes an alignment-check exception (#AC). Not Writethrough (NW) Bit. Bit 29. Ignored. This bit can be set to 1 or cleared to 0, but its value is ignored. The NW bit exists
only for legacy purposes.
Cache Disable (CD) Bit.
Bit 30. When CD is cleared to 0, the internal caches are enabled. When CD
is set to 1, no new data or instructions are brought into the internal caches. However, the processor still accesses the internal caches when CD = 1 under the following situations:

Reads that hit in an internal cache cause the data to be read from the internal cache that reported the hit.

Writes that hit in an internal cache cause the cache line that
reported the hit to be written back to memory and invalidated in the cache.
Cache misses do not affect the internal caches when CD = 1. Software can prevent cache access by setting CD to 1 and invalidating the caches.You cannot really control what memory get's cached or where it get's cached. You can only write software in a way that makes it Cache-friendly:

What is Cache-friendly CodeThanks BC for that link. I read through it and one of the external links sent me to a tutorials point youtube video that showed more information on this.

For some reason I was thinking that cache could be targeted to make use of an address range that was labelled and associated as cache, similar to how knowing a specific address you can perform memory calls & injection to fetch or write information to an address, and so if an address can be targeted then its known and so you can pass data to and from it. Analogy to my thought on this was say you have a system with a Hard Drive and a SSD, you can pass information to the SSD to have a faster read/write, but data that isnt critical to speed remain on the Hard Drive. I was thinking that maybe there was a function that could target cache directly, but its hands off and handled by the CPU only. So it seems that you can call a memory address directly to System RAM, but not cache. Cache is hands off and its a matter of keeping a program small so that the CPU might utilize its internal cache to contain it.

The program I am running is 553KB in size so I guess its pretty probable that the L3 is being utilized for it with 6MB L3 cache available at all 4 cores running 4 instances of the program because its single-threaded basically 4 instances of the program WOULD consume 2.012MB of the 6MB. On the other processors that only have L1 and L2 cache it was likely that it was less efficient and hitting the System RAM more because 512KB per core of 2MB of L2 cache with 4 instances of the program running since its single-threaded the 553k program x4 doesnt fit within the L2 in entirety.

It looks like to make a program that makes better use of your cache memory, its a matter of keeping program size minimal and information that is called over and over again the CPU will pick up on this and run with it to place it into its cache at the 3 cache levels of processors with L1, L2, and L3 cache such as the AMD Phenom and FX processors that I have.

Been working on making a program more efficient and was thinking if I could get it into the L3 cache it would run much more efficiently with lesser wasted clock cycles. I've even thought about porting it to Linux and run it from a distro that doesnt have a GUI because Windows itself have processing overhead which is waste. Also did some reading into methods of utilizing GPU's for mathematical crunching but havent found any examples that show an easy way to tap into a GPU to process a program vs CPU.

I have two GTX 570 video cards and a GTX 780 Ti. Knowing that GPUs are better at crunching numbers ( The crypto currency farming was using them for a while to point this greater efficiency out ) .... it might be the better way to go, but I have yet to find any examples that show how to load a program into GPU and have it crunch away.

Project i am working on is sort of looking for needles in a hay stack. Its all out of curiosity on a project i have that shuffles 89 characters randomly and seeded random where the seed is a key to scramble and unscramble information. For the fact that its probable to have a perfect shuffle where such as with a deck of cards you could shuffle a deck and have it shuffle back to order in which the deck was purchased of 2,3,4,5,6,7,8,9,10, J, Q, K, A for each suit, I have had an interest in with a long long int used as a seed, the frequency at which weak keys occur as well as to hunt down each of the worst keys that shuffle back to close to or the exact original order. There isn't enough processing power in the world to run for every combination of 89 characters ( permutations of 89 ) in a shuffle. Here is an interesting link on permutations of 52 ( deck of cards ) https://www.quora.com/How-many-combinations-can-a-deck-of-52-cards-make

From the program that I use the best method to avoid a weak key is to just test the key before its used for strength which takes a fraction of a second. Currently the curiosity for searching for weak keys I put in a starting value and end value to run to and tell it the flag value (threshold) to which if so many or more characters match between start location of array 1 and destination location of array 2 per iteration it writes to file that key value so I can check it out further to see how bad it is. At looking for 15 characters or more that shuffle back to their original order of 89 I have run through 10 Billion keys so far with no hits. If I drop the threshold to 8 they start popping up here and there, so I know that the program is doing what its designed to do vs not reporting due to a flaw in code. Its just that 15 characters or more to be shuffled back to their original position is extremely rare according to the first 10 Billion tested and nothing found yet.

Performance of the Phenom II x4 945 3.0Ghz CPU is pretty good. I am able to test 1 Billion keys per 2 hours and 17 minutes with 250 million keys per core and 4 instances if the single-threaded program running with core affinity set to tag each instance to its own core.

The project is mainly a curiosity and not an insanity. And it acts as a small space heater during the cooler months of the year in which its currently 30F / -1C outside In relation to what i discussed in prior post I think I found what I need to learn to make use of the nVidia video cards for crunching and get the program to run on the GPU's that I have. Sharing this here in case anyone else has interest in this sort of thing.

https://developer.nvidia.com/how-to-cuda-c-cppOf note is that trying to keep executing loops/code in the cache is an optimization technique that is covered in Michael Abrash's Graphics Programming Black Book. Of course that covers graphics programming but it has extensive coverage of CPU performance characteristics and optimization at the Assembly Level. It doesn't really cover modern systems (I think the Pentium was the latest at the time of it's release) but most of the underlying concepts are sound.

Worthwhile mention as well:

Quote
For the fact that its probable to have a perfect shuffle

And I think this might highlight some of the problems with your approach. Exactly how you shuffle is going to depend on the shuffle algorithm. How are you shuffling?

My own personal preference has been to shuffle using a sort algorithm:

Code: [Select]var cards = Enumerable.Range(0, 51);
var shuffledcards = cards.OrderBy(a => Guid.NewGuid());
(C#). Basically instead of swapping elements around like Fischer-Yates, it just takes the sequence and associates a random GUID with each one, then sorts the elements using those random values. The standard Fischer-Yates algorithm isn't truly a fair shuffle because it's not possible to have it shuffle into the original order.

Despite this, I think for card shuffling and your specific approach, you have a much bigger issue and possibly something you haven't even considered- not enough entropy.

As you linked, there are 52! possible combinations of cards in a 52-card deck.

The issue is that most random number generators use a 32-bit seed. that means there are only 2^32 possible random number sequences, which means that of those 52! possible combinations, it would only be possible to generate around 4 billion of them, which is a teensy tiny fraction. In fact, the most elements you can fairly shuffle with a 32-bit seed is 12. Once you hit 13, there are too many possible sequences. Even the GUID I used above is only 122 bits of entropy, which is also a significantly small fraction of the total problem space.


52! is higher than 2^225 but smaller than 2^226, it would be necessary to have at least a 226 bit seed in order to be able to generate all possible permutations when shuffling a 52-card deck. Otherwise, you won't be able to see all possible sequences.Thanks for the info BC and very interesting...

Curious whats going on beyond seed value beyond 32-bit limit around the 4 Billion value.... do you think its rolling like an odometer back to 0 so that the outcome of a shuffle with seed of 0 and 4,000,000,001 become the same shuffle output?


I'm not sure I understand what you mean. If you are using a 32-bit seed (eg. int) then there isn't anything "beyond" it. The size of the seed is dictated by the algorithm. You typically cannot use srand() for example with anything but a 32-bit seed.

The Seed dictates the sequence of random numbers. If a random number algorithm only accepted say a byte seed, then there could only be 256 unique sequences. that could ever be generated by the algorithm. Asking what happens in that case if you give it a seed larger than 8 bits wouldn't really make sense. It's like asking what happens if you store 8TB on a 1TB Hard drive.

Perhaps using that smaller example can make more sense. Let's say we have a Random number algorithm that takes a byte as a seed. So we've GOT 256 unique sequences of random numbers- 0 gives us one sequence, 1 gives us another, etc.

If you have a sequence of 5 elements, All the possible permutations are represented, because there are 120 possible configurations of those 5 elements.

if you add a 6th element, however, there are 720 possible permutations. Since you only have 256 possible sequences with that limited random number generator, you can only generate 256 possible permutations of those 6 numbers using that random number generator.


There are arguably some workarounds for it that can extend it. For example the sequence with seed 6 could "skip" some early values in the sequence and instead start later in that sequence to (hopefully) get a sequence that isn't represented in the first 6 values of any other sequence, but it is very unreliable.

Hello BC... as per

Quote
I'm not sure I understand what you mean. If you are using a 32-bit seed (eg. int) then there isn't anything "beyond" it. The size of the seed is dictated by the algorithm. You typically cannot use srand() for example with anything but a 32-bit seed.

I was thinking that beyond the 32-bit limit it might loop back to the beginning of the 32-bits like an odometer or like rolling the score back to 0 in asteroids in my last chat here etc, so a seed value of -1 is equal to a seed value of 2147483647 and seed value of 0 is equal to a seed value of 2147483648 and a seed value of 1 is equal to 2147483649. Butchering code to turn it into a loopable shuffle display it proved that it does in fact loop back / roll over back to 0 like an odometer. I supplied the code below in case you want to check it out further.

Additionally, when trying values exceeding 32-bit limit of 2147483647 my program that until today didnt have this limitation, but by which I added a rule now to not allow a value greater than it, caused a roll over of the output to be the same as the beginning but the spill over since the input is greater than 32-bits caused havoc with the next user input. The nature of the spill over is that with 2147483648 ( which is 1 too many ) it starts to scroll u's across the screen like uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu uuuuuuuuuuuu until I kill the program and for 2147483649 it starts to scroll a character that is none of the 89 characters that my program supports input of so it starts to scroll error messages telling the user its an invalid character and to enter a valid character in an endless loop.

Thank you for pointing out this seed limitation as for I wasnt aware of the 32-bit limit of it and well at least I picked a better time of year (winter) to use a computer as a space heater when unknowlingly TIL today that as the values input beyond 2147483647 are just looping around back to 0 so its an odometer that keeps rolling over and there are no shuffles that go back to the original order in accordance with the 32-bit seed limitation.

Do you know if programming for a 64-bit OS with a IDE able to create 64-bit programs if the seed would then support 64-bit value or is the seed strictly 32-bits no matter of 32 or 64 bit compiled program? Most people use a seeded time so 32 bits is plenty for user input delay assisted random, so I could see how maybe it wasnt changed to permit a larger 64-bit seed value.


Quote

Enter Integer Seed:


-1


unCrypt String Key =

18cQUHTZ7Rt4<jAzi3"Je:x/,h]Vk>yGWCXSw#p2%96'[emailprotected]+Y~?l(a\qnB&v.[!=5KsmdMob)f
*ug^Pr_L$;


Run again 1 = Yes and 0 = No
1
Enter Integer Seed:


0


unCrypt String Key =

_Ui?$dopSQ[O"lfLn<Nrv-\j!MJ/4%3Cy6IZk7APY>0R,[emailprotected]&H8e'cx2)z.=^#u(Dg;*9h:a5KX]TtE
s~WbG1VBF+


Run again 1 = Yes and 0 = No
1
Enter Integer Seed:


1


unCrypt String Key =

MBJxAb7~[tS!go)zapwRIv#%$HG?FE</3j5nZD]Q0&[emailprotected]=hVc>Pyiks.mu9,\6WlX('f:-KLC"q
e1_2^d;r+*


Run again 1 = Yes and 0 = No
1
Enter Integer Seed:


2147483647


unCrypt String Key =

18cQUHTZ7Rt4<jAzi3"Je:x/,h]Vk>yGWCXSw#p2%96'[emailprotected]+Y~?l(a\qnB&v.[!=5KsmdMob)f
*ug^Pr_L$;


Run again 1 = Yes and 0 = No
1
Enter Integer Seed:


2147483648


unCrypt String Key =

_Ui?$dopSQ[O"lfLn<Nrv-\j!MJ/4%3Cy6IZk7APY>0R,[emailprotected]&H8e'cx2)z.=^#u(Dg;*9h:a5KX]TtE
s~WbG1VBF+


Run again 1 = Yes and 0 = No
1
Enter Integer Seed:


2147483649


unCrypt String Key =

MBJxAb7~[tS!go)zapwRIv#%$HG?FE</3j5nZD]Q0&[emailprotected]=hVc>Pyiks.mu9,\6WlX('f:-KLC"q
e1_2^d;r+*


Run again 1 = Yes and 0 = No


Code: [Select]#include <CSTDLIB>
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{
long long int seed1=0;
int run=1;

while(run==1){
cout<<" Enter Integer Seed: \n"; // Asks user to input integer seed
cout<<"\n\n";
cin >> seed1; // Input user seed
cout<<"\n\n"<<"unCrypt String Key =\n\n";



//Initialize Valid Characters for String Shuffle Output
//Note Bug corrected with blank space for \ by use of escape character proceeding
//string str="[emailprotected]#$%^&*()_-+=?<>:\\/~.,;"; OLD v 1.02
string str="[emailprotected]#$%^&*()_-+=?<>:\\/~.,;[]\"\'"; // New v 1.10
//String random comparison 1 for 1 match

//Pass static string list to array prior to shuffle
string tmp1 = str; //Pass str output to string tmp
char tab3[128]; // Memory Allocation for array population
strncpy(tab3, tmp1.c_str(), sizeof(tab3)); //string copy tmp into tab3 array
tab3[sizeof(tab3) - 1] = 0;


srand(seed1); // Allows user custom seeded starting algorithm position for random

random_shuffle(str.begin(), str.end()); // Shuffle the string
cout << str << "\n\n\n"; // Output the shuffle sequence


cout<<"Run again 1 = Yes and 0 = No\n";
cin>>run;
}
return EXIT_SUCCESS;
}Quote from: DaveLembke on February 28, 2018, 07:04:03 PM
I was thinking that beyond the 32-bit limit it might loop back to the beginning of the 32-bits like an odometer or like rolling the score back to 0 in asteroids in my last chat here etc, so a seed value of -1 is equal to a seed value of 2147483647 and seed value of 0 is equal to a seed value of 2147483648 and a seed value of 1 is equal to 2147483649. Butchering code to turn it into a loopable shuffle display it proved that it does in fact loop back / roll over back to 0 like an odometer. I supplied the code below in case you want to check it out further.

in C/C++ if you add/subtract outside of an integer values range it will underflow or overflow. To use my byte example, 0-255 is the unsigned range. -128 to 127 is the signed range. Adding 5 to an unsigned byte of 255 gives you 4. There is no such thing as a value of 260 as a byte; nor is there a such thing as a value of -5 as an unsigned byte. Add one to a signed byte of 127 and you get -128. Same deal- there is no such thing as a signed byte with a value of 128. It's not intelligent logic being applied- it's not designed to go, "well, this is too big. I'll just give a different number by wrapping around" it's more a result of the way the CPU does arithmetic. As I understand it for integer operations if a carry bit is present after it's processed all bits of the operands it sets an overflow bitflag that can be checked by software. the CPU The CPU just does the arithmetic and sets the overflow flag if the software cares enough to check. C/C++ doesn't care on it's own.


Quote
Additionally, when trying values exceeding 32-bit limit of 2147483647 my program that until today didnt have this limitation

2147483647 is the maximum positive value of a signed 32-bit integer. For a signed integer there are another 2147483648 available values below zero since the range is -2147483648 to 2147483647.

srand takes an unsigned integer, though, not a signed one. The long long int you use to hold the seed value, doesn't get truncated until you call srand() with it, at which point it get's cast/truncated (I get a compiler warning about this with your program, actually). Since it is an unsigned parameter you would need you'd have to go beyond 4294967295 or below 0, and since you aren't actually printing out the seed that is being used, it's not immediately obvious.

You can observe this directly though. The output from 4294967295 and -1 is identical, for example. so is 4294967298 and 2. The value can be represented as a long long int, but when it's passed to srand it get's forced to a unsigned integer by ignoring higher-order bits, I expect. By way of example, the 16-bit integer 256 is 00000001 00000001, cast to a 8-bit integer would force it as 00000001 or a byte with value 1. The same logic is applied when casting a 64-bit long long int to a 32-bit int- any data in the higher bits is lost and stripped off so you get "wrapping" behaviours.


Quote
Do you know if programming for a 64-bit OS with a IDE able to create 64-bit programs if the seed would then support 64-bit value or is the seed strictly 32-bits no matter of 32 or 64 bit compiled program? Most people use a seeded time so 32 bits is plenty for user input delay assisted random, so I could see how maybe it wasnt changed to permit a larger 64-bit seed value.

No- this has nothing to do with the bit width of the CPU or the Operating System. srand() accepts a 32-bit unsigned integer, and I think it has done so more or less since the standard library was original created. It would be necessary to write your own random number generator (or find one already implemented) that allows for larger seed values. Cool.. Thanks for making it more clear BC
1454.

Solve : Want to start computer programming- need setup files for PC programming programs?

Answer»

Yes, I know how to google search and just did so a couple hours ago for this. I am fi ding the pages I need, and am fine now. I was a little to eager at first but now I realize that I need to take it a little at a time and pace myself. This was in reply to Geek-9pm's post, in case anybody is wondering why I posted.Take your time and persist and you will have good results.
Here is one of many sties that helps new students look in the right direction.
https://lifehacker.com/top-10-ways-to-teach-yourself-to-code-1684250889
Quote

Programming is one of the most valuable SKILLS you can pick up in these modern times, whether for career prospects or to stretch your brain and create something awesome. If you're just getting started on your coding journey, here are ten tips and resources to set you off on the right foot.

Worth reading Youtube has lots of videos as well on programming if your looking for learning by example. I have used youtube myself not for how to program but for figuring out my way around an IDE. Watching SOMEONE else show the steps on how to start a project and compile a project etc might be helpful when there are so many functions and its an overload of where to go and what to do.

Many youtube videos dont go into ( WHY ) something does what it does, and this is where a real course attended in Introduction to Programming would be beneficial because questions that youtube cant answer a teacher/instructor generally can.

If you are the type of person who can use a book and follow it precisely there are all sorts of programming books out there with labs in them to follow like a cook book to making a program that works and if you get an older edition of a book you can get them very cheap. Back when i was in college I saved myself about $75 by buying the 2nd edition of a book used when the 3rd edition was suggested. The only differences was a few more examples added to make a section more descriptive.

From my own mistakes with learning programming since the mid-1980s and not being a master of any language but familiar with a bunch of different languages, its best to figure out what you WANT to program. Do you want to program for android devices, do you want to program for a websites web server, do you want to program games, do you want to program complex calculations that perform encryption and decryption or scientific research, or something else. Each language has its pros ( strengths ) and cons ( weaknesses ) for implementation towards specific programming goals.

Given that you mention Linux and Windows... My language suggestion is to LEARN Python and go from there. C and C++ I wouldn't suggest for anyone that never programmed before. Python is very platform flexible and used a lot. Once you master structure and internal FUNCTIONALITY of object oriented programming with reuse vs putting in redundant instructions you will then have a good foundation to build from to explore other languages and when learning another language it will be far easier because you know how a FOR loop works for example vs a WHILE loop and then you can just learn the syntax of it all but the structure is all very similar, then dive into C or C++ with dependency needs etc if you want something more complex or any other language of choice because you know the internal workings of a program structure and just need to conform to the specific syntax of that language.
1455.

Solve : Mixing C and C++?

Answer»

I am attempting to mix C and C++ in a project. I am using a TI MSP432, which has libraries (BSD licensed) for it that are programed in C. I would like to use these libraries, but I want my code to be C++. In order to run my program I also need a couple c FILES provided by ti. I am having issues GETTING my code to compile. It may just be the flags in my make file.

Code: [Select]SIMPLELINK_MSP432_SDK_INSTALL_DIR ?= /opt/ti/simplelink_msp432p4_sdk_1_60_00_12

XDC_INSTALL_DIR ?= /home/username/ti/xdctools_3_50_04_43_core

FREERTOS_INSTALL_DIR ?= /home/username/FreeRTOSv9.0.0

GCC_ARMCOMPILER ?= /usr/bin/arm-none-eabi-g++
GXX_ARMCOMPILER ?= /usr/bin/arm-none-eabi-g++
GCC_ARMCOMPILER_LIBS ?= /usr/lib/gcc/arm-none-eabi/5.4.1

RM = rm -f
RMDIR = rm -rf
DEVNULL = /dev/null

CC = "$(GCC_ARMCOMPILER)"
LNK = "$(GCC_ARMCOMPILER)"

OBJECTSNAMES = system_msp432p401r.obj startup_msp432p401r_gcc.obj main.obj
OBJECTS = $(addprefix $(OUTPUTDIR), $(OBJECTSNAMES))
NAME = cppTest
OUTPUTDIR ?= ./debug/

CFLAGS = "-I$(SIMPLELINK_MSP432_SDK_INSTALL_DIR)/source" "-I$(SIMPLELINK_MSP432_SDK_INSTALL_DIR)/source/third_party/CMSIS/Include" -D__MSP432P401R__ -DDeviceFamily_MSP432P401x -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffunction-sections -fdata-sections -g -gstrict-dwarf -Wall "-I$(GCC_ARMCOMPILER_LIBS)/include/newlib-nano" "-I$(GCC_ARMCOMPILER_LIBS)/include"

LFLAGS = -Wl,-T,./msp432p401r.lds "-Wl,-Map,$(OUTPUTDIR)/$(NAME).map" "-L$(SIMPLELINK_MSP432_SDK_INSTALL_DIR)/source/ti/display/lib" -l:display.am4fg "-L$(SIMPLELINK_MSP432_SDK_INSTALL_DIR)/source/ti/drivers/lib" -l:drivers_msp432p401x.am4fg "-L$(SIMPLELINK_MSP432_SDK_INSTALL_DIR)/source/third_party/fatfs/lib" -l:fatfs.am4fg "-L$(SIMPLELINK_MSP432_SDK_INSTALL_DIR)/source/ti/devices/msp432p4xx/driverlib/gcc" -l:msp432p4xx_driverlib.a -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -static -Wl,--gc-sections "-L$(GCC_ARMCOMPILER_LIBS)/lib/thumb/v7e-m/fpv4-sp/hard" -lgcc -lc -lm -lnosys --specs=nano.specs

all: outdir $(NAME).out

outdir:
@ mkdir -p $(OUTPUTDIR)

system_msp432p401r.obj: ./system_msp432p401r.c
@ echo Building [emailprotected]
@ $(CC) $(CFLAGS) $< -c -o $(OUTPUTDIR)/[emailprotected]

startup_msp432p401r_gcc.obj: ./startup_msp432p401r_gcc.c
@ echo Building [emailprotected]
@ $(CC) $(CFLAGS) $< -c -o $(OUTPUTDIR)/[emailprotected]

main.obj: ./main.cc
@ echo Building [emailprotected]
@ $(GXX_ARMCOMPILER) -std=gnu++11 $(CFLAGS) $< -c -o $(OUTPUTDIR)/[emailprotected]

$(NAME).out: $(OBJECTSNAMES)
@ echo linking...
@ $(LNK) $(OBJECTS) $(LFLAGS) -o $(OUTPUTDIR)/$(NAME).out

clean:
@ echo Cleaning...
@ $(RM) $(OBJECTS) > $(DEVNULL) 2>&1
@ $(RM) $(OUTPUTDIR)/$(NAME).out > $(DEVNULL) 2>&1
@ $(RM) $(OUTPUTDIR)/$(NAME).map > $(DEVNULL) 2>&1
@ rm -rf $(OUTPUTDIR)
Currently I am compiling everything with g++ and I put extern "C" around the two c source files inside if defs.


When I use gcc and g++ together, the C code works, and the C++ code works, but I can't link them.

Any thoughts?You SAID:
Quote

When I use gcc and g++ together, the C code works, and the C++ code works, but I can't link them.
You have already found the key to the problem.
You will need to make a custom library you can use to link the C code into your C++ project. I wish I knew how that is done, but just wait and an expert will help you shortly.

Did you Googlize it?
Is the C code very simple and static?
Look here:
http://www.oracle.com/technetwork/articles/servers-storage-dev/mixingcandcpluspluscode-305840.html
Quote
Using Compatible Compilers

The first requirement for mixing code is that the C and C++ compilers you are using must be compatible. They must, for example, define basic types such as int, float or pointer in the same way. The Oracle Solaris operating system specifies the Application Binary Interface (ABI) of C programs, which includes information about basic types and how functions are called. Any useful compiler for Oracle Solaris must follow this ABI.
Does that help any?
EDIT: Forgot to mention that Visual Studio will mix languages.Quote
but I can't link them.

The error message/output might be useful...

Code: [Select][emailprotected]:~/Desktop/crossCompilingTests/cppTest$ make
Building system_msp432p401r.obj
Building startup_msp432p401r_gcc.obj
Building main.obj
linking...
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(atexit_arm.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(del_ops.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(new_op.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ios_init.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(istream-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(functexcept.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(locale-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ext11-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ios.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ctype_members.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(streambuf-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ostream-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(cow-string-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(snprintf_lite.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ctype.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(wlocale-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(random.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ctype_configure_char.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(fstream-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(cow-wstring-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ios-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(eh_aux_runtime.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(si_class_type_info.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(pure.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(new_handler.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(new_opv.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(eh_catch.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(del_op.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(eh_globals.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(del_opv.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(eh_terminate.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(dyncast.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(vmi_class_type_info.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(tinfo.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(class_type_info.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(basic_file.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(collate_members_cow.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(istream.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(time_members.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(c++locale.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(globals_io.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(locale.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(codecvt_members.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(locale_facets.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(locale_init.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(codecvt.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(streambuf.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(messages_members_cow.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(monetary_members_cow.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(ios_locale.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(numeric_members_cow.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(cow-istream-string.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(cow-shim_facets.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(cow-locale_init.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(cxx11-shim_facets.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(iostream-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(cxx11-locale-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(lt1-codecvt.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(string-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(cxx11-wlocale-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(compatibility.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(eh_term_handler.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(eh_unex_handler.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(guard.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(numeric_members.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(monetary_members.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(messages_members.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(misc-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(collate_members.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(wstring-inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libstdc++_nano.a(istream-string.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-abort.o): In function `abort':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/stdlib/../../../../../../../newlib/libc/stdlib/abort.c:63: undefined reference to `_exit'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-exit.o): In function `exit':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/stdlib/../../../../../../../newlib/libc/stdlib/exit.c:70: undefined reference to `_exit'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-openr.o): In function `_open_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/openr.c:59: undefined reference to `_open'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-sbrkr.o): In function `_sbrk_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/sbrkr.c:58: undefined reference to `_sbrk'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-signalr.o): In function `_kill_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/signalr.c:61: undefined reference to `_kill'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-signalr.o): In function `_getpid_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/signalr.c:97: undefined reference to `_getpid'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-writer.o): In function `_write_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/writer.c:58: undefined reference to `_write'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-closer.o): In function `_close_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/closer.c:53: undefined reference to `_close'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-fstatr.o): In function `_fstat_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/fstatr.c:62: undefined reference to `_fstat'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-isattyr.o): In function `_isatty_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/isattyr.c:58: undefined reference to `_isatty'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-lseekr.o): In function `_lseek_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/lseekr.c:58: undefined reference to `_lseek'
/usr/lib/gcc/arm-none-eabi/5.4.1/../../../arm-none-eabi/lib/armv7e-m/fpu/libc_nano.a(lib_a-readr.o): In function `_read_r':
/build/newlib-XAuz1P/newlib-2.4.0.20160527/build_nano/arm-none-eabi/armv7e-m/fpu/newlib/libc/reent/../../../../../../../newlib/libc/reent/readr.c:58: undefined reference to `_read'
collect2: error: ld RETURNED 1 exit status
makefile:45: recipe for target 'cppTest.out' failed
make: *** [cppTest.out] Error 1
The link from Oracle explains taught the libraries have to agree on the definition of data types and the data ought to be static. One solution is to uses compiliers taht come in the same package from the vendor.
The Visual Studio compilers and links work together ant that would be one way withstood the ISSUE.
Also, does does the C++ compiler you have allow the use of in-line Assembly code? This is a very old idea that t goes back to some of the very old compilers. What C++ compiler do you use? Would you considering another?

Here is a link that might help:
https://msdn.microsoft.com/en-us/library/aa245307(v=vs.60).aspx
Quote
C++ Inline Assembler
Visual Studio 6.0
The inline assembler lets you embed assembly-language instructions in your C source programs without extra assembly and link steps. The inline assembler is built into the compiler—you don’t need a separate assembler such as the Microsoft Macro Assembler (MASM).
Because the inline assembler doesn’t require separate assembly and link steps, it is more convenient than a separate assembler. Inline assembly code can use any C variable or function name that is in scope, so it is easy to integrate it with your program’s C code. And because the assembly code can be mixed with C statements, it can do tasks that are cumbersome or impossible in C alone.
Hope this will help you in some way.
Perhaps it will help you think outside of the box.
1456.

Solve : Can anone help on Windows .BAT Filescc/ VB scripts?

Answer» HI there

Im trying to run a command using a VB script but need help finishing off if anyone can help as I aint got a clue how to do it

I have this command that creates a new folder in C :\CCTV DOWNLOADS\DownLoad of which shown below.

What im trying to do then is to 7 ZIP the new folder .

I think that its a VB Script that I need but if there an easier way it would be greatly appriciated. Is there anyway I can run a VB script or .BAT file without running as an administrator?


Thanks
Option Explicit

Const strDLFolder = "C:\CCTV DOWNLOADS\DownLoad"
Dim objFSO, objWShell, objDLFolder, strNewFolder, objFile

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWShell = CreateObject("WScript.Shell")


If Not objFSO.FolderExists(strDLFolder) Then objFSO.CreateFolder(strDLFolder)
objWShell.CurrentDirectory = strDLFolder
Set objDLFolder = objFSO.GetFolder(strDLFolder)
If objDLFolder.Files.Count = 0 Then WScript.Quit

Do
Err.Clear
strNewFolder = InputBox("COMPASS REF NO", vbLf & "ENTER the NAME of the folder to be created:")
If strNewFolder = False Then WScript.Quit
On Error RESUME Next
objFSO.CreateFolder strNewFolder
Loop While Err.Number <> 0 Or Not objFSO.FolderExists(strNewFolder)

On Error Goto 0
For Each objFile In objDLFolder.Files
objFSO.MoveFile objFile.Name, strNewFolder & "\"
Next
objWShell.Run "explorer.exe /select,""" & objFSO.BuildPath(strDLFolder, strNewFolder) & """"
1457.

Solve : can anyone help on a 7zip command tidy up?

Answer»

Ladies and Gents

I have the FOLLOWING command that runs from cmd. what im trying to do is to GET to ASK me what FOLDER NAME is to be in "C:\Downloads\zipped.7z" before it starts if I can

7z a -t7z -r "C:\Downloads\zipped.7z" "C:\Downloads"

Any ideas?

1458.

Solve : New to HTML and need to fix repeated problem on Magento blog?

Answer»

Hello
I am using Magento on Windows 7 to create blogs for work. No one can help me align my images and TEXT correctly.
I want to have an image to the left with text to the right (which I can do) but when I try and repeat this below again, the next bit of text creeps up under the other text. I've tried
and all with no luck.

I've attached the result I keep getting. I will be soooo GRATEFUL for any help as I have no training in coding. Here's part of the code:

section>
Slug control:



Beer traps every time. Ron loved them, or his slugs did, and he reckoned he cleared his garden last year after burying yoghurt pots in the soil, filling with beer and letting the slugs die a happy death. One extra point, Ron: leave a centimetre of the yoghurt pot above soil level to help beetles miss the traps. Beetles are good and the slugs won't be bothered by a centimetre of plastic in their pursuit of a beery ending.





Compost:



Jenny loves our Melcourt compost as it is consistent, doesn’t contain peat or green waste and helps her grow a fantastic garden. The whole green waste issue cropped up SEVERAL times at the show and it appears we are all aware of its inherent problems. The main one being the number of lumps and bumps you have to riddle out of most composts before you can use them for sowing seeds. That’s not the case with Melcourt - everyone loved the fact we deliver straight to your door and at superb prices. You know what you need to do!






Not sure if this is of any help or not, but the last time I ran into an issue trying to shove over an image that was too CLOSE to another I placed an image such as a white rectangle.jpg file the same color as the background to force the formatting with a sledgehammer method. You can also insert a table between images top shove the placement over as another sledgehammer method.

Later I found where you can specify the X,Y COORDINATES of the images, but then you have some issues with some browsers displaying it differently. I assume your testing this on other browsers to make sure that it behaves such as IE/EDGE, Firefox, Chrome etc. https://html.com/attributes/area-coords/
1459.

Solve : fresher at python programming language?

Answer»

am NEW in the programming world
I have passion for the stuff
I want to learn python programming LANGUAGE
please how do I start and what are the basic informations I needPython is a great language to learn. Compared to other programming languages, it's easy to read and understand what the program is doing. And it's being used in almost every industry, so you're developing a marketable job skill.

The first thing to understand is the difference between Python 3 and Python 2. Python 3 is the newest version of the language, and is not compatible with Python 2. However, Python 2 is still being used extensively because of the programs that were already written in it. For this reason, Python 2 is still supported, but Python 3 is the direction the language is going, so make sure any books and tutorials you read are for Python 3.

You can't go wrong starting with the official Python 3 tutorial. The official Python documentation is exceptionally good. Definitely start here.

https://docs.python.org/3/tutorial/index.html

After that, I strongly recommend "Learn Python the hard way." The title is a joke by the author, which he explains in the BOOK -- it's not actually "the hard way" to learn, but he has his own ideas about how the language should be learned. Really great book, and it is up to date with Python 3.

https://learnpythonthehardway.org/

After that, there are LOTS of free e-books you can read, and courses you can take. Here are some indexes for you to check out:

https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md#python

https://github.com/EbookFoundation/free-programming-books/blob/master/free-courses-en.md#python

https://pythonbooks.revolunet.com/

http://www.oreilly.com/programming/free/files/a-whirlwind-tour-of-python.epub

I hope this information helps.



Here is item of interest, you can write code that works in either.

Cheat Sheet: WRITING Python 2-3 compatible code
Quote

print

# Python 2 only:
print 'Hello'

# Python 2 and 3:
print('Hello')

Integer division (rounding down):

# Python 2 only:
assert 2 / 3 == 0

# Python 2 and 3:
assert 2 // 3 == 0

Agree, and it doesn't need to be a whole project.

If you want to learn Python, identify something you do on your computer which can be automated. Start with something simple.

You don't even need to open a text editor, you can just open the REPL and start coding.

In general, if you find yourself writing batch files or shell scripts, you can do it in Python instead. Python has many tools to make your life easier.
1460.

Solve : Is Perl on its way out the door??

Answer»

The College course I am currently attending, my instructor suggested that I work in PHP with web interface to MySQL Server. He pointed us to W3Schools. https://www.w3schools.com/default.asp

At the W3Schools website there is nothing there for Perl, which to me might mean that its time has come and passed maybe since W3Schools didnt offer this, but they offer other important and useful tutorials.

So just kind of curious if Perl is on its way out and Python and PHP is the future for the web, or if it was just that W3Schools just decided not to offer a Perl tutorial?W3Schools not offering any tutorials for a given language doesn't mean anything other than that they didn't provide a tutorial for that language.

C# via ASP.NET as well as Java and a bunch of other languages often get use in the back-end. They don't offer any tutorials for those either.

Remember W3Schools is NOT official in any way.Quote

Remember W3Schools is NOT official in any way.

Ok cool... Thanks BC

For college course to use it as a reference for students, never knew it wasn't really official. From a search...

10 most in-demand tech skills

Python. A high-level, general-purpose programming language introduced in 1991. ...
Java. Java is a general-purpose, high-level programming language that was developed with as few implementation dependencies as possible. ...
Cloud services. ...
Linux. ...
JavaScript. ...
SQL. ...
Matlab. ...
HTML.

Hi Geek, found your url 3rd down on search for "10 most in-demand tech skills" ... Perl is #9 on list.


https://www.cio.com/article/3196975/it-skills-training/10-most-in-demand-tech-skills.html

Quote
1. Python

A high-level, general-purpose programming language introduced in 1991. Python has become a core language for data science and continues to be a mainstay for back-end web application development.

2. Java

Java is a general-purpose, high-level programming language that was developed with as few implementation dependencies as possible. It's consistently one of the most used languages in e-commerce and back-end, server-side business applications, as well as the foundation of most Android applications, because its "write once, run anywhere" capabilities allow it to be used across multiple platforms.

3. Cloud services

This meta skill around cloud computing, which provides shared computing power, services and infrastructure on-demand, allows for building and maintaining cloud-based applications that can be deployed quickly and scaled elastically.

[ Related story: Why AI careers can start with a degree in linguistics ]

4. Linux

The Unix-like computer operating system built under the model of free and open-source software and application development, is the preferred operating system for open source engineers and programmers. Today, Linux forms the backend of most of the top 100 websites.

5. JavaScript

The high-level, dynamic, untyped and interpreted runtime language of interactivity on the web, with more lines of JavaScript written each day than many of the more well-known, top languages like Java or Python.

6. SQL

The domain-specific programming language standard for storing and retrieving data in an application, SQL -- or, Structured Query Language -- is the main pillar of the relational database systems (RDBS) that most apps are built on.

[ Related story: 10 best cities for women in tech ]

7. Matlab

This older, mathematics manipulation language with roots as far back as the 1980s is devoted to applied mathematics and used heavily in science and engineering; with big data dominating headlines, it's no surprise it's seeing a resurgence.

8. HTML

All webpages and many applications use HTML to define the content within a page, making it a required skill for doing almost anything that touches the web or displays web-formatted information. The most current VERSION is HTML5.

9. Perl

A stable and versatile scripting and data extraction language, Perl's traditional popularity and presence in legacy web code is the main reason why it's still a requirement for many jobs.

[ Related story: 6 Leadership qualities to look for when hiring ]

10. Go

A relatively new language -- less than 10 years old -- created by Google with a reputation for processing speed and low latency. Because of these qualities, it's great for networking and web servers, stand-alone command-line apps and scripts. It's not well-suited, however, for desktop or GUI-based apps or system-level programming.
For what it is worth...
Many once trendy computer programming languages do not show up very often in a search. But people are still using them or want to learn.

I had to learn assembly language mostly on my own.

Here are some things that might be important to some students:
Quote
The number of courses sold by programming bootcamps
The number of students enrolled in programming classes around the world
The number of videos on each language on YouTube
The number of postings on Reddit or Stack Exchange about a language
More important are methods to teach how to solve problems.
EDIT: Some code that got my eye.
Code: [Select]LIKE, Y*KNOW(I MEAN)START
IF PIZZA = LIKE BITCHEN AND GUY = LIKE TUBULAR AND
VALLEY GIRL = LIKE GRODY**MAX(FERSURE)**2 THEN
FOR I = LIKE 1 TO OH*MAYBE 100
DO*WAH - (DITTY**2)
BARF(I)=TOTALLY GROSS(OUT)
SURE
LIKE BAG THIS PROGRAM
REALLY
LIKE TOTALLY (Y*KNOW)
IM*SURE
GOTO THE MALL
Source:
http://quarkphysics.ca/humour/humor10.htmlIF statement had me laughing. Also even "dead" languages like COBOL and FORTRAN have demand that heavily outstrips the supply, entirely because nobody wants to or thinks they should learn it.Perl has a reputation for being easy to write but difficult to maintain, unless it is written specifically for that purpose. Whereas a language like Python has the rep of being easy to maintain no matter what, due to its stricter, simpler, more universally legible syntax.

In my own experience, Perl is versatile and flexible, with modules for everything under the sun. But, so is Python, and it has greater advantages in a group/team/collaboration setting.

If you were going to ask for a recommendation between the two, I'd say go with Python, because it has broader industry support, and a BDFL (Guido Van Rossum) who demonstrates focused leadership and has a clear vision for the direction the language will take.

But there is nothing stopping you from learning and trying both, which is probably a good idea, because ultimately you're the one who has to write in the language, so you should choose the one that most closely suits your own expressive style as a programmer. Just my two centsThanks for everyones input on this.

Its been ages since I worked with Cobol. I got it along with an 8088 that I picked up in the early 1990s on the cheap. A friend of mines uncle had some books on it and he leant me them to poke around Cobol but I found my love of the time in the style of Basic, since I started with Basic on my TRS-80 Model 1 with 16k RAM. But having worked mainly with Basic and GW-Basic at School around 1987, I loaded up GW-Basic on DOS 2.11 and did most of my programing in that until exposed to QBasic with DOS 5.0. I liked GW-Basic's features with colors and sound and it ran pretty well to make some games, although I hit the 64k limit with it because I was horrible with memory management and reuse.

I took a liking to Python, but took Perl through VIRTUAL University about 13 years AGO for the cost of taking 4 courses a semester for $20 total, ( their pricing has since changed ) and liked how Perl has lots of powerful functions built into it so you can TYPE up a few lines of code and achieve the same outcome as what may take 25 lines of code in C++.

At some point I will dig deeper into Python, its easy to follow but I just need a project that is in it that causes me to spend more time in it. For me its usually that there is someone elses code that I am working with that draws me into languages they are written in, I then learn by example or dabbling in them to add features or tweak it to my needs or curiosity. Seen some cool games created that have python in the background for ARM devices etc. At some point I will dig deeper into it. Its good to be familiar with a bunch of different languages, and the strength in them comes with putting in the time with the code and troubleshooting and having others point them in the right direction.Do you have Active Perl?
https://www.youtube.com/watch?v=V_0hQ_1X_L8
1461.

Solve : ReCAPTCHA placeholder element must be an element or id?

Answer»

I have two errors with an error message:
Uncaught Error: ReCAPTCHA placeholder element must be an element or id

How to solve these errors?
NEED help.
Code: [Select]<!DOCTYPE HTML>

<html>

<head>
<title>reCaptcha</title>
</head>

<body>
<form id="MytblID" class="MytblID" action="" METHOD="post">

<div class="g-recaptcha MYXXX-recaptcha" data-sitekey="XXX" data-expired-callback="recaptchaExpired"></div>
<SCRIPT SRC="https://www.google.com/recaptcha/api.js?hl=en-GB&onload=Callback&render=explicit" async defer></script>

<script>
var form = "#MytblID";
var Callback = function () {
var onRecaptchaExpired = function () {
alert("Warning message as recatpcha has expired!");
// grecaptcha.reset();
};
var gRecaptchaInput = jQuery('.MYXXX-recaptcha');

gRecaptchaInput.each(function (key)
{
var $this = jQuery(this);
var siteKey = $this.data('sitekey');
$this.html('');
grecaptcha.render(document.getElementById($this.attr('id')),
{
'sitekey': 'XXX',
'expired-callback': onRecaptchaExpired
}
);
}
);
};
</script>
</form>
</body>

</html>
I solved it by adding render="explicit" and onloadCallback={console.log.bind(this, "recaptcha loaded")}

1462.

Solve : on the website there is same id textbox but when i am writing WebBrowse?

Answer»

on the website there is same ID textbox but when i am writing
WebBrowser1.Document.All("username").SetAttribute("value", username)
its writen different textbox with same id "username"

placeholder="Kullanici Adi">

i need to reach second field but i COULDNT reach
autocomplete="off" name="username" value="" required=""
data-required="" data-pattern="^[a-zA-Z][a-zA-Z0-9]+$"
data-minlenght="6" data-maxlenght="12"
onkeyup="clearNonAlphaNum(this)">

please help meHello

Have you tried to CHANGE the Code: [Select]id of one of the INPUTS? Can't tell you for sure if it helps, but you need to try.

Cheers
Andrew

1463.

Solve : C, C++ and C# beginner's questions?

Answer»

MIRKOSOFT,
Thank you for sharing your personal information. This helps others to understand what information you need.
Tomorrow I will write more to you after I do some research on Slovakia.About your original question.
I recommend you get Visual Studio 2012 to help you learn C++ and C#.
You should find it easy to use if you already know VB6.
The express version is free. You may have to SEARCH for a site where u can find it.
The 2017 version is much to big at 16 gigabytes. Thank you for suggestions.
I'm using 64-bit Windows 10 and have installed paid version Visual Studio 6, Visual Studio 2017 free community edition and by NTVDMx64 I'm using today YET free Visual Basic for DOS.

So, I think I have all what I need and you help me in Qs about PLs.

Thank you very much.
MiroDoes slovakia offer/honor a GED? https://ged.com/

In the USA people who had problems completing high school can go for their GED and have the same as a high school completion. Not sure which countries accept or offer this though other than USA.DaveLembke,
This might have some information:
http://www.slovakiasite.com/education.php
Quote

Most schools in Slovakia are owned by the state, though there are a few church-owned and private schools. Students go to school five days a week, from Monday until Friday. SUMMER holiday in primary and secondary schools in Slovakia is from the 1st of July until the 31st of August. There is a few days holiday around Christmas and Easter, and on national holidays. Pre-school education in Slovakia is for children from 3 to 6 years old.
Primary education in Slovakia lasts for nine years and is compulsory. It is divided into two stages of for and five years. Children start attending primary school at the age of 6 till 15.
RELEVANT information:
https://www.forbes.com/sites/mattsymonds/2017/12/13/mba-in-europe-the-ranking-of-mba-rankings-2017/#47cc57ea4f38
The Best MBA Programs In Europe?
(Forbes is a credible web site.) Quote
I'm using 64-bit Windows 10 and have installed paid version Visual Studio 6

Possibly worth mentioning that Visual Studio 6 (as in the Visual C++ IDE itself) isn't compatible with Windows Vista or later and has a memory leak when running on them; For C/C++ it might be safer to STICK with 2017.

Quote
The 2017 version is much to big at 16 gigabytes.

That is the offline installer, which of course has to include everything. Typically, what you download is a small, 1.2MB Installer program. The size of the actual Visual Studio installation will then depend on what options are chosen during install, as it will only install what is needed.Thank you for your interest in my possible high school education.
I tried it in age 24 again and happened the same - my doctor recommended me to end it 'cause my health was going wrong.
So, thank you very very much - this support in our forum is great, it is showing that other people are important, not only Qs and answers.
This makes me feel good, thank you all.

To VS6, VS2017 and VB4DOS:

VS6 - compatibility problem with Vista and later is solved in customization and correction install sources and result is working VS6 on Win7/8/8.1/10 x86 or x64
VS2017 - for me is not important how many data it costs, important are possibilities
VB4DOS - works also on 64-bit Windows 10 by installing NTVDMx64 (64-bit NT Virtual DOS Machine), screen size is possible to adjust, only fullscreen works not (yet)

If anyone wants to know how it works, let me know - I can expain all details.

Thank you all people.
Miro
1464.

Solve : anyone can show me how to obfuscate c code manually?

Answer»

anyone can show me how to obfuscate c code manually without any obfuscator software because i don't like being script kiddieYou want to do what?

verb
verb: obfuscate; 3rd person present: obfuscates; past tense: obfuscated; past participle: obfuscated; gerund or present participle: obfuscating
render obscure, unclear, or unintelligible.
"the spelling changes will deform some familiar words and obfuscate their etymological origins"
SYNONYMS:obscure, confuse, make unclear, blur, muddle, complicate,

Most C code is already that way. Judging by your post, you already have the gift. yes !!i want to avoid reverse enginneringSee this Wikipedia article: https://en.wikipedia.org/wiki/Obfuscation_(software)Check out the archives of the IOCCC. 25 years and still going strong. Some amazing code in here. If you can figure out how any of these programs work, you're on the right track. Many of the programs have comments from the authors where they explain some of their techniques.

https://www.ioccc.org/Quote

i want to avoid reverse enginnering

One thing to mention on this is that if anyone has access to seeing how your code runs, they could basically write out a flow chart of what features or what it does and reconstruct their own based on observational reverse engineering. Their program they create can act like your program while coded differently.

Curious how you can prevent someone seeing your software, what it does, and them making their own similar program that does the same thing?

Since C is compiled, what is there to "obfuscate"?
Quote from: Salmon Trout on September 05, 2018, 10:19:01 AM
Since C is compiled, what is there to "obfuscate"?
Good question. Here is a quote from the Wikipedia article cited by Strollin.

In software development, obfuscation is the deliberate act of creating source or machine code that is difficult for humans to understand. Like obfuscation in natural language, it may use needlessly roundabout expressions to compose statements. Programmers may deliberately obfuscate code to conceal its purpose (security through obscurity) or its logic or implicit values embedded in it, primarily, in order to prevent tampering, deter reverse engineering, or even as a puzzle or recreational challenge for someone READING the source code. This can be done manually or by using an automated tool, the latter being the preferred technique in industry.

The article went on to say:

Disadvantages of obfuscation
While obfuscation can make reading, writing, and reverse-engineering a program difficult and time-consuming, it will not necessarily make it impossible.[19] Some anti-virus software, such as AVG AntiVirus,[citation needed] will also alert their users when they land on a site with code that is manually obfuscated, as one of the purposes of obfuscation can be to hide malicious code. However, some developers may employ code obfuscation for the purpose of reducing file size or increasing security. The average user may not expect their antivirus software to provide alerts about an otherwise harmless piece of code, especially from trusted corporations, so such a feature may actually deter users from using legitimate software.

The GNU does not encourage obfuscation of source code. You can use an encrypting executable packer so that the binary code cannot be e.g. passed through a dissassembler, which might puzzle a beginner or amateur-level programmer, but the code has to go into memory, and more advanced level programmers or law enforcement personnel will know how to see the binary code being executed. Also most antivirus software will flag the packed executable.

Think about why you don't want your code to be "reverse engineered". If your code is at all clever or original, you might do better to let people see it, since your reputation would grow as a result. Definitely worth thinking about why you would want to obfuscate the code, sure it may protect against a beginner trying to reverse engineer it but you can never stop it completely. Sure it may seem appealing to prevent anyone seeing how your code works but realistically it's not a huge deal, especially with an appropriate licence in place to prevent or manage the usage of the code. If you're trying to obfuscate the code as some sort of security measure then I'd advise you to look at what the code is doing and why someone finding that out would be a problem. Generally relying on security through obscurity isn't anywhere near sufficient, personally I always write code assuming that an attacker could have full access to the source code, if this would break security measures in the code, then I'd say the code isn't SECURE enough. While there may be a genuine reason to obfuscate it that I haven't thought of, it's definitely worth thinking about whether it is actually the correct thing to be doing as it often doesn't provide the benefits that people think it does.We've had only two instances of our software being "pirated".

The first case was when a disgruntled employee stole the source code and rebadged it and started trying to sell it to some of our existing customers. He apparently forgot to tell them he wasn't with us anymore so they phoned us to ask what was different with the "new product".

Naturally the guy was on the wrong end of a losing lawsuit.

The second case was one customer actually copy-pasting their install to another customers system. We found that one out when we got support calls from people who weren't customers. There was nothing malicious there though and the latter did sign up appropriately once they found out.

You cannot stop the former case which is why there are employment contracts and stuff. The latter case can be dealt with by just blocking casual copying with some basic licensing implementation.

There isn't REALLY much need, IMO, to obfuscate source code, or even compiled code, as a FORM of "security"; Personally, I've found that it is mostly those who have nothing worth copying that seem obsessed with preventing it.

1465.

Solve : How to read directly PS/2 port??

Answer»

Hi!

Really I found not correct forum for coding which member I'm 'cause all forums are PL specific.

I need help - how to read PS/2 keyboard/mouse port directly by C or ASSEMBLY code.

Can anybody recommend me any forum or any web where I find req'd info?
I'm lost in Google results.

Thank you for each word.
MiroDon't have any experience of writing drivers myself, but this looks like a fairly SIMPLE summary:

http://www.cas.mcmaster.ca/~se3f03/content/assignment4tips.pdf

Example:

Code: [Select]Here's a small example of how
you might install your IRQ handler:
install_handler:
PUSH ax
push es
xor ax, ax ; set es to the IVT
mov es, ax
cli ; disable interrupts
mov ax, irq_handler ; irq_handler is declared elsewhere
mov [es:0x1d0], ax ; store pointer to the offset
mov ax, cs ; we also need the CS value
mov [es:0x1d2], ax ; store SEGMENT at 0x1d0 + 2
; interrupt handler is now fully installed
sti ; enable interrupts
pop es
pop ax
ret
Also here:

https://wiki.osdev.org/Mouse_Input#PS2_Mouse_Commands





Thank you very much.
For beginning it is lot.

BTW:
I had simple Q on Slovak forums (I'm from Slovakia) and there is at first place irony and contempt - I never ask Slovak forums again.
Really it is bad.

Thank you very very much!
Miro

1466.

Solve : I am a "developer"!?

Answer»

I mostly fit this description, which I found in a comment to an article on The Register:

Quote

Most "developers" aren't systems engineers and never will be. They're hack-and-bash, copy-and-paste, trial-and-error Google/StackOverflow-searching code monkeys who don't really understand what they're doing.

I do try to understand what I am doing, but I do find Google/StackOverflow-searching handy, especially now I have decided to port as many of my handy little batch & vbs scripts as I can to Python. Another comment I found on El Reg reminds me strongly of a situation I have at work: "Who cares if it doesn't work at first? That's what Agile is for!"

Sounds more like they were poking a stick trying to get traffic to their website by creating an uproar of people who are angry by how that affects them.

"Dont really understand what they are doing" ... just to me seems like they are poking people who develop with a stick in an effort to draw more attention to a website. If people are happy they skip over it and might not share it with friends ( so minimal traffic to a site ), if you upset people thats when they share that with their developer friends and far more traffic rolls into a site with people defending their position/title/label after being offended etc.
To clarify, there was this article on The Register, a pretty good, irreverent tech and IT oriented site:

https://www.theregister.co.uk/2018/02/10/github_account_name_reuse/

which was about how a Github (a code repository) member deleted his account, and how that led to lots of people's apps breaking because they had linked their projects to his code. Some of these tried to fix the situation by creating a new account at Github with the same name as the old one, and uploading locally saved archives of the missing code to the repository thus "re-created". This has obvious security implications. That was the story. The Register has always had very lively reader's comments sections under each story, and this is no exception. Plenty of people use the comments section to moan about "developers today" not being like they used to be, a monkey could get a job as a developer, etc etc. What I posted was one of these. A site which specifically concentrates on "bad coding" is the Daily *censored*. I like to swing by there every week or so to see what has been submitted.

https://thedailywtf.com/

I expect the article comment was trying to be pedagogical regarding how much better they are than everybody else. perhaps as a way of allowing those self-fellating systems engineers to compensate for how they have to deal with "real" engineers who talk about how they aren't actually engineers and shouldn't be calling themselves engineers.

The way I see it, Web searches provide an alternative to reference material. Some people might act all high and mighty that they never use it but then they may very well just be repeating the pitfalls that could be avoided by reading a relevant stackoverflow question's various answers.

"Programmer's Guides" used to come with most software DEVELOPMENT tools, and they often included code samples or even rather large applications- Visual Basic 2.0 even discusses a full-blown icon editor program - so it's not as if you couldn't copy code from those.

On the other hand, I sort of understand where they are coming from. There are some developers who do rely in web searches as a crutch and perhaps would have difficulty solving problems without it; But for the most part I think it is just by developers who really don't care about that specific problem because it's part of some larger puzzle they are trying to put together.

On the other hand, There is also this idea that you "have" to google and see what everybvody else is doing. Take my recent "Tetris" clone. The game concept is pretty straightforward so I decided to reference nothing and do no searches on how it's usually implemented. At the same time I tried to design it well, without hard-coding anything. I've referenced it elsewhere and pretty much just received "Have you seen X" where X is some other Tetris clone/engine project. The entire point wasn't to have a Tetris Engine, it was to Write a Tetris engine/game myself. If I wanted to simply play it it's not like I have to look far.

The best part there is that now that I've got everything working I have looked at those other implementations and found them better in some ways, but lacking in others.

And once you get deep in domain knowledge you can't usually google it anyway. if I have issues with our Internal components, I can't rightly google it. It hasn't always stopped me and sometimes I only remember when I've entered a google search like "TheosClient WriteCommand +Can't read 2 bytes from server Exception" or something, as if there are going to be stackoverflow questions about our specific internal server libraries. And I certainly wouldn't be able to google for the algorithms of how to void invoices, how to rebuild QOH, or how to auto-renew purchase orders or how to reverse Open Item disbursements on an Invoice because even if I find something it's obviously going to be for some completely different platform/framework.

But, I've found it valuable for trying to google issues that seem to be related to the language or framework, which helps point us in the right direction. And considering it is sometimes time sensitive because there is literally a customer having the problem right now I don't think there is any shame in googling the problem. There are some instances where I doubt I would have EVER TRACKED down the real problem, or if I did it would have taken a significant time investment. In one case I googled some of the specific verbiage of the error they were receiving and found STACK overflow answers which mentioned Group policies being a possible cause, which it turned out was the problem- Apparently their IT department had put in place Group Policies that restricted certain folders from executing software on specific secure PCs (the ones they used for accounting) And it was those policies which broke some parts of our software. The policy prevented any executable from running from %APPDATA% and that was where our update software downloaded the new installation packages to and ran them, thus the problems. And once we learned that- it was trivial to change the program to download software to the Common Application Data folder instead, since it was already running as administrator anyway.
Also, a somewhat unrelated thing I've noticed regarding the Internet in general- and articles and posts is that misinformation tends to spread a lot easier. To many posts/sites/blogs are largely "aggregates" who just take information from elsewhere, write some stupid abstract or re-write it into a paraphrased article, and post it so they can attract those sweet sweet pageviews to their add-ridden website. Of course, I'm not talking about any political gubbins here- I'm sure it applies there but that's outside both my expertise as well as thje scope of this forum.

In particular, and, To my endless frustration, for example, is the perpetuating myth that discoloration of ABS plastics (which is a common issue with older tech) is caused by the brominated flame retardants in the plastic.

So now you have countless enthusiasts "restoring" their older devices appearance- which is caused by oxidization, by slathering it with an oxidizing cream. It restores the colour because if oxidizes the carbonyl compounds that cause the discolouration, which are themselves a by product of the Butadiene's known properties of photooxidization that can be easily discovered through any number of peer-reviewed science studies/research. it also expedites the original reaction but worse than that it obliterates any remaining UV stabilisers and UV absorbers. But because after using it, it looks new, it spreads as this brilliant way of fixing stuff.

Down the line, I expect "No retrobrite!" is going to be one of those things people slap on their ebay listings as the deleterious effects of applying it start to be seen in a few years. Some people swear by yearly applications, which is probably a good way to give the plastic the consistency of an aged cheddar- but, thankfully, not the colour, so it's OK (?).Apparently, the mainly US errant spelling "dilemna" (for dilemma) arose from a typo on a grammar site, widely copied.

Being a "developer" is something that needs to be understood by the people who work with a developer and here I refer mainly to users, "beta users", other developers, architects, testers and managers.

Nowadays looks like everybody wants things to be done as fast as possible regardless the consequences and preferably without limitations. Everybody is happy when you are giving short estimations but none cares how you will get to meet them.

So you "as a developer" are being pushed from behind by all others to became a "monkey" and start to copy and paste tones of code or reuse code from other projects without to understand it just because you have to get better times on the development process.

Usually people who works with an developer tends get happy with shorter delivery times than with things like "you know I had to develop it from scratch" or "I had to understand this how it works before to integrate it in our project" these will get probably critical remarks like "yeah you had to develop it from scratch but didn't were any online examples to get so that you could save some time by doing that" or "if it already works take it as it is and just handle the integration".

I consider that "developers" are not willing to become "monkeys" but they are just pushed by all the others to get on this way.
That is completely believable but thankfully has not been my experience. Though, technically/legally my job title is "Programmer" so maybe that's the difference

Another aspect is that a lot of the stuff I work on can't really be googled, so it's mostly simpler reference information like Date format strings that I end up looking up. There isn't going to be a Stack Overflow question about our internal database libraries or our networking protocols.Quote from: shadow on February 24, 2018, 02:14:30 PM
I consider that "developers" are not willing to become "monkeys" but they are just pushed by all the others to get on this way.
Yes. Where I work, legal/finance in an organisation that processes 5 million dollars of payments a month, we have a gee-whiz web based app coming along to replace a paper-form-to-Excel process. I began to get misgivings when senior managers turned up to give a presentation last year. One of them said brightly "It uses a great new technology called Agile!". So far every single one of my fears have been proved true. It's late, clunky, brain-dead (they didn't think talking to the people who do the process was important), and severely inflexible. I heard last week the lead developer was on a 2 year contract that isn't being extended. A cheaper code monkey is coming in to "finish things off". I think too many senior people's reputations are riding on it for them to just abandon it now, which would be the right thing to do.
I guess my different experience is from working in a small company. Often the person writing the software change/fix is directly interacting with the customer staff who discovered it or requested the feature, rather than passing through multiple layers and "shielding" the developers from interacting with customers. In a few cases I've received a forwarded E-mail with a bug, fixed the bug, tested it, deployed it to their site, and responded within a few hours.
Know When to Quit.
Quote
You're thinking of jumping ship. Maybe it's your job, a relationship, a degree, or some other commitment that's both so hard to keep doing and so hard to leave. Should you stay or should you go? Here's how to decide.
Quote from: Geek-9pm on February 24, 2018, 03:01:21 PM
Know When to Quit.

You read my mind.Not sure why anyone would waste their time reading the article. Judging already by title, it's no different than a random you-tube video that says "Don't become a developer!". Any true Developer with business-insight would skip these viewer-proned titles, because you never know what the next generation or current might bring to the IT table.

These videos/articles are just mainly there to draw traffic or have a negative connotation. For the thumb, it's good to ignore these as their almost completely useless, comments by those who have already 'made' it and now are RATTING, and or riddled with opinions that strong supporting facts and solid arguments.

Instead, utilize that time to build your programming skills stronger than on a bias article with bad writing authors. The original post was regarding a comment on the article, not the article itself.
1467.

Solve : GCC warnings?

Answer»

I am playing with GCC's warnings, and I haven't been able to figure out how to suppress some of them.

The most annoying WARNING I ENABLED is with -Wshadow.
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

I LEARNED this pattern:
Code: [Select]Person::Person(string name)
{
this->name = name;
My shadowing in the constructor is intentional. I do this a lot. Is there a way to suppress the warning: Quote

declaration of ‘name’ shadows a member of ‘Person’
on a case by case BASIS? Maybe with a macro? How do you guys do it?
I know a lot of people would do something like
Code: [Select]this->myName = namebut I find the extra 'my' cringy. I don't know why I don't like it. I just don't.rules for Wshadow have been changing in RESPONSE to complaints from devs -

https://stackoverflow.com/a/15554949
1468.

Solve : Auto-update files to domain application?

Answer»

I'm interested in creating an application for automatic updating of files that will be determined by registered users and my approval. Files will be uploaded to my domain.
Well, I have no example of what to build.
Can you help me with an open-source code application example?
That's what I want to get away from.
So far I do not know where to find something.
Thank you for your help.
MiroNo idea?
MiroYour post is a little too vague.
Quote from: MIRKOSOFT on October 23, 2018, 10:45:49 AM

I'm interested in creating an application for automatic updating of files that will be determined by registered users and my approval.
So will each user only get an update if you approve?
Quote from: MIRKOSOFT on October 23, 2018, 10:45:49 AM
Files will be uploaded to my domain.
Are the files uploaded to your domain, and then distributed to the users? Or are the users uploading to the domain?
Quote from: MIRKOSOFT on October 23, 2018, 10:45:49 AM
Can you help me with an open-source code application example?
You could take many routes. Checkout
rsync https://rsync.samba.org/examples.html
wget https://unix.stackexchange.com/questions/36798/sync-with-a-directory-listing-of-web-server
So, what, how and who:

1. user
Can upload selected file after REGISTRATION.
Only one file.
When logs in, all file changes will be automatically uploaded to domain - in time interval, no CHANGE watching, original ALWAYS overwritten.
To other registered users will be file not available.

2. admin (me)
Accept/decline registration, then allow uploading (or updating) file.
No watching file content, only size and type - by rules.

3. domain
Repository for registered users files.


Finally what I want to do?
I'm afraid if it is ok in case of laws.
But want to allow users sync their notes between devices and platforms.
Why own solution when others are available?
What an application this type exist for 8 and 16-bit COMPUTERS?
Exactly Commodore computers...

So, now I admit reason.
Please don't crucify me. I'm working on OS for Commodore computers and want to offer this feature which is not public yet.

MiroI think I understand.
On the commador you could use xmodem:
http://web.cecs.pdx.edu/~rootd/catdoc/guide/TheGuide_226.html
And send the file to a computer that can connect/ run your hypothetical service.Thank you very much!

I try to do it by this way.
MiroQuote from: MIRKOSOFT on December 11, 2018, 06:04:48 PM

No watching file content, only size and type - by rules.


So how's that going to work? You host the file but only the client can view it? Wouldn't they then need to encrypt it before uploading it to your domain? And if this is going to be forced then wouldn't you need to provide the encryption software to your clients to make access reasonably straightforward, or inform them that you will only not be able to view their files if they encrypt it themselves?

I mean you could also encrypt the uploads as soon as they are received at your domain and only provide the key to the client, but then there's no guarantee for the end user that you haven't kept a note of the key.

Or am I missing something here?

File content is problem - of course it needs encryption, but Imust FIRST create main solution and after finish I can to do it, of course before release the service.

Miro
1469.

Solve : Creating a custom XML field dependent on field selection - what language??

Answer»

Hello,

I am writing a custom tool that will have DROP down menus for selection of different parts of an XML file, so you can choose what you do and do not want.

What is the BEST language to achieve this? I was going to use HTML/JavaScript as a pairing.

What are your thoughts?

I envision a window with several drop down menus and then a button to build the XML as PER those selections, so i will need something that can handle writing that also.

Thanks, Maybe take a look at obmenu.
http://obmenu.sourceforge.net/download.html
It is an editor for the openbox menu. Essentially it provides a graphical WAY to EDIT a large xml file. The program is writen in python.
I've attached an image of the openbox menu. I've also attached an image of what obmenu looks like, and my menu.xml.

Is this what you are looking for?

1470.

Solve : Help, trying to create a custom boot usb?

Answer»

Hi FOLKS,

I got a MEGA problem here and it cannot be classified as DOS or a flavour of windows. I designed my computer so that each drive has their own os system ie one drive has win 7,8 and 10, another drive has win 8 etc. There is no xp or OSx. This way I can remove any drive without affecting the boot up procedure.

I have been using the uEFI bios boot manager to chose the drive that I want and it was working ok until I introduced win 10 to one of the drives with 7 and 8. So what happens now is win 10 just wont play ball even if set as the default OS. If I last logged out of win 10 then the next time I put on the pc and select that particular drive, I would not get a windows boot menu, it will simply go STRAIGHT to win 10. Though it goes to my account and I log in, the desktop would not be my desk top or where I left off. I have to reboot and go through the bios boot manager again chose drive and sometimes I have to repeat this 4 times before I get a windows boot manager for that particular drive. Only after going through the windows boot manager and choosing win 10 would I see my own desktop. There is only one account on that win 10, no other. If anyone knows what is causing this, I will be grateful for an explanation.

Anyway I don't want to bore you will all the other issues Im facing on my setup but I FEEL that if I can make a usb boot drive then the boot up menu for all the partitions can be programmed onto it. The problem I am facing is that if it were dos, I could have used something like EasyBCD but that wont work on current windows os. All the examples of multiboot stuff on google and youtube are for those trying to install an os. Nobody is designing a bootable usb for choosing which os u want to log into.

I'd be grateful if anyone can help me look into this or make a suggestion on how I can go about it. I remember something called clover back in the days which was a sort of independent boot up software that gave the freedom of multibooting
Apple and Windows but that was not for usb but something similar will be great. It can be any uefi compatible platform that can run when I switch the pc on to provide me with a boot menu. Thanks in advance for any help.I'd add a removable drive bay to the computer and have a drive for each OS and keep it all separate. This will make life much easier if you nuke and install on an OS to which you just install clean to that drive and all is well, and you dont have to work about the other OS's getting messed up.

I bought a bunch of 160GB SATA Hard Drives from Newegg for $9.99 per hard drive and have a system with removable hard drive bay and drives labelled with whatever OS I want to run.

As FAR as UEFI I set my bios to legacy mode with UEFI basically disabled. There is no benefit to UEFI in my system so I shut it off. This way older OS's dont have boot issues.Thanks Dave, It would be quite a bother to use a bay in my setup but one interesting point u made is running stuff in legacy mode. Im not sure my mobo supports legacy mode nor do I know if Win 7/8/10 supports this mode either. Will legacy mode support Dos and linux based utilities?

Thanks. I use legacy mode and can boot.
Windows XP pro
Windows 7 64 bit
Windows 10 pro

Also, I boot Linux from CD if and when I reedit.

Macrium Reflect does a good job of fix up of the Windows 10 boot manager when it goes bad.
https://www.macrium.com/reflectfree
I boot it from a CD and repair the boot thing.

1471.

Solve : Visual Studio .NET?

Answer»

I'm using visual studio .NET enterprise 2003.
It used to work fine, now I get an error 'the operation could not be COMPLETED' WHENEVER I try to add a new form to a new or existing project.
It won't even create the default form1 when I start a new project.
I have RUN a repair, and reinstalled the .NET framework.

Anyone got any ideas?OK, fixed it!

In case anyone ever has the same problem, it was caused by a dodgy windows scripting host.

Downloading Windows script 5.6 from the Microsoft site fixed it.

Woo YAY.

1472.

Solve : Error occur while opening the PC?

Answer»

When I START up my computer I GET a small box in the middle of the screen saying Frequencia fuera de bande.

Can anyone tell me how to remove this.

I am USING a computer with windows xp.

ThanksThe monitor is not able to display. The SCAN rate is too high.
Start the PC in safe mode and verify the resolution is right for your monitor.
You might have to cycle the monitor on and off for it to sync with the PC.

1473.

Solve : BRAINFUCK?

Answer» HEY. does ANYONE IKNOW what file extension i would use for a BRAINFUCK document?A .jstnnice Raptor
1474.

Solve : Split String in Lua?

Answer»

So I am attempting to split all of the arg[a] values (which are separated by a comma (,)) into argtb[a] = {x,y}. The issue is that with the current fuction I have, it is removing the negative signs, and thus passing on the wrong number.

What I have:
Code: [Select]-- btw: arg = {...}

function Seperate() -- Seperate args into X and Y Values
a = 1 + tonumber(modifyer)
repeat
b = {}
index = 1
for value in string.gmatch(arg[a],"%w+") do
b [index] = value
index = index + 1
end
print(arg[a])
print(b[1],b[2])
os.execute("pause")

-- x = (arg:sub(arg[a])) --This one I could not get to work.
-- y = arg[a]:sub((arg[a]:find(',')+1)) --This one worked.

x = b[1]
y = b[2]


_G["argtb" ..a] = {x,y} -- outputs to table argtb%a%
-- (as per Batch Scripting syntax)
-----
print(_G["argtb"..a][1],_G["argtb"..a][2])
-----
a = a + 1
until (arg[a] == nil)
a = nil
end

Arg examples:
Code: [Select]-41,0
3,-1
1,1
5,-6
-2,-3

What I am currently getting: (with input of "-5,-6")
x = 5
y = 6

Any help or explanations would be appreciated as I just started learning and am not quite sure I understand.
I dont see anything in this code snippet, HOWEVER in search for an explaination, this is all I could find in reference to LUA and this happening where Absolute Value is involved as linked here and shown below: http://lua-users.org/wiki/MathLibraryTutorial

Quote

math.abs
Return the absolute, or non-negative value, of a given value.
> = math.abs(-100)
100
> = math.abs(25.67)
25.67
> = math.abs(0)
0

*Is there an absolute value conversion happening somewhere else in the program that is not shown in this code snippet?

Only other thought is that through a string to numeric conversion it is looking at - and each value as not a whole, but 2 DIFFERENT pieces of string data in which string to numeric conversion is dropping the - and causing an absolute value condition to happen. I ran into issues a while back when trying to cast from string to numeric, maybe thats the issue that is going on here.

Something like this could have a band aid placed into the code to end up with negitive numbers, however anyone who knows how to fix this may grit their teeth stating its poor programming, but if you knew you were working with data in a range of say -2000 to +2000, you could work with 0 to 4000, and when the data is extracted with the offset to work with positive integers, you can have an offset removal once you have your integer to pass it back to the correct value that will show as negative.

So for example if we were working with -23, and want -23 to be the number vs 23 as you have now. You can offset everything into positive territory even when written to data file so that -23 is actually 1977 with 2000 equal to 0. In the data file you have 1977, 2009 for values -23, 9 and before the data is used you remove the 2000 offset with integers working with integers and you will get your negative value vs the absolute value type condition that is happening.

I have had to do stuff like this in the past with C++, its probably not the right way, but when running into issues casting from string to integer a few lines of code extra is a band aid, although as I said a master programmer would probably grit their teeth at such a band aid.Quote
So for example if we were working with -23, and want -23 to be the number vs 23 as you have now. You can offset everything into positive territory even when written to data file so that -23 is actually 1977 with 2000 equal to 0. In the data file you have 1977, 2009 for values -23, 9 and before the data is used you remove the 2000 offset with integers working with integers and you will get your negative value vs the absolute value type condition that is happening.

The value's I'm using are passed directly from the user into the program. So the user call it with 'graph.lua -5,-6' where arg[1] becomes "-5,-6". It was a good idea, but sadly cannot be implemented without first separating the values.

I believe I have found the issue, and sadly it's only solvable by someone with lua experiance.
Code: [Select]for value in string.gmatch(arg[a],"%w+") do
Is separating it by punctuation, and happens to include "-" as punctuation. I've messed around with %w+ to no avail (%w+ is suppose to specify how to separate the string) I will continue messing with it until I find something that works.


EDIT: Fixed it... All I needed to do was put a "-" in front of "%w+"... I feel really stupid now...
Thanks for pointing me in the right direction DaveLembke!Glad I was able to help some even though I have never worked with LUA

Did some research on it and LUA looks interesting. Going to read up some more on it. Thanks for pointing me towards LUA to check it out I use C++, C#, and Perl as my choice languages so going to read deeper into LUA to see what benefits there are that C++, C#, and Perl dont already have.

Quote
Lua is a fast language engine with small footprint that you can embed easily into your application. Lua has a simple and well documented API that allows strong integration with code written in other languages. It is easy to extend Lua with libraries written in other languages. It is also easy to extend programs written in other languages with Lua. Lua has been used to extend programs written not only in C and C++, but also in Java, C# , Smalltalk, Fortran, Ada, Erlang, and even in other scripting languages, such as Perl and Ruby.


and interesting that its used in games that I play. So I am interested in looking to see what role LUA is used in each of those, if its common knowledge to know and not classified by the makers.

Quote
Lua is a proven, ROBUST language
Lua has been used in many industrial applications (e.g., Adobe's Photoshop Lightroom), with an emphasis on embedded systems (e.g., the Ginga middleware for digital TV in Brazil) and games (e.g., World of Warcraft and Angry Birds). Lua is currently the leading scripting language in games. Lua has a solid reference manual and there are several books about it. Several versions of Lua have been released and used in real applications since its creation in 1993. Lua featured in HOPL III, the Third ACM SIGPLAN HISTORY of Programming Languages Conference, in June 2007.

1475.

Solve : Fetching code - JavaScript Help?

Answer»

Hi there,

Just a question. A friend was telling me that he found some fetching code, in JS, that COULD detect what type of device and screen resolution a person is using. Once the device and resolution has been detected it will then display the web page to the resolution they are using on their device.

Is this JavaScript or is he getting confused with another language?

B2 Me again,

Any examples of this code would be great also!

B2 With a little help from Scriptomatic v2, I was able to tweak this into something you might find helpful:

Code: [Select]var wbemFlagReturnImmediately = 0x10;
var wbemFlagForwardOnly = 0x20;

var objWMIService = GetObject("winmgmts:\\\\" + "." + "\\root\\CIMV2");
var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_DesktopMonitor", "WQL",
wbemFlagReturnImmediately | wbemFlagForwardOnly);

var enumItems = new Enumerator(colItems);
var objItem = enumItems.item();

WScript.Echo("DisplayType: " + objItem.DisplayType);
WScript.Echo("ScreenHeight: " + objItem.ScreenHeight);
WScript.Echo("ScreenWidth: " + objItem.ScreenWidth);

Save SCRIPT with a JS extension and RUN from the command line as cscript scriptname.js

Quote

Once the device and resolution has been detected it will then display the web page to the resolution they are using on their device.

Not sure how you plan to do this.

Quote
Is this JavaScript or is he getting confused with another language?

The above JScript uses the Windows Management Interface (WMI). Other LANGUAGES such as Powershell, Perl, Python, and VBscript all have the same access to the WMI classes. Even batch code can access the classes thru the WMIC command line utility (not available on XP Home).

Good luck.

Hi Sidewinder,

Thanks for the info and the example code! Will give it a GO but it also answers my question too.

thanks again!

B2
1476.

Solve : eject cd?

Answer»

is there ANY CODE or way that i can create an executable that onopen ejects the cd TRAY?
PREFERABLY with C++

1477.

Solve : Assembly Language For the x86 Processor college problem?

Answer»

I am taking a programming class in college, and I am having a lot of trouble with this assignment the teacher is not willing to help and I don't know where to go for help.

These are the instructions

This project has three loops.
1. Create a DWORD integer array that is 16 elements long.
2. The first loop: Ask the user to enter 16 numbers to fill the array.
3. The second loop: Reverse the second HALF of the array.
4. The third loop: Use a loop to display the array, to show that the second half was, indeed, reversed. As with step 1, the loop has to access the array from the first element to the last and display the numbers stored in memory. Use a message that reads "The array after the second half was reversed is: "
Use the SIZEOF, TYPE, and LENGTHOF operators to make the program flexible to support the array size and type being changed in the future. If I change the array size in your code to any even number size, say 8, your program should still run correctly, reversing the last 4 elements of the array. Do not use hard-coded numbers like 16 or 8. Use registers and variables for these numbers.
Here is an example:
Please enter 16 numbers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

The array after the second half was reversed is: "
1
2
3
4
5
6
7
8
16
15
14
13
12
11
10
9

Commenting:
You are required to comment every line of code you write. Failure to comment will force a grade reduction of 25%
A Strategy For Solving Problem
This problem asks you to reverse a section of an array. This means that you are not supposed to copy numbers to another array. The best way to approach this is to have addressing that will refer to the first number of the array section to be reversed and addressing that will refer to the last number of the array. You simply swap the numbers at each location then increment the address at the front and decrement the address at the end at each loop pass.
How to determine how much to loop when reversing? Simply divide the length of the array in half, because you need to reverse just the last half of the array. Then divide it again in half, because you swap pairs of numbers.
Division
Here is how to do division:
move into the eax the value you want divided
move into another register the value you want to divide by.
Then simply use div instruction.
The result will be in the eax and the remainder will be in the edx. Since we have here only even numbers and the divide is by 2 or by 4 the reminder will be zero.
Here is an example
MOV edx, 0
mov eax 20
mov ecx, 3
div ecx ;Divide eax by 3
eax will have 6 and the the edx will have 2. 20 / 3 is 6 with a remainder of two.



This is what I have so far



.DATA ;// write your data in this section

Numbers DWORD 16 DUP(?)
count DWORD ?
msg1 BYTE "Enter 16 numbers",0ah,0dh,0
msg2 BYTE "The array after the second half was reversed is",0ah,0dh,0


.code ;// write your program here
main proc

L1:
mov edx, OFFSET msg1
call WriteString

mov edx, OFFSET Numbers
mov ecx, 17
call ReadString

mov ebx, 0
mov edx, OFFSET Numbers
mov ecx, 17

L2:
mov count, ecx
mov ecx, 1

L3:
mov eax, Numbers[ebx]
call WriteChar
inc ebx
loop L3
call crlf
mov ecx, count
loop L2


The biggest thing I do not understand how I reverse the second half of the DWORD storage through the loop, but I am honestly confused with most of it. I have not had trouble with any assignments up till this point, but this one really has me stuck
I don't believe anyone here wants to do your homework for you, but I want to encourage you by helping you find resources.

If you have not already seen them, these online resources might help you.

The Art of Assembly Language (16 and 32 bit): http://www.plantation-productions.com/Webster/www.artofasm.com/index.html

Easy x86-64: http://ian.seyler.me/easy_x86-64/

x86-64 Assembly Language Programming with Ubuntu: http://www.egr.unlv.edu/~ed/assembly64.pdf

Good luck and I hope this helps.


Have you no prior training in computer programming?
Assembly language tends to lack apparent structure. Some, even many, educators think one should start with a tool that encourages one to think of the larger picture.

Free programming tutorials from Microsoft focus on high level language with the option of using some assembly language for a few specific needs.
Here is a good example:
C# Fundamentals for Absolute Beginners

To simplify your tech training journey, we are consolidating our learning resources and retiring Microsoft Virtual Academy in phases, with the next phase finishing on April 30, 2019. On that date, courses, learning paths and associated badging are retiring. Complete site RETIREMENT is scheduled for later in 2019. Check your MVA Dashboard frequently for courses you have started that are retiring. To earn your certificates of completion, be sure to finish any courses by April 30, 2019. For more learning options, check out Microsoft Learn.

Years ago I did hard core assembly programming on the 8080 CPU using an Intel system. That was a very longtime ago.
Even back then I l found using a higher level design saved a lot of development time and reduced errors. So we eventually used high level code whenever we could.
Thank you for the links, I will check them out. Have a good day.

1478.

Solve : VBA Access 2010 - Assigning text to a label caption?

Answer»

So I have an on-click event, a SQL query that imports a bunch of data to my SQL db. That all works FINE. I want to add a function which then writes a date/time stamp on several FORMS that I decided are relevant. I'm already got it working in a few forms, but I rand into a bump in the method I'm using. Here's the code I have now:

Code: [Select]Private Sub DateTimeLastUpdated()
Dim strUpdateMsg As String
Dim strUpdateDate As String
Dim strUpdateTime As String

strUpdateMsg = "Las Updated: "
strUpdateDate = Date
strUpdateTime = Time

Forms!Main!LblLasUpdated.Caption = strUpdateMsg &AMP; strUpdateDate & " " & strUpdateTime
Me.LblLasUpdated.Caption = Forms!Main!LblLastUpdated.Caption

All of this works fine (And it works on all forms listed plus more). The problem that I run into though, is that it will only execute if the form is open. If the form is CLOSED, it will not update the label, and will cause errors in my script. So the question is:

What can I do so that it will assign the CONTENT to EVERY listed label across the entire project even if they are closed, don't have focus, whatever.

If you just want to point me in the right direction, that is still greatly appreciated. And feel free to judge my code... but I only accept nice words. I've decided to go another direction with this, so I don't really need the answer now. Thanks to everyone for taking a look, an I'm sure I'll have another thread soon enough.

Mods (Calum, Allen, patio, an all) feel free to lock this for me if you want.

1479.

Solve : Beginning with C and first problems?

Answer»

Hi!

I began learning C and at first example "Hello world!" compilation returns error.
I have no problem with programming at all - I know assembler of some 8/16-bit COMPUTERS, Basic and Visual Basic.

This is code of ahoj.c:
Code: [Select]#INCLUDE <stdio.h>

main()
{
printf("Ahoj SVET!\n");
}
I used Visual C++ 6 Portable and it reports error at compiling:
Code: [Select]--------------------Configuration: ahoj - Win32 Debug--------------------
Compiling...
Error spawning cl.exe

ahoj.obj - 1 error(s), 0 warning(s)
Then I tried VS Code Portable and there at syntax highlighting reports this:



What do I WRONG?

Thank you all for help me in World of C.
MiroQuote

Visual C++ 6 Portable
There is no "Visual C++ 6 Portable" so whatever you are using is aftermarket. Anyway, cl.exe needs to be in the list of "Executable directories" found under tools->Options. That might be set per-machine with this "aftermarket" thing, or maybe it merely needs configured.

This is the same thing the VS Code error is indicating you should do. You need to add the include directory to the c_cpp_properties.json file.

.C is the file extension for C files. .cpp is for C++ files. this is relevant because what you have there is in a CPP file but is not valid C++ code, so you'd want to use the .C file extension so that the compiler knows it is a C file. In C you could omit the RETURN type of the main() routine but in C++ you have to specify it.Thank you!

I configured paths and my code in Visual C++ 6 Portable works.
Really it is portable VC++ - no install only extract and now I know that configure....

How to configure VSCode Portable don't know.
Miro
1480.

Solve : How to check if a file is present in a directory at a specific time?

Answer»

I WOULD like to know how to create a bat FILE to EXECUTE at a certain time (i.e. 3:00am) to check in a DIRECTORY if a file with the current date (YYYYMMDDaa.req) is present. If not, SEND an email notification. I am not a programmer so any help is greatly appreciated.

1481.

Solve : PDFBox: I need to change the font size when filling fields?

Answer»

I am using PDFBox in Eclipse with Java in ORDER to take in a PDF and fill the fillable fields automatically. I have a working program, the only problem is one field that is too small for the information written in it.

I need to KNOW how to change the FONT size of the text that is written to a field when PDField.setValue(String) is CALLED. I am not creating a pdf at any point, I am just getting the fields of a pdf file and filling them. Thanks in ADVANCE.

1482.

Solve : Problem Moving A Directory From External Hard Drive To Internal (C:) Drive?

Answer»

I'm trying to use the following command, to move a directory (folder), from my external HD, to my internal (C:) Drive's Desktop.

I used the command:

move "G:\Test" "C:\Documents and Settings\Owner\Desktop"

but, I get an 'Access is denied.' message.

I can move files from within the Test folder with:

move "G:\Test\TestFile.txt" "C:\Documents and Settings\Owner\Desktop"

This works fine. TestFile.txt GETS moved to my Desktop with no 'Access is denied' message.

I tried to give myself full control to the folder with the CACLS command.

I did this:

cacls "G:\Test" /e /c /g Owner:f

and it reported:

processed dir: G:\test

So it supposedly gave me full control to that folder, but when I use:

move "G:\Test" "C:\Documents and Settings\Owner\Desktop"

it still reports the 'Access is denied.' message.

I can also use the RD command to remove the folder, with no problem. I just can't move it from one drive to the other.

I can't move it from the (G:) Drive to the (C:) Drive, or from the (C:) Drive to the (G:) Drive.

I'm sure it has SOMETHING to do with the permissions or ownership, but I'm not that experienced with using permissions to gain access to files and folders, since I have XP Home Edition, which doesn't have the Permissions tab, when you right-click folders and files.

I have to do EVERYTHING through DOS, or login through my Administrator account, which then allows me access to the Permissions tab.

I'll never buy a Home Edition of an operating system again. I want full, power-user, control.

Oh well, I didn't know enough at the time I bought the computer. Lesson learned.

This is driving me nuts. Could somebody please help?

ThanksOk, after fiddling around with this, I think I have it figured out.

I think the MOVE command, just doesn't work like I originally thought.

I thought the MOVE command would move a Folder, and all of it's files, then remove itself from it's original location, all with one command, but it doesn't, at least not drive to drive.

If I create an empty folder named 'Test', then try to move it to 'Test2', without creating an empty folder named 'Test2' folder beforehand, it just renames the 'Test" folder to 'Test2'.

For example, when I use:

move "G:\Test" "G:\Test2"

it just renames the 'Test" folder to 'Test2'.

But, if I create the 'Test2' folder beforehand, it DOES move the 'Test' folder into the 'Test2' folder, like this:

"G:\Test\Test2"

As long as I stay on the same drive, this approach works. But, if I create a folder on my Desktop named 'Test2', and try to move 'Test" from the (G:) Drive into it, I get the 'Access is denied.' message.

For example, when I use:

move "G:\Test" "C:\Documents and Settings\Owner\Desktop\Test2"

I get the 'Access is denied.' message.

So, what I came up to move a folder on one drive, to a second drive, and have it be named with the same name, is a FOUR step process.

First command to execute is:

attrib -h -r -s "G:\Test" /s /d

which unsets all of the attributes of the top folder that might hinder it from being copied.

Second is:

attrib -h -r -s "G:\Test\*.*" /s /d

which unsets all of the attributes of the subfolders and files that might hinder everything from being copied.

Third is:

xcopy /e /i "G:\Test" "C:\Documents and Settings\Owner\Desktop\Test"

which copies the top folder 'Test', all of the subfolders, and all of the files, in it.

Forth is:

rd /s /q "G:\Test"

which deletes the original 'Test' folder.

This is the only way I can seem to move a folder from one drive to another.

If there is a better way, please let me know.

Or, if my problem is access permissions, please let me know that too.

Thanks

1483.

Solve : Script I stumbled upon...?

Answer»

I came across this script LAST week and tried it out for WSL, it works great - is there a downside to using it that anyone can see?


Code: [Select]C:\wsl\bat-launcher.vbs

If WScript.Arguments.Count <= 0 Then
WScript.Quit
End If

bat = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\")) & WScript.Arguments(0) & ".bat"
arg = ""

If WScript.Arguments.Count > 1 Then
arg = WScript.Arguments(1)
End If

CreateObject("WScript.Shell").Run """" & bat & """ """ & arg & """", 0, False
I guess I should describe what it does - it runs my batch file and hides the annoying flashing console
Is WSL Windows Subsystem for Linux?

https://en.wikipedia.org/wiki/Windows_Subsystem_for_LinuxNo downside, at least in operation, as long as the batch script actually exists in the script folder. Did you write it yourself? What I write about it depends on your answer.

Another question - do you really need to pass a parameter to the batch script?

What do you mean by WSL?

I will say this pending your reply...

If you just want to run a named batch invisibly, and you don't need to pass a parameter to the batch. this is all you need

If it is called Myrun.vbs, use it like so - Myrun.vbs batname.bat

CreateObject("WScript.Shell").Run """" & wscript.arguments(0) & """", 0, False


Yes, Windows Subsystem for Linux
No, I didn't write it, like I said I just stumbled across it looking for information about Ubuntu installs on WSL
Yes, it seems to do what it says it does.
I don't know enough about scripting to know if it's actually safe to use though

I haven't any idea what parameter is being passed

Could the parameter be setting some condition to exist for XFCE?
It's safe, as long as you use it to run your own batch scripts. Script kiddies use the technique to run batch scripts without any betraying console window. As VBS scripts go, it's a bit crude. Like it was written by someone just starting out. It helpfully checks that you supplied some parameters, but silently QUITS if you didn't, and makes you supply the batch bare name and adds '.bat' to it, and decodes the script name to get its folder name, none of which is necessary. And all without checking if the batch actually exists.Quote from: Quantos on April 30, 2019, 02:44:22 PM

<edit> I haven't any idea what parameter is being passed </edit>

<edit2> Could the parameter be setting some condition to exist for XFCE? </edit2>


More context needed. A link?

Quote from: Quantos on April 30, 2019, 02:44:22 PM
<edit2> Could the parameter be setting some condition to exist for XFCE? </edit2>

Strange not to do it in WSL. I have installed LXDE in my Ubuntu WSL, and use a VNC SERVER to get an X desktop, but I didn't need batch files to do it.Quote from: Salmon Trout on April 30, 2019, 02:52:20 PM
More context needed. A link?

Oh sure, it took a few to find it - https://token2shell.com/howto/x410/creating-shortcut-for-wsl-gui-desktop/
That's where I found the script
1484.

Solve : fortress?

Answer»

dose any ONE now how to CRASH a COMPUTER fortress its a program that stops yoru from opening all programs execpt the ONES alowed by the adminastraterYou'll need a ballista.what is thatjustin your having the same prolbems

1485.

Solve : programming the greed game?

Answer»

I have a huge problem, I have to write a COMPUTER program for my class and i cant write it. The program is called the Greed Game. If anyone has this program COULD you please email it to me at [emailprotected]And another kid who WANTS US to do his homework...

1486.

Solve : Python - Cannot download py2exe module?

Answer»

Hello all. Just wondering if ANYONE actually has a copy of the py2exe program for COMPILING Python code?

I've tried most of the mirrors at it's Sourceforge site (the only PLACE it's distributed, apparently), the closest mirror to me (Heanet, Ireland) gives me a generic "File Not Found" error, and the rest give me Sourceforge's own error at the top of the page.

The exact file I need is "py2exe-0.5.4.win32-py2.3.exe" and the download link at the official site is here:
http://prdownloads.sourceforge.net/py2exe/py2exe-0.5.4.win32-py2.3.exe?download

If anyone has it, could you email it to me please? (PM me and I'll tell you my email addy) Or is there another place it's avaliable? I'm in no RUSH and it isn't all that big a deal really. Any help would really be appreciated though! ....why not just do a google search on python.... try another URL???But as I described, the only source the makers are using to distribute the module is via Sourceforge, presumably so they can get more accurate data on the number downloads.

I did actually do a search for it. Most EITHER went to the homepage for py2exe, some went directly to Sourceforge, the rest were dead.

1487.

Solve : Compiled Code Question?

Answer»

Friend of mine hit me up asking if there was a way to compile code and have it unable to be decompiled?

Last I knew there was no way to block someone from decompiling especially in grabbing it from memory addresses where it can all be exposed to its inner workings.

Figured I'd check here to see if I am wrong and there is a way. Then I will get back to him on this.Yes, it can be done.
However, when people WORK together they try to make it easy, not hard to de compile and debug. I recall some 'tricks' that are used to make code more dense and it also makes it harder to debug. One is to use instructions that are not documented in the standard literature.This is done at the machine code LEVEL, or by an assembly make for that kind for trickery.
Another is to enter a procedure at a point that should be wrong. Some modes do not allow that, but older CPU designs did allow that kind of foolishness.

An other is to use some instructions that will change the flags in the accumulator. This will confuse anybody WANTING to understand the logic.
More extreme is encrypted code that UNLOCKS itself just before it is used and then goes back to the way it was. I I knew how that is done I could not tell you because they would kill me when they found out who I am.

Another is to have a special custom CPU that is made for super secret aplications.
It looks like a normal CPU but...
Wait... Somebody is pounding on the door - be back in a jiff.
sNo. You can obfuscate it or encrypt it to make it more difficult, but it isn't possible to make it be completely unable to be decompiled. The program has to be run by the machine and the machine needs machine code instructions, and machine code instructions can always be mapped to assembly language identifiers. Even in the case of encrypted code blocks at some point it must be decrypted and in memory so that it can be executed.

Personally, I think at a wider scale, obfuscation, preventing decompiling, etc. is putting resources in the wrong direction. It tends to cause PROBLEMS for legitimate customers and that time could arguably be put towards real-world features in the software.Cool... TY both for input on this and if Geek never returns we will know that he said too much.

Quote

Even in the case of encrypted code blocks at some point it must be decrypted and in memory so that it can be executed.

Yeah that is what my thought was on trying to hide the code was that the computer has to have the information structured pretty much the same as an unprotected program, and poking around in memory to see what is there is too easy for someone with skills/tools to be able to see its structure.

Will share this with him when I see him tomorrow.
1488.

Solve : Neat online PHP interpreter I found?

Answer»

Found this neat online PHP interpreter when digging around on google for some info on PHP. Figured I'd share the link here in case anyone wants to play with PHP without having to install WAMP, LAMP, or XAMPP. HOWEVER if you are doing ANYTHING complex or linked to a database etc you will need to use a real package locally for development.

http://writecodeonline.com/php/I love the Javascript availability on this page. Thanks for pointing this out.Here is a more comprehensive variant on that idea. Supports a load of languages.WOW.... SWEET!!!! Thanks for sharing that BC, so many to chose from vs just PHP, JS, etc

Also I see Ruby is there. Have been thinking about trying out that language to see how I like it. I know that people say its slower than Perl etc, and a pain to deploy, but would be good to be familiar with it all even if I dont use it as a replacement to Perl which I use on a regular basis. But also Ruby on Rails is preferred to avoid SQL Injection attacks and XSS etc so while slower it does have its benefits.Here's another option (That I use myself): http://ideone.com/Quote from: DaveLembke on October 19, 2013, 03:37:46 PM

WOW.... SWEET!!!! Thanks for sharing that BC, so many to chose from vs just PHP, JS, etc

Also I see Ruby is there. Have been thinking about trying out that language to see how I like it. I know that people say its slower than Perl etc, and a pain to deploy, but would be good to be familiar with it all even if I dont use it as a replacement to Perl which I use on a regular basis. But also Ruby on Rails is preferred to avoid SQL Injection attacks and XSS etc so while slower it does have its benefits.

It's important to remember that Ruby on Rails- the Framework- has itself been an attack vector that has compromised websites before.

Anyway, I covered Ruby in One of my Language comparisons a while back. Ruby was the most CONCISE language I used, in that it allowed me to write the program with the least code. I think I also make a reasonable point at the end of that particular post- "The time for judging a language on it’s inherent execution MODEL passed before the end of the Cold War. ". It was only one line shorter than the Perl implementation, but the difference is I can look at the Ruby code and understand what is happening. With the Perl implementation, I haven't got much of a clue.

1489.

Solve : programer?

Answer»

what do u to creat a programjustin......GIVE it a REST Justin


dl65 Yes, Justin. Hush up and PLAY along.y i want to create a PROGRAM

1490.

Solve : How make a package software .bat files?

Answer»

HI..

I want to deploying application from .BAT file
if i install with manually so easy, i only double CLICK .bat file then installer.exe running..

i tried MAKE a PACKAGE via hpca admin publisher, when i try deploy application to client .bat files only copying source to client but not execute

help me Quote

i tried make a package via hpca admin publisher, when i try deploy application to client .bat files only copying source to client but not execute


So you need remote execution service ability added then at the clients systems to support remote install. There are tools out there to do this, but I am not sure of they open up security holes or not with them present to handle the incoming remote execution request. If it is a one time execution, you have many systems to perform this install on, and users have power user privileges to perform installations without requiring admin privileges, I'd have each user execute it and when its done the software is there. Or if this is a software update that requires execution, I would use scheduled task built into Windows to check for updates at say midnight. If no NEW software updates then nothing happens, but of a software update is present it triggers this event to perform the software update.
1491.

Solve : Run a program only on idle time - Screensaver Creation Question?

Answer»

I have a project that I am playing with to which I'd like to have it running on my computers only during idle time and then when computer is in use it either pauses the program or runs it at a much lesser CPU priority so that it doesn't cripple the system when hopping on to use it.

Currently I set it to run with a core affinity setting on how hard I want it to hit the cores of the quadcore system. But was thinking if I could wrap this exe that was programmed in C++ around a screensaver and set it to only run when idle, that would make more sense vs stopping the exe and going about what i am doing and then having to click on the shortcut to run it when I am done what i am doing to pick up where it left off.

I've never dabbled in screensaver programming, but interested in learning how to take what I have and make it a screensaver compatible program. I am looking to run it on two computers a Windows 7 and 10 system. Not sure if there are any differences in compatibility to make it work with 1 vs the other or if a screensaver written for 7 is automatically Windows 10 compatible.

Some of the questions I have are ones that the answers in the wrong hands could be used to make a malicious screensaver etc. So I am thinking that maybe SOMEONE responding here with interest in assisting me on this via PM might be the smart way to go with this vs posting information here which could be used as a cookbook to making a bad screensaver.

Biggest question I was curious about was if there was a screensaver wrapper that exists to be able to wrap a program around a screensaver shell and have rules for this shell on how the EXE should behave when idle and how it should behave when the computer is suddenly in use my myself or my wife? I did a google search and didnt find anything helpful on a wrapper to make any program created run only when idle and then go dormant or run very slowly when the computer is in use to not impact myself and my wife as users of these 2 computers.

Because I didnt see a wrapper out there, maybe I need to program up a screensaver and add my code to it, but never done it before and figured I'd check here to see if anyone was able to point me in the right direction to myself coding up one that would work for myself.

A screensaver is just a normal executable renamed to SCR. Windows runs it after the screensaver timeout and it can do whatever it wants. (Obviously, screensavers tend to show full-screen graphics and exit out as soon as you move the mouse or press a key)

it is configured in the registry under each user profile. HKEY_USERS\.DEFAULT\Control Panel\Desktop has a SCRNSAVE.EXE key which would have the full path to any configured screensaver executable. (It might let you use exe there come to think of it?)

As a screensaver I'd probably have the screensaver create a Window and then make it transparent via Layered Attributes with opacity 0, then if it detects any mouse movement or key presses it removes the window, does any needed cleanup for whatever it was doing, and exits.

An alternative approach could be to simply use task SCHEDULER. Configure a repeating task for say every 10 minutes and set the option to "only execute when computer is idle for " option, "stop if the computer ceases to be idle" and "restart if the idle state resumes". Every 10 minutes task scheduler will check the conditions and start your background program, then close it when somebody uses it. (Which probably won't work well if you had the idea to use a console APPLICATION...)Thank You BC for this info... As far as the program opening and closing multiple times I have no problem with that as for it writes to a file of where it left off, however if the program was interrupted/ended during the write process it would corrupt the file it writes to or if it ends before the file close instruction was executed,... I am not sure how a program with a file open without a file close instruction would affect the system, however it might make for a memory leak because the proper file close instruction wasn't completed. So with each new instance of that program run and abnormally terminated it might not release the memory address that was used for the write to file instruction because the file close never completed.

The scheduled task idea that you shared to trigger every 10 minutes and if user is active ignore and if idle run it until active, I never thought of and actually that would be really easy to implement. It also seems the better route to go SINCE it is a console program. I forgot about the ability to set scheduled tasks to trigger conditionally to system idle.

I just need to figure out how much of a problem it would be if the executable is interrupted during a file write which I am not sure if a program in a LOOP would wait to the end of the loop before exiting which is the safest point of an exit after the file close instruction has completed, or if its like taskkill and kills the program dead in the water no matter of how critical in the execution it is processing.For normal Windows applications you can handle WM_CLOSE of the main window. For Console applications you might be able to detect when the program is exited by using SetConsoleCtrlHandler(). In each case you can do the appropriate "cleanup" to store what the current state of the task is.Cool... Thanks for your help BC!

1492.

Solve : Batch Files and Logging?

Answer»

Is there any way of WRITING the output of a batch file as a program runs to a text file? There is no option with the .exe that I am running from the batch for logging. But would LIKE to keep track of what files it finds. These files are written to the screen as the file executes, but I would like to write these to a text file.

Any ideas

TCUse redirection.
>
To avoid over writing the original use >>
The double redirection appends the output instead of over writing the original. If you append output, create an empty file with the filename first.Thankyou thankyou thankyou!

I've been looking for this for over a week now! I was beginning to think it wasn't possible to log the changes...

Yay!

Now, all I have to do is get it to log the date as well... any SUGGESTIONS / ideas?
I ASSUME you are using WINDOWS or MS-DOS.

I use this to get the date/time into the log files:

date >C:\D\PEB\TXT\F_Bak_Log\F_Bak_Log.TXT
time >C:\D\PEB\TXT\F_Bak_Log\F_Bak_Log.TXT

HTH,
Phil.

1493.

Solve : create batch file?

Answer»

need help in CREATING a batch with below conditions.
i have abc.txt file. i want to read this file and load HEADER and trailer information in xyz.txt file. and i want to accoplish this using batch file.
can you please help me in thisI deleted your other post and moved this one to a more appropriate area on our site. Please do not post the same QUESTION more than once. Thank you.Okay alan thank you.
as am new to this site got LITTLE confused.
No problem. We have a number of very talented folks who can help with your batch programming question. Sit tight, I'm sure some one will be ABLE to offer assistance.

1494.

Solve : Computer stuck on automatic repair?

Answer»

My Alienware m17 r4 has been STUCK on the AUTOMATIC repair screen,I have no problem with restarting it to factory settings I just can’t get to the advanced OPTIONS settings for some reason Hi

Perhaps your 32GB mSATA SSD is full, if it is you will need something ELSE to boot from like a windows 10 Pendrive or Linux version to delete some files or update files. After you boot from the media you should be able to check free space to confirm if the drive is full. You will need at least 4 gb's free for windows 10 to boot. Look for folders like windows.old to delete.

1495.

Solve : jpeg files do not open in Thunderbird emails?

Answer»

How can I GET THUNDERBIRD to open INCOMING jpeg FILES in EMAIL.

1496.

Solve : need codin advice?

Answer»

Hi, Just wading thru trying to keep my little mind INTACT. My project is a
calculator. The code:
refreshes database, doesn't display data being entered, but does create the

records (zeroes), prints record.
Im HOPING someone will take a look at this, please.
Below is my code; Yeah, I could have removed a little:


personal calculator

input { text-align:center; }













width=100>





<img
SRC="http://localhost/images/yesbutton.png" height=25 width=50 alt="yes

button">


click
http://localhost/images/nobutton.png" height=25 width=50 alt="no

button">[/url]





body {font-family: helvetica}
p {font-size: 12pt}
.red {color: red}
.blue {color: blue}



var Memory = 0;
var purpose = "";
var value1 = 0;
var value2 = 0;
var NewNumber = "";
var opvalue = "";
var op = opvalue;

function Display(displaynumber) {
document.calculator.answer.value = displaynumber;
}

function MemoryClear()
{Memory = 0;document.calculator.mem.value = "";}

function MemoryRecall(answer)
{
if(NewNumber !== "")
{value2 += answer;}
else
{value1 = answer;}
NewNumber = "";
Display(answer);
}

function MemorySubtract(answer)
{Memory = Memory - eval(answer);}

function MemoryAdd(answer)
{Memory = Memory + eval(answer);
document.calculator.mem.value = " M ";NewNumber = "";}

function ClearCalc()
{value1 = "";value2 = "";NewNumber = "";Display("");}

function Backspace(answer)
{
answerlength = answer.length;
answer = answer.substring(0, answerlength - 1);if (value2 !== "")
{value2 = answer.toString();Display(value2);}
else
{value1 = answer.toString();Display(value1);}
}

function CECalc()
{value2 = "";NewNumber = "yes";Display("");}

function CheckNumber(answer)
{
if(answer == ".")
{
Number = document.calculator.answer.value;
if(Number.indexOf(".") != -1)
{answer = ""; }
}
if(NewNumber == "yes")
{value2 += answer;Display(value2);}
else
{
if(NewNumber '==' "")
{value1 = answer;value2 = "";NewNumber = "no";}
else
{value1 += answer;}
Display(value1);
}
}
function AddButton(x)
{
if(x == 1) EqualButton();
if(value2 !== "")
{value1 = parseFloat(value1) + parseFloat(value2);}
NewNumber = "yes";
opvalue = '+';
Display(value1);
}
function SubButton(x)
{
if(x == 1) EqualButton();
if(value2 !== "")
{value1 = parseFloat(value1) - parseFloat(value2);}
NewNumber = "yes";
opvalue = '-';
Display(value1);
}
function MultButton(x)
{
if(x == 1) EqualButton();
if(value2 !== "")
{value1 = parseFloat(value1) * parseFloat(value2);}
NewNumber = "yes";
opvalue = '*';
Display(value1);
}
function DivButton(x)
{
if(x == 1) EqualButton();
if(value2 !== "")
{value1 = parseFloat(value1) / parseFloat(value2);}
NewNumber = "yes";
opvalue = '/';
Display(value1);
}
function SqrtButton()
{value1 = Math.sqrt(value1);NewNumber = "";Display(value1);}
function PercentButton()
{
if(NewNumber != "blank")
{value2 *= '.01';NewNumber = "";Display(value2);}
}
function RecipButton()
{value1 = 1/value1;NewNumber = "";Display(value1);}
function NegateButton()
{value1 = parseFloat(-value1);NewNumber = "no";Display(value1);
}
function EqualButton() {
if(opvalue == '+') AddButton(0);
if(opvalue == '-') SubButton(0);
if(opvalue == '*') MultButton(0);
if(opvalue == '/') DivButton(0);
value2 = "";
opvalue = "";
}
function OnCalc(purpose,value1,op,value2,total)
{return(purpose,value1,op,value2,total);}
// End -->





action="http://localhost/calculator/post1.php" method="post">










Calculator































onChange="CheckNumber(this.value)">





name="backspace" class="red" value="Backspace"

onClick="Backspace(document.calculator.answer.value); return FALSE;">
type="button" name="CE" class="red"

value=" CE " onClick="CECalc(); return false;">
class="red" value=" C "

onClick="ClearCalc(); return false;">


onClick="MemoryClear(); return false;">

onClick="CheckNumber('7'); return false;">

onClick="CheckNumber('8'); return false;">

onClick="CheckNumber('9'); return false;">

onClick="DivButton(1); return false;">

onClick="SqrtButton(); return false;">

onClick="MemoryRecall(Memory); return false;">

onClick="CheckNumber('4'); return false;">

onClick="CheckNumber('5'); return false;">

onClick="CheckNumber('6'); return false;">

onClick="MultButton(1); return false;">

onClick="PercentButton(); return false;">

onClick="MemorySubtract

(document.calculator.answer.value); return false;">

onClick="CheckNumber('1'); return false;">

onClick="CheckNumber('2'); return false;">

onClick="CheckNumber('3'); return false;">

onClick="SubButton(1); return false;">

onClick="RecipButton(); return false;">

onClick="MemoryAdd

(document.calculator.answer.value); return false;">

onClick="CheckNumber('0'); return false;">

onClick="NegateButton(); return false;">

onClick="CheckNumber('.'); return false;">

onClick="AddButton(1); return false;">

onClick="EqualButton(); return false;">








print



Thanks
1497.

Solve : want to change computer sounds?

Answer»

How can I create sound files to change the standard sounds that my computer makes, such as startup, mouse click, etc.?
It requires wav. files, so I want to create shortened wave files form other wav. files, or from other formats such as avi, mpg, etc.
Any programs out there specialising in this? Keep it simple for me eh.
Much appreciated. My computer needs personality.
And this is related to programming how....?as much as changing computer sounds isor coloursNot really. Get your jargon right and POST in the proper SECTION.

Quote

A set of coded instructions that enables a machine, especially a computer, to perform a DESIRED sequence of operations.


I donot see you code any instructions when you are merely trying to set Windows sounds, do you?

The word you're looking for is 'configuring'

Quote
To DESIGN, arrange, set up, or shape with a view to specific applications or uses
And I see the "configuring" section where...? How about software or Windows?
1498.

Solve : html5 game debugging?

Answer»

Ok so im makin an html5 game but i have hit a road bump.
im getting an error in LINE 167 of the javascript on the html page.

the simple game LIBRARY should be one directory above the rest of the files.

what i was trying to do is to get the coins and the blocks to scroll at the same time.

suggestions please.

coin sprite coming soon.

[recovering disk SPACE, attachment deleted by ADMIN]Somehow I believe I MESSED up the nested if statements.
But i'm not sure.

1499.

Solve : PHP - User Interface Question?

Answer»

So I am playing around with PHP and what better WAY to learn it than to make a game, however ... I have some questions regarding the user interface options:

Looking online I see multiple ways for implementing user controls through web pages with PHP, but there are pros and cons to each one and havent found the best option yet that would work for the game I am making.

Method #1 - Forms, where a user enters data or checks a box etc and clicks submit.
( Cons = requires data entry + submit )
( Pros = works well with database data entry etc )

Method #2 - Hyperlinks pointed to PHP scripts, contained within tables which compose the buttons for the GUI
( Cons = I think it is going to be a problem with database data entry unless form data can be passed within the PHP script without user having to click submit )
( Pros = Requires just 1 click to trigger event and no submit required )


While forms are the better method, I want the interface to be a simple single-click of predetermined options vs selecting an option and then selecting to submit.

While Hyperlinks to PHP scripts allow for a single-click to execute a routine, it will likely be a problem when implemented in a client/server environment later on when data is passed to a mySQL database to record game status etc, so why build it to operate locally and then have to drastically reconstruct it later to work in a client/server environment.

While my knowledge of HTML is pretty good, when it comes to CGI and Forms etc I generally have to do research and when stumped ask questions. It would be NICE to be able to use forms and have a single-click to trigger an event, but I am not sure if this is possible or not since the basic design of forms is for data entry and then submit it vs instantly passing an INSTRUCTION in a single-click which is what I really want to make the controls as simplistic as possible.jQuery.

an exceedingly simple example.

Basically you can issue asynchronous requests through client-side javascript, which can perform any required request. The above for example requests a QUOTE through an existing PHP file every few moments, but it could also be invoked by a button or other control.

eg. In your case it would be trivial to submit a form when a combobox changed, or to do so dynamically and actually display the results in a separate div without reloading the page or loading a new page- the combobox's event handler could issue a asynchronous POST request of that changed item and show the appropriate result in a separate div through DOM.Thanks BC for pointing me in correct direction.

Found some more examples here: http://www.w3schools.com/jquery/jquery_examples.asp

1500.

Solve : Java 2 problems?

Answer»

I have been working with the SAMS Java 2 in 24 Hours book and was doing fine up to chapter 7 when I had to reformat my hard drive. Since then I have re downloaded and reinstalled the j2sdk kit in the form of the j2ee1.4sdk package. I have set my classpath correctly (have scrutinized this carefully) When I run the command line from the java folder and enter any "java" command it responds with "JAVA is not a recognized command, program or batch file"
I'm running Windows XP Home.
Can anyone help here?
thanks,
BarkleyHave you tried to reinstall the Java package?Hi Barkleyc,

Most likely your COMPUTER's class path is not set correctly.

Type java -version at c prompt and if you get a java version messge, it means u have installed java and likely you have not set the class path correctly. Read through your book or website on how to set the class path in WinXp. I think it's in control panel, SYSTEM, Advance, environment.

CheersThank you for the response to the two above. It seems as if you didn't read my initial post very well. The questions you asked were addressed INITIALLY. The Class Path is set to .;C:\j2sdk1\lib\tools.jar as the book indicates and was what worked before. I have re-downloaded and re-installed java with no results.
Don't know what to do at this point...maybe a bad source?? ... permissions for XP user set right? ..... Maybe Java was disabled by mistake?Problem solved! I moved tools.jar out of the C:\Sun\AppServer\jsdk\lib where it was to C:\Sun, and changed the Class Path accordingly. (I know that in my above response it appears that the Class Path was set incorrectly but I assure you, it was correct. I checked it at least 8 times.) Everything WORKS fine now. It appears that XP couldn't find it buried that deep. Huh!? Weird.
Barkley