Skip to content

Commit 08c58d0

Browse files
committed
improved several references
1 parent 35f75cf commit 08c58d0

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

text/main/basics/simpleDataTypesAndOperations/str/str.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@
445445
The system then knows how to interpret these numbers as characters.
446446
Maybe the most well-known historical mapping is ASCII~\cite{ASA1963ASCII,USAS1967USCFII}, which, however, contained only latin characters, punctuation marks, numbers, and some control characters (like the newline and tab characters we learned when discussing string escaping).
447447
Since different languages use different characters, many different mappings have historically evolved and still exist today.
448-
In China, different mappings specialized to Chinese characters exist additionally, including the historical GB~2312~\cite{GBT23121980PROCNSG21CCECSFIE}, GBK~\cite{TSSL1995CICSNSE}, or the newer GB~18030~\cite{GB180302022ITCCCS}.
448+
In China, different mappings specialized to Chinese characters exist additionally, including the historical GB~2312~\cite{GBT23121980PROCNSG21CCECSFIE}, GBK~\cite{GBK1995CICSNSE}, or the newer GB~18030~\cite{GB180302022ITCCCS}.
449449
Today, the vast majority of computers and systems understand one common standard that covers all languages:
450450
\pgls{unicode}~\cite{TUC2023U1510,TUC2023U151ACS,ISOIEC106462020ITUCCSU}, the most frequently used mapping of characters to numbers.
451451
Therefore, \python\ uses \pgls{unicode} as well\pythonIdx{str!unicode}.

text/main/basics/variables/typesAndTypeHints/typesAndTypeHints.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
%
266266
Finally, it is worth noting that using static type-checkers can even have a positive influence on security aspects of your code, as you can learn in our \citetitle{databases} class~\cite{databases}.
267267
Injection attacks such as \pglspl{SQLi} have been an application security concern for decades.
268-
Such attacks can be prevented if the queries to \dbs\ are never dynamically constructed by the likes of \pglspl{fstring} but instead are always defined as string constants.
268+
Such attacks can be prevented if the queries to \pglspl{db} are never dynamically constructed by the likes of \pglspl{fstring} but instead are always defined as string constants.
269269
\python\ supports the type~\pythonilIdx{LiteralString} for string constants~\cite{PEP675}.
270270
Implementations of the \python\ \db\ \pgls{API}, such as \psycopg~\cite{VDGE2022PPDAFP:ST}, can be annotated to only accept such strings.
271271
Hence, a type checker could detect and complain if you would try to dynamically construct queries, thus preventing \pglspl{SQLi} -- but only if you use it\dots

text/main/controlFlow/loops/loops.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,9 @@
471471
\end{pythonSyntax}
472472
%
473473
\gitPythonAndOutput{\programmingWithPythonCodeRepo}{loops}{while_loop_search.py}{--args format}{loops:while_loop_search}{%
474-
We implement binary search~\cite{K1998SAS,H2024POICBS,B1999PP} using a \pythonilIdx{while} loop with a \pythonilIdx{break} statement.}%
474+
We implement binary search~\cite{K1998SAS,H2024POIC:BS,B1999PP} using a \pythonilIdx{while} loop with a \pythonilIdx{break} statement.}%
475475
%
476-
We now use this construct to implement a binary search~\cite{K1998SAS,H2024POICBS,B1999PP}.
476+
We now use this construct to implement a binary search~\cite{K1998SAS,H2024POIC:BS,B1999PP}.
477477
Binary search works is an algorithm that finds the index of an element in a \emph{sorted} sequence \pythonil{data} of values.
478478
The core concept of binary search is that we consider a segment~$S$ of the list in which the element~$E$ we search may be contained.
479479
In each step of the algorithm, we want to reduce the size of this segment by ruling out the \emph{half} in which~$E$ cannot be.
@@ -483,7 +483,7 @@
483483
If~$M$ is smaller than~$E$, then $E$ must be in the upper half, i.e., in the sub-segment starting right after~$M$ and reaching until the end of~$S$.
484484
Otherwise, we must have found the element.
485485
This means in one step we have effectively halved the size of~$S$.
486-
If~$n=\pythonil{len(data)}$, then we can do this at most $\log_2 n$~times and the time complexity of binary search is in~\bigOb{\log n}~\cite{K1998SAS,H2024POICBS,B1999PP}.%
486+
If~$n=\pythonil{len(data)}$, then we can do this at most $\log_2 n$~times and the time complexity of binary search is in~\bigOb{\log n}~\cite{K1998SAS,H2024POIC:BS,B1999PP}.%
487487
%
488488
\begin{sloppypar}%
489489
In~\cref{lst:loops:while_loop_search}, we want to find the indices of some characters in the alphabetically sorted string~\pythonil{data = "abdfjlmoqsuvwyz"}.
@@ -504,7 +504,7 @@
504504

505505
Inside the binary search loop, we first compute the mid index as \pythonil{mid = (lower + upper) // 2}\footnote{%
506506
Interestingly, this works only because \python~3 has integers of infinite range (see \cref{sec:int}). %
507-
In programming languages like \pgls{C} or \pgls{Java} where integer types have limited ranges, we need to do \pythonil{mid = lower + (upper - lower) // 2}~\cite{H2024POICBS}.%
507+
In programming languages like \pgls{C} or \pgls{Java} where integer types have limited ranges, we need to do \pythonil{mid = lower + (upper - lower) // 2}~\cite{H2024POIC:BS}.%
508508
}.
509509
We obtain the value \pythonil{mid_str} as the single character at that index via \pythonil{mid_str = data[mid]}.
510510

text/main/introduction/whyPython/whyPython.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Indeed, the aforementioned Octoverse report~\cite{GS2024OALPTTLATNOGDS} states that the use in soft computing is one of the drivers of \python's popularity.
2727

2828
Third, there exists a very large set of powerful libraries supporting both research and application development in these fields, including \numpy~\cite{HMvdWGVCWTBSKPHvKBHFdRWPGMSRWAGO2020APWN,N2025N,DBvR2024ITN,J2018NPSCADSAWNSAM}, \pandas~\cite{PD2025P,B2012DPWP,L2024PW}, \scikitlearn~\cite{PVGMTGBPWDVPCBPD2011SMLIP,RLM2022MLWPAS}, \scipy~\cite{VGOHRCBPWBvdWBWMMNJKLCPFMVLPCHQHARPvMS2020SFAFSCIP,J2018NPSCADSAWNSAM}, \tensorflow~\cite{ABCCDDDGIIKLMMMSTVWWYZ2016TASFLSML,L2023TDDBTADMLMWT}, \pytorch~\cite{PGMLBCKLGADKYDRTCSFBC2019PAISHPDLL,RLM2022MLWPAS}, \matplotlib~\cite{HDFDM2012MVWP,H2007MA2GE,P2021HOMLPAVWP,J2018NPSCADSAWNSAM}, \simpy~\cite{Z2024DESIEWS}, and \moptipy~\cite{WW2023RSDEWASSAA}\footnote{Yes, I list \moptipy\ here, next to very well-known and widely-used frameworks, because I am its developer.}, just to name a few.
29-
There are also many \python\ packages supporting other areas of computer science, that offer, e.g., connectivity to \dbs~\cite{VDGE2010P}, or support for web application development~\cite{T2024MFWAAD,A2024FSFAR}.
29+
There are also many \python\ packages supporting other areas of computer science, that offer, e.g., connectivity to \pglspl{db}~\cite{VDGE2010P}, or support for web application development~\cite{T2024MFWAAD,A2024FSFAR}.
3030
This means that for many tasks, you can find suitable and efficient \python\ libraries that support your work.
3131

3232
Fourth and finally, \python\ is very easy to learn~\cite{GPBS2006WCTIPIHSUP,VR1999CPFERPASEFTPOT}.

0 commit comments

Comments
 (0)