Search Results

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

Page 197/1194 | < Previous Page | 193 194 195 196 197 198 199 200 201 202 203 204  | Next Page >

  • Excel macro, to copy and paste a cell value based on another cell value?

    - by Keziah Dorman
    Hi I shall try to explain clearly what I need to be able to do, here goes: I have an Excel spread sheet 1 with postcodes in column a and a number in column b. I need to create a macro/formula so that it will see the number (i.e 4) and copy and paste the postcode that number of times into sheet 2 column a underneath each other. I need to do this for the next row down etc until it comes to a blank. Sheet 1 A,B DE43PP,3 DE43PQ,8 Sheet 2 A,B DE43PP, DE43PP, DE43PP, Thanks

    Read the article

  • any faster alternative??

    - by kaushik
    have file data of format 3.343445 1 3.54564 1 4.345535 1 2.453454 1 and so on upto 1000 lines and i have number given such as a=2.44443 for the given file i need to find the row number of the numbers in file which is most close to the given number "a" how can i do this i am presently doing by loading whole file into list and comparing each element and finding the closest one any other better faster method?

    Read the article

  • RTL shows numbers at the end of lines

    - by Tiger
    Hi. Trying to display a hebrew string that starts with a number, always displays the number at the end of the string like so: 1. ??? ???? ????? but I need the number to be displayed at the right side of the text- any solution to that? It happens with UILabel & UITextField & UITextView and trying to write the number at the left side also produce the same resault. Playing with combinations of UITextAlignment will doesn't help.

    Read the article

  • jCarousel jQuery ajax loading 1000 records

    - by user1714862
    I'm using jCarousel to present a vertical scolling list of +-1000 names. I am using ajax to load the data 100 records at a time then when all the data has loaded I just let the jCarousel loop in the DOM. I have the ajax and loop all working but would like to make the code work no matter how large the total record count becomes. 1) I'd like to eliminate the 1201 fixed number and use a variable. 2) I currently loop on every record I see (carousel.first) to see if it matches my reload position(s) (albeit the loop is ony 12x it still seems a little "loopy") Any suggestions on improving this? function mycarousel_itemLoadCallback(carousel, state) { //if (carousel.has(carousel.first, carousel.last)) { //return; //} var getCount = 100; // Number of records to grab at a time var maxCount = 1201; // total possible number of records var visible = 9; // the number of records you can see in the window so this creates a pre-load by this number of records for (var i = 1; i < maxCount; i+=getCount ) { if (carousel.first === 1 || carousel.first === (i-visible)){ var getFrom = i; var getTo = getFrom+(getCount-1); //alert('TOP Record ='+carousel.first+'\n Now GET '+getFrom+'-'+getTo); jQuery.get('#ajaxscript#', { first: getFrom, last: getTo }, function(xml) { mycarousel_itemAddCallback(carousel, getFrom, getTo, xml); }, 'xml' ); break; } } };

    Read the article

  • jQuery $.each()-problem

    - by Volmar
    Hi, im making a wordpress plugin and i have a function where i import images, this is done with a $.each()-loop that calls a .load()-function every iteration. The load-function page the load-function calls is downloading the image and returns a number. The number is imported into a span-element. The source and destination Arrays is being imported from LI-elemnts of a hidden ULs. this way the user sees a counter counting from zero up to the total number of images being imported. You can se my jQuery code below: jQuery(document).ready(function($) { $('#mrc_imp_img').click(function(){ var dstA = []; var srcA = []; $("#mrc_dst li").each(function() { dstA.push($(this).text()) }); $("#mrc_src li").each(function() { srcA.push($(this).text()) }); $.each(srcA, function (i,v) { $('#mrc_imgimport span.fc').load('/wp-content/plugins/myplugin/imp.php?num='+i+'&dst='+dstA[i]+'&src='+srcA[i]); }); }); }); This works pretty good but sometimes it looks like the load function isn't updating the DOM as fast as it should because sometimes the numbers that the span is updated with is lower than the previous and almost everytime a lower number is replacing the last number in the end. How can i prevent this from happening and how can i make it hide '#mrc_imp_img' when the $.each-loop is ready?

    Read the article

  • Javascript Inheritance and Arrays

    - by Inespe
    Hi all! I am trying to define a javascript class with an array property, and its subclass. The problem is that all instances of the subclass somehow "share" the array property: // class Test function Test() { this.array = []; this.number = 0; } Test.prototype.push = function() { this.array.push('hello'); this.number = 100; } // class Test2 : Test function Test2() { } Test2.prototype = new Test(); var a = new Test2(); a.push(); // push 'hello' into a.array var b = new Test2(); alert(b.number); // b.number is 0 - that's OK alert(b.array); // but b.array is containing 'hello' instead of being empty. why? As you can see I don't have this problem with primitive data types... Any suggestions?

    Read the article

  • @Html.Label won't allow string concatination

    - by MrGrigg
    I'm building dynamic forms based on a partial view. My view inherits a model with a single property: CatalogName { get; set; }. I have tried this: @Html.Label(Model.CatalogName + "-ProductNumber", "Product Number") @Html.TextBox(Model.CatalogName + "-ProductNumber") The HTML renders like this though: <label for>Product Number</label> <input name="CatatalogName-ProductNumber" type="text" /> If I write my code like this: @Html.Label("ProductNumber-" + Model.CatalogName", "Product Number") It will render the way I expect <label for="ProductNumber-CatalogName">Product Number</label> Is this a bug with MVC? Are there any answers to why my concatenation won't work the way I want it in the label, but works fine with the TextBox?

    Read the article

  • MYSQL Query using subquery

    - by Michael Quiles
    Cant get this to work can any one help. List the part number, part description, and on_hand value of each part whose number of units on hand is more than the average number of units onhand for all parts use a subquery? SELECT PART_NUM, DESCRIPTION, SUM(ON_HAND * PRICE) ON_HAND_VALUE FROM PART; WHERE MAX(ON_HAND); (AVG(ON_HAND) > ON_HAND);

    Read the article

  • undefined method `output_data' for #<EventManager:0x007fa4220320c8> (NoMethodError)

    - by Roger Camps
    I keep getting this error: event_manager.rb:83:in': undefined method output_data' for #<EventManager:0x007fc5018320c0> (NoMethodError) I am following the exercise on this website: Here is my code (My error comes towards the end with DEF OUTPUT_DATA ...): # Dependencies require "csv" # Class Definition class EventManager INVALID_PHONE_NUMBER = "0000000000" INVALID_ZIPCODE = "00000" def initialize puts "EventManager Initialized." filename = "event_attendees.csv" @file = CSV.open(filename, {:headers => true, :header_converters => :symbol}) end def print_names @file.each do |line| puts line.inspect puts line[2] + " " + line[3] end end #printing home phone number method def print_numbers @file.each do |line| number = clean_number(line[:homephone]) puts number end end #cleaning numbers method def clean_number(number) cleaner= number.delete('.' + ')' + '(' + '-') if cleaner.length == 10 # Do Nothing elsif cleaner.length == 11 if cleaner.start_with?("1") cleaner = cleaner[1..-1] else cleaner = INVALID_PHONE_NUMBER end else cleaner = INVALID_PHONE_NUMBER end return cleaner end def clean_zipcode(original) if original.nil? zipcode = INVALID_ZIPCODE elsif original.length < 5 while original.length < 5 original = original.insert(0, "0") end else return original end return zipcode end def print_zipcodes @file.each do |line| zipcode = clean_zipcode(line[:zipcode]) puts zipcode end def output_data output = CSV.open("event_attendees_clean.csv", "w") @file.each do |line| output << line end end end end # Script manager = EventManager.new #manager.print_numbers #manager.print_zipcodes manager.output_data I've tried several things, checked all through the internet and I just can't figure it out myself. I will really appreciate any help. Thank you in advance!

    Read the article

  • Python 3: list atributes within a class object

    - by MadSc13ntist
    is there a way that if the following class is created; I can grab a list of attributes that exist. (this class is just an bland example, it is not my task at hand) class new_class(): def __init__(self, number): self.multi = int(number) * 2 self.str = str(number) a = new_class(2) print(', '.join(a.SOMETHING)) * the attempt is that "multi, str" will print. the point here is that if a class object has attributes added at different parts of a script that I can grab a quick listing of the attributes which are defined.

    Read the article

  • what is the purpose of numeric/boolean/string objects as opposed to primitive values?

    - by zespri
    In javascript you can call a function as a function or as a constructor. For example you can do : myObject = new Number(13); myPrimitiveValue = Number(13); or simply myPrimitiveValue = 13; I understand the difference between the results. Can you explain me under which reasonable circumstances creating a number, a boolean or a string as an object is desirable? For example, ability to set new properties (this is something you can do on objects but can't really do on primitive values) is almost always a bad idea for objects containing number/boolean/string. Why would I want a numeric/boolean/string object?

    Read the article

  • excluding previously randomized integer, and randomize again without it

    - by Rob
    <?php if (isset($_POST['Roll!'])) { $sides = $_POST['sides']; $rolled = rand(1,$sides); echo "$rolled was rolled by the dice, it is now out!"; } ?> This is the code I currently have. After rolling that number, however, I want it to roll again, but without the previously rolled number, until it has rolled all number except one, which would be the winning number. I have no idea how to go about doing that. Any ideas? EDIT: I'm sorry, I should have been more clear, thank you all for the help so far, but I also need to echo each number rolled, such as echo "$rolledArray[0] was rolled, it lost.\n"; echo "$rolledArray[1] was rolled, it lost.\n"; echo "$rolledArray[2] was rolled, it lost.\n"; echo "$rolledArray[3] was rolled, it lost.\n"; echo "$rolledArray[x] was rolled, it lost.\n"; echo "$rolledArray[x] was rolled, it lost.\n"; echo "$rolledArray[50?] was rolled, it lost."; EDIT AGAIN: Also I only want them to have to click Roll! once, not multiple times until they've rolled all the numbers, meaning no need for session, I think, though I could be wrong, most of you are clearly more experienced than me. Sorry, I should have mentioned that before as well.

    Read the article

  • Adding characters to string (input field)

    - by Zaps
    Hi, I have a text box where the value the result of a calculation carried out in jQuery. What I would like to do, using jQuery, is to display brackets around the number in the text box if the number is negative. The number may be used again later so I would then have to remove the brackets so further calculations could be carried out. Any ideas as to how I could implement this? Thanks Zaps

    Read the article

  • please help me to solve problem

    - by davit-datuashvili
    hi everybody fisrt of all this is not homework and now question is like this suppose i have array int a[]=new int[]{0xBCDA,0xABFE,0xBCAD,0xEFCA,0xFFCA} i know that there is always some hexadecimal number which occurs in all number or in this case A is repeat in array everywhere so my aim is print only repeat number and other numbers should be zero so my new array should be like this 0x000A, 0xA000,0x00A0 0x000A,0x000A any idea please help me? p.s please nobody say that this is homework

    Read the article

  • Maintaining software versions

    - by SCM
    I am preparing an Excel sheet in which I have to maintain the version number of different pieces of software developed at our company. Can anyone tell me what kind of information to save along with the version number in that sheet for different types of software? I know only one attribute that is version number, and if anything else so please let me know. Regards

    Read the article

  • as3 custom functions

    - by pixeltocode
    why is it that every time moveSlide() is called, the values traced are the same? var slideWidth:Number = 680; var newPos:Number; function moveSlide () { var currentPos:Number = image_holder.x; newPos = currentPos + slideWidth; trace('currentPos ' + currentPos); trace('newPos ' + newPos); } moveSlide(); moveSlide(); moveSlide(); (image_holder is a movieclip with the images)

    Read the article

  • Regular expression help

    - by dmr
    I need to do a find and replace in Notepad of Err.Number, canBeAnything, canBeAnything, Err.Description (where canBeAnything is just what it says) with Err.Number, "canBeAnything", "canBeAnything", Err.Description (basically, put quotes around canBeAnything) I got as far as the find Err.Number, .+, .+, Err.Description But I'm stuck on the replace. Any suggestions?

    Read the article

  • Multisite Enabling a Table

    - by Joe Fitzgibbons
    I am creating a table (table A) that will have a number of columns(of course) and there will be another table (table B) that holds metadata associated to rows in table A. I am working with a multi site implementation that has one database for the whole shabang. Rows in table A could belong to any number of sites but must belong to at least one. The problem I have is I am not sure what the best practice is for defining what site each row in table A belongs to. I want performance and scalability. There is no finite number of sites going forward. Rows in table A could belong to any number of sites in the future. Right now there are only 3. My initial thoughts are to have a primary site ID in Table A and then metadata in table B will have rows defining additional sites as needed. Another thought is to have a column in Table A for each site and it is a boolean as to wether it belongs to that site. Lastly I have thought about having another table to map rows in Table A to each site. What is the best way to associate rows in a table with any number of sites with performance and scalability in mind?

    Read the article

  • Remove duplicates in a linked list before adding - C

    - by DesperateCoders
    Hi, My question is about removing duplicates from a linked list. But i want to do it before adding to linked list. struct myStr{int number; mystr *next;} void append(mystr **q,int item) { myStr *temp; temp = *q; myStr *newone; if(*q==NULL)// There should be control of previous elements. Call of keysearch function. { temp = (myStr *)malloc(sizeof(myStr)); temp->number =size; temp->next=NULL; *q=temp; } else //And also here { temp = *q; while(temp->next !=NULL) { temp=temp->next; } newone = (myStr *)malloc(sizeof(myStr)); newone->count = size; newone->next=NULL; temp->next=newone; } } int keysearch (myStr *p) { struct myStr *temp = p; int found = 0; int key= p->number; while (temp->number != NULL) { if(temp->number == key) { found = 1; } temp = temp->next; } return found; } My problem is in keySearch. I don't know what is wrong? Or is there another way for doing this.

    Read the article

< Previous Page | 193 194 195 196 197 198 199 200 201 202 203 204  | Next Page >