-
Posts
57 -
Joined
-
Last visited
Reputation Activity
-
RandleMcmurphy got a reaction from shadow_ray in Need help for this easily fixable C program
I completely agree, 90% of the C++ alternatives are safer, and switching between types is a pain.
void see_safe() { //When input is 123456789 char buff[9]; scanf("%8s", buff); //Buffer overflow's can't exist }
-
RandleMcmurphy reacted to Newbie_Gamerz in Need help for this easily fixable C program
This is my C program for reading and displaying flight ticket details...
Pls compile and see the errors then help me fix it.... I am blankly saying this bcoz IDK how to explain my issue....
I promise this will be easier to fix than my last code..........
There are some pointer errors that's what I need to fix...
Thanks BTW
#include <stdio.h> typedef struct { int ptickno; char pname[100]; char flightname[100]; char fdate[100]; char fltime[100]; char class[100]; char gate[100]; char seat[100]; char from[100]; char to[100]; }passenger; void input_output(passenger p1[100]) { int i=0; int n; int *ticket; ticket=&p1->ptickno; char *passname, *airplanename, *airdate, *airtime, *flclass, *airgate, *airseat, *flyfrom, *flyto; passname=p1->pname; airplanename=p1->flightname; airdate=p1->fdate; airtime=p1->fltime; flclass=p1->class; airgate=p1->gate; airseat=p1->seat; flyfrom=p1->from; flyto=p1->to; printf("ENTER THE NUMBER OF TICKETS YOU WANT TO ENTER : "); scanf("%d",&n); for(i=0;i<n;i++) { printf("\n********************************************"); printf("\nENTRY FOR PASSENGER %d :", i+1); printf("\n\nEnter ticket number : "); scanf("%d",&p1[i](*ticket)); printf("Enter name of passenger : "); scanf("%s",p1[i](passname)); printf("Enter name of flight : "); scanf("%s",p1[i](airplanename)); printf("Enter date of flight : "); scanf("%s",p1[i](airdate)); printf("Enter time of flight : "); scanf("%s",p1[i](airtime)); printf("Enter class : "); scanf("%s",p1[i](flclass)); printf("Enter gate : "); scanf("%s",p1[i](airgate)); printf("Enter seat : "); scanf("%s",p1[i](airseat)); printf("Enter from : "); scanf("%s",p1[i](flyfrom)); printf("Enter to : "); scanf("%s",p1[i](flyto)); printf("********************************************\n"); } for(i=0;i<n;i++) { printf("\n********************************************"); printf("\nTICKET DETAILS OF PASSENGER %d",i+1); printf("\n\nTICKET NUMBER : %d",p1[i](*ticket)); printf("\nNAME OF PASSENGER : %s",p1[i](passname)); printf("\nNAME OF FLIGHT : %s",p1[i](airplanename)); printf("\nDATE OF FLIGHT : %s",p1[i](airdate)); printf("\nTIME OF FLIGHT : %s",p1[i](airtime)); printf("\nCLASS : %s",p1[i](flclass)); printf("\nGATE : %s",p1[i](airgate)); printf("\nSEAT : %s",p1[i](airseat)); printf("\nFROM : %s",p1[i](flyfrom)); printf("\nTO : %s",p1[i](flyto)); printf("\n********************************************"); } } int main() { passenger p[100],*pptr; pptr=&p[0]; input_output(pptr); return 0; }
-
-
RandleMcmurphy reacted to AlexTheGreatish in The Ruthless Economy PC
How much PC can you get for $500? A lot... if you're willing to get sketchy
Check out the BGA to LGA CPUs: https://a.aliexpress.com/_d6jfsk1
Buy Timetec RAM
On Amazon (PAID LINK): https://geni.us/Qy0N
On Newegg: https://geni.us/e6yPl
Parts from our $500 value PC:
Buy AMD 3100 CPU
On Amazon (PAID LINK): https://geni.us/94hZ7f
On Newegg (PAID LINK): https://geni.us/PwZqEAM
On B&H (PAID LINK): https://geni.us/MEt9h
Buy ASRock B450M Pro4 Motherboard
On Amazon (PAID LINK): https://geni.us/86viff
On Newegg (PAID LINK): https://geni.us/bgVk
On B&H (PAID LINK): https://geni.us/pEov
Buy G.SKILL 2 x 4GB RAM
On Amazon (PAID LINK): https://geni.us/oUtMQMv
On Newegg (PAID LINK): https://geni.us/dY8Qomy
On B&H (PAID LINK): https://geni.us/lyz0
Buy Seagate 1TB Barracuda
On Amazon (PAID LINK): https://geni.us/O313
On Newegg (PAID LINK): https://geni.us/gkyylBP
On B&H (PAID LINK): https://geni.us/kita
Buy XPG SX850 256GB
On Amazon (PAID LINK): https://geni.us/42ySq0
Buy ZOTAC GTX 1650 Super Twin Fan
On Amazon (PAID LINK): https://geni.us/vADqvT
On Newegg (PAID LINK): https://geni.us/GIGcu
On B&H (PAID LINK): https://geni.us/XzeS3la
Buy Cougar MG120
On Amazon (PAID LINK): https://geni.us/VegK
On Newegg (PAID LINK): https://geni.us/9euDxIk
Buy EVGA 400w PSU
On Amazon (PAID LINK): https://geni.us/Ybkz52
On Newegg (PAID LINK): https://geni.us/qBABgU
*Purchases made through some store links may provide some compensation to Linus Media Group.*
-
RandleMcmurphy reacted to Kimmaz in The under 100 line challenge!
This is 111 lines of Javascript code so far. does html and css count or not? Its almost finished. What do you think, any suggestions?
Check what it does here https://fallout2rcg.000webhostapp.com/
-
RandleMcmurphy reacted to straight_stewie in The under 100 line challenge!
Interestingly enough, here's a C# function to do the same thing, albeit without all of the console output:
public void WriteRandomBitsToFile(int bitLength, RNGCryptServiceProvider numberGenerator, string path) { byte[] randomBytes = new byte[bitLength / 8]; numberGenerator.GetBytes(randomBytes); using (FileStream file = new FileStream(path, FileMode.Create)) { using (BinaryWriter writer = new BinaryWriter(file)) writer.Write(randomBytes); } }
-
RandleMcmurphy reacted to mariushm in The under 100 line challenge!
This actually makes me sad.... templates and std libraries and requiring c++ 11 for something that can be done in other languages in a few lines.
Go (golang) for example can do it in less than 20 lines using only built in stuff and you end up with a binary that doesn't require runtime dlls to work.
-
RandleMcmurphy reacted to jdfthetech in Anyone got any idea how to factory reset this thing?
This article appears to explain how to flash this chip for a 2 channel relay of similar build:
https://www.hagensieker.com/wordpress/2019/02/21/hacking-unknown-2-channel-relay-with-tasmota/
In this article, he discusses the 4 channel version and how it relates to the 2 channel.
-
-
-
RandleMcmurphy reacted to Sub2pewdiepie in XLoader
Thank you so much for helping me with this it means a lot to me that you were willing to stick with it and help me for this long Thank you so much
-
RandleMcmurphy reacted to Eerietom in 5v RGB led strip to rgb header
so
I'm from Brazil and I don't have RGB strips available either abundantly or by a fair price.
I did got a TV LED strip as a gift tho
it's one of those with a Music sensitive USB powered box and a remote
I have soldering skils and equipment due to arduino and some life experiences but very limited electronic knowledge
as far as I've measured on my multimeter
voltage wise it sends about 1V~3V max around the pins
I think it'd be fun to venture on a project like this just to find out if it can be done easily and maybe do a tutorial on reddit or something
sorry about reviving this old post
I secretly spent some points on my necromancer skill tree
-
RandleMcmurphy reacted to AeroMagnus in DIY RGB?
1-
2- that's almost $30, where doing it myself would cost like $8
-
RandleMcmurphy reacted to Jingtian Wang in Laptop Battery Replacement
I did some more digging, apparently although the cells are made by panasonic, if you look closely at the battery on the teardown, it's actually made by the same manufacturer. They just sell them without the acer logo...This is getting more interesting.
Already did, but due to corona, their reply turn around is pretty slow...still waiting
Thanks for all the advice
-
RandleMcmurphy reacted to BLAHHOOGIE in My first ever PC build!
Motherboard: Asus X570 TUF Gaming Plus
CPU: AMD Ryzen 5 3600x
GPU: EVGA RTX 2080 Super FTW3
PSU: Corsair CX750m 80+ Bronze
Memory: Corsair Vengance RGB 16Gb DDR4
Storage: ADATA XPG SX8200 PRO 1TB M.2 SSD
Inland premium 512 GB m.2 SSD
Chassis: Thermaltake S300TG
Cooling: Corsair H100i platinum AIO,
x3 Corsair ML series fans
Keyboard: Corsair K70 MK.2 RGB
Mouse: Logitech g502
-
RandleMcmurphy reacted to minibois in Creating a while loop to return sequence of characters between two characters
You could basically turn that for-loop into a while-loop, if that code already works:
// Original loop: for(i=start;i<=stop;i++) { printf("%c",i); } // While loop: while(i<=stop) { i = start; printf("%c",i); i++; } These two loops do the same thing, just one with a for loop, the other a while loop.
For obvious reason, people often prefer for-loops, because they look a lot neater
The idea is:
- You use a for-loop when you know how many times you need to iterate (like you know you have a set of characters that is x long, so you iterate x amount of times)
- You use a while-loop for when you are not sure how many times it needs to run (like when you need to wait for user input, you're not sure how many times/how long that will take).
You could tackle this problem like this:
1. iterate through letters in the list (should be done with a for-loop, could be done with a while-loop)
2. Either a letter is the first character you want, or not.
2a. If it is NOT the first character, go to next letter and go to 2.
2b. If it is the first character, save it to the string and go to 3
3. Go to the next character and save it to the string. Check if we have reach the end of the list (3a), the end character(3b) or something else(3c).
3a. Have we reached the end of the list? We didn't find the end character. Do whatever you must print out here.
3b. is the next character the end character? Go to 4.
3c. not the end of the list/end character. go to 3.
4. the end character has been reached, print out the output.
So that's basically what you need to program, in steps.
1. should really be done with a for-loop, can be done with a while loop too
2. can be combined with 1 into a while-loop. So basically:
while(letterToCheck == firstCharacter) { // Save it to the list // Move on to 3 } 3. is a loop inside of the while loop above and should again realistically be a for-loop.
Could be done as a while-loop too.
while(letterToCheck == firstCharacter) { string result += letterToCheck; letterToCheck = nextLetter; while((letterToCheck != endCharacter) && (letterToCheck != null)) { string result += letterToCheck; letterToCheck = nextLetter; } } Now you have to kind of make it do resursion.
Imma be honest though, this is me coding at 1am... I kind of am losing focus.
Either someone else will swoop in and finish this up (because I'm pretty sure the steps are alright), but I really can't focus enough to produce a decent bit of code.
P.S. the code I wrote above is more in a C# style and uses some 'shortcuts' like just saying 'letterToCheck = nextLetter', of course there is some logic behind this needed too.
Just one tip, we have a feature on this forum specifically for posting code. See the top bar (with the different formatting options and such), this icon is for posting code:
Makes it just much easier to read code.
-
RandleMcmurphy reacted to gm8675309 in A-RGB Fan Controller - Mobo Connector?
That does look awfully close. I agree it should have come with the pooter and installed. I called CyberPower and they sent me a cable and it also didn't work (wrong connector). For $10, it might be worth a try.
That might be a good solution. Mobo only has 1 ARGB header. Where can I find the appropriate splitters or adapters to join them all together?
I am a little worried about power draw direct from Mobo as well. Right now only the ARGB strips are fed directly from the mobo and the fans are on this controller which also has power fed to it directly.
-
RandleMcmurphy got a reaction from Hackentosher in EzFlow Oven
I just got finished with my EzFlow Oven. This hacked toaster oven should make SMD assembly 'soooo' much easier. Caution, High voltage is involved. I added QuickChips temperature profile to the firmware, works amazing with the low temperature paste QuickChip has available.
I added heat resistant insulation to the internal gaps of the oven chaise, as well as the bottom of the unit to keep my desk cool.
The internally mounted solid state relay also has a large heat-sink mounted to it for heat dissipation.
(I should have took more pictures)
Big public thanks to RocketScream for providing a super affordable solution.
(Not Sponsored, I'm just weird)
Pics of Build
Pics of SMD Test
Links to Parts 'n' Stuff
-
RandleMcmurphy reacted to Ruffleduffle in EzFlow Oven
the king of ghettorigs approves.
Question tho: how accurate is your temp-probe and can you calibrate for specific holding temps?
-
-
RandleMcmurphy got a reaction from minibois in Confused about Arduino (microcontroller) terms
Sweet, custom Arduino stuff is always fun. What I would do if I were you, is find a working schematic for your chip, that includes the in circuit program headers, then work from there. NOTE! the all bootloaders are not the same, IE spakfun bootloader won't work in an adafuit board, the led pinouts are different, additional pin mapping stuff..... idk.
https://arduino.stackexchange.com/questions/473/how-do-i-burn-the-bootloader
https://github.com/michalmonday/supremeDuck/wiki/Flashing-bootloader-to-Atmega32U4-using-Arduino-IDE
I'm pretty sure you can flash the bootloader right from the arduino IDE, after you select the right board type. All you need is an in circuit serial programmer. Or program the sketch without the bootloader by using the icsp.
https://www.pololu.com/product/3172
https://www.pololu.com/docs/0J67/5.4
If your wanting to play with the ATmega32U4, I would clone the leonardo.
https://www.pololu.com/file/0J555/arduino-leonardo-schematic_3b.pdf
It already has the icsp headers broken out, and a bootloader. NOTE! if you plan on using the bootloader and the board files for the leonardo, use the same pin definitions in your design. The arduino 'pins' are mapped to the physical chip pins, so pin0 is not pin0, I hope this is clear.
After the bootloaders on your blank chip, your good to program with usb, it should be like talking to any other arduino at that point.
I would also google arduino clones to see how others are doing it, its super helpful.
Best of Luck!
EDIT: I'm dumb, the schematic you uploaded had the icsp header, I thought it was missing, at any rate, the above still applies.
-
RandleMcmurphy got a reaction from FakeCIA in LTT forum "banning" game
Banned for "not joining the American parrot rave".
-
RandleMcmurphy reacted to minibois in Confused about Arduino (microcontroller) terms
Hey,
Currently I am looking into make a custom PCB for a project I am working. This PCB will have an ATmega32U4 microcontroller on it, just like the Arduino (Pro) Micro uses.
I have been looking at some places online on how to flash that microcontroller, but I am just unsure on what I need to look for. Bootloader? Flashing? ISP header? I am just unsure what I am suppose to look for here.
The PCB will have a USB port (mini, if that matters) on it, to interface with a computer with. Preferably I would just like to install the Arduino IDE, maybe click a switch on the device and then just flash a new firmware/sketch to the MCU.
Questions:
- If I get a bare microcontroller, do I need to put a bootloader on it? How would I do that? What pins do I need to expose to do this easily?
- Once a bootloader is on the MCU, can I simply flash it via USB? What pins (on the MCU) are used for that?
- Should I just copy what the Arduino Micro uses for its connection to USB? Or do they have a bootloader on it, so it work with the Arduino IDE? https://www.arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
Anyone with some guidance, I would be very happy if you could share your wisdom! I am just kind of unsure as to what to Google and how to interpret what I am reading.
If anything was unclear, please ask away and I will clarify myself further!
-
RandleMcmurphy reacted to AlienALX in The Hell Cat.
Upgrades. TR 1920x, 32gb Dom Plats, X399 Aorus Pro, Two Phison 256gb SSD, one Intel 400gb U.2 and etc.
Coming next.
-
RandleMcmurphy reacted to Hackypenguin in The under 100 line challenge!
https://github.com/HackyPenguin/annoyance
my attempt some prankware. can be packaged as an exe and provided to an end user to install on a target machine. <60 lines