Search Results

Search found 6031 results on 242 pages for 'imaginary numbers'.

Page 102/242 | < Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >

  • Decimal data type in Visual Basic 6.0

    - by Appu
    I need to do calculations (division or multiplication) with very large numbers. Currently I am using Double and getting the value round off problems. I can do the same calculations accurately on C# using Decimal type. I am looking for a method to do accurate calculations in VB6.0 and I couldn't find a Decimal type in VB6.0. What is the data type used for doing arithmetic calculations with large values and without getting floating point round off problems? Thanks

    Read the article

  • Complex(?) regex: Is expression, but not another

    - by Kieron
    (If you can make a better title, please do) Hi, I need to make sure a string matches the following regex: ^[0-9a-zA-Z]{1}[0-9a-zA-Z\.\-_]*$ (Starts with a letter or number, then any number of letters, numbers, dots, dashes or underscores) But given that, I need to make sure it doesn't match a Guid, my Guid matching reg-ex looks like this (obviously, this needs to be negated in the merged result): ^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$ The last requirement here is that they must (if it's possible) be merged into a single expression.

    Read the article

  • two's complement, why the name "two"

    - by lenatis
    i know unsigned,two's complement, ones' complement and sign magnitude, and the difference between these, but what i'm curious about is: why it's called two's(or ones') complement, so is there a more generalize N's complement? in which way did these genius deduce such a natural way to represent negative numbers?

    Read the article

  • Tetris Piece Rotation Algorithm

    - by coppercoder
    What are the best algorithms (and explanations) for representing and rotating the pieces of a tetris game? I always find the piece rotation and representation schemes confusing. Most tetris games seem to use a naive "remake the array of blocks" at each rotation: http://www.codeplex.com/Project/ProjectDirectory.aspx?ProjectSearchText=tetris However, some use pre-built encoded numbers and bit shifting to represent each piece: http://www.codeplex.com/wintris Is there a method to do this using mathematics (not sure that would work on a cell based board)?

    Read the article

  • 4096 MiB SD card in Android Emulator... less than 9MB?

    - by Izhido
    Every time I attempt to create a new AVD with the latest Android SDK (under Eclipse), I can't actually specify SD Card Sizes greater than 1024 MiB. Any attempt to specify higher numbers gets me always the same message: "SD Card Size must be at least 9MB" What gives? Any idea why this could be happening?

    Read the article

  • Best way to get ints from a string with whitespace?

    - by befall
    Hey all, I know this is simple, I just can't recall the best way to do this. I have an input like " 5 15 " that defines the x and y of a 2D vector array. I simply need those two numbers into int col and int row. What's the best way to do this? I was attemping stringstreams, but can't figure out the correct code. Thanks for any help!

    Read the article

  • trying to find the comment hook I need for wordpress?

    - by beagleguy
    hi all , I'm writing a wordpress plugin that will execute a certain function when a user submits a comment. The only issue is I'm using the hook "comment_post" which works but if that comment gets stopped by akismet I'm still logging that comment but now my numbers are off from what's on the actual site. Is there a comment_approved type hook I should be using instead? thanks!

    Read the article

  • Embed pdb into assembly

    - by Konstantin
    Hi! I want my application to be distributable as a single .exe file but I want to be able to get nice error reports with source code line numbers (the application simply sends email with exception.ToString() and some additional information when unhandled exception occurs). Is there any way to embed .pdb into assembly?

    Read the article

  • Format all elements of a list

    - by Curious2learn
    I want to print a list of numbers, but I want to format each member of the list before it is printed. For example, theList=[1.343465432, 7.423334343, 6.967997797, 4.5522577] I want the following output printed given the above list as an input: [1.34, 7.42, 6.97, 4.55] For any one member of the list, I know I can format it by using, print "%.2f" % member Is there a command/function that can do this for the whole list. I can write one, but was wondering if one already exists. Thanks.

    Read the article

  • dynamic programming [closed]

    - by shruti
    the input to this problem is a sequence S of integers(not necessarily positive). the problem is to find consecutive subsequence of S with maximum sum using dynamic programming. consecutive means that you are not allowed to skip numbers. for example: if the input was 12,-14,1,23,-6,22,-34,-13. the output would be 1,23,-6,22.

    Read the article

  • Running response time tests on php code - how much is 7.2E-5 microseconds?

    - by Ali
    Hi guys I'm using microtime() function of php to tell how long certain snippets of code take to run I do this by taking the time before and after the snippet and subtracting them using microtime function. I got the following results though for the different snippets: 1 - 0.022976 2 - 0.003656 3 - -0.196361 4- 0.006563 5- 7.2E-5 6- 0.847695 7- 0.005092 8- 7.6E-5 9- 0.08024 The first numbers represent the snippt and the following the time taken... I've forgotten whatever I learnt back in College on numerical methods :( - how big is 7.2E-5 microseconds?

    Read the article

  • Decimal point issue on cocoa app

    - by Manuel Rocha
    I there, I'm trying making my first cocoa app, but I'm having problems with float numbers because of the regional settings. If I write on the TextBox the float number 1.2 I only can get the number 1, but If I write on the same TextBox the same float number but this time with the ',' sign instead (1,2) I can get the right float value. How can I bypass the regional settings? Kind Regards, Manuel Rocha

    Read the article

  • How to validate integer and float input in asp.net textbox

    - by Rajesh Rolen- DotNet Developer
    I am using below code to validate interger and float in asp.net but if i not enter decimal than it give me error <asp:TextBox ID="txtAjaxFloat" runat="server" /> <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" TargetControlID="txtAjaxFloat" FilterType="Custom, numbers" ValidChars="." runat="server" /> i have this regex also but its giving validation error if i enters only one value after decimal.. http://stackoverflow.com/questions/617826/whats-a-c-regular-expression-thatll-validate-currency-float-or-integer

    Read the article

  • Retrieve sequence of data from different columns.

    - by janetsmith
    Let's say I have a table containing following data: | id | t0 | t1 | t2 | | 1 | 4 | 5 | 6 | | 2 | 3 | 3 | 2 | | 3 | 6 | 4 | 5 | | 4 | 4 | 5 | 5 | I want to retrieve all the rows containing 4, 5, 6 (regardless the position of numbers in the tables), so row 1 & row 3 will be selected. How to do that with SQL query?

    Read the article

  • Histogram using gnuplot?

    - by mary
    I know how to create a histogram (just use "with boxes") in gnuplot if my .dat file already has properly binned data. Is there a way to take a list of numbers and have gnuplot provide a histogram based on ranges and bin sizes the user provides?

    Read the article

  • Float PPM image file format?

    - by Luca
    I've found a PPM image with the header starting with PF. The resolution number is stored in floating point (-1.000). No comments are inserted to get how it was produced. From the resolution, each pixel is composed by 12 bytes (4 bytes per component)... I suppose they are float or integer numbers. The problem is that I cannot get a clear image. Someone has already found this kind of images?

    Read the article

  • Is there a library or other way to do 128-bit math operations?

    - by samoz
    I am writing a cryptography application and need to work with 128 bit numbers. In addition to standard add, subtract, multiply, divide, and comparisons, I also need a power and modulo function as well. Does anyone know of a library or other implementation that can do this? If not 128-bit, is there a 64-bit option available?

    Read the article

  • How can I read individual lines of a CSV file into a string array, to then be selectively displayed

    - by Ryan
    I need your help, guys! :| I've got myself a CSV file with the following contents: 1,The Compact,1.8GHz,1024MB,160GB,440 2,The Medium,2.4GHz,1024MB,180GB,500 3,The Workhorse,2.4GHz,2048MB,220GB,650 It's a list of computer systems, basically, that the user can purchase. I need to read this file, line-by-line, into an array. Let's call this array csvline(). The first line of the text file would stored in csvline(0). Line two would be stored in csvline(1). And so on. (I've started with zero because that's where VB starts its arrays). A drop-down list would then enable the user to select 1, 2 or 3 (or however many lines/systems are stored in the file). Upon selecting a number - say, 1 - csvline(0) would be displayed inside a textbox (textbox1, let's say). If 2 was selected, csvline(1) would be displayed, and so on. It's not the formatting I need help with, though; that's the easy part. I just need someone to help teach me how to read a CSV file line-by-line, putting each line into a string array - csvlines(count) - then increment count by one so that the next line is read into another slot. So far, I've been able to paste the numbers of each system into an combobox: Using csvfileparser As New Microsoft.VisualBasic.FileIO.TextFieldParser _ ("F:\folder\programname\programname\bin\Debug\systems.csv") Dim csvalue As String() csvfileparser.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited csvfileparser.Delimiters = New String() {","} While Not csvfileparser.EndOfData csvalue = csvfileparser.ReadFields() combobox1.Items.Add(String.Format("{1}{0}", _ Environment.NewLine, _ csvalue(0))) End While End Using But this only selects individual values. I need to figure out how selecting one of these numbers in the combobox can trigger textbox1 to be appended with just that line (I can handle the formatting, using the string.format stuff). If I try to do this using csvalue = csvtranslator.ReadLine , I get the following error message: "Error 1 Value of type 'String' cannot be converted to '1-dimensional array of String'." If I then put it as an array, ie: csvalue() = csvtranslator.ReadLine , I then get a different error message: "Error 1 Number of indices is less than the number of dimensions of the indexed array." What's the knack, guys? I've spent hours trying to figure this out. Please go easy on me - and keep any responses ultra-simple for my newbie brain - I'm very new to all this programming malarkey and just starting out! :)

    Read the article

  • a non recursive approach to the problem of generating combinations at fault

    - by mark
    Hi, I wanted a non recursive approach to the problem of generating combination of certain set of characters or numbers. So, given a subset k of numbers n, generate all the possible combination n!/k!(n-k)! The recursive method would give a combination, given the previous one combination. A non recursive method would generate a combination of a given value of loop index i. I approached the problem with this code: Tested with n = 4 and k = 3, and it works, but if I change k to a number 3 it does not work. Is it due to the fact that (n-k)! in case of n = 4 and k = 3 is 1. and if k 3 it will be more than 1? Thanks. int facto(int x); int len,fact,rem=0,pos=0; int str[7]; int avail[7]; str[0] = 1; str[1] = 2; str[2] = 3; str[3] = 4; str[4] = 5; str[5] = 6; str[6] = 7; int tot=facto(n) / facto(n-k) / facto(k); for (int i=0;i<tot;i++) { avail[0]=1; avail[1]=2; avail[2]=3; avail[3]=4; avail[4]=5; avail[5]=6; avail[6]=7; rem = facto(i+1)-1; cout<<rem+1<<". "; for(int j=len;j>0;j--) { int div = facto(j); pos = rem / div; rem = rem % div; cout<<avail[pos]<<" "; avail[pos]=avail[j]; } cout<<endl; } int facto(int x) { int fact=1; while(x0) fact*=x--; return fact; }

    Read the article

< Previous Page | 98 99 100 101 102 103 104 105 106 107 108 109  | Next Page >