Compare commits
10 Commits
8812ea5162
...
1ca1cc8d27
Author | SHA1 | Date | |
---|---|---|---|
1ca1cc8d27 | |||
fcdcfba6bb | |||
|
82e45def99 | ||
14d09d7bf1 | |||
ca8147fe3c | |||
f69d1ef8f4 | |||
c7b5ea40cc | |||
8829b7d245 | |||
bcd69034f3 | |||
8f4bcda542 |
11
Makefile
11
Makefile
@ -1,10 +1,10 @@
|
||||
OUTPUT_DIR=./output
|
||||
WEB_ROOT=/var/www/themusicinnoise.net/main
|
||||
|
||||
.PHONY: all pages blog sync clean
|
||||
.PHONY: all pages blog clean install
|
||||
|
||||
all: pages blog
|
||||
cp -r static/* $(OUTPUT_DIR)
|
||||
#cp nicolas@ortegas.org_pub.asc style.css favicon.png profile.png $(OUTPUT_DIR)
|
||||
|
||||
pages:
|
||||
mkdir -p $(OUTPUT_DIR)
|
||||
@ -17,10 +17,11 @@ blog:
|
||||
cat blog/templates/index.html/footer-part.html templates/page/footer.html > blog/templates/index.html/footer.html
|
||||
find blog/posts -type f -name '*.cfg' -print0 | sort -zr | xargs -0 saait -o $(OUTPUT_DIR)/blog/ -t blog/templates/
|
||||
|
||||
sync: all
|
||||
rsync -avz --delete $(OUTPUT_DIR)/ nicolas@192.168.1.141::tmin-site
|
||||
|
||||
clean:
|
||||
rm -rf $(OUTPUT_DIR)
|
||||
rm -f blog/templates/index.html/header.html
|
||||
rm -f blog/templates/index.html/footer.html
|
||||
|
||||
install: all
|
||||
mkdir -p $(WEB_ROOT)
|
||||
cp -r $(OUTPUT_DIR)/* $(WEB_ROOT)/
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
<p>We must also recognize that God is looking at a much larger picture than we are. Whereas an evil may have significant negative consequences for us here today, God may have planned to derive good from this evil 500 years from now. What's more, because God is beyond both space and time, He knows the outcome of everything that happens, and knows how we will freely choose to react to it. As such, it is impossible to disprove, even, that God has this capability! For in order to do this, one would have to be omniscient and omnipresent, i.e. God.</p>
|
||||
|
||||
<p>Now, back when I was an Atheist I enjoyed watching a YouTube channel called <i>Darkmatter2525</i>. The creator makes fun animations where he attempts to debunk religion, primarily Christianity - although I've seen him do videos on Islam as well. One of his videos, titled <i><a href="https://invidio.us/watch?v=XUhIvqWyrPM" target="_blank" >If God Answered Prayers</a></i> is ironically a great video explaining butterfly theory such that one can easily see how God can permit evils and still derive good from them 'down the daisy chain'. The video gives the scenario of a little girl who asks god for a kitten. God does not comply and explains to his angel, Jeffrey, how the eventual consequence of giving that girl a kitten would cause a person vital for preventing the Third World War to never exist. As such, by not giving the little girl the kitten, god leaves way for a person to be born who will prevent a world-ending catastrophe.</p>
|
||||
<p>Now, back when I was an Atheist I enjoyed watching a YouTube channel called <i>Darkmatter2525</i>. The creator makes fun animations where he attempts to debunk religion, primarily Christianity - although I've seen him do videos on Islam as well. One of his videos, titled <i><a href="https://yewtu.be/watch?v=XUhIvqWyrPM" target="_blank" >If God Answered Prayers</a></i> is ironically a great video explaining butterfly theory such that one can easily see how God can permit evils and still derive good from them 'down the daisy chain'. The video gives the scenario of a little girl who asks god for a kitten. God does not comply and explains to his angel, Jeffrey, how the eventual consequence of giving that girl a kitten would cause a person vital for preventing the Third World War to never exist. As such, by not giving the little girl the kitten, god leaves way for a person to be born who will prevent a world-ending catastrophe.</p>
|
||||
|
||||
<p>Now, the video has its issues, and obviously was not made with the intention of providing a solution to the problem of evil. His intention is instead to argue that God <i>never</i> answers prayers. He tries to argue that because granting even the smallest prayer would have such massive consequences for His plan, that it would be implausible or incredible for God to account for it. This, of course, is simply the fallacy of personal incredulity. God is beyond space and time, it is not as though He had a deadline by which He had to finish His divine plan. The second argument he makes is the typical argument that God cannot have a divine plan and allow us free will. Of course, there are some Christian denominations that have chosen one or the other, but Catholics know both from Sacred Scripture and from Sacred Tradition and the Magisterium of the Church that both can and do coexist. There are many ways to skin this cat, but my preferred method is to give an example that's closer to us. I'm fairly certain that there is someone in your life that you know very well. So well, in fact, that you can predict how they will react to certain stimuli. Yet, the ability to know their reaction does not mean they are without free will. Now, if we are to consider God who not only created you, but was also present at all moments of your life and knows you even better than you know yourself, would it be surprising if God were to know exactly how you will respond to certain stimuli from your environment? Add to this the dimension that God is beyond both space and (more importantly) time, and we can see how God already knows what you will choose out of your own free will.</p>
|
||||
|
||||
|
5
blog/posts/0157-in-out-parameters.cfg
Normal file
5
blog/posts/0157-in-out-parameters.cfg
Normal file
@ -0,0 +1,5 @@
|
||||
filename = 2023-03-14-in-out-parameters.html
|
||||
title = In- and Out-Parameters
|
||||
description = A sort of half-rant of mine on the sloppy use of references and pointers as parameters in C and C++ code.
|
||||
created = 2023-03-14
|
||||
updated = 2023-03-14
|
105
blog/posts/0157-in-out-parameters.html
Normal file
105
blog/posts/0157-in-out-parameters.html
Normal file
@ -0,0 +1,105 @@
|
||||
<p>
|
||||
So at work I have to deal with a codebase that works with C and C++. In the part
|
||||
of the code that is C++ specifically I'll often find lots of reference
|
||||
parameters in functions. This is something great and good for objects, since
|
||||
passing lots of information by copy is extremely inefficient, but there is one
|
||||
thing that is extremely bothersome: not knowing which parameters are
|
||||
in-parameters and which are out-parameters.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In case you're not familiar with this concept of in- and out-parameters, this is
|
||||
something very common in the world of C and C++, but more from C. If you've ever
|
||||
done any programming (or mathematics) you probably already know what an
|
||||
in-parameter is: it's the parameter that serves as input for the function to do
|
||||
what it needs to do. But there are cases where you may want a parameter not to
|
||||
input something, but to output something. The idea is if you need to return an
|
||||
object from your function, but you also want to return an integer code if
|
||||
there's an error - or whatever other example you can think of, this just came to
|
||||
my mind. In such a case you may have something like this:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<code>
|
||||
int init_obj(struct object *obj) { /* init object */ }<br />
|
||||
...<br />
|
||||
struct object obj;<br />
|
||||
int res = init_obj(&obj);<br />
|
||||
if (res < 0) { /* handle error */ }
|
||||
</code>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
In this example, we want to initialize our structure object statically, so we
|
||||
pass a pointer to it (<code>&obj</code>) so it can be modified. Therefore we
|
||||
cannot simply return the object, or if we did it might be costly since the
|
||||
compiler might try to make a copy - leave arguments about compiler optimization
|
||||
for another time. But also we want to know if this operation failed, and to have
|
||||
an error code in the case that it does (in this case the code being less than
|
||||
zero). Therefore, in this example, the <code>obj</code> parameter of the
|
||||
<code>init_obj</code> function is an out-parameter.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
These are extremely useful in C and even C++. What's more, in C++ they have
|
||||
these wonderful things called <em>reference parameters</em>, which are great
|
||||
because you don't have to deal with the pesky pointer syntax, and you basically
|
||||
treat them like any other variable - the obvious downside being you may forget
|
||||
you're actually dealing with memory that isn't yours. I use them a lot at work,
|
||||
as will any good C/C++ programmer. But there's one problem: when pointers &
|
||||
references are used, but nowhere is it clarified whether they are in- or
|
||||
out-parameters.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Imagine you're reading through some code and you come across a function with a
|
||||
few different references in its parameters - or pointers, same thing. You look
|
||||
at the parameter names, but they seem completely undescriptive. You check to see
|
||||
if maybe you can discern something from the function name or the type definition
|
||||
of the parameters... No, there's nothing. You think: "Okay, maybe I can just
|
||||
read the function and figure this out." Only then you realize the function is
|
||||
some 1000+ lines long. You check to see if someone wrote a comment at the head
|
||||
of the function or its declaration, but no cigar, because if there's one thing
|
||||
programmers hate it's documenting their code (or someone else's for that
|
||||
matter).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There are technically three solutions to this problem... Well, three solutions
|
||||
<em>you</em> can implement in good practice to avoid someone (like yourself)
|
||||
falling into this problem. And they aren't mutually exclusive, you could do all
|
||||
three.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The first is the most obvious: document your code! Yes, I know, it's hard. I
|
||||
probably don't do it as often as I should either. (Who does?) But it's really
|
||||
the easiest thing to do. Just write a small header to the function saying what
|
||||
the function does, what each parameter is for, and what are the possible return
|
||||
values. Should only take you less than a minute.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The second is perhaps easier than the first, and if you're into the philosophy
|
||||
of "The Code Should Document Itself" then this is probably your way to go:
|
||||
prepend the keywords <code>in_</code> and <code>out_</code> to each reference
|
||||
parameter. It's simple, it's descriptive, and the next developer (or you in a
|
||||
week) knows what they're doing with the function.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The third and final solution, which is truly my personal favorite because it
|
||||
also gives optimization benefits: make all in-parameters constant. Seriously,
|
||||
it's C/C++ efficiency 101 that when you have a parameter that is a
|
||||
pointer/reference that you won't be modifying you make it <code>const</code>.
|
||||
You may think this is less effective than the previous two strategies - and at
|
||||
least compared to the first it is -, but considering how modern editors/IDEs
|
||||
work, they generally show you the kind of parameter which is required as you're
|
||||
filling in the function call, and even if you mess up, the linter will notice
|
||||
you're trying to modify a constant parameter and it will yell at you.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Well, there you go. No more excuses. Now you can continue to write good C/C++
|
||||
code like a boss, but without creating headaches for some poor future developer.
|
||||
</p>
|
@ -4,51 +4,39 @@
|
||||
title="Profile picture."
|
||||
id="profile" />
|
||||
|
||||
<h2>Who Am I?</h2>
|
||||
<p>I'm a Spanish-American, living in Seville, Spain. I'm fluent in English and
|
||||
Spanish, with a decent proficiency in Portuguese and Esperanto. My interests
|
||||
(and therefore the content of this website) are very diverse, e.g. computer
|
||||
engineering, music composition, (Catholic) religion, language learning, etc.</p>
|
||||
<p>
|
||||
The Music in Noise is my personal website. From here you can access pretty much
|
||||
all my works. The name of the website comes from my (musical) artistic alias -
|
||||
which honestly I don't really use anymore. I'm a Spanish-American, living in
|
||||
Seville, Spain. I'm fluent in English and Spanish, with some proficiency in
|
||||
Portuguese and Esperanto.
|
||||
</p>
|
||||
|
||||
<h2>What's My Experience?</h2>
|
||||
<h3>SARUS</h3>
|
||||
<p><a href="http://sarus.es/" >Website</a></p>
|
||||
<p>For a few years I've been helping the <i>Servicio de Asistencia Religiosa de
|
||||
la Universidad de Sevilla</i> to maintain and update their website, as well
|
||||
as serving as general tech support for the university chaplain. I've also led
|
||||
various activities, including some Bible study sessions on the epistles of Saint
|
||||
Paul the Apostle. This is also the association that gave me catechesis for my
|
||||
Confirmation.</p>
|
||||
<p>
|
||||
I'm a Roman Catholic, and I take much interest in my faith. Many of my blog
|
||||
posts tend to be related to Catholicism; whether it be general theology,
|
||||
apologetics, or simply my personal opinion on certain matters.
|
||||
</p>
|
||||
|
||||
<h3>DMUX</h3>
|
||||
<p><a href="https://gitlab.com/CollectiveTyranny" >
|
||||
GitLab
|
||||
</a></p>
|
||||
<p>For a year I was working with
|
||||
<a href="https://bkeys.org" >Brigham Keys</a> to develop a 3D
|
||||
derby-style shooter game in C++. The project did not end up
|
||||
working out, due to a variety of factors, but it remains one of
|
||||
the most rigorous projects I've ever worked on in collaboration
|
||||
with a team. We used modern C++, extensively exploited the
|
||||
Standard Template Library, developed a complex build system
|
||||
using CMake, and even had to dig up an old code base to
|
||||
interface with two different libraries (Irrlicht and Bullet
|
||||
Physics).</p>
|
||||
<p>
|
||||
I also publish some techy content, as one of my hobbies is computers - low-level
|
||||
computing in particular. I also work as a Junior C++ Developer at Zevenet. My
|
||||
favorite computer programming languages are C and C++, although I've recently
|
||||
does some dabbling in Rust.
|
||||
</p>
|
||||
|
||||
<h3>Private English Lessons</h3>
|
||||
<p>For a couple years now I've been giving private English
|
||||
lessons to some of my neighbors, as well as in-person
|
||||
conversations with people I know. I work hard to make sure that
|
||||
their English improves, primarily focusing on recurring
|
||||
mistakes. I've worked with children as well as adults, helping
|
||||
them to attain a better degree of English fluency.</p>
|
||||
<p>
|
||||
There's also some music available here... but I haven't really done any new
|
||||
songs since 2016. It's something I've (regrettably) not been able to spend a lot
|
||||
of time on.
|
||||
</p>
|
||||
|
||||
<h3>Conservation Corps. Minnesota</h3>
|
||||
<p><a href="https://conservationcorps.org/" >
|
||||
Website
|
||||
</a></p>
|
||||
<p>I worked for a summer as a youth crew member. We lived with
|
||||
our crew members for the duration of the job, and worked in
|
||||
various national parks and lake access points. Our work was
|
||||
primarily trail construction, removal of invasive species, and
|
||||
clearing of lake access points.</p>
|
||||
<p>
|
||||
There are other things available on this site, but it's basically just
|
||||
miscellaneous stuff. If you find something you like, good for you. If you don't,
|
||||
then I'm glad you stopped by.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Happy hacking, and God bless you!
|
||||
</p>
|
||||
|
BIN
static/docs/resume_en.pdf
Normal file
BIN
static/docs/resume_en.pdf
Normal file
Binary file not shown.
BIN
static/docs/resume_es.pdf
Normal file
BIN
static/docs/resume_es.pdf
Normal file
Binary file not shown.
@ -3,6 +3,10 @@
|
||||
<p><a href="http://ft2bvxji6lxfttqcjz6ed3iyzdhv4gbcdl2bt7cdxguk56xsvdkqnbid.onion/" >Onion Address</a>
|
||||
-
|
||||
<a href="https://themusicinnoise.net/" >Clear-Net</a></p>
|
||||
<p>
|
||||
Résumé: <a href="/docs/resume_en.pdf" >EN</a>,
|
||||
<a href="/docs/resume_es.pdf" >ES</a>
|
||||
</p>
|
||||
<p>Copyright © 2016-${copyyear} Nicolás A. Ortega Froysa<br />
|
||||
This document is licensed under the
|
||||
<a href="https://creativecommons.org/licenses/by-nd/4.0/" >CC-BY-ND 4.0 License</a>.</p>
|
||||
|
Loading…
Reference in New Issue
Block a user