|
Vaclav_Sal wrote: I am building a small database app on SAM3x8e hardware...I was just curious how the "big boys" do search on VERY large database.
First part of that is basically incompatible with the second.
In general the solution for your problem is similar in a very broad way in that one must:
1. Understand the data
2. Understand the searches needed.
The solution(s) are then based on that.
So for example it is pointless to use a hash if you are doing regular expression searches on free form text.
|
|
|
|
|
Hello there, Im trying to make an assembly program that translates a simple switch case program in c without using and commands related to jg or jt only jmp
I tried making something like this:
org 100h
mov si,3
jmp word ptr [jmptab+si]
case1:
PRINTN "Number One"
jmp endcases
case2:
PRINTN "Number Two"
jmp endcases
case3:
PRINTN "Number Three"
jmp endcases
case4:
PRINTN "Number Four"
endcases:
jmptab:
DW case1
DW case2
DW case3
DW case4
mov ah, 0
int 16h
ret
include magshimim.inc
Where did I go wrong?
modified 11-Jul-15 8:53am.
|
|
|
|
|
[This should really go in QA]
Hint:
a. What is the size of each entry in your jump table?
b. How are you indexing the jump table?
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
Completely new to C++ and have been given a task that includes creating an application that uses CString data from a completely separate .h file.
The CStrings consist of info that I need to be able to copy to the clipboard, then be able to paste that text into word etc. I have set up a button in the application so when that button is pressed it executes what I want it to do (read the CString data and copy it to the clipboard).
For a person of my skill level this is difficult and my colleagues do not have the time to support me on this learning project so I thought I could get some advice and pointers here. Any help would be greatly appreciated. I am an apprentice working in software for 2 months.
Kind regards,
Luke
|
|
|
|
|
Member 11822807 wrote: I have set up a button in the application so when that button is pressed it executes what I want it to do (read the CString data and copy it to the clipboard). This is what it does or this is what you want it to do?
Member 11822807 wrote: ...so I thought I could get some advice and pointers here. Any help would be greatly appreciated. So what EXACTLY do you have a question about?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
You have not actually told us what help you want, so I am guessing you want to know how to:
|
|
|
|
|
Hello guys. I am trying to make a simple TSP using Julmar TSP SDK. I am able to make a skeleton TSP which gets detected by Windows and its added line can be seen from Phone.exe.
I want to add a thread in this TSP, which generates fake call to Phone.exe
How do I take it further? Should I add a main()and instantiating all the classes in it, in my .tsp project? Or will I be doing something in TSPUI project (so that I setup few things during manual installation of TSP)? Thanks for giving any pointer.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
Hello all!
I need help. I need to estimate function execution time in under Linux OS. I guess that it's right way to estimate code/algorithm performance.
I'm trying, something like this:
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
void test(){
int i;int s=0;
for(i=1; i<1000000; i++){s+=sin(i)/i;}
}
float timedifference_msec(struct timeval t0, struct timeval t1)
{
return (t1.tv_sec - t0.tv_sec) * 1000.0f + (t1.tv_usec - t0.tv_usec) / 1000.0f;
}
int main(void)
{
struct timeval t0;
struct timeval t1;
float elapsed;
gettimeofday(&t0, 0);
f1();
gettimeofday(&t1, 0);
elapsed = timedifference_msec(t0, t1);
printf("Code executed in %f milliseconds.\n", elapsed);
return 0;
}
. But It's wall clock, I'm not sure that I can estimate performance by this way, besides, I need approach which will allow to measure time of each function which I choose. I've heard that there is approach to use CPU-time.
|
|
|
|
|
CodingStyle wrote: I've heard that there is approach to use CPU-time. And there is even a man page[^] for it.
|
|
|
|
|
|
Yeah. There is such approach like, count the number of ticks to estimate performance. I do not think that it's panacea.
Richard MacCutchan and Jochen Arndt also correct.
But I guess that you mean universal and independent implementation version. Look here.
|
|
|
|
|
|
This is probably what you need:
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
void test(){
int i;int s=0;
for(i=1; i<1000000; i++){s+=sin(i)/i;}
}
int main(void)
{
clock_t time[2], timediff;
float elapsed;
time[0] = clock();
f1();
time[1] = clock();
elapsed = ((float)abs(time[0] - time[1]))/CLOCKS_PER_SEC;
printf("Code executed in %f milliseconds.\n", elapsed);
return 0;
}
|
|
|
|
|
I am an innocent bystander of a discussion about how #include directive is handled in IDE.
The IDE in question uses proprietary file "main" name extension (still a text file) and processes #include <header.h> and #include "local_header.h" in that file just fine.
However, when the local_header.h file has <b>another #include <header_1.h></b> in it the compiler "does not see that". That is basically what people who "knows / developed" the IDE are saying.
Including another local file in first local file such as #include "local_header_1.h" is "seen / processed " by IDE.
I was under the impression that #include <file.h > tells the OS to find the file "anywhere" and #include "file.h" tells the OS to search only current / parent directory.
So why is IDE (gcc) getting into the act?
|
|
|
|
|
#include <file>
This variant is used for system header files. It searches for a file named file in a standard list of system directories.
#include "file"
This variant is used for header files of your own program. It searches for a file named file first in the directory containing the current file, then in the quote directories and then the same directories used for <file>.
https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html[^]
|
|
|
|
|
FTFY
Chris Losinger wrote: This variant is used for system or library header files.
|
|
|
|
|
Vaclav_Sal wrote: However, when the local_header.h file has <b>another #include <header_1.h></b> in it the compiler "does not see that". That is wrong. The compiler (or more precise: the preprocessor part) will process such includes.
However, an IDE may do other things with your files before they are passed to the compiler. But GCC is the Gnu Compiler Collection (a collection of command line tools) and not an IDE.
|
|
|
|
|
A compiler is not an IDE. An IDE is a front-end to a compiler and it should follow the same rules as the compiler (and pre-processor in this case). If the IDE does not, then it is broken and must be fixed.
|
|
|
|
|
Thanks for confirming my suspicions.
Obviously I got the compiler mixed up , so here is the way I view the whole mess.
To get from idea to running code I see these basic blocks
Operating system - with environment configuration
Development application (IDE )
Development tools
Text editor
Main file .*ino
"System " includes - example <stdio.h>
IDE "libraries" - example <LiquidCrystal.h>
Local includes - example "MyClass.h"
Compiler / linker (preprocessor)
Executable code
I think I need to take a look how the compiler handles / finds the path to each include.
I can see if local includes are in SAME directory as the x.ino file it works fine.
But the "system" or "library" includes path are different and that why if fails.
But I want to write code and not troubleshoot the IDE.
Maybe I should use a different IDE.
Cheers
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: But I want to write code and not troubleshoot the IDE. There is nothing to troubleshoot. Whether you use the IDE or not, the issues are the same. The compiler needs to know the paths of any directories which contain header files that you wish to include in your compilations. The linker needs to know the paths of any directories which contain libraries that are referenced by your project. When you install Visual Studio it sets a default set of both, which gives the paths to all the default library components. If you create a project that uses other headers and libraries then you need to add those paths, and the library names, using the Project Properties link in Solution Explorer. If you want to do it without using the IDE then it is much more hard work and you would probably need to set up some complex batch files, or learn how to use Make: something that is not for the fainthearted.
|
|
|
|
|
Richard, I feel you missed my question.
Just FYI, the IDE I am using is pretty tight lipped about "an additional path" I experienced using my VC++. It just was not build to expand...
I posted my question here for reasons which I do not wish to discuss.
Thanks anyway.
|
|
|
|
|
Vaclav_Sal wrote: I feel you missed my question. No, I think it was clear enough.
Vaclav_Sal wrote: I posted my question here for reasons which I do not wish to discuss. Then maybe you should not have posted it.
|
|
|
|
|
Vaclav_Sal wrote: Main file .*ino Are you working with Arduino?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yes,
I'll take wild guess what you are going to say...on better not...
Anything after ONE file is a challenge.
|
|
|
|
|
Vaclav_Sal wrote: I'll take wild guess what you are going to say...on better not...Anything after ONE file is a challenge. Negative. I was just trying to narrow down the problem a bit. The Arduino IDE uses the avr-gcc compiler. That compiler's preprocessor, like others, has a list of directories it will search to resolve #include directives. This is usually the -I command-line switch.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|