I'm designing a LongDouble datatype which take a 16 byte space. my question is how to add or substract a two double numbers correctly ex : a= 3.025466 b=4.132655`` the result will be 7.158121 but in my code it's different here is my code LongDouble LongDouble::operator+( LongDouble olong) { LongDouble temp; if (this->sign == 0 && olong.sign == 0) { temp.exponent = this->exponent + olong.exponent; for (int i = 0; i < 7; i++) temp.mantissa[i] = this->mantissa[i] + olong.mantissa[i]; if (temp.mantissa[0] > 9) { temp.exponent += 1; temp.mantissa[0]-=10; } temp.sign = 0; } if (this->sign == 1 && olong.sign == …

Member Avatar
Member Avatar
+0 forum 4

Rightnow i am facing a problem of print Long Text. In my database i have data in long text format and that field has around 2000 line of text so how can i print that. I am giving here full code of my file please go through it and try to solve my problem <?php if($objConnect = mysql_connect("localhost","root","")){ $objDB = mysql_select_db("android"); $from_date=$_GET['from_date']; $to_date=$_GET['to_date']; $time = strtotime($from_date); $time1 = strtotime($to_date); $fdate = date( 'Y-m-d', $time ); $todate = date( 'Y-m-d', $time1 ); $tmpdate=""; $time2 = strtotime($tmpdate); $tempdate = date( 'Y-m-d', $time2 ); if($fdate==$tempdate){ echo "if block"; $strSQL = "SELECT LessonText FROM …

Member Avatar
Member Avatar
+0 forum 10

Hi, I am trying to generate a spool file through below anonymous block in order to find out views on a particualar table. declare cursor c1 is select view_name,text from users_view; rt c1%rowtype; begin open c1; loop fetch c1 into rt; exit when c1%notfound; dbms_output.put_line(rt.view_name || '|' || rt.text); end loop; end; When I run it I get an error as "numeric or value errors", however if I remove text(LONG) column from cursor defination the block goes through without any error. I understand that we can not use LONG data type in a where clause but is it that it …

Member Avatar
Member Avatar
+0 forum 1

I really got bored and tired of trying to find or remember some codes usage in so many files saved on my system, when it was needed. So, I called 'Monsieur' perl for help, hacking together some codes which works great for me and solve my problem of boredom. You run the code from the CLI, like so: perl <perl_script.pl> <-l | -location> <-s | -search > E.g. perl search_doc.pl -l Desktop/Doc_file -s Win32::OLE 1. Your perl file : search_doc.pl 2. Your location : -l Desktop/Doc_file or -location Desktop/Doc_file 3. Your search string: -s Win32::OLE or -search Win32::OLE You can …

Member Avatar
Member Avatar
+0 forum 14

We recently had our account suspended (without warning - thanks 1&1) due to exceeding server load. The reason this happened was there were quite a few divs that were refreshing (via Ajax) every 9 seconds to give a 'live update' on the site (it is a sports site so this was to give live score updates etc). Now I am looking for an alternative way of getting the same functionality without putting strain on the server and, ideally, not register a page hit on each refresh and hopefully someone can give me advice on the best way to go. Currently, …

Member Avatar
Member Avatar
+0 forum 5

I am getting wrong output. My Code is following, in which I have to use function unsigned long powerof2(int n); #include <stdio.h> #include <stdlib.h> #include <math.h> //int powerof2(int n); unsigned long powerof2(int n); int main(void) { printf(" n 2^n\n"); printf("-- ---\n"); for (int n=0; n<65 ;n++) { //printf(" n 2^n\n"); printf("%d %ld\n", n, powerof2(n)); } } unsigned long powerof2(int n) { unsigned long y; for(int j=0;j<65;j++) { if (n == 64) y = 0; else y = 1 << n; } return y; } Output: n 2^n -- --- 0 1 1 2 2 4 3 8 4 16 5 …

Member Avatar
Member Avatar
+0 forum 5

I need help with this http://codepad.org/FNUci22s I am posting the ling of code pad because it has a way to execute it, so long story short. I use two different functions seno, sen (both for sin). When using the printf and adressing both to compare results I get from the seno function the correct result(sin(45)=0.70710) but the moment I remove the other function from the printf i get "nan". Funcitons dont depend from each other.

Member Avatar
Member Avatar
+0 forum 2

Hi all, I implemented a C program using my mac book. Now, my client wants to migrate to windows OS (MinGW). Program does many calculation using long double: on mac it works fine, otherwise on winz doesn't. I read on internet the problem is that long double type is supposed to be a double type in WinZ, because it is no supported. Making sizeof of double and long double, I obtain: MAC DOUBLE=8, LONG DOUBLE=16 WINZ DOUBLE=8, LONG DOUBLE=12 Is there a solution or a workaround? How can I "force" the use of long double or its simulation? Sorry for …

Member Avatar
Member Avatar
+0 forum 4

Hi Everyone! My question is on Pagination (as it is called). I have a php program that accesses a database and shows the result list with HTML. Well, if my result list is quite long how do i code so that only say 10 rows show per page. I know that there have been past discussions on Pagination. I went through them. But as i am a novice, i could not really understand the logic of the long codes. So if someone could take little time out and give me an overview of the basic logic of pagination and how …

Member Avatar
Member Avatar
+0 forum 1

Hi, There is a bug with the editor that I noticed and others noticed too. When you post a very long code segment (or maybe just a long post, period), at some point it seems to overflow the capacity of the editor and you can no longer scroll all the way to the end of the post. The scroller becomes weird and jumps around, but you can never get to actually see the latter end of the post in the editor. You can still edit the content after where the editor stops, and that content still turns up in the …

Member Avatar
Member Avatar
+0 forum 7

Hi, below is my code for an android app I am developing, I was wondering how I can pass the value of pos from the array adapter to another activity through intent? What I would like is for the code in the next activity to be performed based on the value of the array's position from this file. I understand I have to use putExtras, but I don't understand how exactly to pass this value with the return type of onItemSelected being void. public class App2Activity extends Activity { Button button1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main2); Spinner …

Member Avatar
Member Avatar
+0 forum 3

I would like to take string argument for class BalancedTrinary intializer, but the string type of argument is processed before it enters the init function. I guess I must override any class method which deals with those for int/long? def val(number_sequence, base): """ produce integer value of number_sequence as base number """ print number_sequence return sum(int(n) * base ** p for p, n in enumerate(reversed(number_sequence))) def balanced_ternary_value(number): """ produce integer value of balanced ternary number """ #print 'balanced_ternary_value', number, type(number) return val([(-1 if c == '-' else (1 if c == '+' else 0)) for c in str(number)], 3) def …

Member Avatar
Member Avatar
+0 forum 1

Why do we have to suffix long literals by 'L' or 'l' even though we have specified the datatype ? Does it serve any special purpose?

Member Avatar
Member Avatar
+0 forum 2

Hello. I've been doing a small application that will go (using only unsigned integer values) from 0 to 4026531840 and print them out. My code is next: [CODE]#include <stdio.h> #include <inttypes.h> int main(void){ uint64_t cnt; for(cnt=0;cnt<=4026531840;cnt++){ printf("%d\n",cnt); } } [/CODE] The only problem that i have is the last numbers are negative (the really last one is -268435456). I also tried using: [CODE]#include <stdio.h> int main(void){ unsigned long long int cnt; for(cnt=0;cnt<=4026531840;cnt++){ printf("%d\n",cnt); } } [/CODE] but the problem persists. I'm using gcc: Target: x86_64-linux-gnu gcc version 4.6.1 (Debian 4.6.1-4) on my linux machine: Linux mysql 3.0.0-1-amd64 #1 SMP Sat …

Member Avatar
Member Avatar
+0 forum 2

hey guys, when do we use "long"? and what is it anyway? like: [B] public [COLOR="Red"]long[/COLOR] someStuff([COLOR="Red"]long[/COLOR] n) { ..... ..... } [/B] thanks :)

Member Avatar
Member Avatar
+0 forum 4

Hey guys, I need to find the length of a long variable (how many numbers it holds). So if the variable holds: '1234567890' then I want to return an int value of '10'. varName.Length() doesn't work, and I haven't found anything from google or msdn. Thanks for the help, - [B][I]WolfShield[/I][/B]

Member Avatar
Member Avatar
+0 forum 5

[CODE] // foo vector of unsigned chars // contains 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x00, 0x1F, 0xEC 0x82 std::vector< unsigned char > foo; long some_long = (long)&foo[6]; // i want the unsigned chars 0x00, 0x1F, 0xEC 0x82 to // make up the long decimal value of 2092162 [/CODE] Now the above would work if my system was big-endian however how do i get this to work for little-endian? Also is the above way preferred? or should I be using something like below: [CODE] std::copy(&foo[6], &foo[6] + sizeof(long), reinterpret_cast<unsigned char*>(&some_long)); [/CODE]

Member Avatar
Member Avatar
+0 forum 5

Here is code for hexagonal and pentagonal numbers. I need type that stores something bigger than 10 billion. Double works fine to about 8.4 billion. Of course I tried using long long and unsigned long long but it's still not working. Please repair this code because it overflows now matter what I do or explain how to use GMP library. I'm using CodeBlocks 10.5. Best regards. [CODE]#include <stdio.h> #include <math.h> double Pentagonal(int n){ double P = 0; P = (3*n*n - n) / 2; P = -P; return P; } double Equation(){ double x1,x2,remainder = 0; //where the cycle starts …

Member Avatar
Member Avatar
+0 forum 2

hi, is there a way to convert from string to long? for eg: i want to concatenate all the arrays into data and make it same type (long) as data1. [CODE] a='0x' array0 = '00000018000004000000000000000000' array1 = '00000000000000000000000000000000' array2 = 'fe000000000000000000000000000000' array3 = '00000000000000000000000000ffffff' data = a+array0+array1+array2+array3 print data print type(data) data1 = 0x0000001800000400000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000ffffff print type(data1) [/CODE]code: ###result: 0x0000001800000400000000000000000000000000000000000000000000000000fe00000000000000000000000000000000000000000000000000000000ffffff <type 'str'> <type 'long'> ###### thanks tcl

Member Avatar
Member Avatar
+0 forum 4

Hi, I have analyzed and collected a few Long Tail Keywords. Is there any special technique available to promote these long tail keywords other than the usual way of doing things like Articles, Forums, etc. Any ideas would be appreciated. Thanks in advance

Member Avatar
Member Avatar
+0 forum 6

I have too make an application in C that uses a dictionary. I have 54000 words in a file, on per line and I need a way to handle it. - I first wanted to keep it in an array but as it's bigger that INT (32767) I cannot do that. - The second option is to keep all in a very long string but it seems it give me some errors and throws me out of program. I tried to use a pointer for char like this: [CODE] FILE *f=fopen("d.txt","r"); char *line; while(fgets(line,sizeof(line),f)){ strcat(str,line);//concatenate all strings to this one …

Member Avatar
Member Avatar
+0 forum 13

The End.