#ifndef
Explore tagged Tumblr posts
insanethornsabotage · 16 days ago
Text
Top Programming Institute in Jalandhar
Tumblr media
Best Programming Institute in Jalandhar: Unleash Your Coding Potential In the fast-paced world of technology, acquiring good programming skills is vital for establishing a fulfilling career in software development, data science, web development, and other areas. If you are on the lookout for the top programming institute in Jalandhar, you have arrived at the right destination. Jalandhar is becoming a center of good technical education, providing multiple opportunities for students interested in learning programming languages and software development methodologies.
Why Select the Best Programming Institute in Jalandhar? The need for competent programmers remains on the rise across sectors such as IT, banking, healthcare, and e-commerce. In response to this need, it is important to join a programming college that has intensive training with current material and experienced professionals. The ideal colleges offer not only academic knowledge but also practical skill development through actual projects, thereby allowing students to build problem-solving capabilities and coding expertise.
Selecting a suitable programming institute in Jalandhar is access to a systematic curriculum covering trendy programming languages like Python, Java, C++, and JavaScript. Additionally, these institutions focus on learning by doing through coding practice, live projects, and hackathons, which equip students with real-world industry challenge preparation.
Features of a Top Programming Institute What makes the top programming institute in Jalandhar different from others? Listed below are some highlights:
Experienced Faculty: Instructors with industry experience who lead students through concepts effectively and clearly.
Current Curriculum: Courses framed based on industry requirements and prevailing technology trends. Experiential Learning: Live coding exercises, hands-on workshops, and project-based tasks. Career Assistance: Help with resume building, interview preparation, and job placement support.
Flexible Learning Options: Weekday, weekend, and online classes to accommodate varied student needs.
Small Batch Sizes: To provide individual attention and doubt-removal sessions.
Most Popular Courses Taught at Programming Institutes in Jalandhar The best institutes provide a range of programming courses for beginners and experienced learners. Some of the most popular courses include:
Python Programming: Ubiquitous for automation, AI, data science, and web development.
Java Development: Creating enterprise software and Android apps. C and C++: Key programming languages widely used in system-level software and game creation. Full-Stack Development: Merging frontend and backend programming skills. Data Structures & Algorithms: Essential skills for excelling in competitive programming and technical interviews.
Why TechCADD is the Top Rated Programming Institute in Jalandhar
With so many choices, TechCADD has become the top rated programming institute in Jalandhar. Renowned for its student-focused methodology, TechCADD bridges the gap between theoretical knowledge and industry demands. The institute provides individualized mentorship, state-of-the-art infrastructure, and revised course material.
Their training process fosters experiential learning via actual projects, coding puzzles, and interactive sessions. This, besides enhancing technical skills, builds confidence and communication skills, which are prerequisites for professional success.
Career Prospects After Completing Programming Courses Graduates from a well-known programming institute can pursue career options like Software Developer, Web Developer, Mobile App Developer, Data Analyst, and many more. The solid foundation obtained through these courses leads to opportunities in the field of jobs at startups, IT companies, and multinational corporations. Moreover, placement assistance is offered by many institutes, thus allowing it to easily enter the world of technology.
Conclusion Investing in good education at the top programming college or institute in Jalandhar can change your career graph in the field of technology. Whether you are a newcomer or want to enhance your skills, choosing an institute that provides practical training, expert advice, and placement benefits is important. Jalandhar's leading programming institutes, such as TechCADD, offer the best possible environment to study, develop, and prosper in the dynamic field of programming.
0 notes
c-official · 6 days ago
Note
why my code no compile?
#define stdinclude iopdfsjopidfspiofjdspiojfds /*stdinclude*/
#include <stdio.h> #include <stdlib.h>
#endif
#ifdef DEBUG
#define debug printf("your are here %i of %s\ni",__line__,__file__)
#endif
#include <time.h>
#ifndef DEBUG
#define debug /*do something arbitrary*/ int lesbian=0
#endif
#ifndef random
#define random dfklsjladfsjldfslkdfsadfdsklj /*code here*/
char* seed(void* gay,void* davoid){int bi=0;while(gay[bi]&&davoid[bi]){ gay[bi]=<<davoid[bi];bi++;};bi=0;/*dont do this*/while(gay[bi]&&davoid[bi]){davoid[bi]=(char)gay[bi];bi++;};return gay;}; char Random(char* gay,char* trans){char* queer=seed(gay,trans); if (queer[gay[trans[0]]]){return queer[gay[trans[0]]];}; else{return qeueer[random[0]];};} #endif #ifdef random #define unrandom kjadfklskldfsakldfs char* random(void){return unrandom;} #undef random #endif int main(int argc;char** argv){ FILE* dykefile=fopen("keysmash","w"0); if(!argv[1]){printf("give me /*arguements dumbass*/\n";);return argc;} if(!fopen(argv[1],"w")){printf("error opening file: /*argv[1]*/\n";return argc);} FILE* fagfile=fopen(argv[1],"r");char dyke;char fag;time_t Time; while(!feof(fagfile)){/*ignore all that shit and just use libc*/ time(Time); srand(Time); dyke=fgetc(fagfile);fag=dyke|rand();fputc(fag,dykefile); } return 666;}
Sorry about that, but gcc is aware that it is international nonbinary day so no code can be compiled today. You might have better luck the rest of the week when there is a 1 in 42 chance of compiling into a binary format.
If you really need it to be done today i can recommend making it into an analog circuit. They have a huge boost this week so abuse that while you can.
7 notes · View notes
kremlin · 2 years ago
Note
How DOES the C preprocessor create two generations of completely asinine programmers??
oh man hahah oh maaan. ok, this won't be very approachable.
i don't recall what point i was trying to make with the whole "two generations" part but ill take this opportunity to justifiably hate on the preprocessor, holy fuck the amount of damage it has caused on software is immeasurable, if you ever thought computer programmers were smart people on principle...
the cpp:
Tumblr media Tumblr media Tumblr media
there are like forty preprocessor directives, and they all inject a truly mind-boggling amount of vicious design problems and have done so for longer than ive been alive. there really only ever needed to be one: #include , if only to save you the trouble of manually having to copy header files in full & paste them at the top of your code. and christ almighty, we couldn't even get that right. C (c89) has way, waaaay fewer keywords than any other language. theres like 30, and half of those aren't ever used, have no meaning or impact in the 21st century (shit like "register" and "auto"). and C programmers still fail to understand all of them properly, specifically "static" (used in a global context) which marks some symbol as inelligible to be touched externally (e.g. you can't use "extern" to access it). the whole fucking point of static is to make #include'd headers rational, to have a clear seperation between external, intended-to-be-accessed API symbols, and internal, opaque shit. nobody bothers. it's all there, out in the open, if you #include something, you get all of it, and brother, this is only the beginning, you also get all of its preprocessor garbage.
this is where the hell begins:
#if #else
hey, do these look familiar? we already fucking have if/else. do you know what is hard to understand? perfectly minimally written if/else logic, in long functions. do you know what is nearly impossible to understand? poorly written if/else rats nests (which is what you find 99% of the time). do you know what is completely impossible to understand? that same poorly-written procedural if/else rat's nest code that itself is is subject to another higher-order if/else logic.
it's important to remember that the cpp is a glorified search/replace. in all it's terrifying glory it fucking looks to be turing complete, hell, im sure the C++ preprocessor is turing complete, the irony of this shouldn't be lost on you. if you have some long if/else logic you're trying to understand, that itself is is subject to cpp #if/#else, the logical step would be to run the cpp and get the output pure C and work from there, do you know how to do that? you open the gcc or llvm/clang man page, and your tty session's mem usage quadruples. great job idiot. trying figuring out how to do that in the following eight thousand pages. and even if you do, you're going to be running the #includes, and your output "pure C" file (bereft of cpp logic) is going to be like 40k lines. lol.
the worst is yet to come:
#define #ifdef #ifndef (<- WTF) #undef you can define shit. you can define "anything". you can pick a name, whatever, and you can "define it". full stop. "#define foo". or, you can give it a value: "#define foo 1". and of course, you can define it as a function: "#define foo(x) return x". wow. xzibit would be proud. you dog, we heard you wanted to kill yourself, so we put a programming language in your programming language.
the function-defines are pretty lol purely in concept. when you find them in the wild, they will always look something like this:
#define foo(x,y) \ (((x << y)) * (x))
i've seen up to seven parens in a row. why? because since cpp is, again, just a fucking find&replace, you never think about operator precedence and that leads to hilarious antipaterns like the classic
#define min(x,y) a < b ? a : b
which will just stick "a < b ? a: b" ternary statement wherever min(.. is used. just raw text replacement. it never works. you always get bitten by operator precedence.
the absolute worst is just the bare defines:
#define NO_ASN1 #define POSIX_SUPPORTED #define NO_POSIX
etc. etc. how could this be worse? first of all, what the fuck are any of these things. did they exist before? they do now. what are they defined as? probably just "1" internally, but that isn't the point, the philosophy here is the problem. back in reality, in C, you can't just do something like "x = 0;" out of nowhere, because you've never declared x. you've never given it a type. similar, you can't read its value, you'll get a similar compiler error. but cpp macros just suddenly exist, until they suddenly don't. ifdef? ifndef? (if not defined). no matter what, every permutation of these will have a "valid answer" and will run without problem. let me demonstrate how this fucks things up.
do you remember "heartbleed" ? the "big" openssl vulnerability ? probably about a decade ago now. i'm choosing this one specifically, since, for some reason, it was the first in an annoying trend for vulns to be given catchy nicknames, slick websites, logos, cable news coverage, etc. even though it was only a moderate vulnerability in the grand scheme of things...
(holy shit, libssl has had huge numbers of remote root vulns in the past, which is way fucking worse, heartbleed only gave you a random sampling of a tiny bit of internal memory, only after heavy ticking -- and nowadays, god, some of the chinese bluetooth shit would make your eyeballs explode if you saw it; a popular bt RF PHY chip can be hijacked and somehow made to rewrite some uefi ROMs and even, i think, the microcode on some intel chips)
anyways, heartbleed, yeah, so it's a great example since you could blame it two-fold on the cpp. it involved a generic bounds-checking failure, buf underflow, standard shit, but that wasn't due to carelessness (don't get me wrong, libssl is some of the worst code in existence) but because the flawed cpp logic resulted in code that:
A.) was de-facto worthless in definition B.) a combination of code supporting ancient crap. i'm older than most of you, and heartbleed happened early in my undergrad. the related legacy support code in question hadn't been relevant since clinton was in office.
to summarize, it had to do with DTLS heartbeats. DTLS involves handling TLS (or SSLv3, as it was then, in the 90s) only over UDP. that is how old we're talking. and this code was compiled into libssl in the early 2010s -- when TLS had been the standard for a while. TLS (unlike SSLv3 & predecessors) runs over TCP only. having "DTLS heartbeat support in TLS does not make sense by definition. it is like drawing a triangle on a piece of paper whose angles don't add up to 180.
how the fuck did that happen? the preprocessor.
why the fuck was code from last century ending up compiled in? who else but!! the fucking preprocessor. some shit like:
#ifndef TCP_SUPPORT <some crap related to UDP heartbeats> #endif ... #ifndef NO_UDP_ONLY <some TCP specific crap> #endif
the header responsible for defining these macros wasn't included, so the answer to BOTH of these "if not defined" blocks is true! because they were never defined!! do you see?
you don't have to trust my worldview on this. have you ever tried to compile some code that uses autoconf/automake as a build system? do you know what every single person i've spoken to refers to these as? autohell, for automatic hell. autohell lives and dies on cpp macros, and you can see firsthand how well that works. almost all my C code has the following compile process:
"$ make". done. Makefile length: 20 lines.
the worst i've ever deviated was having a configure script (probably 40 lines) that had to be rune before make. what about autohell? jesus, these days most autohell-cursed code does all their shit in a huge meta-wrapper bash script (autogen.sh), but short of that, if you decode the forty fucking page INSTALL doc, you end up with:
$ automake (fails, some shit like "AUTOMAKE_1.13 or higher is required) $ autoconf (fails, some shit like "AUTOMCONF_1.12 or lower is required) $ aclocal (fails, ???) $ libtoolize (doesn't fail, but screws up the tree in a way that not even a `make clean` fixes $ ???????? (pull hair out, google) $ autoreconf -i (the magic word) $ ./configure (takes eighty minutes and generates GBs of intermediaries) $ make (runs in 2 seconds)
in conclusion: roflcopter
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ disclaimer | private policy | unsubscribe
159 notes · View notes
auroroboros1 · 1 month ago
Text
wqhy my code no compile?
```ifndef stdinclude
define stdinclude iopdfsjopidfspiofjdspiojfds
/stdinclude/
include
include
endif
ifdef DEBUG
define debug printf("your are here %i of %s\ni",line,file)
endif
include
ifndef DEBUG
define debug /do something arbitrary/ int lesbian=0
endif
ifndef random
define random dfklsjladfsjldfslkdfsadfdsklj
/code here/ char* seed(void* gay,void* davoid){int bi=0;while(gay[bi]&&davoid[bi]){ gay[bi]=<<davoid[bi];bi++;};bi=0;/dont do this/while(gay[bi]&&davoid[bi]){davoid[bi]=(char)gay[bi];bi++;};return gay;}; char Random(char* gay,char* trans){char* queer=seed(gay,trans); if (queer[gay[trans[0]]]){return queer[gay[trans[0]]];}; else{return qeueer[random[0]];};}
endif
ifdef random
define unrandom kjadfklskldfsakldfs
char* random(void){return unrandom;}
undef random
endif
int main(int argc;char** argv){ FILE* dykefile=fopen("keysmash","w"0); if(!argv[1]){printf("give me /arguements dumbass/\n";);return argc;} if(!fopen(argv[1],"w")){printf("error opening file: /argv[1]/\n";return argc);} FILE* fagfile=fopen(argv[1],"r");char dyke;char fag;time_t Time; while(!feof(fagfile)){/ignore all that shit and just use libc/ time(Time); srand(Time); dyke=fgetc(fagfile);fag=dyke|rand();fputc(fag,dykefile); } return 666;}
```
2 notes · View notes
axiomfinity · 1 day ago
Text
#include <stdio.h>
#include <conio.h>
#include <time.h>
#include <dos.h>
#ifndef __adlib_h_
#define __adlib_h_
/* ADLIB.H
* Christopher R. Evans with portions from Kevin A. Lee
* 27th April, 1993
* June 16th, 2013 - Adapted for NXDOS system
* Description: Low-level interface to the Adlib (or compatible)
* FM sound card. All information gleaned from
* Jeffrey S. Lee's "Programming the Adlib/Sound
* Blaster FM Music Chips". See Lee's document for
* further information.
*
* Compiled succesfully under Turbo C, Borland C++,
* and Microsoft Quick C (all latest versions).
*/
#define MIN_REGISTER 0x01
#define MAX_REGISTER 0xF5
#define ADLIB_FM_ADDRESS 0x388 /* adlib address/status register */
#define ADLIB_FM_DATA 0x389 /* adlib data register */
#ifndef BYTE
#define BYTE unsigned char
#endif
/*
* FM Instrument definition for .SBI files - SoundBlaster instrument
* - these are the important parts - we will skip the header, but since
* I am not sure where it starts and ends so I have had to guess.
* However it SEEMS! to work. Each array has two values, one for
* each operator.
*/
typedef struct
{
BYTE SoundCharacteristic[2]; /* modulator frequency multiple... */
BYTE Level[2]; /* modulator frequency level... */
BYTE AttackDecay[2]; /* modulator attack/decay... */
BYTE SustainRelease[2]; /* modulator sustain/release... */
BYTE WaveSelect[2]; /* output waveform distortion */
BYTE Feedback; /* feedback algorithm and strength */
} FMInstrument;
/*
* Enumerated F-Numbers (in octave 4) for the chromatic scale.
*/
enum SCALE
{
D4b = 0x16B, D4 = 0x181, E4b = 0x198, E4 = 0x1B0,
F4 = 0x1CA, G4b = 0x1E5, G4 = 0x202, A4b = 0x220,
A4 = 0x241, B4b = 0x263, B4 = 0x287, C4 = 0x2AE
};
/* function prototyping */
void WriteFM(int reg, int value);
int ReadFM(void);
int AdlibExists(void);
void FMReset(void);
void FMKeyOff(int voice);
void FMKeyOn(int voice, int freq, int octave);
void FMVoiceVolume(int voice, int vol);
void FMSetVoice(int voiceNum, FMInstrument *ins);
int LoadSBI(char filename[], FMInstrument *ins);
void Wait(clock_t wait);
/* Function: WriteFM ********************************************************
*
* Parameters: reg - which FM register to write to.
* value - value to write.
*
* Description: writes a value to the specified register and
* waits for the "official" recommended periods.
*
*/
void WriteFM(int reg, int value)
{
int i;
outp(ADLIB_FM_ADDRESS, (BYTE)reg); /* set up the register */
for (i = 0; i < 6; i++) inp(ADLIB_FM_ADDRESS); /* wait 12 cycles */
outp(ADLIB_FM_DATA, (BYTE)value); /* write out the value */
for (i = 0; i < 35; i++) inp(ADLIB_FM_ADDRESS); /* wait 84 cycles */
} /* End of WriteFM */
/* Function: ReadFM *********************************************************
*
* Returns: the value in the status register.
*
* Description: return a value in the status register.
*
*/
int ReadFM(void)
{
return (inp(ADLIB_FM_ADDRESS));
} /* End of ReadFM */
/* Function: AdlibExists ****************************************************
*
* Returns: 1 (true) if an Adlib compatible sound card
* is present, else 0 (false).
*
* Description: determines whether an Adlib (or compatible)
* sound card is present.
*
*/
int AdlibExists(void)
{
int stat1, stat2;
WriteFM(0x04, 0x60); /* reset both timers */
WriteFM(0x04, 0x80); /* enable timer interrupts */
stat1 = ReadFM(); /* read status register */
WriteFM(0x02, 0xFF);
WriteFM(0x04, 0x21); /* start timer 1 */
Wait(10); /* could do something useful*/
stat2 = ReadFM(); /* read status register */
WriteFM(0x04, 0x60); /* reset both timers */
WriteFM(0x04, 0x80); /* enable timer interrupts */
if (((stat1 & 0xE0) == 0x00) && ((stat2 & 0xE0) == 0xC0)) return (1);
return (0);
} /* End of AdlibExists */
/* Function: FMResest *******************************************************
*
* Description: quick and dirty sound card reset (zeros all
* registers).
*
*/
void FMReset(void)
{
int i;
/* zero all registers */
for (i = MIN_REGISTER; i < MAX_REGISTER+1; i++) WriteFM(i, 0);
/* allow FM chips to control the waveform of each operator */
WriteFM(0x01, 0x20);
/* set rhythm enabled (6 melodic voices, 5 percussive) */
WriteFM(0xBD, 0x20);
} /* End of FMReset */
/* Function: FMKeyOff *******************************************************
*
* Parameters: voice - which voice to turn off.
*
* Description: turns off the specified voice.
*
*/
void FMKeyOff(int voice)
{
int regNum;
/* turn voice off */
regNum = 0xB0 + voice % 11;
WriteFM(regNum, 0);
} /* End of FMKeyOff */
/* Function: FMKeyOn ********************************************************
*
* Parameters: voice - which voice to turn on.
* freq - its frequency (note).
* octave - its octave.
*
* Description: turns on a voice of specfied frequency and
* octave.
*
*/
void FMKeyOn(int voice, int freq, int octave)
{
int regNum, tmp;
regNum = 0xA0 + voice % 11;
WriteFM(regNum, freq & 0xff);
regNum = 0xB0 + voice % 11;
tmp = (freq >> 8) | (octave << 2) | 0x20;
WriteFM(regNum, tmp);
} /* End of FMKeyOn */
/* Function: FMVoiceVolume **************************************************
*
* Parameters: voice - which voice to set volume of
* vol - new volume value (experiment).
*
* Description: sets the volume of a voice to the specified
* value in the range (0-63)?
*
*/
void FMVoiceVolume(int voice, int vol)
{
int regNum;
regNum = 0x40 + voice % 11;
WriteFM(regNum, vol);
} /* End of FMVoiceVolume */
/* Function: FMSetVoice *****************************************************
*
* Parameters: voiceNum - which voice to set.
* ins - instrument to set voice.
*
* Description: sets the instrument of a voice.
*
*/
void FMSetVoice(int voiceNum, FMInstrument *ins)
{
int opCellNum, cellOffset, i;
voiceNum %= 11;
cellOffset = voiceNum % 3 + ((voiceNum / 3) << 3);
/* set sound characteristic */
opCellNum = 0x20 + (char)cellOffset;
WriteFM(opCellNum, ins->SoundCharacteristic[0]);
opCellNum += 3;
WriteFM(opCellNum, ins->SoundCharacteristic[1]);
/* set level/output */
opCellNum = 0x40 + (char)cellOffset;
WriteFM(opCellNum, ins->Level[0]);
opCellNum += 3;
WriteFM(opCellNum, ins->Level[1]);
/* set Attack/Decay */
opCellNum = 0x60 + (char)cellOffset;
WriteFM(opCellNum, ins->AttackDecay[0]);
opCellNum += 3;
WriteFM(opCellNum, ins->AttackDecay[1]);
/* set Sustain/Release */
opCellNum = 0x80 + (char)cellOffset;
WriteFM(opCellNum, ins->SustainRelease[0]);
opCellNum += 3;
WriteFM(opCellNum, ins->SustainRelease[1]);
/* set Wave Select */
opCellNum = 0xE0 + (char)cellOffset;
WriteFM(opCellNum, ins->WaveSelect[0]);
opCellNum += 3;
WriteFM(opCellNum, ins->WaveSelect[1]);
/* set Feedback/Selectivity */
opCellNum = (BYTE)0xC0 + (BYTE)voiceNum;
WriteFM(opCellNum, ins->Feedback);
} /* End of FMSetVoice */
/* Function: LoadSBI ********************************************************
*
* Parameters: fileName - name of .SBI file.
* ins - variable to place data in.
*
* Description: loads a .SBI into the instrument structure.
*
*/
int LoadSBI(char fileName[], FMInstrument *ins)
{
int i;
FILE *fp;
size_t structSize = sizeof(FMInstrument);
if ((fp = fopen(fileName, "rb")) == NULL) return (0);
/* skip the header - or do we? */
for (i = 0; i < 36; i++) fgetc(fp);
/* read the data */
fread(ins, structSize, 1, fp);
fclose(fp);
return (1);
} /* End of LoadSBI */
void FMSetVolume(int voiceNum, int vol)
{
int opCellNum, cellOffset;
voiceNum %= 11;
cellOffset = voiceNum % 3 + ((voiceNum / 3) << 3);
opCellNum = 0x40 + (char)cellOffset;
opCellNum += 3;
WriteFM(opCellNum, vol);
}
/* Function: Wait **********************************************************
*
* Parameters: wait - time in microseconds
*
* Description: pauses for a specified number of microseconds.
*
*/
void Wait(clock_t wait)
{
clock_t goal;
if (!wait) return;
goal = wait + clock();
while ((goal > clock()) && !kbhit()) ;
} /* End of Wait */
#endif
int main(void) {
int x = 0;
x = AdlibExists();
if (x) {
printf("ADLIB detected!\n");
} else {
printf("NO ADLIB found!\n");
}
getchar();
return(x);
}
0 notes
Text
2-v-1 battles (you and a friend vs an NPC)
Tumblr media Tumblr media Tumblr media Tumblr media
pretty proud of my wally tag battle I coded, although its not actually very complicated. i worked it out though! There's still a couple movements and things that could be finessed a little, but on the whole its pretty good! If you decline the tag battle, wattson is clearly disappointed and calls you a bad friend.
Code for a 2v1 (most of it. not including speech cause eh
pre-setup (files that need to exist to pull off a 2-v-1)
define the partner you'll fight with
include\constants\battle_partner.h
Define your new partner to the end of the list, and update the partner count accordingly
ifndef GUARD_CONSTANTS_BATTLE_PARTNERS_H define GUARD_CONSTANTS_BATTLE_PARTNERS_H define PARTNER_NONE 0 define PARTNER_STEVEN 1 define PARTNER_WALLYWATSON 2 define PARTNER_COUNT 3 endif  // GUARD_CONSTANTS_BATTLE_PARTNERS_H
give them a backsprite
because I re-used Wally, i THINK you just need to put them into graphics/trainers/back_pics, but no idea. for re-using wally, mine just worked
give the partner some pokemon
src\data\battle_partners.party
it has the same smogon format as the normal parties, with a slightly reduced format for the name and class and pic. just copy what's there for Steven and adjust accordingly.
=== PARTNER_WALLYWATSON === Name: WALLY Class: Rival Pic: Wally Gender: Male Music: Male Delcatty (F) @ Sitrus Berry Ability: Wonder Skin Level: 30 EVs: 144 HP / 132 Def / 132 SpD Assist Fake Out Light Screen Hyper Voice Roselia @ Eviolite Ability: Poison Point Level: 30 EVs: 240 HP / 148 Def / 120 SpD IVs: 0 Atk Sunny Day Toxic Spikes Magical Leaf Sludge Kirlia (M) @ Eviolite Ability: Trace Level: 30 EVs: 160 HP / 156 Def / 172 SpD IVs: 0 Atk Dazzling Gleam Light Screen Reflect Psybeam
actual battle code (after pre-setup has been done)
this is all defined in the script for your map, just like how you would for a normal battle.
TrainerBattleWattsonMultiWithWally_MultiBattleStart:: //if you want them to say something before picking your pokemon, place it here //battle starts //saves the current player party to memory special SavePlayerParty //asks the player to pick three of their pokemon. there's an instruction for pick six, but it doesn't work for this purpose fadescreen FADE_TO_BLACK special ChooseHalfPartyForBattle waitstate //if you want them to say something after picking your digimon, but before you fight, place it here. //initiates the battle. structure is (command) (opponent, from normal trainer list) (what they say when defeated) (the partner, from the partner trainer list) multi_2_vs_1 TRAINER_WATTSON_1, MauvilleCity_Gym_Text_WattsonDefeat, PARTNER_WALLYWATSON //checks if you win switch VAR_RESULT //if you won the battle, go to a new event. case 1, TrainerBattleWattsonMultiWithWallyVICTORY //if you lost the battle fadescreen FADE_TO_BLACK special SetCB2WhiteOut waitstate TrainerBattleWattsonMultiWithWallyVICTORY: //whatever you need to happen after the battle goes here. You prob dont need this, but because i was writing a gym battle script, there was a ton of flags to put here release end //Text MauvilleCity_Gym_Text_WattsonDefeat: string: "Oh no you won.$"
0 notes
devnews · 4 months ago
Text
External Versioning in GCC: Defining Project Versions Without Modifying Source Code
I was experimenting with gcc linker and how I could define the version of my project externally. The idea is to have a version bump procedure, but without needing to modify source code for just a version. So assuming we have this file named test.c: #include <stdio.h> #ifndef VERSION #define VERSION "default" #endif int main(){ printf(VERSION); } Enter fullscreen mode Exit fullscreen…
0 notes
siliconsignalsblog · 7 months ago
Text
Defining Hardware Capabilities: Devicetree Bindings
We discovered in a previous blog post how the hardware on the device could be described by a devicetree in an embedded software application based on The Zephyr Project. We saw an example of how the devicetree can be used to describe the four LEDs found on a nRF52840 development kit (https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dk). We discovered that a complete board can be created by combining several devicetree files. In order to comprehend how to reference elements in the devicetree, we lastly went over some source code. We will discover how The Zephyr Project uses the devicetree in this blog post.
Tumblr media
 
Zephyr Is Not Linux!
One of the main points of the previous blog post was that, despite the fact that the devicetree concept is derived from Linux, Zephyr's application is very different. As part of the boot process in Linux, the kernel reads the devicetree in binary form from somewhere in RAM and, based on the devices that are present and enabled, calls the relevant driver functions. But in Zephyr, the devicetree is used to create header files that are used with the Zephyr kernel and drivers, as well as the source code that makes up the finished application. Therefore, Zephyr uses the devicetree during compile-time, while the Linux kernel uses it during run-time. Zephyr's build infrastructure incorporates particular mechanisms to interface with the devicetree as a result of this distinction.
Devicetree Bindings
“Devicetree bindings” are the basis of Zephyr’s mechanism to allow the C portion of the application to reference the devicetree source file. The following graphic from The Zephyr Project’s documentation (https://docs.zephyrproject.org/latest/build/dts/intro-scope-purpose.html) demonstrates this mechanism:
Tumblr media
The conventional devicetree files covered in the last blog post are the "Devicetree sources." The contents of the devicetree, including the data types of the nodes, are described by the "Devicetree bindings." The source files and bindings are finally combined into a C header file by the Zephyr build infrastructure. The "devicetree.h" header file, which is utilized by the application and Zephyr source files, abstracts the contents of the generated header file.
Through The Looking Glass
An outstanding illustration of how devicetree bindings function in Zephyr is "custom_dts_binding" under samples/basic. To navigate devicetree bindings, we surprisingly only need to pay attention to the following three lines in the sample's main.c:#if !DT_NODE_EXISTS(DT_NODELABEL(load_switch))#error “Overlay for power output node not properly defined.”#endif
First, we’ll need to build the application using the following invocation (assuming “zephyr_main” is where we cloned the latest west manifest): $> west build -p always -b nucleo_l073rz zephyr_main/zephyr/samples/basic/custom_dts_binding
The C source files in Zephyr and the applications that use it ultimately use devicetree.h, as seen in the above image. The generated header files are included close to the top of the devicetree.h file when we open it under zephyr_main/zephyr/include/zephyr/:#ifndef DEVICETREE_H#define DEVICETREE_H#include <devicetree_generated.h>...#endif /* DEVICETREE_H */
Where is “devicetree_generated.h”? It’s not in the Zephyr repository but in the build directory!
Tumblr media
If we return to the relevant lines in main.c and search for the “DT_NODELABEL” in devicetree.h, we find the following definition:#define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
If we further search for DT_CAT, we find the following definition: #define DT_CAT(a1, a2) a1 ## a2
These two macros will convert “DT_NODELABEL(load_switch)” from main.c into “DT_N_NODELABEL_load_switch”. If we search for DT_NODE_EXISTS, we find the following definition:#define DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS))
The IS_ENABLED macro is defined using the following clever macros in the util_macro.h and util_internal.h header files under zephyr_main/zephyr/include/zephyr/sys:#define IS_ENABLED(config_macro) Z_IS_ENABLED1(config_macro)#define Z_IS_ENABLED1(config_macro) Z_IS_ENABLED2(_XXXX##config_macro)#define _XXXX1 _YYYY,#define Z_IS_ENABLED2(one_or_two_args) Z_IS_ENABLED3(one_or_two_args 1, 0)#define Z_IS_ENABLED3(ignore_this, val, ...) val
If we work through the macros using “DT_N_NODELABEL_load_switch,” the first one expands to the following: IS_ENABLED(DT_N_NODELABEL_load_switch) --> IS_ENABLED(DT_N_S_load_switch_EXISTS)
Where is “DT_N_NODELABEL_load_switch_EXISTS” defined? It’s (ultimately) in devicetree_generated.h!#define DT_N_S_load_switch_EXISTS 1...#define DT_N_NODELABEL_load_switch DT_N_S_load_switch
The second macro will cause “DT_N_NODELABEL_load_switch” to expand to “DT_N_S_load_switch” and the first macro will result in the expansion to “DT_N_S_load_switch_EXISTS”! If we step through the expansion of the series starting with “IS_ENABLED” macros, we see the following (and remembering that DT_N_S_load_switch_EXISTS expands to “1”): IS_ENABLED(DT_N_S_load_switch_EXISTS) --> Z_IS_ENABLED1(1)Z_IS_ENABLED1(1) --> Z_IS_ENABLED2(_XXXX1)
Now, since “_XXX1” expands to “_YYY,” (paying close attention to the comma), Z_IS_ENABLED2 expands to “Z_IS_ENABLED3(_YYY, 1, 0)”. Finally, the last macro expands to: Z_IS_ENABLED3(_YYY, 1, 0, ...) --> 1
And there we have it! Let’s say the DT_N_S_load_switch_EXISTS macro was set to “0” instead. Then we wouldn’t be able to leverage the macro which expands “_XXX1” to “_YYY,” and rather, we’d have the following chain of macros: IS_ENABLED(DT_N_S_load_switch_EXISTS) --> Z_IS_ENABLED1(0)Z_IS_ENABLED1(0) --> Z_IS_ENABLED2(_XXX0)Z_IS_ENABLED2(_XXX0) --> Z_IS_ENABLED3(_XXX0 1, 0)
>p>And the lack of the comma in Z_IS_ENABLED3 will result in that macro expanding to 0 (since the macro is extracting the value after the first comma): Z_IS_ENABLED3(_XXX0 1, 0, ...) --> 0
And ultimately, the original macro in main.c will result in a compilation error. You can try and see for yourself. Change the DT_N_S_load_switch_EXISTS macro in devicetree_generated.h from a “1” to a “0” and rebuild the application using the following invocation (take note that we’re not performing a pristine build since that will regenerate the header file):
Conclusion
This blog post demonstrated how the application source could use the generated devicetree header files in conjunction with a few header files from The Zephyr Project's core repository to identify the existence of particular nodes during compilation. We observed how the Linux kernel, which makes use of this data during run-time, is different from this. To gain insight into this process, we traced the expansion of certain clever macros using a sample from the Zephyr repository. To verify the anticipated outcomes, we then disabled the node's existence in the devicetree header file that was generated. We will examine in more detail how the Zephyr build infrastructure integrates the devicetree sources and bindings to create the generated devicetree header files in a subsequent blog post.
Understanding and implementing devicetree bindings is crucial for efficient hardware configuration in embedded systems. At Silicon Signals, we specialize in optimizing your hardware and software integration with Zephyr-based projects. Whether you're tackling devicetree bindings or enhancing your embedded system's performance, our team is equipped to support you through the development cycle.
👉 Contact Us Today to get started and take your embedded solutions to the next level with expert hardware design and custom software development!
0 notes
teguhteja · 10 months ago
Text
C++ Selection Operators: Mastering Class Member Access and Header Guards
Dive into C++ Selection Operators! Master #ifndef, #define, member functions, dot operator, pointers, and arrow operator. Boost your C++ skills and write cleaner, more efficient code. #CPP #ProgrammingTips #CodingSkills
C++ selection operators play a crucial role in object-oriented programming, allowing developers to access class members efficiently. In this comprehensive guide, we’ll explore essential C++ concepts including #ifndef, #define, member functions, the dot operator, pointers, and the arrow selection operator. By understanding these fundamental elements, you’ll enhance your ability to write clean,…
0 notes
tinchicus · 2 years ago
Text
C / Preprocessors
Hoy les traigo un tema polemico como son preprocessors, a pesar de haber estado usandolos sin saberlo, espero les sea de utilidad y buen finde!
Bienvenidos sean a este post, hoy veremos como son los preprocessors. En el post anterior vimos como se trabaja verdaderamente con los archivos de encabezado y en este post vimos uno de los comandos llamado preprocessors como fue ifndef y define, si bien hablamos muy superficialmente sobre como eran ellos y en este post vimos como trabajar con define aqui veremos al resto y para que sirven. Los…
Tumblr media
View On WordPress
0 notes
insanethornsabotage · 16 days ago
Text
Best web development course in jalandhar
Tumblr media
Best Web Development Course in Jalandhar: Boost Your Career with Expert Training With the modern digital era, learning web development has become a much-desired skill. Whether you want to develop interactive websites, design interactive user experiences, or create robust web applications, a professional course in web development can guide you towards success. For individuals in Punjab looking to venture into this field, the web development course in Jalandhar provides a great platform to learn from experienced professionals and acquire hands-on training that can make you stand out in the professional arena. Why a Web Development Course? Web development is a growing industry with regular demand from all industries. All businesses, big or small, need websites and web applications to communicate with their audiences effectively. By joining an extensive web development course, you acquire the skills in HTML, CSS, JavaScript, backend stacks, databases, and frameworks that employers seek. These courses also make you learn responsive design, SEO basics, and current industry trends so that you are up to date. What Makes the Web Development Course in Jalandhar Unique? Jalandhar, as an emerging IT hub, is home to numerous training schools, but few offer comprehensive, hands-on learning experiences. The top web development course in Jalandhar is structured to be a blend of theory and hands-on project work, enabling learners to develop actual-world websites and apps from the ground up. The experiential learning strategy enables the learners to develop confidence and refine their problem-solving skills. Here, courses are regularly updated to incorporate the latest web technologies such as React, Angular, Node.js, and so on. Moreover, industry-experienced professional trainers take students through every step, offering one-to-one mentorship and career guidance. Course Curriculum and Covered Skills A standard web development course in Jalandhar encompasses: Frontend Development: HTML5, CSS3, JavaScript, Bootstrap, and frameworks such as React or Angular. Backend Development: Server-side coding with Node.js, PHP, Python, or Java. Database Management: Handling SQL and NoSQL databases using MySQL and MongoDB. Version Control: Utilizing Git and GitHub for collaborative development. Deployment and Hosting: Registering domains, managing hosting services, and launching websites live. Project Work: Real projects to develop portfolios that best demonstrate your abilities to potential employers. Career Opportunities After Completing the Course With the solid groundwork laid by the top web development course in Jalandhar, students can choose to pursue a career as a Frontend Developer, Backend Developer, Full-Stack Developer, UI/UX Designer, or even go on to freelance. The need for talented web developers is immense, both domestically and internationally, making it a promising career path for one who is technology-savvy. Moreover, many training institutes assist with job placements, internships, and interview preparation, boosting your chances of landing a rewarding job. Why TechCADD is a Top Choice for Web Development Training in Jalandhar Among the numerous options, TechCADD is a top training institute that provides a well-designed web development course in Jalandhar. The course curriculum is industry-relevant, emphasis on latest technologies and real-world exposure. The students are provided with flexible class schedules, batch sizes, and post-training support, including clearing doubts and placement services. Final Thoughts Selecting the ideal web development course is important for achieving a successful career in technology. For prospective students in Punjab, enrolling in a well-known web development course in Jalandhar such as the one by TechCADD can speed up learning and provide opportunities for great jobs. Begin today and become a proficient web developer poised to succeed in the digital age.
0 notes
c-official · 9 months ago
Note
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// DESCRIPTION:
// Zone Memory Allocation, perhaps NeXT ObjectiveC inspired.
// Remark: this was the only stuff that, according
// to John Carmack, might have been useful for
// Quake.
//
//---------------------------------------------------------------------
#ifndef __Z_ZONE__
#define __Z_ZONE__
#include <stdio.h>
//
// ZONE MEMORY
// PU - purge tags.
// Tags < 100 are not overwritten until freed.
#define PU_STATIC 1 // static entire execution time
#define PU_SOUND 2 // static while playing
#define PU_MUSIC 3 // static while playing
#define PU_DAVE 4 // anything else Dave wants static
#define PU_LEVEL 50 // static until level exited
#define PU_LEVSPEC 51 // a special thinker in a level
// Tags >= 100 are purgable whenever needed.
#define PU_PURGELEVEL 100
#define PU_CACHE 101
void Z_Init (void);
void* Z_Malloc (int size, int tag, void *ptr);
void Z_Free (void *ptr);
void Z_FreeTags (int lowtag, int hightag);
void Z_DumpHeap (int lowtag, int hightag);
void Z_FileDumpHeap (FILE *f);
void Z_CheckHeap (void);
void Z_ChangeTag2 (void *ptr, int tag);
int Z_FreeMemory (void);
typedef struct memblock_s
{
int size; // including the header and possibly tiny fragments
void** user; // NULL if a free block
int tag; // purgelevel
int id; // should be ZONEID
struct memblock_s* next;
struct memblock_s* prev;
} memblock_t;
//
// This is used to get the local FILE:LINE info from CPP
// prior to really call the function in question.
//
#define Z_ChangeTag(p,t) \
{ \
if (( (memblock_t *)( (byte *)(p) - sizeof(memblock_t)))->id!=0x1d4a11) \
I_Error("Z_CT at "__FILE__":%i",__LINE__); \
Z_ChangeTag2(p,t); \
};
#endif
//-----------------------------------------------------------------------------
Are you trying to run doom on me one ask at a time?
1 note · View note
codeklairvoyant · 2 years ago
Text
Integrate C++ and QML - 4
Access Property, access method and handle signal of C++ Class in QML AppManager code #ifndef APPMANAGER_H #define APPMANAGER_H #include <QObject> class AppManager : public QObject { Q_OBJECT Q_PROPERTY(bool isNightMode READ isNightMode WRITE setIsNightMode NOTIFY isNightModeChanged) public: explicit AppManager(QObject *parent = nullptr); bool isNightMode() const; void setIsNightMode(bool…
View On WordPress
0 notes
axiomfinity · 1 month ago
Text
#ifndef COMPLEXN_H
#define COMPLEXN_H
//2001 protocode
class complexnum {
private :
struct Complex {
float a, b; // REAL part
// solves only one segment of equation at a time
float i; // IMAGINARY part
// results below
float rr; float ri; float xx;
};
Complex mathcplx;
// access recs dunno why i called it an instance :(
int yada; // counter vars yada yada yada yada yada yada
public :
void complex() { init(); }
// --- read states --------------------------------------------------------
float getreal() { return mathcplx.rr; }
float getimag() { return mathcplx.ri; }
float power(float n, int nb);
/* int power(int n, int nb); // this should be in mathobj.h */
// --- change states ------------------------------------------------------
void init(float reala = 0.0, float realb = 0.0, float imagi = 0.0) {
mathcplx.rr = 0.0; mathcplx.ri = 0.0; // init these to zero
mathcplx.a = reala; mathcplx.b = realb; mathcplx.i = imagi; } // init
void conj (float ar, float ai); // manipulate imaginary
void add (float ar, float ai, float br, float bi);
void sub (float ar, float ai, float br, float bi);
void mul (float ar, float ai, float br, float bi);
void div (float ar, float ai, float br, float bi);
}; // --- complexnumber ---------------------------------------------------------------
float complexnum::power(float n, int nb)
{ for (yada=0; yada<(nb+1); yada++) mathcplx.xx = (n * n); return mathcplx.xx; }
void complexnum::conj (float ar, float ai) {
mathcplx.rr = ar;
mathcplx.ri = -ai; }
void complexnum::add (float ar, float ai, float br, float bi) {
mathcplx.rr = ar + br;
mathcplx.ri = ai + bi; }
void complexnum::sub (float ar, float ai, float br, float bi) {
mathcplx.rr = ar - br;
mathcplx.ri = ai - bi; }
void complexnum::mul (float ar, float ai, float br, float bi) {
mathcplx.rr = ar*br - ai*bi;
mathcplx.ri = ar*bi + br*ai; }
void complexnum::div (float ar, float ai, float br, float bi) {
struct Complex c, result, num;
float denom;
conj(br, bi); c.a = getreal(); c.i = getimag();
mul (ar, ai, c.a, c.i); num.a = getreal(); num.i = getimag();
denom = br*br + bi*bi + 1.2e-63; // zero chopping
mathcplx.rr = num.a / denom;
mathcplx.ri = num.i / denom; }
// --- end of complexnum class --------------------------------------------------------
#endif
0 notes
kremlin · 2 years ago
Text
having flashbacks of looking at another bsd devs screen years ago at a hackathon during our libssl rewrite after…whatever that horrible libssl vuln was..
literally not even recognizable as C at first. they created their own weird byzantine convoluted sludge language with preprocessor macros and, my god, after closer inspection the sins they committed were unspeakable. we aren’t talking like #IFNDEF level shenanigans. every preprocessor sin committed at every level severity and in every combination possible. a permutation-complete reference work on how to go to hell.
it would be like building the wallet and grommace bed/breakfast contraption in real life, and then trying it for the first time, dislocating several vertebrae from the bed spring, breaking both legs falling through the floor, hitting your forehead on the table & concussing you, and then getting blasted with superheated porridge that has also started a fire. you yell “help me grommit!!” but it is a normal real life dog.
103 notes · View notes
pictureamoebae · 4 years ago
Note
Hey! I was wondering if you had any advice for me - I'm trying to use the MXAO shader BUT whenever I try to open the 'preprocessor definitions' I press the down arrow next to preprocessor def (under the MXAO effect in home tab) and my game crashes immediately, every time. Is there a way to manually edit these definitions (like in vscode/notepad) maybe? Okay that's it, thanks so much!
Hi there! Yes, you can edit the preprocessor definitions in the files themselves.
Go ahead and open the shader file (it ends with .fx and depending on which one you want to edit will be somewhere in your Shaders folder or one of its subfolders).
For qUINT_mxao.fx, for example, at the top you'll see a section called Preprocessor settings, followed by a bunch of settings that each begin with #ifndef and the name of the definition. This is where you'll find the settings like MXAO_SMOOTHNORMALS and MXAO_ENABLE_IL. You'll see they have a number after them. 0 means it's turned off, 1 means it's turned on. Change it to whichever you need, and save.
You can do this while the game is running. If you play in windowed mode, when you tab back in you'll need to press Reload at the bottom of the ReShade menu. If you play in fullscreen mode, it will automatically reload when you tab back in.
You can actually edit the shaders directly in the ReShade menu too. If you right click on the shader name you'll get a little box with some options in it, and one of them will be Edit source code. Click that and a large window will open that fills your screen, and that's all the shader code - the same thing you see when opening the .fx file in Notepad++ or whatever your preferred program is. I prefer to do it in Notepad++, because old habits die hard and that's how you used to have to make presets back in the day before there was any kind of menu at all! But it's up to you which way you choose.
If you need to edit the Global Preprocessor Definitions manually, open ReShade.ini inside your Bin folder (you need to edit this one with an external editor) and look in the General section. You'll eventually see a line that starts with PreprocessorDefinitions= followed by a bunch of different commands. The one you'll most likely need to change is RESHADE_DEPTH_INPUT_IS_REVERSED=1, changing the 1 to a 0.
11 notes · View notes