Skip to content
AngularFixing

AngularFixing

Just another Dev Community!

  • All Questions
  • Angular
  • AngularJS
  • CSS
  • HTML
  • Ionic
  • Javascript
  • Node.js
  • NPM
  • Typescript

Tag: c

November 28, 2022 Angular

OpenMP tasks execution time varies depending on where I put the pragmas

Issue I’m trying to parallelize some code using OpenMP (and MPI) using tasks. I have the following code: double t_copy = 0, t_forward = 0, t_backward = 0, t_diag = 0; void pc_ssor_poisson3d(int N, void *data, double *restrict Ax, double

Continue reading
November 18, 2022 Angular

error logging in c – linux environment

Issue I have been reading about how to keep error/warning logs of a C program on Linux environment. Is it better to write the errno to a file as it is done here or is it better to use syslog

Continue reading
November 14, 2022 Angular

Longpolling with WinAPI's InternetReadFile()

Issue I’m writing a cross platform app. I need to get data from a longpoll url. On Mac/Linux I can use curl, curl_easy_perform() takes care of everything automatically. On Windows I have to use native api. The code below works

Continue reading
November 8, 2022 Angular

How to arrange the data of a .txt file for correspond with each value of the other data in C

Issue My problem is this I have a txt file name file.txt with the data. I need to input this for do some calculations,this how the code run: Please enter input file name file.txt File file.txt STUDENT NAME STUDENT NO.

Continue reading
September 27, 2022 Angular

How do I put my custom syntax highlighting in .vimrc?

Issue I use a shorthand form for the basic C/C++ types and I want Vim to syntax highlight them. I added syn keyword cType u8 s8 u16 s16 u32 s32 u64 s64 f32 f64 byte to my .vimrc, but that

Continue reading
September 26, 2022 Angular

How to change the syntax highlight color in GNU Enscript?

Issue GNU Enscript is a free replacement for Adobe enscript program, and I downloaded it for syntax highlighting and *.ps output, but can I change the default color model? I found that there is a file named c.st in /usr/share/enscript,

Continue reading
September 23, 2022 Angular

New and Delete Operator?

Issue What i’m asking now is, what does the delete and new operator do in C? I asked this question, when I was just simply thinking about how to allocate memory in C++, and I remembered you use the new

Continue reading
September 23, 2022 Angular

Turn off vim syntax highlighting inside C++ comments

Issue I recently downloaded vim 8.0. I don’t know if I messed something up or a default changed, but in this code… int foo() { // This is a comment containing a “string” and the number 5. return 42; }

Continue reading
September 21, 2022 Angular

How to run command automatically for every new file opened in Vim

Issue I have to edit a bunch of files in a programming language that has C-like syntax (and which may or may not be used only within the confines of my university). To get syntax highlighting without going through the

Continue reading
September 15, 2022 Angular

Nano syntax highlighting in Mac OS X 10.7 (Lion)?

Issue How to enable syntax highlighting for nano in Mac OS X 10.7 (Lion)? According to what I found so far on Google is that it has got to do with /.nanorc file. I have no idea how to get

Continue reading
September 4, 2022 Angular

Override a function call in C

Issue I want to override certain function calls to various APIs for the sake of logging the calls, but I also might want to manipulate data before it is sent to the actual function. For example, say I use a

Continue reading
September 3, 2022 Angular

Is it possible to override C syscall open without LD_PRELOAD?

Issue The source gets printed, but no open: or open64: gets printed. How to fix this? Thanks! /* gcc -o emload emload.c -ldl ./emload */ // emload.c #define _GNU_SOURCE #include <stdio.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <dlfcn.h> #include

Continue reading
September 2, 2022 Angular

Is it possible to overload operators in C?

Issue Is it possible to overload operators (such as operators of comparison) in C? If so, how do you do it? I did a quick search, but all I found was for C++, and what I want is for C.

Continue reading
August 31, 2022 Angular

STB Image Writing JPEG Incorrectly

Issue i was working on my pixel art editor in C/C++ which was a fork of sixel till then saving the image as jpeg worked completely fine until i re-wrote my application to use SDL2 (so i don’t have to

Continue reading
August 24, 2022 Angular

Is it safe to call a function after casting it to a void return type?

Issue I have a function that returns a value. Is it safe to cast it to a function pointer type that returns nothing (void) and then call it? Does the C standard give enough guarantees to make this safe on

Continue reading
August 24, 2022 Angular

Function pointer assignement and typecast

Issue I wanted to test a my idea about function pointers. I wrote a test but it doesn’t work(causes a Segmentation fault). Here is my test simplified: #include<stdlib.h> void a(){} void b(){} int main(){ size_t s=0; char* p1=(char*)&a; char* p2=(char*)&b;

Continue reading
August 24, 2022 Angular

Function pointer assignement and typecast

Issue I wanted to test a my idea about function pointers. I wrote a test but it doesn’t work(causes a Segmentation fault). Here is my test simplified: #include<stdlib.h> void a(){} void b(){} int main(){ size_t s=0; char* p1=(char*)&a; char* p2=(char*)&b;

Continue reading
August 24, 2022 Angular

Casting struct into int

Issue Is there a clean way of casting a struct into an uint64_t or any other int, given that struct in <= to the sizeof int? The only thing I can think of is only an ‘ok’ solution – to

Continue reading
August 21, 2022 Angular

Encoding QR data as PNG using C and stb_image_write

Issue im trying to render QR to image (png, svg) using QR-Code-generator-1.8.0 and stb_image_write, i follow the example on demo example and generate the QR correctly but very small and i dont know how to scale it, i suppose must

Continue reading
July 25, 2022 Angular

C – extern, static, include

Issue Scoping in C is confusing as hell. I have a variable: “int qwe”. This var should be visible in one or more files – f1.c in this case, but not the another f2.c . Say i have: main.c, f1.c,

Continue reading
July 25, 2022 Angular

Scoping rules for struct variables in GCC

Issue Consider the following C program #include <stdio.h> typedef struct s { int x; } s_t; int main() { int x; s_t a; scanf(“%d”, &x); if (x > 0) { s_t a; a.x = x; } printf(“%d\n”, a.x); } The

Continue reading
July 24, 2022 Angular

Static scoping in C/C++

Issue In the following code, 2 is printed. int x = 1; int f(int y) { return x; } int main() { x = 2; printf(“%d”, f(0)); } How is it happening if we have static scoping in C? Why

Continue reading
July 23, 2022 Angular

Trying to understand the difference between static and dynamic scoping in this C program

Issue So I am just trying to take a look at this little bit of code in C. Basically I am trying to learn how to read / determine the differences when using static and dynamic scoping and how the

Continue reading
July 23, 2022 Angular

variable set but not used Warning but also error undeclared identifier

Issue The debugger tells me I don’t use my variable but also that it is not declared. What is going on here? is an if statement it’s own scope? Somehow it seems to be the case that an array of

Continue reading
June 28, 2022 Angular

CS50: Filter Edge Returns Mostly White Image

Issue I have been stuck on CS50 Filter – Edges for a few days now, having a hard time determining what’s wrong with my code. This code returns an almost all white images (which indicates to me final values are

Continue reading
June 26, 2022 Angular

How to get an image char array by using libpng?

Issue Although I have successfully utilized stb_image/CImg/lodepng open source to get a char array, the memory usage is too huge that I can’t implement it in a low power embedded system. Therefore, I try to use libpng to read a

Continue reading
June 26, 2022 Angular

converting bmp to 2d matrix messing up colors

Issue I’m trying to create a 2d array that contains RGB value for each pixel in the image, I created a copy of the original image to check out if the images are similar and I got that the output

Continue reading
June 25, 2022 Angular

Fast 7×7 2D Median Filter in C / C++

Issue I’m trying to convert the following code from matlab to c++ function data = process(data) data = medfilt2(data, [7 7], ‘symmetric’); mask = fspecial(‘gaussian’, [35 35], 12); data = imfilter(data, mask, ‘replicate’, ‘same’); maximum = max(data(:)); data = 1

Continue reading
June 25, 2022 Angular

Function to filter non digit characters in a string

Issue So I’m currently trying to create a function to filter out non digit characters but I can only use strlen. For example, "a4n55" -> "455" I’ve attempted it and I feel like I’m close. The printf’s are just for

Continue reading
June 24, 2022 Angular

Is it possible to subscript into a uint64_t pointer in C?

Issue I’m a C beginner. Having trouble understanding whats happening with this code: #include <stdio.h> #include <stdint.h> int main(void) { uint64_t num = 99999; uint64_t *num_ptr = &num; uint8_t first_byte = ((uint8_t *)num_ptr)[0]; printf("%hhu", first_byte); return 0; } This prints

Continue reading
June 20, 2022 Angular

Are there range operators in the C programming language?

Issue Are there range operators in C like there are in, say, Swift (closed range, open range)? For example, in a switch statement, in Swift I would write this: switch num { case 144…168: print("Something between 144 and 168") case

Continue reading
June 20, 2022 Angular

Program to find number of elements between two elements a and b (where a and b both are inclusive)

Issue Given an unsorted array of size n, write a program to find number of elements between two user-defined elements a and b (where a and b both are inclusive) of a user-defined array. Input : arr = [1, 2,

Continue reading
May 22, 2022 CSS

GTK3 CCS style not being applied

Issue I am unable to set any style on a widget by name. Here is my code: #include <gtk/gtk.h> #define CSS_STYLE "\ #first { \ background-color: black; \ background-image: none; \ border-width: 0; \ color: yellow \ }" int main

Continue reading
May 8, 2022 CSS

Trying to get 'Style' list for a GtkWidget

Issue I’m trying hard to get a list of style properties for a GtkWidget (GtkButton). This is my code so far: #include <gtk/gtk.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main (int argc, char *argv[]) { // Declare variables. GtkWidget

Continue reading
April 28, 2022 HTML

How to download a file from http using C?

Issue I spent the last days trying to figure out how to download a file from an URL. This is my first challenge with socket and I’m using it to have an understanding of protocols so I would like to

Continue reading
April 28, 2022 Node.js

What to use on Nodejs addons. Node.h or Napi.h

Issue I have some pretty simple questions. What is the main difference between node.h and napi.h. What should I use for normal/personal use case. Why are there more "nodejs" headers. (node.h, napi.h, nan.h, node_api.h, …) I have looked on Internet

Continue reading
April 25, 2022 Node.js

What to use on Nodejs addons. Node.h or Napi.h

Issue I have some pretty simple questions. What is the main difference between node.h and napi.h. What should I use for normal/personal use case. Why are there more "nodejs" headers. (node.h, napi.h, nan.h, node_api.h, …) I have looked on Internet

Continue reading
April 25, 2022 Node.js

What to use on Nodejs addons. Node.h or Napi.h

Issue I have some pretty simple questions. What is the main difference between node.h and napi.h. What should I use for normal/personal use case. Why are there more "nodejs" headers. (node.h, napi.h, nan.h, node_api.h, …) I have looked on Internet

Continue reading
April 25, 2022 HTML

How to download a file from http using C?

Issue I spent the last days trying to figure out how to download a file from an URL. This is my first challenge with socket and I’m using it to have an understanding of protocols so I would like to

Continue reading
April 25, 2022 HTML

How to download a file from http using C?

Issue I spent the last days trying to figure out how to download a file from an URL. This is my first challenge with socket and I’m using it to have an understanding of protocols so I would like to

Continue reading
March 14, 2022 Node.js

Communication between multiple programs

Issue I am currently planning a complicated networking project on Windows IoT Enterprise. Basically, I will have a C program keeping alive a special network interface. This C program should receive tasks in some way from other programs on the

Continue reading

amazon-web-services android angular angular-cdk angular-cli angular-datatables angular-material angular-material2 angular-reactive-forms angular-test angular-ui-router angular2-directives angular2-forms angular2-nativescript angular2-routing angular2-template angular5 angular6 angular7 angular8 angular9 angular10 angular11 angular12 angularjs angularjs-e2e api arrays bootstrap-4 c# c++ css discord.js django django-templates docker express firebase flexbox forms google-chrome html image image-processing ionic-framework ios jasmine java javascript jestjs jquery json karma-jasmine loopbackjs mongodb mongoose mysql nativescript nativescript-angular nestjs next.js ng-class nginx nginx-reverse-proxy ngroute node.js npm observable opencv overriding php primeng protractor python r range rating react-native reactjs regex rest rxjs sass scoping scripting single-sign-on spring-boot strongloop svg syntax-highlighting templating training-data twitter-bootstrap typescript typescript-generics unit-testing validation visual-studio-code vue.js webpack

WordPress Theme: Maxwell by ThemeZee.

Terms and Conditions - Privacy Policy