Using Circuitikz in Beamer - beamer

I cannot compile a beamer presentation with the circuitikz package. Does anyone know if it is possible, I get an error:
undefined control sequence \usepackage{circuitikz}
Below is my code (simplified version)
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{default}
\usepackage{tikz}
\usepackage{siunitx}
\usepacakge[siunitx]{circuitikz}
\begin{document}
\begin{frame}
\begin{figure}[!htb]
\centering
\begin{circuitikz}[scale = 1.4] \draw
(0,0) node[anchor=east]{$E_{in} -$}
to[short, o-] (4,0)
to[V, v=$E_{emf}(t)$] (4,2)
to[L, l=$L_m$] (3,2)
to[R, l=$R_m$] (1,2) -- (0,2)
to[short, o-] (0,2)
node[anchor=east]{$E_{in} +$};
\end{circuitikz}
\caption{Circuit Diagram of Motor}
\label{fig:basicMotor_wInductor}
\end{figure}
\end{frame}
\end{document}
I could just copy/ paste the image from my report, but I would prefer to include the code in Beamer. Thanks!

it could be that you don't have the latest version of circuitikz....
but before you try to download the newest version try:
\usepackage[siunitx]{circuitikz}
Latest version:
https://code.google.com/p/circuitikz/source/browse/#hg%2Ftex%2Flatex%2Fcircuitikz
Place the files in the same folder as your tex or place the files into your directory...
e.g.: https://en.wikibooks.org/wiki/LaTeX/Packages/Installing_Extra_Packages

When I changed \usepacakge[siunitx]{circuitikz} to \usepackage[siunitx]{circuitikz} your code works for me.

Related

GNU Radio + HackRF: RuntimeError: firdes check failed: 0 < fa <= sampling_freq / 2

I just started using GNU Radio, I must say I am quite a noob but I have some background on RF related stuff.
Here's the thing:
I recorded a file that I now want to repeat through my HackRF and GNU Radio.
This is the exact settings for the filter:
The settings you see are casual (since I cannot get it working I started testing with random values).
This is the error I get:
Executing: /usr/bin/python3 -u /home/scare/LAB/RadioFrequencies/GNU Radio/reply_433.py
gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.2.0
built-in sink types: uhd hackrf bladerf soapy redpitaya file
[INFO] [UHD] linux; GNU C++ version 11.1.0; Boost_107600; UHD_4.0.0.0-0-unknown
Using HackRF One with firmware 2017.02.1
Traceback (most recent call last):
File "/home/scare/LAB/RadioFrequencies/GNU Radio/reply_433.py", line 211, in <module>
main()
File "/home/scare/LAB/RadioFrequencies/GNU Radio/reply_433.py", line 187, in main
tb = top_block_cls()
File "/home/scare/LAB/RadioFrequencies/GNU Radio/reply_433.py", line 137, in __init__
firdes.high_pass(
File "/usr/lib/python3.9/site-packages/gnuradio/filter/filter_swig.py", line 124, in high_pass
return _filter_swig.firdes_high_pass(*args, **kwargs)
RuntimeError: firdes check failed: 0 < fa <= sampling_freq / 2
Done (return code 1)
Where obviously the interesting part is the RuntimeError: firdes check failed: 0 < fa <= sampling_freq / 2
Unfortunately, I don't get what that 'fa' stands for.
Any idea?
Cheers
I just got done solving this same error. The error is caused by a filter's Cut-off and transition parameters being set incorrectly (in my case far too large). GNU radio handles the variable 'samp_rate' differently for each block and filters seem to interpret it was a point to center the filter on (that's my take on it so don't quote me).
I also looked in the source code and can't find anything helpful on 'fa'
So try adjusting your cutoff to be something below samp_rate and make your transition width something to the tune of 250e3. I used GUI sliders to set the filter how I liked and I will make these permanent in the final version.
Screen Cap of Settings Here
Slider Settings For Both Sliders
Mike Ossmann's "SDR with HackRF One, Lesson 10 - Filters helped" me out here. Also just a great SDR lecture series for GNU radio if you haven't come across them yet. (just make sure to use the QT GUI).
I hope this helped. I am pretty new to GNU so sorry if the explanation is a little half-baked.
fa is the cutoff_frequency in the function that is throwing the error message. The cutoff frequency has to be greater than 0 and no more than the Nyquist limit. There are some functions called sanity_check_xxx (xxx being whether one cutoff or 2, i.e. bandpass, and optionally c for complex) around line 750 in gr_filter/lib/firdes.cc in the GNU Radio repository on GitHub.
In the question the samp_rate would need to be at least 800MHz to support a high pass cutoff of 400Mhz. As far as I can tell sample rate is used the same way in these filter functions as anywhere else in GNU Radio.
I ran into the same error message because I used 'firdes.band_passinstead offirdes.complex_band_pass` and the low cutoff was negative, which it should be for the complex band pass filter.

Having trouble compiling scribble document with `#lang scribble/html`

I'm trying to use Scribble (Racket v8.0 [cs]) to generate some HTML using #lang scribble/html and I've reduced my source file to only the lang statement (to isolate other issues):
#lang scribble/html
To run the code I'm using terminal:
% scribble test.scrbl
However, I'm running into the following error during compilation:
dynamic-require: name is not provided
name: 'doc
module: #<resolved-module-path:"/Users/josh/Desktop/blog architecture/00001 article name/test.scrbl">
context...:
.../private/map.rkt:40:19: loop
.../racket/cmdline.rkt:191:51
body of "/Applications/Racket v8.0/share/pkgs/scribble-lib/scribble/run.rkt"
Obviously something is missing - perhaps a require statement? I'm not sure. If you have a better approach to using #lang scribble/html I'm open to that as long as I can use the html tags.
Thank you!
Hello person from 6 months ago! I hope you have solved your problem, but for other travelers here's what worked for me:
Don't use the scribble binary, but directly use the racket executable.
So, instead of:
$ scribble test.scrbl
Do
$ racket test.scrbl
This seemed to work for me with scribble/text, and outputted exactly what I wanted (nothing weirdly processed, nothing "helpfully" escaped - just my text + my racket code executed)

How to add LCOV_EXCL_LINE marker for code coverage in C or C++ code?

I tried two ways to add LCOV_EXCL_LINE in my code.
I add it as comment, compile and generate lcov report but lcov binary takes it as a comment and showing the coverage of excluded line.
Image showing coverage of excluded line:
After compilation and execution I add LCOV_EXCL_LINE before running lcov and genhtml binaries but it results in misalignment after first exclusion.
Image showing misalignment coverage:
You add the comment in the line you want excluded. Not in the line before that you want excluded.
As 1737973 said, you should do something like:
printf("* ") // LCOV_EXCL_LINE
printf("\n") // LCOV_EXCL_LINE

libFuzzer, why only show offset instead of detailed function location

I am new for libFuzzer. Right now, I use it to find the potential bug in one library (myLibrary.a). So, I write test_fuzz.cpp file which calls the function LLVMFuzzerTestOneInput().
I compile test_fuzz.cpp with clang++ flags " -fsanitize=address -fsanitize-coverage=trace-pc-guard -g -o2", and linked with libFuzzer.a myLibrary.a to create the executable App.
The myLibrary.a is pre-built with same compiler flags (clang++).
Run the App, it did hit the heap-use-after-free. But, it reported as below. My question is, why it can only reports offset instead of detailed location (like function name, file name and line number)? The myLibrary.a contents many files which locates in different folders(modules), it is not possible to list all the files one by one and build with test.cpp.
It is hard for me to use offset to figure out which part of codes have bug. Anything I miss here? Thanks for any helps.
==18728==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f0000000c0 at pc 0x00000127884c bp 0x7f7db9decd70 sp 0x7f7db9decd68
READ of size 8 at 0x60f0000000c0 thread T8
#0 0x127884b (/home/workspace/test_fuzz+0x127884b)
#1 0x127aad5 (/home/workspace/test_fuzz+0x127aad5)
#2 0x127acd2 (/home/workspace/test_fuzz+0x127acd2)
#3 0x127e591 (/home/workspace/test_fuzz+0x127e591)
#4 0x12633ac (/home/workspace/test_fuzz+0x12633ac)
#5 0x121efee (/home/workspace/test_fuzz+0x121efee)

Problem with conflict between mysql and math.h

The problem is that the compiler says that there is a redefinition of a function between a library that belongs to MySQL and math.h from the std library.
I have been over this for two days and I still can't figure it out.
Has this ever happened to anyone?
This is the output from the compiler
C:\mingw\bin\mingw32-make.exe all
'Building file: ../src/interfaz/ventanaconf.cpp'
'Invoking: GCC C++ Compiler'
C:\mingw\bin\mingw32-g++.exe -mms-bitfields -I"c:\dev-cpp\gtkmm\include\gtkmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\gtkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\glibmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\glibmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\gdkmm-2.4"
-I"c:\dev-cpp\gtkmm\lib\gdkmm-2.4\include" -I"c:\dev-cpp\gtkmm\include\pangomm-1.4"
-I"c:\dev-cpp\gtkmm\include\atkmm-1.6" -I"c:\dev-cpp\gtkmm\include\sigc++-2.0"
-I"c:\dev-cpp\gtkmm\lib\sigc++-2.0\include" -I"c:\dev-cpp\gtkmm\include\cairomm-1.0"
-I"c:\gtk\include\gtk-2.0"
-I"c:\gtk\include\glib-2.0"
-I"c:\gtk\lib\glib-2.0\include"
-I"c:\gtk\lib\gtk-2.0\include"
-I"c:\gtk\include\pango-1.0"
-I"c:\gtk\include\cairo"
-I"c:\gtk\include\freetype2"
-I"c:\gtk\include"
-I"c:\gtk\include\atk-1.0"
-I"c:\Archivos de programa\MySQL\MySQL Server 5.0\include"
-O0 -g3 -w -c -fmessage-length=0 -MMD -MP -MF"src/interfaz/ventanaconf.d"
-MT"src/interfaz/ventanaconf.d"
-o"src/interfaz/ventanaconf.o" "../src/interfaz/ventanaconf.cpp"
In file included from c:/Archivos de programa/MySQL/MySQL Server 5.0/include/my_global.h:73,
from ../src/interfaz/../gestiondb/gestordb.h:6,
from ../src/interfaz/../gestiondb/operacionesdb.h:5,
from ../src/interfaz/ventanamodulos.h:20,
from ../src/interfaz/ventanaconf.h:27,
from ../src/interfaz/ventanaconf.cpp:1:
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h: **In function `double rint(double)':
c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h:228: error: redefinition of `double rint(double)'
C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h:620: **error: `double rint(double)' previously defined here**
C:\mingw\bin\mingw32-make.exe: *** [src/interfaz/ventanaconf.o] Error 1**
Thanks in advance!!!
This thread in the mysql support area seems to indicate that they've taken the definition of rint() out of their config_win.h file as of April this year (even though the patch was proposed in 2006). Are you using a version of the MySQL source newer than that?
The problem was about an included library, which linux simply ignores, but windows want out. There is no problem letting it out in linux neither...
Somedays i feel SOOOOOOOOOOOOOOOOOOOOOOO STUPID:..
In line 228 of c:/Archivos de programa/MySQL/MySQL Server 5.0/include/config-win.h you should find a declaration/definition of function named "rint". In line 620 of C:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/math.h you should find another definition of a function with the same name (which probably even does the same).
To solve the problem you will have to delete/outcomment/undefine one of these definitions.
Be prepared to get a similar problem when linking, if you also link two libraries with the same function.