Search Results

Search found 2558 results on 103 pages for 'significant digits'.

Page 67/103 | < Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >

  • Current state of Erlang web development? Frameworks, Template languages

    - by pommonico
    Django is to Python as Rails is to Ruby. What is the current front-runner for Erlang? Recent Erlang web activity has resulted in many new frameworks but they are all still moving targets. ErlyWeb is very far along but now seems to be dead. If you were to invest significant capital into a new web product (i.e. not a hobby, you use your own money and you use other's investment in you with expectation of payback), would you choose Erlang as a web platform? If so, what framework and technologies would you choose?

    Read the article

  • Django: Storing ordered, arbitrary references

    - by Sarah
    I'm new to Django, and I'm not sure what I want is possible: I have a number of items that I want each AppUser (extended User model) to be able to reference. That is, given an AppUser, I want to be able to extract its list of items in the way that AppUser has chosen to order them. In general, these items would actually be references to something else in the database, and this led me to one possible solution: Store the keys for the given objects in a CommaSeparatedIntegerField in AppUser. This way, a user could have stored {7, 3, 232, 42, 1} in their items field and both the references and their preferred order would be stored. However, this feels hacky. Since most db backends store CommaSeparatedIntegerField as a VARCHAR internally, the user is not only limited by a number of objects, but also the number of digits in their chosen items. Eg. "you may store 10 items if you choose items with itemID < 10, but only 5 items if 10 < itemID < 100". Is there a better way to do this?

    Read the article

  • Excel - Variable number of leading zeros in variable length numbers?

    - by daltec
    The format of our member numbers has changed several times over the years, such that 00008, 9538, 746, 0746, 00746, 100125, and various other permutations are valid, unique and need to be retained. Exporting from our database into the custom Excel template needed for a mass update strips the leading zeros, such that 00746 and 0746 are all truncated to 746. Inserting the apostrophe trick, or formatting as text, does not work in our case, since the data seems to be already altered by the time we open it in Excel. Formatting as zip won't work since we have valid numbers less than five digits in length that cannot have zeros added to them. And I am not having any luck with "custom" formatting as that seems to require either adding the same number of leading zeros to a number, or adding enough zeros to every number to make them all the same length. Any clues? I wish there was some way to set Excel to just take what it's given and leave it alone, but that does not seem to be the case! I would appreciate any suggestions or advice. Thank you all very much in advance!

    Read the article

  • Problem with mathamatical calculation in JQUERY

    - by Param-Ganak
    Hello friends! I have two text boxes. I enter number in one textbox. I write following JQUERY for that textbox which get executed when the focus out from first text box. The JQUERY code takes the entered value from first text box and multiply it by a decimal number 34.95 and display the answer in second text box. The code is doing the calculation little bit ok because when I enter the value 1000 in first text box it gives answer 34950 in second textbox and when I enter the value 100 in first text box it gives answer 3495.0000000000005 in second text box. **Please any one tell me what is the problem. is problem is in my JQUERY code. I also want to show the answer always in decimal point. Answer should always dislply only two digits after decimal point. so How to achieve this too.** This is my JQUERY code. $("#id_pvalue").focusout(function() { q=$("#id_pvalue").val(); var ans=q*34.95; $("#id_tvalue").val(ans); }); Please guide me friends! Thank You!

    Read the article

  • I need to make a multithreading program (python)

    - by Andreawu98
    import multiprocessing import time from itertools import product out_file = open("test.txt", 'w') P = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p','q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',] N = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] M = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] c = int(input("Insert the number of digits you want: ")) n = int(input("If you need number press 1: ")) m = int(input("If you need upper letters press 1: ")) i = [] if n == 1: P = P + N if m == 1: P = P + M then = time.time() def worker(): for i in product(P, repeat=c): #check every possibilities k = '' for z in range(0, c): # k = k + str(i[z]) # print each possibility in a txt without parentesis or comma out_file.write( k + '\n') # out_file.close() now = time.time() diff = str(now - then) # To see how long does it take print(diff) worker() time.sleep(10) # just to check console The code check every single possibility and print it out in a test.txt file. It works but I really can't understand how can I speed it up. I saw it use 1 core out of my quad core CPU so I thought Multi-threading might work even though I don't know how. Please help me. Sorry for my English, I am from Italy.

    Read the article

  • Extracting a number from a 1-word string

    - by Kyle
    In this program I am trying to make, I have an expression (such as "I=23mm", or "H=4V") and I am trying to extract the 23 (or the 4) out of it, so that I can turn it into an integer. The problem I keep running into is that since the expression I am trying to take the numbers out of is 1 word, I cannot use split() or anything. One example I saw but wouldnt work was - I="I=2.7A" [int(s) for s in I.split() if s.isdigit()] This wouldnt work because it only takes the numbers are are delimited by spaces. If there was a number in the word int078vert, it wouldnt extract it. Also, mine doesnt have spaces to delimit. I tried one that looked like this, re.findall("\d+.\d+", "Amps= 1.4 I") but it didnt work either, because the number that is being passed is not always 2 digits. It could be something like 5, or something like 13.6. What code do I need to write so that if I pass a string, such as I="I=2.4A" or I="A=3V" So that I can extract only the number out of this string? (and do operations on it)? There are no spaces or other constant chars that I can delimit by.

    Read the article

  • Efficient questions

    - by rayman
    Hi, I have to manage xml's and Strings in my app. by efficenty and memory saving, is collection(ArrayList) will be much more 'expensive' then array of Strings? another issue is: i could use the content as regular String, or XML.. is working with XML also makes it more 'expensive' ? when i say i expensive i talk about taking system sources. please tell me by any of your exprience if the diffrences are significant? thanks, ray.

    Read the article

  • Basic C# problem

    - by Juan
    Determine if all the digits of the sum of n -numbers and swapped n are odd. For example: 36 + 63 = 99, y 409 + 904 = 1313. Visual Studio builds my code, there is still something wrong with it ( it doesnt return an answer) can you please help me here? using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { long num = Convert.ToInt64(Console.Read()); long vol = voltea(num); long sum = num + vol; bool simp = simpares(sum); if (simp == true) Console.Write("Si"); else Console.Write("No"); } static private bool simpares(long x) { bool s = false; long [] arreglo = new long [1000]; while ( x > 0) { arreglo [x % 10] ++; x /=10; } for (long i=0 ; i <= arreglo.Length ; i++) { if (arreglo [i]%2 != 0) s = true; } return s; } static private long voltea(long x) { long v = 0; while (v > 0) { v = 10 * v + x % 10; x /= 10; } return v; } } }

    Read the article

  • Help me validate these points regarding Ruby

    - by Bragaadeesh
    Hi, I have started learning Ruby for the past 2,3 weeks and I have come up with some findings on the language. Can someone please validate these points. Implemented in many other high level languages such as C, Java, .Net etc., Is slow for the obvious reason that it cannot beat any of the already known high level languages. Should never be compared with any other high level language. Not suitable for large applications. Completely open source and is in a budding state. Has a framework called Rails which claims that it would be good for Agile development Community out there is getting better day by day and finding help immediately should not be a problem as time goes by. Has significant changes between releases which many developers wont welcome right away. Running time cannot be comprehensively estimated since the language has several underlying implementation in several languages. Books are always outdated by the time when you finish them. Thanks.

    Read the article

  • Speed up this query joining to a table multiple times

    - by Mongus Pong
    Hi, I have this query that (stripped right down) goes something like this : SELECT [Person_PrimaryContact].[LegalName], [Person_Manager].[LegalName], [Person_Owner].[LegalName], [Person_ProspectOwner].[LegalName], [Person_ProspectBDM].[LegalName], [Person_ProspectFE].[LegalName], [Person_Signatory].[LegalName] FROM [Cache] LEFT JOIN [dbo].[Person] AS [Person_Owner] WITH (NOLOCK) ON [Person_Owner].[PersonID] = [Cache].[ClientOwnerID] LEFT JOIN [dbo].[Person] AS [Person_Manager] WITH (NOLOCK) ON [Person_Manager].[PersonID] = [Cache].[ClientManagerID] LEFT JOIN [dbo].[Person] AS [Person_Signatory] WITH (NOLOCK) ON [Person_Signatory].[PersonID] = [Cache].[ClientSignatoryID] LEFT JOIN [dbo].[Person] AS [Person_PrimaryContact] WITH (NOLOCK) ON [Person_PrimaryContact].[PersonID] = [Cache].[PrimaryContactID] LEFT JOIN [dbo].[Person] AS [Person_ProspectOwner] WITH (NOLOCK) ON [Person_ProspectOwner].[PersonID] = [Cache].[ProspectOwnerID] LEFT JOIN [dbo].[Person] AS [Person_ProspectBDM] WITH (NOLOCK) ON [Person_ProspectBDM].[PersonID] = [Cache].[ProspectBDMID] LEFT JOIN [dbo].[Person] AS [Person_ProspectFE] WITH (NOLOCK) ON [Person_ProspectFE].[PersonID] = [Cache].[ProspectFEID] Person is a huge table and each join to it has a pretty significant hit in the execution plan. Is there anyway I can adjust this query so that I am only linking to it once, or at least get SQL Server to scan through it only once?

    Read the article

  • C function prototype: void f(). Is it recommended?

    - by ycalleecharan
    Hi, I'm learning C and I saw in a book that a function prototype has the form void f() and in the function declaration or in the calling function, the f function takes arguments. Thus In the function declaration we have something like void f(long double y[], long double A) and in the calling function is f(y, A). The function is doing operations on the array y i.e. when the function is called, some elements in the array y are changing. A is just a constant numerical value that doesn't change. I have two questions: If defining the function prototype at the top in the program as void f() a good practice? Or is it better to put it as void f(long double y[], long double A) as in the function declaration? The called function f is changing elements in the array y. Is void the right return type? The program is working fine as such with the void as described. Or should I change all my "voids" to "long double". I'm working with long double as I need as much precision as possible though on my machine both double and long double gives me 15 precision digits. Thanks a lot

    Read the article

  • How to Audit Database Activity without Performance and Scalability Issues?

    - by GotoError
    I have a need to do auditing all database activity regardless of whether it came from application or someone issuing some sql via other means. So the auditing must be done at the database level. The database in question is Oracle. I looked at doing it via Triggers and also via something called Fine Grained Auditing that Oracle provides. In both cases, we turned on auditing on specific tables and specific columns. However, we found that Performance really sucks when we use either of these methods. Since auditing is an absolute must due to regulations placed around data privacy, I am wondering what is best way to do this without significant performance degradations. If someone has Oracle specific experience with this, it will be helpful but if not just general practices around database activity auditing will be okay as well.

    Read the article

  • Is it possible to submit an update for an app on the AppStore without losing reviews?

    - by Frank Krueger
    Whenever I submit an update for me app, the number of reviews visible for it drops to 0. If the customer bothers to click through they can see the previous versions' reviews... But the damage has been done. Since the app has 0 stars, I see a significant drop in sales. It takes the app a good week of earning new reviews to restore sales. I usually version the app as 1.1, 1.2, 1.3 etc. Is there something I can do during the update process to prevent losing reviews like this?

    Read the article

  • regexp to match string with (comma-separated) number at start and to split into number and rest?

    - by mix
    Given a string such as: 23,234,456 first second third How can I split string this into two parts, where part 1 contains the number at the beginning and part 2 contains the rest---but only if the string STARTS with a number, and the number can be comma-separated or not? In other words, I want two results: 23,234,456 and first second third. If there's a number in that string that isn't part of the first number then it should be in the second result. My best stab at this so far, to grab the number at the beginning, is something like this: ^[0-9]+(,[0-9]{3})* Which seems to grab a comma-separated or non-comma-separated number that starts the line. However, when I run this in the Javascript console I get not only the full number, but also a match on just the last 3 digits with their preceeding ,. (e.g. 23,234,456 and ,456). As for getting the rest into another var I'm having trouble. I tried working with \b, etc., but I think I must be missing something fundamental about grabbing the rest of the line. I'm doing this in Javascript in case it matters. More examples of what to match and what not to match. 2 one two three should return 2 and one two three 2345 one two three should return 2345 and one two three 2 one 2 three should return 2 and one 2 three 2,234 one two 3,000 should return 2,234 and one two 3,000 The space between parts 1 and two could be included in the beginning of part 2.

    Read the article

  • choose javascript variable based on element id from jquery

    - by phoffer
    I feel like this is a simple question, but I am still relatively new to javascript and jquery. I am developing a site for a touch interface that uses unordered lists and jquery .click functions to take input data. I have a section to input a m:ss time, with 3 divs, each containing a list of digits for time. I need to get the input for each column and set it as a variable. I originally designed the inputs to change form inputs, because I didn't understand javascript very much. It was easy to change the 3 hidden inputs by using div id's, but I can't figure out how to do it now with javascript variables. Here is my original jquery code... $("div#time>div>ul>li").click(function() { var id = $(this).parents(".time").attr("name"); var number = $(this).html(); $("input#"+id).val(number); }); The last line sets one of 3 hidden inputs equal to whatever was clicked. I need to make it so separate variables take the inputs, then I can manipulate those variables however I want. Here's a short snippet of the html, to have an idea of how jquery grabs it. <div id="time"> <h1>Time</h1> <div name="minute" class="time" id="t_minute"> M : <ul> The full time html is here: link text Thanks everyone! I've been using SO to answer many questions I've had, but I couldn't find something for this, so I figured I would join, since I'm sure I will have more questions along the way.

    Read the article

  • Fast, cross-platform timer?

    - by dsimcha
    I'm looking to improve the D garbage collector by adding some heuristics to avoid garbage collection runs that are unlikely to result in significant freeing. One heuristic I'd like to add is that GC should not be run more than once per X amount of time (maybe once per second or so). To do this I need a timer with the following properties: It must be able to grab the correct time with minimal overhead. Calling core.stdc.time takes an amount of time roughly equivalent to a small memory allocation, so it's not a good option. Ideally, should be cross-platform (both OS and CPU), for maintenance simplicity. Super high resolution isn't terribly important. If the times are accurate to maybe 1/4 of a second, that's good enough. Must work in a multithreaded/multi-CPU context. The x86 rdtsc instruction won't work.

    Read the article

  • I asked a question about arrays before, but this one won't compile

    - by unit
    I asked about this array a little while ago, and I can't see what the problem is. Too tired. What have I done wrong? Basically, I am taking a string array and trying to check to see if it contains numbers or an x (ISBN number validation). I want to take the number from a given input (bookNum), check the input, and feed any valid input into a new array (book). At the line 'bookNum.charAt[j]==book[i]' I get the 'not a statement error'. What gives? String[] book = new String [ISBN_NUM]; bookNum.replaceAll("-",""); if (bookNum.length()!=ISBN_NUM) throw new ISBNException ("ISBN "+ bookNum + " must be 10 characters"); for (int i=0;i<bookNum.length();i++) { if (Character.isDigit(bookNum.charAt(i))) bookNum.CharAt[j]==book[i]; j++; if (book[9].isNotDigit()|| book[9]!="x" || book[9]!="X") throw new ISBNException ("ISBN " + bookNum + " must contain all digits" + "or 'X' in the last position");

    Read the article

  • Javascript Regex: Testing string for intelligent query

    - by Shyam
    Hi, I have a string that holds user input. This string can contain various types of data, like: a six digit id a zipcode that contains out of 4 digits and two alphanumeric characters a name (characters only) As I am using this string to search through a database, the query type is determined on the type of search, which i want to handle serverside using JavaScript (yes, I am using JavaScript serverside). Searching on StackOverflow, brought me some interesting information, like the .test-method, which seems perfect for my needs. The test-method returns either true or false based on the evaluation on the string using a regex object. I am using this page as a reference: http://www.javascriptkit.com/jsref/regexp.shtml So I am trying to determine the zipcode, by using the following very noobish regex. var r = /[A-Za-z]{2,2}/ As far I can understand, this should limit the amount of occurrences of alphanumeric characters to a maximum of two. See beneath the output of my JavaScript console. > var r = /[A-Za-z]{2,2}/ > var x = "2233AL" > r.test(x) true > var x = "2233A" > r.test(x) false > var x = "2233ALL" > r.test(x) true /* i want this to be false */ > A little help would be really appreciated!

    Read the article

  • C#, Using Custom Generic Collection faster with objects than List

    - by Kaminari
    Hello, I'm using for now List< to iterate through some object collection and find matching element, The problem is that object has only 2 significant values Name and Link (strings) but has some other values wich I dont want to compare. I'm thinkig about using something like HashSet (wich is exactly what I'm searching for - fast) from .NET 3.5 but target framework has to be 2.0. There is something called Power Collections here: http://powercollections.codeplex.com/ But maybe there is other way? If not, can you suggest me a suitable custom collection?

    Read the article

  • moving a website built on struts to a CMS

    - by fabiobeta
    Hi. Imagine having developed a classical website with java&struts. Now you customer is learning that redeploying the application to change an image or a text is a significant cost. And it asks to add a function to the site: cms-like handling of the contents (editing, versioning, approved publishing). How would you handle this request? Would you develop it in the webapp? Would you merge the webapp with a CMS? Would tou MOVE the webapp into a cms? Would you run away?

    Read the article

  • C++ - Where do i start?

    - by richzilla
    Hi All, As a bit of a side project while I'm on my summer break from uni, I've decided to have a look at C++, and get the hang of the basics. I'm by no means a programming novice, I've done web development before with PHP and Ruby, and I've done a fair bit of work with compiled languages (Java / C#). However, C++ seems to be a more significant undertaking. Basically I'm wanting pointers to the best resources for learning C++, as well as some idea as to areas I could do with reading up on (That I might not have come across before). Any help would be hugely appreciated. Thanks

    Read the article

  • AS3: Performance question calling an event function with null param

    - by adehaas
    Lately I needed to call a listener function without an actual listener like so: foo(null); private function foo(event:Event):void { //do something } So I was wondering if there is a significant difference regarding performance between this and using the following, in which I can prevent the null in calling the function without the listener, but am still able to call it with a listener as well: foo(); private function foo(event:Event = null):void { } I am not sure wether it is just a question of style, or actually bad practice and I should write two similar functions, one with and one without the event param (which seems cumbersome to me). Looking forward to your opinions, thx.

    Read the article

  • About a Class Object

    - by Chicko Bueno
    I have a very basic question about a class object. After the class has been created, we need to create a class object. At this point, I'm a bit confused to make either *object or object. Example: CClass object CClass *object What is the difference both of them? And to access class function i need to use dot '.' and arrow '->'. I know dot and arrow used to access class function, but what is the significant meaning for both dot and arrow?

    Read the article

  • What is the role of `while`-loops in computation expressions in F#?

    - by MizardX
    If you define a While method of the builder-object, you can use while-loops in your computation expressions. The signature of the While method is: member b.While (predicate:unit->bool, body:M<'a>) : M<'a> For comparison, the signature of the For method is: member b.For (items:seq<'a>, body:unit->M<'a>) : M<'a> You should notice that, in the While-method, the body is a simple type, and not a function as in the For method. You can embed some other statements, like let and function-calls inside your computation-expressions, but those can impossibly execute in a while-loop more than once. builder { while foo() do printfn "step" yield bar() } Why is the while-loop not executed more than once, but merely repeated? Why the significant difference from for-loops? Better yet, is there some intended strategy for using while-loops in computation-expressions?

    Read the article

  • Documentation for installing and running hadoop 2.2 on Windows

    - by user2325154
    With the latest release of Hadoop 2.2 I see that the release notes mentions that this version has significant improvements for running Hadoop on Windows. I downloaded Hadoop 2.2 yesterday and I saw lot of .cmd file alon with .sh files which ensures that this version has scripts and batch files for running Hadoop on Windows environment. However while looking at the Apache Hadoop documentation I couldn't find any step-by-step instructions on how to install and run this newer version on Windows. Besides this it looks like that the newer version has YARN architecture embedded in it and the old configurations provided on some of the tutorials online may be outdated and not applicable anymore. Is there any good documentation for Hadoop 2.2 available online ? I want it specifically for running Hadoop under Windows.

    Read the article

< Previous Page | 63 64 65 66 67 68 69 70 71 72 73 74  | Next Page >