Search Results

Search found 29841 results on 1194 pages for 'random number generator'.

Page 113/1194 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • code to idetntify the number

    - by [email protected]
    Hi All, I got one problem while doing one TAPI application based project in C#. I'm using ITAPI3.dll My problem is.. i'm not getting incoming call information. To get the incoming call information, i'm using getcallinfo function. but it is showing empty message.

    Read the article

  • Sql query number of occurance

    - by phenevo
    Hi, I wanna to have query: Select cars.* from cars where cars.code in ( select carCode from articles where numberofrecords with this car (it is not a column) >1 and Accepted=1 order by date ) How to write it?

    Read the article

  • PHP function: find argument's variable name, and function calls line number

    - by Majid
    I want to do something like this for simplifying logging operations. Any idea what I should put in for ?[1]? and ?[2]?? function log_var($var) { $line = ?[1]?; $var_name = ?[2]?; $line--; $filepath = 'log-' . date('Y-m-d'). '.txt'; $message = "$line, $var_name = $var\n"; $fp = fopen($filepath, "a"); fwrite($fp, $message); fclose($fp); @chmod($filepath, 0666); return TRUE; } This how I'd use the function in code (numbers are assumed to be line numbers in actual code): 23 $a = 'hello'; 24 log_var($a); 25 $b = 'bye'; 26 log_var($b); And this is what I want to be written to the log file: 23, a = hello 25, b = bye

    Read the article

  • c permutation of a number

    - by Pkp
    I am writing a program for magic box. As the only way around it is brute force, I wrote a program to compute permutations of a given array using bells algorithm. I wrote in the lines similar to http://programminggeeks.com/c-code-for-permutation/. It does work for array of 3 and 4. It does not work for an arryay of 8 numbers (1,2,3,4,5,6,7,8). I see that the combination 1 2 3 4 5 6 7 8 gets repeated couple of times. Also there are other combinations that gets repeated. I see that certain combinations don't get displayed even. So could someone tell me what is wrong in the program below. Code: include<stdio.h> int len,numperm=1,count=0; display(int a[]){ int i; for(i=0;i<len;i++) printf("%d ",a[i]); printf("\n"); count++; } swap(int *a,int *b){ int temp; temp=*a; *a=*b; *b=temp; } no_of_perm(){ int x; for(x=1;x<=len;x++) numperm=numperm*x; } perm(int a[]){ int x,y; while(count < numperm){ for(x=0;x<len-1;x++){ swap(&a[x],&a[x+1]); display(a); } swap(&a[0],&a[1]); display(a); for(y=len-1;y>0;y--){ swap(&a[y],&a[y-1]); display(a); } swap(&a[len-1],&a[len-2]); display(a); } } main(int argc, char *argv[]){ if(argc<2){ printf("Error\n"); exit(0); } int i,*a=malloc(sizeof(int)*atoi(argv[1])); len=atoi(argv[1]); for(i=0;i<len;i++) a[i]=i+1; no_of_perm(); perm(a); }

    Read the article

  • SQLite Select an id which is smaller than a number

    - by user345039
    Hi, I am trying to only select the objects where the id is smaller than an int value. e.g.: i have 3 objects - id = 1, id = 2, id = 3 Now I want to only get the objects with the id smaller than the variable i = 2; How can I manage this? sql = "SELECT id FROM table_name WHERE id <= i"; Thanks ;-)

    Read the article

  • handling large number

    - by klw
    Hello, this is actually an problem question from project euler site http://projecteuler.net/index.php?section=problems&id=3 Anyway I'm not out after the solution, but I probably guess you will know what my approach is. To my question now, how do I handle numbers exceeding unsigned int? Is there a mathematical approach for this, if so where can I read about it?

    Read the article

  • how to number the datas from mysql

    - by udaya
    Hi This is a doubt on mysql select query let me axplain my doubt with a simple example consider this is my query SELECT dbCountry from tableCountry tableCountry has fields dbCuntryId dbCountry and dbState I have the result as dbCountry india america england kenya pakisthan I need the result as 1 india 2 america 3 england 4 kenya 5 pakisthan the numbers 12345 must be generated with the increase in data and itis not a autoincrement id How can i get it is it something like loop

    Read the article

  • use printf("text %d", number) type format to assign value to variable

    - by rksprst
    I would like to use the syntax that printf uses, using the %d, %s and adding values after to assign a value to a char[]. Is this possible? e.g. Given an output of: printf("now: %d-%d-%d %d:%d:%d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); I'd like to assign that to char[] output; How can this be done? I tried: sprintf(output, "now: %d-%d-%d %d:%d:%d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); but that didn't seem to work. Is sprintf used differently... or is that not what I should be using? Thanks!

    Read the article

  • Existing function to slice pandas object by axis number

    - by Zero
    Pandas has the following indexers: Object Type Indexers Series s.loc[indexer] DataFrame df.loc[row_indexer,column_indexer] Panel p.loc[item_indexer,major_indexer,minor_indexer] I would like to be able to index dynamically by axis, for example: df = pd.DataFrame(data=0, index=['row1', 'row2', 'row3'], columns=['col1', 'col2', col3']) df.index(['row1', 'row3'], axis=0) # index by rows df.index(['col1', 'col2'], axis=1) # index by columns Is there a built-in function that does this?

    Read the article

  • Read number from text file using C++ stream

    - by Yongwei Xing
    Hi all I have a text file like below 2 1 2 5 10 13 11 12 14 2 0 1 2 99 2 200 2 1 5 5 1 2 3 4 5 1 0 0 0 I want to read file line by line, and read the umbers from each line. I know how to use the stream to read a fixed field line, but what about the non-fixed line? Best Regards,

    Read the article

  • Java Int Array - Number being stored are different from ones specified

    - by Danadir
    Hey there, I have encountered the most weird problem ever in Java. When I am doing this: int []s = new int [5]; s[0] = 026; s[1] = 0011; s[2] = 1001; s[3] = 0026; s[4] = 1101; the numbers being stored in the array, seen from debug mode are different i.e. the numbers stored are 22,9,1001,22,1101. Can you give me some hints what might be wrong with this? Thanks in advance

    Read the article

  • Quickest way to compute the number of shared elements between two vectors

    - by shn
    Suppose I have two vectors of the same size vector< pair<float, NodeDataID> > v1, v2; I want to compute how many elements from both v1 and v2 have the same NodeDataID. For example if v1 = {<3.7, 22>, <2.22, 64>, <1.9, 29>, <0.8, 7>}, and v2 = {<1.66, 7>, <0.03, 9>, <5.65, 64>, <4.9, 11>}, then I want to return 2 because there are two elements from v1 and v2 that share the same NodeDataIDs: 7 and 64. What is the quickest way to do that in C++ ? Just for information, note that the type NodeDataIDs is defined as I use boost as: typedef adjacency_list<setS, setS, undirectedS, NodeData, EdgeData> myGraph; typedef myGraph::vertex_descriptor NodeDataID; But it is not important since we can compare two NodeDataID using the operator == (that is, possible to do v1[i].second == v2[j].second)

    Read the article

  • what math do i need to convert this number

    - by Uberfuzzy
    given an X, what math is needed to find its Y, using this table? x->y 0->1 1->0 2->6 3->5 4->4 5->3 6->2 language agnostic problem and no, i dont/cant just store the array, and do the lookup. yes, the input will always be the finite set of 0 to 6. it wont be scaling later.

    Read the article

  • construct a unique number for a string in java

    - by praveen
    We have a requirement of reading/writing more than 10 million strings into a file. Also we do not want duplicates in the file. Since the strings would be flushed to a file as soon as they are read we are not maintaining it in memory. We cannot use hashcode because of collisions in the hash code due to which we might miss a string as duplicate. Two other approaches i found in my googling: 1.Use a message digest algorithm like MD5 - but it might be too costly to calculate and store. 2.Use a checksum algorithm. [i am not sure if this produces a unique key for a string- can someone please confirm] Is there any other approach avaiable. Thanks.

    Read the article

  • PHP number range menu from array

    - by Julious
    Hello people! I'm a bit confused here. I have a php array like this Array(2010,2009,2008 ...1992) and i want to create a loop to print a menu with a four year range counting down like this 2010-2006 2005-2001 2000-1996 etc.. How can i do this Everything i tried end up in an endless loop. THnx in advance. J.

    Read the article

  • How much does precomputation (matching a series of strings and their permutations with a set number

    - by nipun
    Consider a typical slots machine with n reels(say reel1: a,b,c,d,w1,d,b, ..etc). On play we generate a concatenated string of n objects (like for above, chars) We have a paytable which lists winning strings with payout amounts. The problem is a wild character (list of wilds: w1,w2) which can replace {w1:a,b,c},{w2:a} ..etc. Is it really worthwhile to have all possible winning strings permutations with the wilds precomputed and used or simply at the time of occurance, generate all combinations with the pattern in hand accordingly. I did'nt really see much difference initially, but now if I need to scale the machine to handle 11+ reels with a much higher concentration of wilds than previously, I need to figure out the exact approach for this particular bit. Any ideas will be really appreciated :)

    Read the article

  • Determining smallest number of samples for 99% accuracy

    - by test
    I'm trying to compare 100,000 records on a local database (L) with 100,000 records on a remote database (R). Basically I want to know if an elment in L exusts in R. To determine that, I have to make a request against the R for each L, which takes a long time (I know, there should be a better way, there isn't, that's the API I've got). So I would like to test a small sample of L against R, and then infer with some level of confidence how many are present in the whole R. How many do I have to test to have a 99% confidence level?

    Read the article

  • 1136: Incorrect number of arguments. Expected 0.? AS3 Flash Cs4

    - by charmaine
    Basically i am working through a book called..Foundation Actionscript 3.0 Animation, making things move. i am now on Chapter 9 - collision detection. On two lines of my code i get the 1135 error, letting me know that i have an incorrect number of arguments. Can anybody help me out on why this may be? package { import flash.display.Sprite; import flash.events.Event; public class Bubbles extends Sprite { private var balls:Array; private var numBalls:Number = 10; private var centerBall:Ball; private var bounce:Number = -1; private var spring:Number = 0.2; public function Bubbles() { init(); } private function init():void { balls = new Array(); centerBall = new Ball(100, 0xcccccc); addChild(centerBall); centerBall.x = stage.stageWidth / 2; centerBall.y = stage.stageHeight / 2; for(var i:uint = 0; i < numBalls; i++) { var ball:Ball = new Ball(Math.random() * 40 + 5, Math.random() * 0xffffff); ball.x = Math.random() * stage.stageWidth; ball.y = Math.random() * stage.stageHeight; ball.vx = Math.random() * 6 - 3; ball.vy = Math.random() * 6 - 3; addChild(ball); balls.push(ball); } addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(event:Event):void { for(var i:uint = 0; i < numBalls; i++) { var ball:Ball = balls[i]; move(ball); var dx:Number = ball.x - centerBall.x; var dy:Number = ball.y - centerBall.y; var dist:Number = Math.sqrt(dx * dx + dy * dy); var minDist:Number = ball.radius + centerBall.radius; if(dist < minDist) { var angle:Number = Math.atan2(dy, dx); var tx:Number = centerBall.x + Math.cos(angle) * minDist; var ty:Number = centerBall.y + Math.sin(angle) * minDist; ball.vx += (tx - ball.x) * spring; ball.vy += (ty - ball.y) * spring; } } } ***private function move(ball:Ball):void*** { ball.x += ball.vx; ball.y += ball.vy; if(ball.x + ball.radius > stage.stageWidth) { ball.x = stage.stageWidth - ball.radius; ball.vx *= bounce; } else if(ball.x - ball.radius < 0) { ball.x = ball.radius; ball.vx *= bounce; } ***if(ball.y + ball.radius > stage.stageHeight)*** { ball.y = stage.stageHeight - ball.radius; ball.vy *= bounce; } else if(ball.y - ball.radius < 0) { ball.y = ball.radius; ball.vy *= bounce; } } } } The bold parts are the lines im having trouble with! please help..thanks in advance!!

    Read the article

  • How do you think about an Application Generator? [closed]

    - by Mehdi Sheyda
    I'm designing an application-generating application. It is an application that takes the requirements of customer as inputs , analyzes the requirements, creates classes and produces program files in C#. I am at the beginning of this project and have a long way to go with this application. Do you have an experience with designing similar kinds of projects? What risks might I encounter with this project?

    Read the article

  • 1136: Incorrect number of arguments. Expected 0 AS3 Flash CS5.5 [on hold]

    - by Erick
    how do I solve this error? I've been trying to get the answer online but have not been successful. I'm trying to learn As3 for flash so I decided to try making a preloader for a game. Preloader.as package com.game.moran { import flash.display.LoaderInfo; import flash.display.MovieClip; import flash.events.*; public class ThePreloader extends MovieClip { private var fullWidth:Number; public var ldrInfo:LoaderInfo; public function ThePreloader (fullWidth:Number = 0, ldrInfo:LoaderInfo = null) { this.fullWidth = fullWidth; this.ldrInfo = ldrInfo; addEventListener(Event.ENTER_FRAME, checkLoad); } private function checkLoad (e:Event) : void { if (ldrInfo.bytesLoaded == ldrInfo.bytesTotal && ldrInfo.bytesTotal !=0) { dispatchEvent (new Event ("loadComplete")); phaseOut(); } updateLoader (ldfInfo.bytesLoaded / ldrInfo.bytesTotal); } private function updateLoader(num:Number) : void { mcPreloaderBar.Width = num * fullWidth; } private function phaseOut() : void { removeEventListener (Event.ENTER_FRAME, checkLoad); phaseComplete(); } private function phaseComplete() : void { dispatchEvent (new Event ("preloaderFinished")); } } } Engine.as package com.game.moran { import flash.display.MovieClip; import flash.display.Sprite; import flash.events.Event; public class Engine extends MovieClip { private var preloader:ThePreloader; public function Engine() { preloader = new ThePreloader(732, this.loaderInfo); stage.addChild(preloader); preloader.addEventListener("loadComplete", loadAssets); preloader.addEventListener("preloaderFinished", showSponsors); } private function loadAssets (e:Event) : void { this.play(); } private function showSponsors(e:Event) : void { stage.removeChild(preloader); trace("show sponsors") } } } The line being flagged as an error is line 13 in Engine.as.

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >