440 Posted Topics
Re: Hi, you may try this: [CODE]select 'aaa_01' as st, left(st, locate ('_', st)-1) as shorter -- st shorter ------------------- -- aaa_01 aaa -- however, code not tested. you should look-up left and locate functions from mysql manual whether -- the parameters are in correct sequence (mysql has its own notion … | |
Re: Hi, you should give some more details, especially on the obviously wrong select statement containing those computed columns. If mmtot, mattot, and odctot are also computed columns, what they are computed from, from real table columns? Simple post your select statement and some information on the involved tables too. [CODE]-- … | |
Re: Hi, table joke shouldn't be a joke, therefore column joke.authorid must have proper values, assuming that first joke is from Tim and second from fredl your joke table would then look like: [CODE] +----------------------+----------+ | LEFT(joketext, 20) | authorid | +----------------------+----------+ | Why did the chicken | 3 | | … | |
Re: Hi you have been posting twice. I tried to answer a little on forum Databases. -- tesu | |
Re: Hi, Once I had heard of all of them, well 10 years ago, when I finished Uni. So let me take a try: A1. worst case requires O(N)reads, where N= 100000/10 = 10,000 pages to read. Best case is 1 read. (Efforts for page scanning in main memory ignored.) A2. … | |
Re: So why don't you comply with all those valuable piece of advice you have got in your 2-day-old [URL="http://www.daniweb.com/forums/thread294812.html"]former thread[/URL]? If you had only compared above program with that one posted in your former thread, you would have already spotted the principal mistake. Then you were ready to figure out … | |
Re: Hi, I think your RK steps are not correct, you may check [URL="http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods"]this[/URL]. Also a RK function of my own shows other steps for y direction: [CODE]tSCALAR ruku5( tODEF f, tSCALAR x, tSCALAR y, tSCALAR h) // Common 4th order Runge–Kutta method { tSCALAR k1, k2, k3, k4; k1 = … | |
Re: Hello, I am using such a self-written auto-number generator on MS-SQL Server and Sybase databases for generating compound numbers, e.g. suffix.sequence-number.prefix. The numbers are generated from a user definded function for a specified table, say UDF genKey('table_name'). UDF genKey is able to manage various types of compound numbers, for example … | |
Re: [QUOTE]what is the ones complement representation of 0 ?[/QUOTE] Short answer (0D encoded in 1 byte): [B]00000000 and 11111111[/B]. There are really two one's complement representations of decimal 0 (=0D). Longer answer, well, not sure whether this answer is too long: [CODE]There are four commonly used methods for encoding [B]positive … | |
Re: Hello, yes there is, as you have already noticed: if you want fast access on the file name, the primary key should be this file name, provided that it is unique. If you had decided an autoincrement to be PK as usually, you would have to create an additional index … | |
Re: Hi, you can try this: [CODE]select coalesce(columnSometimesNULL, '0.00') from yourTable;[/CODE] -- tesu | |
Re: Hi your select statement is formally quite correct, except for ID which is a well known system identifier of MS SQL server itself. Because your select statement seems to be only constructed for asking your question it would really be a good idea to post the ORIGINAL erroneous statement AND … | |
Re: Hi, In this [URL="http://www.daniweb.com/forums/thread293999.html"]thread[/URL] I gave a solution on how to split strings into parts although it was for Oracle this statement also works on SQL Server and Sybase databases without changes. But I am afraid, you will need a more sophisticate solution because the number of tags within a … | |
Re: Well, getInFile is a class function of class FileController, where FileController might be inherited from eos because of eof(). If so, getInFile is very specific to class FileController which is not part of c++ iostream library. Therefore, nobody is able to state anything on the behaviour of getInFile nor the … | |
Re: [QUOTE]hello! i need to make this program that lets the user input like for example 99 then the program will output 'c'. i don't know how to start. but i thought about getting the first 9 first, then subtract 30h, the multiply it by 10. afterwards, add the other 9, … | |
Re: Selamat Siang, what you are doing is conventional inner join where join conditions ar in where-clause. The result set of inner join only contains rows where these join conditions (a.id_aduan=c.id_aduan AND c.id_bahagian=b.bahagian_id) be completely matched. Only outer joins (left, right, full) guarantee that rows are included in result set where … | |
Re: Hello, All these identifiers not found and listed in error listing are class functions, e.g. lugareslavagem in line 21. They are declared in CNoFila.h, however, there exists no implementation as yet. Corresponding to include file CNoFila.h there usually exists a further implemention file CNoFila.cpp, or some such thing, which must … | |
Re: Well, if you want to do suchlike string separation in query statement, you can make use of ora's string functions, such as: [CODE]select 'tag: key1, key2, key3' as st, length(st) as le, instr(st, ':') as lo, substr(st, 1, lo-1) as tag, substr(st, lo+1, le-lo) as whateverfor; /* st le lo … | |
Re: hi, you should remove the [COLOR="Red"][B];[/B][/COLOR] in this line: if(n<=18)[COLOR="Red"][B];[/B][/COLOR] -- tesu | |
Re: Hi Iznar I did some corrections on your program hopefully you will learn something of these. The lines I modified, added or deleted are marked by // and sometimes also explained. Because of your true problems with pointers you should particularly focus on the usage of & and * in … | |
Re: Well rayborn66, BOTH of your code snippets are WRONG as Ancient Dragon already pointed out. You should really go back to your [URL="http://www.daniweb.com/forums/thread294401.html"]former[/URL] thread and there you should carefully study my suggested code to understand why I put [B][U]fin >> next[/U][/B] within while loop exactly in the place where it … | |
Re: Obviously, size of paintComponent is a global variable (instance or class). Where the scope of Vizatuesi's size is local within this method even it is a formal parameter. Any changes of the local variable does not affect the globally defined size, that is just as living in two different worlds. … | |
Re: [QUOTE=cmsc;1266228]I was wondering if it is possible to subtract 30 from 4ah? i thought so i can convert the ascii character 'C' to hexadecimal '43', i will just subtract 30h from 43h, then add 30 so it will become 43 again and i will be able to perfrom arithmetic on … | |
Re: Well, some 8k entries and excecuting that select statement would last about 22 sec ? sounds really kind of unreal. So which database engine? Are there any primary keys and foreign keys, or indexes defined on tables: items it, relations rel, relation_types relType? If NOT, access time is proportional to … | |
Re: well then, what actually is wrong with your output? Why not posting this? Knowing your compiler would be a great help too. Indeed, there are such twerps still not knowing long double. Also there are some convention such as l or L or typecasting when processing long double. -- tesu | |
![]() | Re: Hello Could that be that you have mistaken counter and avg in: [CODE] stdDev = sqrt((totalDevSqrd / (avg - 1))); /* standard deviation equals the square root of the total square deviations devided by the average minus 1 */ // shouldn't it be? stdDev = sqrt((totalDevSqrd / (counter - 1))); … ![]() |
Re: Hello Not really sure whether it will work: 1. Sort the array by a method O(n log n), for example by heap or quick sort 2. Then access the array elements by bisection method, O(log n). -- tesu | |
Re: [QUOTE=annitaz;1266291]The character in memory position 109h = F[/QUOTE] Hello Well done ! Do you know how to prove it? -- tesu | |
Re: Hello, the WHY is given [URL="http://www.daniweb.com/forums/thread291865.html"]there[/URL] Carefully read my two postings. If you have still problems with aggregate functions and "missing" group-by clause, simply ask again. -- tesu | |
Re: [QUOTE=Silvershaft;1265935]I got only one entry and one column in my table so would I do like this [code] stmt = con->createStatement(); res = stmt->executeQuery("UPDATE users SET usersactive = usersactive+1"); [/code] This isn't working.. What do I do wrong[/QUOTE] Maybe this is finally missing: [CODE]res = stmt->executeQuery("COMMIT");[/CODE] It's always necessary after … | |
Re: Hi again, no, this is not a true brain-teaser, actually it's quite easy to give a correct data model. If you were plain followed my suggestions, you would have already solved it. -- tesu | |
Re: Hello, greetings from the closest hood ! Which mips assembly? The idea you sketched out is very good! It only functions this way. [CODE]# Assuming that the 64 bits int are always in two 32 bit regs ($11, $10) and ($21, $20), # where $11 and $21 contain the high … | |
Re: [QUOTE=Madawar;1264819]Hi, Am a self teaching Newbie Assembly programmer :) Still in the theoretical Stages. My question is.... [B]According to the book am reading When you convert 254(decimal) to hexadecimal you get 0FEh. And when you convert -2(decimal) to hexadecimal using two's complement you get OFEh.[/B] When i do it manually … | |
Re: As pritaeas already explained trigger cannot consist of PHP code. There are only SQL and PSM (Persistent Storage Modul, yes, that's a standardized procedural programming language, not only like Oracle's pl/sql but partly derived from it) allowed within a trigger. You may consult SQL standard 2003. Java, C, C++ or … | |
Re: [QUOTE]I have a table in my database named products with the fields [B]id[/B] and [B]model[/B] in it. Now, I need to get 'all' the products but with different model names and each result represent a valid product. I have tried with: select id, modelname, ... from products group by modelname … | |
Re: [QUOTE=wayn3san;1260698]I want to write an assembly program to convert Hexadecimal to Binary in 8086 assembly language. I am using Winasm as my compiler. However i have no idea how to write this code. Can anyone shed some light? thanks in advance![/QUOTE] Hello, how is your hex value coded and stored, … | |
Re: [QUOTE=cmsc;1260551]we were asked to make a program that adds two digit numbers. I was ableto scan and add the input numbers but I have trouble doing the 'carry' part. i can't divide the sum of the ones place integers by ten. what's wrong with this code? : [CODE] mov al,bl;move … | |
Re: Hi Werner, not an easy question yet a solution can be given by WITH-clause. [CODE]/* Assuming table xyz contains these rows: x y z ----------------- e w 9 e w 12 e wo 8 e wo 10 e wo 11 e wo 18 i w 4 i w 6 i … | |
Re: Hi iqra123 You may have a look into gnu C library. It contains fully DES Encryption, also MD5. If you are only interested in putting some cipher on your data, there is a nice method by using pseudo random numbers: sender side: for all chars of message to send do … | |
Re: Hi, If you are using EMU8086, I suppose you are about to learn assembly programming and generating a sequence of random numbers seems to be kind of exercise. EMU8086 does not have random number generator. Classical method for computing pseudo random numbers is the linear congruential random number generation method … | |
Re: Greetings from the hood First, to your question how to join 5 tables: [CODE]-- To get all steps of a person which are assigned via TaskOrders: select lastname from Persons p join taskorders o ON p.ID = o.personaidFK join tasks t ON t.ID = o.taskidFK join workflow w ON w.taskidFK … | |
Re: Well, to state a serious answer more information is needed: Processor, assembly, mermory organisation (aka memory model), and for we can access memory portions of 1 byte, 1 word, 1 dword (32Bit) you should also know what really should be accessed from abs. address 12345H. We also need to know … | |
Re: Hi >> I want to avoid multiple entry of a stock for the same timestamp in the database. Then put a timestamp attribute in the primary key, for example ts: [CODE]CREATE TABLE yourtable ( ts TIMESTAMP NOT NULL, a VARCHAR(20), PRIMARY KEY(ts)) ENGINE = InnoDB; [/CODE]Resolution of ts is approximately … | |
Re: Is there any error message at all? Did you use correct server, user name, password? explain connectDB() -- tesu ![]() | |
Re: Hi, though your polynomial function calls itself recursively (if we believe that "polinomyal" equals to "polynomial"), yet the value of the polynomial isn't computed recursively instead it is done in for loop if n becomes 0. You may study this code: [CODE]void pore(int d, float a[], float x, float *r){ … | |
Re: >> string currentChar = 0; should be char currentChar; Question: how to finish this loop: >> while (subscript < numChars) ? so what about subscript++ ? Greetings to Cotton State! I've often been to Huntsville :) -- tesu | |
Re: [QUOTE] can i have a bulk insert into specific columns ..for example just in user_name and u_id? [/QUOTE] yes, you need a [URL="http://msdn.microsoft.com/en-us/library/ms179250.aspx"]format file[/URL] when inserting data in a column's subset. In format file you specify which columns are to insert and which are to overleap. You may also read … | |
Re: MS SQL server also supports if and case statements within select. Your statement is syntactically incorrect (and much to complicated, too, to clarify such a problem). In principle if-else (there is no "then") on MS SQL server should look like: [CODE] if (select only_one_column from your_table where...) = 'E' begin … | |
Re: [CODE]UPDATE yourtable SET price=1 WHERE Name='Apples';[/CODE] It would be really easier and SAVER if you table has primary key. Consider that [CODE]UPDATE yourtable SET price=1;[/CODE] changes all three rows. -- tesu | |
Re: You may want to look up there: [URL="http://msdn.microsoft.com/en-us/library/ms682499%28VS.85%29.aspx"]http://msdn.microsoft.com/en-us/library/ms682499%28VS.85%29.aspx[/URL] -- tesu |
The End.