Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
120 views

Is it possible in C# to have the string formatting of an interpolated string to be performed only if it is required? Take the following example code: public class Program { private static bool ...
bgh's user avatar
  • 2,200
1 vote
0 answers
104 views

PROBLEM I am trying to put together a short demonstration of a simple hack for a presentation about cyber-security. I thought about using a format string vulnerability, and heavily inspired by this ...
arg_arthur's user avatar
1 vote
0 answers
203 views

I'm working on a challenge that requires me to overwrite a memory address with a libc address, which is usually around 48 bits. I can write a 32-bit number into an address but with anything larger ...
john's user avatar
  • 11
3 votes
1 answer
130 views

According to the C Standard, the signature of printf() is: int printf(const char * restrict format, ...); As I understand, the meaning of the restrict is that format will be the only reference to the ...
CPlus's user avatar
  • 5,110
1 vote
2 answers
142 views

scanf is supposed to consume and discard any character in the format string that is not part of a conversion specifier. But its behavior seems different when a non-whitespace, non-conversion ...
Amittai Aviram's user avatar
3 votes
4 answers
790 views

I'm willing to print a size_t value using the %zu format specifier in my format string, however, I always get "zu" as an output, rather than the actual value in my size_t variable: size_t ...
kokopelli's user avatar
  • 372
0 votes
0 answers
113 views

Let's say a format string is given as export_%05u.png, we can create a full string in python by supplying an integer like this s = "export_%05u.png"%1. But If we have the format string and ...
Appaji Chintimi's user avatar
0 votes
3 answers
222 views

I have a specific format string and the result looks like that X5Y9 Z : true X1Y20 Z : true X35Y2 Z : true X20Y99 Z : true X01Y05 Z : false X2Y09 Z : false X77Y08 Z : false X05Y9 Z : false ...
Brian Crist's user avatar
-1 votes
2 answers
184 views

Type entryEntityType = entry.Entity.GetType(); string tableName = GetTableName(entryEntityType); string primaryKeyName = GetPrimaryKeyName(entryEntityType); string deletequery = string.Format("...
Radha's user avatar
  • 81
0 votes
1 answer
1k views

I have a string (sql query) in which I want to pass a variable at one point, then pass another variable at another point (list of variables, but just focusing on one for now). The expected would be ...
EAA's user avatar
  • 87
2 votes
1 answer
57 views

CL-USER> (progn (format t "abc~%") (format t "~&abc")) abc abc NIL CL-USER> My guess is: An ostream descriptor always stores the latest char sent ...
shynur's user avatar
  • 505
1 vote
1 answer
345 views

I have a Pyspark DataFrame looking like this : sdf1 = sc.parallelize([["toto", "tata", ["table", "column"], "SELECT {1} FROM {0}"], "titi", &...
Fred's user avatar
  • 13
-1 votes
1 answer
246 views

Trying to understand the output of the following code: 1 #!/usr/bin/python3 2 3 from os.path import exists 4 5 filename = input("What file do you want to erase?: ") 6 7 check =...
RTGho's user avatar
  • 3
0 votes
1 answer
97 views

I have a python string like this: expression = "test[1]" var1 = "{%s}" % expression str1 = f"{var1}" print(str1.format(test="world")) I can only change the ...
Bob5421's user avatar
  • 9,353
1 vote
1 answer
952 views

consider the following code: #include <stdio.h> #include <string.h> #include <stdlib.h> void vuln(char *user_input) { char buf[128]; strcpy(buf, user_input); printf(buf)...
Alexander Lee's user avatar
2 votes
2 answers
498 views

I have a C program that output values to stdout from measure. I use printf to display them and the format allows me to change the precision printf("Scan=%d S_0=%.5f S_1=%.5f S_2=%.5f S_3=%.5f&...
Apo's user avatar
  • 348
1 vote
0 answers
128 views

Let's consider the functions below: void func2(void) { . . . exit(1); } void func1(void) { char buf[512]; fgets(buf, 512, stdin); printf(buf); exit(1); } int main(...
Glitch's user avatar
  • 406
2 votes
3 answers
3k views

Goal: Print variable number of bytes using a single format specifier. Environment: x86-64 Ubuntu 20.04.3 LTS running in VM on an x86-64 host machine. Example: Let %kmagic be the format specifier I am ...
iMrFelix's user avatar
  • 345
0 votes
1 answer
819 views

I'm using the MousePosition control to show the mouse coordinates as it moves but I'm showing an output similar to this: '7.85, 47.98' but I wanted an output like this: '47° 58′ 60.0″ N 7° 50′ 60.0 &...
Yuri Furtado's user avatar
1 vote
1 answer
116 views

The numbers that I import from an sql database on google sheet are interpreted as duration and not as numbers, more specifically as currencies. colA colB colC colD 449 1234 29521.00 0.00 449 1234 ...
user avatar
-1 votes
1 answer
191 views

I'm a newbie to C programming and I've found this strange behaviour while using the following placeholders specification in the function printf's argument. I get two different results while using an ...
Valerio Giovannini's user avatar
-1 votes
2 answers
2k views

Given the following code snippet package main import ( "fmt" ) type Message string const ( ConnectRepositoryError Message = "failed to connect %s repository" ) func ...
j3d's user avatar
  • 9,822
-1 votes
1 answer
606 views

Maybe I'm confusing something but I can't figure out if there is a way to format a TimeSpan that has a value such as: 4.21:02:00 as 117 hours, 2 minutes (change full days to hours) I have done it ...
Paweł Swajdo's user avatar
1 vote
1 answer
1k views

I have this code where I am trying to prompt the user to input a path for a file and depending on the title of the file, it would rename it accordingly. This is what I have so far: import os path = ...
WaddyBox's user avatar
0 votes
2 answers
779 views

I need a function that behaves similar to the behavior of sscanf For example, let's suppose we have a format string that looks like this (the function I'm looking for doesn't have to be exactly like ...
Ruiqi Li's user avatar
  • 197

1
2 3 4 5