Questions tagged [c]

1099972 questions
1

votes
1

answer
59

Views

Send data to another JavaScript file from a JavaScript file

I want to see the information of this admin in the panel when admin enters the panel. But there are more than one admin on the system. Therefore, I need to find the administrator who logs in to the system according to the mail entered from the login page. When I click submit button, I need to send t...
Engr. Arda
1

votes
0

answer
135

Views

How to prevent WCF service from wrapping CDATA in response?

I have created WCF method which return C# object as response. Now the problem is that while I am posting request to this method using chrome postman I am getting JSON response and some of parameters are wrapped with CDATA. For example, One of parameter URL has value like 'http://www.examplewebsite.c...
Sanjay Parmar
1

votes
0

answer
90

Views

Standard serialization protocol to serialize set of objects to disk

I am looking for standard protocol that provides ability to serialize set of object (same type) to a file, but also provide easy way to align to object boundary if reader/de-serializer start reading from random byte offset. After googling I found out that Apache Avro provides this functionality usi...
user2774767
1

votes
1

answer
116

Views

Downloading an image from twitter with libcurl C++

I'm making a program that takes a person's tweet, and if it contains an image, download it. Why can I download an image from this URL (Example #1) http://www.google.co.id/intl/en_com/images/logo_plain.png And not from this URL (Example #2) https://www.google.com/imgres?imgurl=https://pbs.twimg.com/m...
user9143463
1

votes
0

answer
39

Views

How to share an InMemory Db between a read and write context

I have am working on a project that needs to support a read db and write db. I have decided to create two contexts accordingly. I have a Web API to interact with the db. I have an endpoint creates a user and another that fetches a user by id. The issue I'm running into is on the Development server,...
czifro
1

votes
0

answer
495

Views

Timeout trying to use Chrome Headless Browser print-to-pdf with Selenium WebDriver C#

I'm trying to create a ChromeDriver object using the ChromeOptions that will print the screen to a p.pdf. If I run the following command I'll get that: 'C:\Program Files (x86)\Google\Chrome\Application\chrome' --headless --enable-logging --disable-gpu --print-to-pdf=C:\Users\Me\Documents\google.pdf...
user2961759
1

votes
3

answer
398

Views

C++ struct bit field doesn't parse data correctly

I'm trying to extract fields from a VLAN Header using a packed struct: I created this struct: #pragma pack(push, 1) struct vlan_header { uint16_t PCP : 3, DEI : 1, ID : 12; }; #pragma pack(pop) When I take an uint8_t array and try to extract the fields from it: uint8_t* data; vlan_header* vlanHeader...
Lior Sharon
1

votes
0

answer
166

Views

How to stop reading from stream on a disconnect gracefully?

I have a simple socket connection that runs a read task in async. When I disconnect I get an exception: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'SslStream'. I don't know how to stop it trying to read when it is sitting and waiting to read a message when I call d...
WDUK
1

votes
1

answer
923

Views

How to calculate SHA512/224 and SHA512/256 hashes using OpenSSL?

Here's how I calculate a SHA512 hash in C. #include #include char *calc_sha512(char *data) { SHA512_CTX ctx; char *md = malloc(sizeof(char)*(SHA512_DIGEST_LENGTH+1)); SHA512_Init(&ctx); SHA512_Update(&ctx, data, strlen(data)); SHA512_Final(md, &ctx); md[SHA512_DIGEST_LENGTH] = '\0'; return md; } i...
Umayr
1

votes
1

answer
69

Views

Limit button press in between in seconds?

How to make button press function work only in between # seconds? For example, allow user to press E at any time, but execute, for example, animation every 5 seconds? I've tried Invoke but it doesnt seem to work as it should. I've also tried timestamp and StartCoroutine (waitforseconds). Here's what...
papi
1

votes
2

answer
73

Views

Double pointer as function parameter

I was reading a page of 'Understanding and Using C Pointers' when this function appeared: void safeFree(void **pp) { if (pp != NULL && *pp!= NULL) { free(*pp); *pp = NULL; } } and an example code from it: int main(int argc, char **argv) { int* pi = (int*)malloc(sizeof(int)); *pi = 5; safeFree((void*...
Martín
1

votes
1

answer
42

Views

FIFO with /dev/urandom

I got a problem. Trying to write a simple programm which forks once The parent proccess sends child bytes from /dev/urandom and child outputs them to screen (15 bytes in HEX per line). The problem is: when i first open the compiled programm the output looks like: B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 B0 B0...
DrJoe
1

votes
0

answer
648

Views

EF how can I refresh Context with updated values in the Database?

I have a static Context that is doesn't refresh after updating values from the DB. Here is a little background on how the systems work. CRUD is done in a separate app. After saving to the DB triggers notify the API on the changes. After getting the changed Entity from the Context in the API, the en...
Ortho Home Defense
1

votes
0

answer
547

Views

Using POSIX semaphores between processes (Named semaphores, Linux, C)

The main idea of this simple program is to make communication between processes through the shared memory and limit their access by using semaphores. 'Forks' creating the main Parent Process and 3 Child Processes. Child are consumers and Parent is the producer. Child ought to get in the queue for ev...
LowProfile
1

votes
0

answer
131

Views

GdiPlus : Region from a GraphicPath without filling it

I need to get a Gdi+ Region from a GraphicPath without filling it, and I don't know how to do it. A draw is better than words, so here is what I want to do : What I want to do I have an ellipse, than I want to be displayed unfilled (whith a known line width) I have a full rectangle, and I want it to...
Alex
1

votes
1

answer
1.4k

Views

.NET Core 2.0 API with EF6 and .edmx file?

I want to build a API using .NET Core 2.0 that targets the full .NET framework so I can work with Entity Framework 6 and an .edmx file. Is this possible? How do I inject the DbContext generated by the .edmx file? I want to do this because my project works with a lot of stored procedures and I don't...
genzop
1

votes
0

answer
69

Views

IOS - Connecting to bluetooth device in background periodically

I have a bluetooth device which connects to my iphone and i can perform all sorts of operations on the device. Its a tracking device and I log all sensor based data in the device. Since the device have a data limit, I want to read data from the device once every hour and dump it into a file through...
Kpatel1989
1

votes
1

answer
258

Views

jQuery UI Autocomplete in MVC modal window

I'm trying to implement the autocomplete jQuery UI function in a Bootstrap modal window, but it does not work. screenshot module console debug Take the steps of not returning a partial view, also already implement jQuery CSS styles, the truth works for me in full views, but why when calling a modal...
Fytito Ambiado
1

votes
0

answer
88

Views

C#, Get class properties

I have the following class structure: class structure The user can select to work with SystemA or SystemB. The following code is from the class that creates the main object: public class MainViewModel() { var project = new Project(); project.PropAList = new List(); project.PropAList.Add(new SystemB(...
gr1d3r
1

votes
1

answer
206

Views

'ShowSUM': __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention

I have a C# DLL with the following code: namespace Csharplib`{ public class Calculate { public static int Sum(String value1, String value2) { int res = int.Parse(value1) + int.Parse(value2); return res; } } }` I have a CLI/CLR C++ Application where I have added the reference of my C# DLL. Following...
Uzair Raza
1

votes
1

answer
35

Views

Iterate through properties in a loop

I'm trying to loop through a row of data for a set amount of times to access a different property every time. The data looks like this: [JsonProperty('Afbeelding')] public string Afbeelding { get; set; } [JsonProperty('Afbeelding_2')] public string Afbeelding2 { get; set; } [JsonProperty('Afbeelding...
Michelindoll
1

votes
1

answer
58

Views

Entity Framework - mapping one class to two tables with many to one relation

I have a class which represent a connection of a page and a tag and it looks more or less like this: public class TagLink { [Key] public int Id { get; set; } public int PageId { get; set; } public int TagId { get; set; } public string TagName { get; set; } } In my database I would like to have 2 tab...
krajol
1

votes
1

answer
100

Views

Objective-C protocol delegate not working

I want to send back an array of objects to myViewController from myRenderer In myRenderer.h: @protocol myProtocol; @interface myRenderer : NSObject @property (weak) id myDelegate; @end @protocol myProtocol - (void)sendToMyViewController : (NSMutableArray *) objects; @end In myRenderer.mm (C++ / o...
Brian Scherady
1

votes
0

answer
38

Views

C# WebKit Dot Net navigate with post data

for one of my project i need a webbrowser in a c# programm. At first i tryed to use the default webbrowser but this use the IE8 and this dont run for me. After this i implemenent the WebkitDotNet (Link). The implementation was very easy and all functions run, but now i need a navigate call with post...
Pla558
1

votes
0

answer
482

Views

MVC Ajax, Post to Controller base64 string

In my project I send post json data object. One item of this object is base64 string. When base63 string is too long, my request doesnt reach to controller. In my opinion , due to length of parameter,it doesnt work. I couldnt find any solition. [HttpPost] [ValidateInput(false)] public ActionRe...
Çağrı Taçyıldız
1

votes
1

answer
39

Views

The first-time-FlannBasedMatcher influence the result of the later FlannBasedMatcher

I use FlannBasedMatcher twice in my project, but it seems like the first FlannBasedMatcher is affecting the results of the second FlannBasedMatcher. cvtColor(c_image1,hsi1,CV_BGR2HSV); cvtColor(c_image2,hsi2,CV_BGR2HSV); split(hsi1,channel_hsi1); split(hsi2,channel_hsi2); image1s=channel_hsi1[1]; im...
user9148841
1

votes
2

answer
60

Views

GTK C - get value of pointer to gint64 to feed the gtk_list_store_set

I guess i have a pure C problem here and that it has nothing to do with GTK, but i'm not sure. I have this function in which i'm retreiving the content of a GtkEntry, converting the gchar to gint64 with another function, and then i want to add it to the list. Thou, while the first printf gives me th...
Rafi's Revenge
1

votes
1

answer
259

Views

Posting multiple values with one parameter with httpclienthandler in c#

I am trying to send a form to a website with HTTP Client. The Website then returns a list with data based on my request. The process itself is working fine but I have to do 3 requests wheras one is enough when I do it by hand in the browser. In the browser I have multiple checkboxes to apply Filters...
julian bechtold
1

votes
0

answer
53

Views

Prevent `using static` Directive with RequireQualifiedAccess

In F#, there is a .NET attribute that prevents programmers to use using static: Adding the [] attribute to a module indicates that the module may not be opened and that references to the elements of the module require explicit qualified access. For example, the Microsoft.FSharp.Collections.List modu...
MiP
1

votes
1

answer
234

Views

How to get root value of Json get from dialogflow?

I got the json response from dialogflow. Now I want to get the 'q1' value. So I've tried this: var stringjson = ApiAiJson.Serialize(queryResponse); var deserializejson =ApiAiJson.Deserialize(stringjson); if (deserializejson.Result.Action == 'web.search') { JObject jsonob = JObject.Parse(stringjson);...
1

votes
0

answer
632

Views

Xamarin Android live stream video/audio from device in c#

I am challenged with the task to stream video and audio (camera and mic) from my android API 19 devices directly to a server. Displaying (on the device) is also optional. Following this link I learned that you can use Mediarecorder with a socket instead of an output file. But they describe this meth...
b.holz
1

votes
0

answer
38

Views

Which of a Dictionary's fields should I make serializable?

I'm trying to implement my own serializable dictionary based on the source code from here. Obviously the keys, values, and count need to be serialized. MSDN says you should never serialize hash codes. But I'm having trouble wrapping my head around the usage of the buckets array and Entry.next field...
SilentSin
1

votes
0

answer
46

Views

Keeping page layout in control updates

I have managed to create a custom renderer for Page in iOS that handles keyboard events and using Element.LayoutTo() I change the area that page renders to, and hence bring my controls into view while the keyboard is open. The problem is once any control changes (ex. a label text changes) the page l...
Emad
1

votes
1

answer
373

Views

Unity freezes at firebase GetAsyncValue().ContinueWith()

I have the latest firebase unity SDK - 4.3.0 My Unity version is 2017.2.0f3 In my script, if I have two calls to GetValueAsync().ContinueWith(), the first one is executed normally and the second one halts. If I somehow merge the two calls into one, the program halts at the first call. I have already...
CCS
1

votes
0

answer
61

Views

C++ calls cv2 in python with multithreading

C++ calls Python.(Python3.6+VS2012+opencv_python‑3.4.0‑cp36‑cp36m‑win_amd64) I initialize Python in the main thread, and execute python statements in sub-thread. I can normally call skimage, sklearn and numpy in any thread apart from cv2. When i use cv2 in the sub-thread, the program will be...
user9147627
1

votes
0

answer
50

Views

When using ScrollViewer's ViewChanging event, e.IsInertial always returns false. [UWP]

According to Microsoft's documents, e.IsInertial should return true under conditions such as when the mouse wheel scrolls the ScrollViewer's contents. No matter what I do it always returns false. I need to know when the user's mouse wheel caused the ScrollViewer to scroll. ScrollViewer has a ViewCha...
LeBrown Jones
1

votes
2

answer
73

Views

Reset or clear iOS app badge without any app interactions like open the app or push notification

Any possibility to reset/clear app badge without any app interactions such as opening the app or any push/local notifications. My need is, I want to reset my app badge starting off every day without even opening the app or with any notifications.
anasaman_p
1

votes
1

answer
223

Views

Where does ASP.NET Identity store information about external authentication provider?

In my ASP.NET MVC application, I have enabled authentication using Microsoft and Google accounts. They both are working fine. i.e., I am able to login to my application using my hotmail and gmail both accounts. Once logged in (say, using Microsoft account), I am able to see following screen as well...
Nirman
1

votes
0

answer
88

Views

SignalR setup when separating out data access layer

Current setup has a single webapi with controllers, services, SignalR Hubs/server, data entity models and view models (say Project.Main). The thought is to create a separate project (Project.Data - webapi) for Data entity model, view models and services. Project.Main would reference Project.Data to...
Shyamal Parikh
1

votes
1

answer
49

Views

Why aren't my windows being displayed? (Ncurses)

I'm trying to create this program where I print two windows side by side on the stdscr. I've created the class 'menu' to declare everything about the whole screen in one place, I create a 'menu' object ('menu_principal') in main but nothing happens. I added two functions to see if my object is being...
Rodrigo Ordóñez

View additional questions