15,893,588 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by RAMASWAMY EKAMBARAM (Top 26 by date)
RAMASWAMY EKAMBARAM
17-Oct-17 1:46am
View
Deleted
In addition to the tips (solutions 1 and 2) you may need to ignore all the comment characters as '{' and '}' could be included in comments.
RAMASWAMY EKAMBARAM
30-Sep-17 2:50am
View
You can get rid of possible "rubbish in the input queue" using fflush(...)
RAMASWAMY EKAMBARAM
29-Aug-17 1:16am
View
"for more than 1 machine" - I did not overlook the requirement but you can complete it yourself. Instead of querying for a particular machine ("where machine = '500'") you will have to select the machine for each of the days (in my example I have done it only for 'monday') and alias as 'mch_mon', 'mch_tue' .. and in the condition for joining the sub queries you will need to match the machines (mch_mon = mch_tue) in addition to matching the dates.
The only drudgery is that you will need to spell out the individual columns (aliases) for each day rather than simply writing mon.*, tue.* ...!
RAMASWAMY EKAMBARAM
28-Aug-17 2:00am
View
char s1[100000] and s2[100000] - even if your system has 8GB of RAM do you get 200000 bytes of stack by default i.e. without using any special directives while compiling? As this memory is needed only within this function, I think you should declare char *s1, *s2 and use malloc().
RAMASWAMY EKAMBARAM
23-Aug-17 5:32am
View
Your requirement will be clearer if you explain with reference to the above data, what you mean by getting 6 wrt column 'value' and 2 & 3 wrt 'value2'. In fact there is no reference to column 'value2' in your query.
RAMASWAMY EKAMBARAM
10-Aug-17 2:27am
View
If the only difference is size, declare the array as a global or static variable - better still allocate using calloc() (since most elements are 0) and assign 1 where needed.
RAMASWAMY EKAMBARAM
21-Jul-17 0:46am
View
You should not have any problem with the above unless you think of your programming assignments as some imposition/ drudgery?
RAMASWAMY EKAMBARAM
9-Jul-17 0:50am
View
Search 'Warshall Algorithm' on the net - maybe that's what you are looking for.
RAMASWAMY EKAMBARAM
28-Jun-17 1:11am
View
I do use PostGRESql but have never used the PlPGSql procedural language (only with C programs or directly querying in PGAdmin).
Maybe you are getting a tuple like (n1, n2) due to the line of code "RETURNS table (COL3 text,COL5 text )".
You can check the manuals - very comprehensive and in a single PDF for each version as you are surely aware.
RAMASWAMY EKAMBARAM
24-Jun-17 3:36am
View
gotoxy() is a function - it was implemented in all C compilers for MS-DOS. Possibly, it is still there in compilers on Linux. Borland C++ freeware compiler v5.5 (bcc32) which runs in Windows Console still supports gotoxy().
RAMASWAMY EKAMBARAM
5-Jun-17 2:05am
View
I hope you are writing this as a Console program. If you are still learning C, then Win32 GUI is a bad choice - you don't know where (standard) C ends and Win32 API begins.
If you are writing as a Console program on Windows, I can suggest using the freeware Borland C++ compiler version 5.5 (bcc32). Bcc32 works fine on (and at least up to) Windows 7. BCC32 is good for most things but there are lot of bugs in the Date handling functions but that won't come in the way of the game.
The functions gotoxy() and getch() can help you with tic-tac-toe and of course you will need to create an array like: char game[3][3] to match the positions and initialize to spaces (say) to distinguish from filled positions. You can use getch() to read even the Arrow Keys and you can call gotoxy() to position the cursor anywhere on the screen. gotoxy() does not seem to be supported any longer on the other compilers in Windows (GCC or Microsoft C).
If you are bent on writing tic-tac-toe in C this is probably the easiest route other than downloading ready made code from the net!
RAMASWAMY EKAMBARAM
5-Jun-17 1:13am
View
Deleted
I believe I have not conveyed clearly:
Sale_Date || Sale_Value || Year_Week || Max_Week_Date || Cum_Week_Sale
21-May-2017 || 120 || 2017-21 || 25-May-2017 || 120
22-May-2017 || 110 || 2017-21 || 25-May-2017 || 230
24-May-2017 || 140 || 2017-21 || 25-May-2017 || 370
25-May-2017 || 180 || 2017-21 || 25-May-2017 || 550
30-May-2017 || 150 || 2017-22 || 02-Jun-2017 || 150 -- start of new week sub-total starts afresh
31-May-2017 || 160 || 2017-22 || 02-Jun-2017 || 310
02-Jun-2017 || 200 || 2017-22 || 02-Jun-2017 || 510
I have no experience working with Sql-Server.
In Oracle the functions:
to_char(to_date('30-may-2017'), 'yyyy-ww') will give '2017-22' (string)
to_char(510) will give '510' (as a string)
Max_Week_Date is the name (alias) for the computed column got by:
select max(sale_date) over (partition by to_char(sale_date, 'yyyy-ww')) max_week_date
with the above data if I queried (in Oracle):
select sale_date, sale_value, case when sale_date = max_week_date then to_char(cum_week_sale) else '' end cum_week_sale I would get the output as requested in the original post.
convert_to_string() was meant to be place holder for the correct function in Sql Server which does the conversion from numeric to string equivalent to to_char(<numeric value>) in Oracle (shown above).
max_week_date_convert_to_string is not a single entity -
max_week_date is the computed column alias as mentioned above
convert_to_string() was a HINT cum placeholder for the real function (in Sql Server) to do the job of converting to string
The complete (Oracle based tested) solution would have avoided such communication gap but that might have been doing someone's homework/ assignment.
RAMASWAMY EKAMBARAM
3-Jun-17 6:36am
View
Consider records for the period 21-may-2017 .. 10-jun-2017
period 21-may-2017 .. 27-may-2017 is week 21 of 2017
Period 28-may-2017 .. 03-jun-2017 is week 22 of 2017
Period 04-jun-2017 .. 10-jun-2017 is week 23 of 2017
max_week_date for:
21-may-2017 .. 27-may-2017 is 27-may-2017
28-may-2017 .. 03-jun-2017 is 03-jun-2017
04-jun-2017 .. 10-jun-2017 is 10-jun-2017
The person posting request wants the weekly cumulative ONLY for the last day of week (week completion).
As we are using CASE WHEN sale_date = max_week_date ..
we need to convert week_sale (which is numeric) to a string else we cannot display a BLANK ('') in the other cases (Type Compatibility).
RAMASWAMY EKAMBARAM
1-Jun-17 6:44am
View
"http://www.friedspace.com/" contains short tutorials on assembly (x86) including getting input via keyboard (ReadConsole()).
The tutorials by 'iczelion' (easy to locate in google) though very old are still useful.
'Assembly Language Succinctly' is part of the Succinctly series and is a free download. If you are doing any serious programming in assembly (x86) you probably need a book like 'Assembly Language for X86 - Kip Irvine' or 'Assembly programming - Pirogov'.
You can also write an equivalent short Windows Console program in C for just a single operator (say '+') reading user input using ReadConsole() and compile (using Borland bcc32 or Microsoft C compiler) with the flag -S (or -s ??) to generate assembly output and study the output file.
RAMASWAMY EKAMBARAM
18-May-17 2:38am
View
given as solution 2
RAMASWAMY EKAMBARAM
17-May-17 6:09am
View
The series count is 702 - think how you can map 0 .. 701 to A .. ZZ using quotient (/) and modulus (%).
RAMASWAMY EKAMBARAM
8-May-17 6:47am
View
Use PHP Data Objects (PDO) - just search the net and you get plenty of links including the following:
"https://en.wikibooks.org/wiki/PHP_Programming/PHP_Data_Objects"
PDO makes it easy to work with other DBs too (Oracle and PostGRESql)
RAMASWAMY EKAMBARAM
30-Apr-17 2:10am
View
Reading metadata using C is easy if you know the offset of the metadata within the file (binary file handling fopen(<filename>, "rb"), fseek() etc). If you are using Windows check whether folder exists using GetFileAttributes() (which will return error if no such file/folder - there is also FindFirstFile() but that's more involved) and CreateDirectory()
RAMASWAMY EKAMBARAM
20-Apr-17 7:29am
View
I had submitted code for Greek characters - see if any help:
"https://www.codeproject.com/Answers/1174538/How-do-I-print-the-symbol-theta-in-C-language#answer2"
RAMASWAMY EKAMBARAM
13-Apr-17 22:11pm
View
Maybe the 'insert's have not been 'commit'ted.
RAMASWAMY EKAMBARAM
13-Apr-17 9:29am
View
what is the requirement - just to split any file (.docx, .rar, .exe or some database export dump) and then merge them later to get back the original? this was a common requirement years back when there was severe size limit on mail attachments. If It's only for this limited purpose, It is possible to split any file without knowing anything about the format and then merge the parts to get back your file.
RAMASWAMY EKAMBARAM
11-Apr-17 13:42pm
View
You are assigning instance (object) of derived class to variable of base class and thru this variable invoking method of derived class which overrides virtual base class method - it is run time polymorphism. To understand how it works you need to read about vtable and function pointers - but pointers belong to realm of C and every book on OOP languages devote (at least) the first 100 pages explaining why you should never learn C for you will have to unlearn a lot of bad habits! You decide.
RAMASWAMY EKAMBARAM
11-Apr-17 1:55am
View
Also check the data dictionary:
User_constraints & user_cons_columns - you will find SYS_C00721767 listed when you query:
"Select * from user_constraints where table_name = 'JOBS' "
Likewise for 'user_cons_columns'
RAMASWAMY EKAMBARAM
8-Apr-17 6:22am
View
Requirement is not very clear. Oracle provides support for hierarchical queries (just search google) but even that will not work with the above data (A being parent of A, A being parent of B and again B being parent of A .. this will result in a loop/ cycle and Oracle will report error!
RAMASWAMY EKAMBARAM
24-Mar-17 1:25am
View
"C wears well as one's experience with it grows" - Preface to "The C Programming Language - K & R".
Pointers wear exceptionally well as one's experience increases! Callbacks & Event Handlers, thread execution, polymorphism (C++) all depend on function pointers.
Pointers are probably the main reason that C continues to hold its own!
RAMASWAMY EKAMBARAM
23-Mar-17 2:16am
View
Keyed in the query from the phone and tried (unsuccessfully!) to put it in a code block. Thanks for doing it!
Show More