C - Sending the structure table to the pipe

I'm trying to send an array of structs through a pipe. I have a struct: typedef struct visitordata { char name[80]; char email[80]; int id; char reg_time[9]; }visitordata; Then I do //... //ds is the number of struct entries to be stored visitordata*

Analyze a string with a double quote

I have a table in which one of the fields contains the string 302720"?. When I try to do a substring of that string, it returns an error. I understand that it is because of the double quotes within the string. I tried replacing the quotation with REG

WSO2 api manager error 404 - File or directory not found

When I try to execute my api through API Console in WSO2 api manager , I received error "404 - File or directory not found". My API is working fine when I run it through the Postmen tool. Could you please help me to identify above issue. Here wi

Creating a 'delete member' function in prologue

I am new to Prolog and I'm trying to to create function that will simply remove all instances of an element from a list. The following code is what I have so far: remove([H|T], E, L2) :- (\+ ([H|T] == []) -> (H == E -> remove(T, E, L2) ; append(L2,

Android Studio launches in an incorrect sdk source

I've got the following build.gradle settings. compileSdkVersion 21 buildToolsVersion '21.1.1' defaultConfig { minSdkVersion 18 targetSdkVersion 21 } The problem is that when I step into Android SDK source on an KitKat device (19 on Genymotion or Devi

Assign a random value to JButton

I need to assign different number from 1 to 8 to JButton Array. But the elements of array has to be different. Random random = new Random(); JButton[] number = {jButton1,jButton2,jButton3,jButton4,jButton5,jButton6,jButton7,jButton8,jButton9}; for(in

Find a file name with a wildcard character in iPhone SDK

I am trying to write a program that creates dynamically named .csv files that need to be either retrieved or deleted at a later run date. What I am trying to do is this: I would like to run an algorithm that will find out if any of these types of fil

Validation for Irish Eircode

I'm wondering if there's a best practice for validation for the Irish Eircode format. My best attempt so far, using REGEX in JavaScript, is the following based on the official spec found on page 11 here. (Page 11 based on the page numbers in the docu

Import Mysql Workbench UML diagram into ArgoUML

I have a big database and I need to create an uml diagram. The only program I find to make this automatically is Mysql Workbench, but I don't like it to work. I usually work with Argouml. Mysql workbench exports a .mwb, this is a compressed file with

Why this recursive function only works when it is used ELSE

I made this function that returns the number of digits in an integer: it works fine when I used ELSE to return the count int getIndex(int number, int count) { // at first call count is 0 number /= 10; if (number > 0){ getIndex(number,++count); } else

Circle with two borders

How can I style a a circle (a div) with two borders responsively so that it reacts to a container's size? Suppose circles like this for example: Here is a working CSS for a circle: div.circle { width: 90%; height: 0; padding-bottom: 90%; margin: auto

Ruby on track: correct location for sql query

I have a general question about rails controllers/models: I have a model Providers, that represents the table providers in my database. If I have sql queries (with certain conditions) to gather information from that table, where the SQL code should b

JavaScript Matrix - Unexpected Token

Hello I'm trying to create an array of errors, and display them at once. Something like this. if (!first_name) { var error[] = "Заполните Фамилию"; $('#first_name').addClass('error'); } else { $('#first_name').removeClass('error'); } if (!second

How to manipulate time in HH: MM format

I simply want to add 15 minute increments to a variable that holds data in HH:MM format in 24 hour clock mode. I tried using Time:Piece which lets me format the time, but I'm not able to run conditions or manipulate the value since it forces me to us

Perl - Redefined subprogram

I have asked this question before or searched and seen others ask - why am I getting the warning "Subroutine mySub redefined at ../lib/Common.pm line x"? and you always get the answer you declared the sub twice in the same code. I created this t

Breaking up SQL script

I am writing a rather long SQL script that is running close to 2000 lines of code. Since it becomes really difficult to comprehend a long script, I would like to break it up into logical units and separate them out in other SQL files. What would be t

How can we achieve abstraction using interfaces in java?

I have learned that interfaces and abstract classes in java help us achieve abstraction. However, I do not fully understand that theory, abstraction means hiding internal mechanism and showing relevant details only, but how exactly interface and abst

Python Code Organization Help: Importing Functions

I have written some code, but it's all located in one file. It's sort of annoying to work with now because it's so long. So I'm thinking I should put all the function in a different file and just import them. I'm just not sure about the best way to g

pylint warning on 'unless exception:'

For a block like this: try: #some stuff except Exception: pass pylint raises warning W0703 'Catch "Exception"'. Why?It's considered good practice to not normally catch the root Exception object, but instead to catch more specific ones - for exam

Google Analytics API comparative period previous year

The Google Anlaytics Web Interface has a checkbox where you can compare your data to the previous year. I am running queries in java with the API and was wondering if anyone has noticed the same functionality built into the API? right now I am runnin

NodeJS backend POST for the array element?

Sample JSON data, to show you how my MongoDB is arranged: { "state" : "California" "person" [{"name": "Bob"}, {"name": "Bill"}] } I have an input form with the following POST value name

Wordpress error when activating the plugin

I was try many answred question here... Like remove space before <?php and after ?> not working at all Iam still stucked.. My code below.. add_action( 'admin_notices', 'fii' ); function fii(){ // parent plugin if ( ! is_plugin_active( 'xxx/aaa.php'

Qt, MSVC and / Zc: wchar_t- == I want to explode the world

So Qt is compiled with /Zc:wchar_t- on windows. What this means is that instead of wchar_t being a typedef for some internal type (__wchar_t I think) it becomes a typedef for unsigned short. The really cool thing about this is that the default for MS

How to set a default value for an existing column

This isn't working in SQL Server 2008: ALTER TABLE Employee ALTER COLUMN CityBorn SET DEFAULT 'SANDNES' The error is: Incorrect syntax near the keyword 'SET'. What am I doing wrong?This will work in SQL Server: ALTER TABLE Employee ADD CONSTRAINT DF_

Buy X quantity of products at reduced price

How would I go about a rule which sets something along the lines of: -------------------------- | Amount in Cart | Price | -------------------------- | 1 | 1,99 | | 3 | 1,50 | | 5 | 1,20 | -------------------------- I can't figure it out. Thanks in a