Quantcast
Channel: User arminb - Stack Overflow
Browsing index pages (40 articles)

PHP MySQLi Error Handling 1062 duplicate key entry

How can I elegantly catch the column name(s) a 1062 error code (duplicate key entry) occurred on?When I do:$db = @new mysqli('localhost', 'root', '******', 'database');$pstmt = $db->prepare("INSERT...

View Article


RS232 Serial Pin Read in C in Linux

Ist there any possibility to read values from the pins of the COM Port? Any solution in C under Linux is appreciated!

View Article


Answer by arminb for getting value from void function with printf

You are assigning return value of m() to k. Since m() has no return value undefined behaviour will be visible, so there will be "garbage" in k (in this case: 5).

View Article

GraphViz Dot very long duration of generation

I have a tree structure I want to be generated by Dot. Each node has 4 edges to another 4 nodes. In sum there are about 1,000 nodes. If I try to generate it with Dot it takes a very long time (once I...

View Article

Why is GCC 11 compiler producing weird output when optimization is enabled?

Please take a look at this code:#include <stdio.h>#include <stdint.h>int main(){ uint8_t run = 1; /* Define variable of interest and set to random value */ uint32_t dwTime = 0xdeadc0de; /*...

View Article


Write HEX values to file in Windows batch

In Linux we can doecho -n -e '\x66\x6f\x6f'> test.txtto write HEX values to a file.How can this be done simply in Windows batch?

View Article

How to trigger pynput's GlobalHotkeys when all of the keys are released?

With pynput we can listen for global hotkeys like this:from pynput import keyboarddef on_activate_i(): print('<ctrl>+<alt>+i pressed')with...

View Article

Answer by arminb for Is checking the return value of printf important?

Not checking a return value is considered bad practice. BUT it is considered clean, if you explicitly state that you ignore the return value by adding (void) in front of the function call:(void)...

View Article


Answer by arminb for CCID protocol command types

The official CCID specification: LinkAlso helpful document (not public available): ISO 7816-3

View Article


Looking for source code of __builtin_avr_delay_cycles called by _delay_ms in...

I was investigating the delay_ms function of avr-gcc. In delay.h I found its definition:void _delay_ms(double __ms){ double __tmp ;#if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \...

View Article

Can we tell the browser to set a specific header field?

Can we tell the web browser to set a specific header? I want the web browser to fetch a token from an authentication site. The browser then should set the acquired token in its header...

View Article

bash: xargs passing variable

How can a global script variable be passed to the command of xargs? I tried it this way:TEST=hallo2echo "hallo" | xargs sh -c 'echo passed=$1 test=$TEST' shOutput:passed=hallo test=I know I could use...

View Article

Answer by arminb for Substitutes for OSR Driver Loader (windows kernel driver )

Peter_Viscarola's comment from OSR community:Right now, you can't. We're in the process of trying to determine what to do with these hideously old, legacy, utilities. We haven't touched them in years...

View Article


Answer by arminb for LoRa: application layer receiving fragmented packets for...

I am not familiar with the Ebyte ttl-1w-433 module but it uses the Semtech SX1276 chip. The SX1276 has a register RegPayloadLength (see SX1272 datasheet, page 114) which defines the payload length....

View Article

How to obtain SCARD_ATTR_DEVICE_UNIT correctly

I am developing a smartcard UMDF windows driver. I would like to achieve following behaviour:When listing all connected readers by using API call SCardListReaders I want to retrieve the correct...

View Article


Using Data Annotations for SQLite in Entity Framework Core

I am using the Entity Framework Core to interface my SQLite database. I want to set a minimum and maximum range for the field ExitSide in my model Station:using...

View Article

Answer by arminb for Single channel gateway only detect first message

This sounds like your transmitter sends the messages using frequency-hopping, while your receiver does not handle it correctly (or the other way around).Definition of frequency-hopping found in chapter...

View Article


Image may be NSFW.
Clik here to view.

Answer by arminb for What's mean 10B payload?

Semtech provides a calcualtor for its LoRa chip SX1272. When you fill in the parameters to the calculator from the example (LoRa for the Internet of Things):To give an example we assume SF12, BW125,...

View Article

Answer by arminb for Can't Download Full File in Python

First of all http://www.nmgncp.com/dark-wallpaper-1920x1080.html is an HTML document. Second when you try to download an image by direct URL (like:...

View Article

Answer by arminb for Add a hyperlink only to one column of a table

Add a counter to you inner loop:$counter = 0;foreach ( $value as $a ){ $url = get_template_directory_uri(); if ($counter == 1) { echo '<td><a href="'.$url.'/folder/' . $a . '">'....

View Article
Browsing index pages (40 articles)


Latest Images