Search Results

Search found 4971 results on 199 pages for 'mu mind'.

Page 8/199 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Reasons for either 32-bit or 64-bit as development machine

    - by vartec
    I'm about to make a new Linux install, which will be primarily used for programming. I've seen benchmarks showing speed improvement of 64-bit version, however, I have hard time of telling how much these benchmarks translate to improvement in every day usage. And of course there are other aspects to consider. Usage I have in mind: mainly programming Python, with occasional C, C++ and Java; IDEs, which are using Java platforms (Eclipse and IntelliJ); on very rare occasions having to compile for 32-bit platform; not planning to have more than 64GB of RAM anytime soon (and I don't mind using PAE kernels); machine in question has 4GB RAM and Athlon II X2; What are pros and cons of choosing either i386 or x86_64 distro?

    Read the article

  • Are RSS feeds used? [closed]

    - by acidzombie24
    I was thinking about implementing RSS feeds on my site. The one thing that came to mind is Are RSS feeds ever used?! I don't use them nor know anyone who does. I know to use them it must be through an rss feed program or built in with the browser. I like my browser clean and i know many ppl dont know how to use/configure their browser. So with my thoughts i deducted that rss are not used 99.9999% of people (thats 4 decimal places which is really saying something). Now twitter on the other hand or even email may be used. But I have doubts about rss feeds. Can anyone give me statistics or change my mind on implementing it? I suspect it would be simple but i dont think i should bother if no one will ever use it. I dont even use SE/SO RSS feeds.

    Read the article

  • Why does a computer science degree matter to a professional programmer?

    - by P.Brian.Mackey
    I have a degree in computer science. It has been great for opening doors, getting a job. As far as helping me in the professional field of C# .NET programming (the most popular platform and language in the area I work if not the entire united states on hands down the most popular OS in the world) its hardly useful. Why do you think it helps you as a programmer in your professional career (outside spouting off to prims algorithm to impress some interviewer)? In today's world adaptation, a quick mind, strong communication, OO and fundamental design skills enable a developer to write software that a customer will accept. These skills are only skimmed over in the cs program. In my mind, reading a 500 page C# book by Wrox offers far more useable a skillset than 4 years of the comp sci math blaster courses. Many disagree. So, why does a computer science degree matter?

    Read the article

  • How do I show a minimap in a 3D world?

    - by Bubblewrap
    Got a really typical use-case here. I have large map made up of hexagons and at any given time only a small section of the map is visible. To provide an overview of the complete map, I want to show a small 2D representation of the map in a corner of the screen. What is the recommended approach for this in libgdx? Keep in mind the minimap must be updated when the currently visible section changes and when the map is updated. I've found SpriteBatch(info here), but the warning label on it made me think twice: A SpriteBatch is a pretty heavy object so you should only ever have one in your program. I'm not sure I'm supposed to use the one SpriteBatch that I can have on the minimap, and I'm also not sure how to interpret "heavy" in this context. Another thing to possibly keep in mind is that the minimap will probably be part of a larger UI, is there any way to integrate these two?

    Read the article

  • Consistency vs. Usability?

    - by dsimcha
    When designing an API, consistency often aids usability. However, sometimes they conflict where an extra API feature can be added to streamline a common case. It seems like there's somewhat of a divide over what to do here. Some designs (the Java standard library come to mind) favor consistency even if it makes common cases more verbose. Others (the Python standard library comes to mind) favor usability even if it means treating the common case as "special" to make it easier. What is your opinion on how consistency and usability should be balanced?

    Read the article

  • Building (simple) stellar systems

    - by space borg
    hi I'm currently looking at how to simulate easily some stellar systems (meaning some central stars and then some planets with maybe satellites), in order to allow later some space based strategy game (hence with space ships moving around). This should all be based around time (so the state of each system differs through time) I'm quite struggling with the math behind this topic, like for example: - ellipse related math, - creating the path from planet A to B having time in mind (respective positions will change over time)... Do you know of any resources for that ? I wouldn't mind even buying books about it... thanks in advance best space borg side note: how to display all this stuff isn't a matter at this point in time, I'll simple plans for that (basically sticking to 2D and a "high level view" with no space ships/planets details, just markers)

    Read the article

  • How to implement Scrum in a company with three similar web-based products

    - by user1909034
    I am somewhat familiar with the concepts and benefits of Scrum. With that in mind, I am trying to improve the failing Scrum product management structure of a company I'm now working for that has three separate B2C products, catering to the same demographic and accessible on the same website. Each product has a product owner and a unique development team (5 - 9 people in each) behind it. Given that the target audiences are similar (not sure if it should matter) and the 3 web products are similar in nature, what are the potential benefits/risks associated with merging the teams and having just one product owner/scrum master/dev team? Some questions that come to mind are: does it make sense to have 3 product owners and three distinct backlogs if your website has three distinct products? Also, if you only have one product owner, what is the best metric off which to choose who that will be?

    Read the article

  • Where to start a software Analysis & Designing?

    - by Muneer
    I am starting a big database oriented software to develop. I have full picture of the software in mind. I need to do the designing using UML. As there are various tools in UML such as usecase, class diagram, statechart, component diagram, deployment diagram, activity diagram and so on, where should I start my designing. Should it be from Usecase or from Class Diagram or from State Chart? which wich approach will help me to put my mind's picture in to design.? Please corporate with me. Thanks.

    Read the article

  • What would you choose for your project between .NET and Java at this point in time ?

    - by Basic
    You are just starting a new project and you have these two technologies to choose from, Java and .NET. The project you are working doesn't involve having features that would make it easy to choose between the two technologies (e.g. .NET has this that I need and Java does not) and both of them should work just fine for you (though you only need one of course). Take into account: Performance Tools available (even 3rd party tools) Cross platform compatibility Libraries (especially 3rd party libraries) Cost (Oracle seems to try and monetize Java) Development process (Easiest/Fastest) Also keep in mind that Linux is not your main platform but you would like to port your project to Linux/MacOs as well. You should definitely keep in mind the trouble that has been revolving around Oracle and the Java community and the limitations of Mono and Java as well. It would be much appreciated if people with experience in both can give an overview and their own subjective view about which they would choose and why.

    Read the article

  • 3D Location Handling

    - by tgrosinger
    I am thinking about making a simulator type game that will involve having lots of small objects in a 3D space. What is the typical solution for handling these objects? The first thing that comes to mind is a 3D Array, but I can't help but think there is a more efficient solution. Another idea that comes to mind is objects having possession of smaller items. For example a House possesses a Table which possesses a Cup and Bowl. The final way I can think of handling this is just having an array of "objects" that each have an x, y, z value. While this would make storing them easy I do not understand how you would detect collisions without just looking at every possible object and checking to see if it is in the way. Are there other ways of holding onto these objects that is more efficient?

    Read the article

  • Multiplayer in a game. How to design it object wise?

    - by Ninetou
    I was suggested on StackOverflow to ask this question here. I'm working on a simple game and I was thinking of adding multiplayer feature but I'm a bit stuck. I'm not sure what approach should I take, keeping in mind good programming practices. I have a Player object which is created for each player but then I have many other classes that would have to be able to access them. The thing is, if I initialise them in, let's say my main method, then I can't relate to different instances of player class from other classes. The only solution to my problem that comes to my mind is using some form of global objects but afaik using anything globally in apps is usually not a good practice. Any suggestions/ideas?

    Read the article

  • What is the best way to maintain our programming experiences? [closed]

    - by M3HD1
    Possible Duplicate: how do you remember programming related stuff? During my work experiences, I always met many kind of blocking problems with different technologies. When I remember the efforts I spent to find the solutions I become frustrated and want to find a way to keep all in mind. Generally I keep all the project I made in my Hard Drive, and I usually reuse them when I encounter a problem i already encountered. But this is not to really efficient when you reopen your own code and say: Who is the sucker who wrote this code!? I'm thinking to make my own website in which I can post some tutorials / articles about the problems I met and their solutions. So I keep all in mind and help community. Do you think that it will be a good idea or just a loss of time regarding the actual programming forums?

    Read the article

  • Valgrind says "stack allocation," I say "heap allocation"

    - by Joel J. Adamson
    Dear Friends, I am trying to trace a segfault with valgrind. I get the following message from valgrind: ==3683== Conditional jump or move depends on uninitialised value(s) ==3683== at 0x4C277C5: sparse_mat_mat_kron (sparse.c:165) ==3683== by 0x4C2706E: rec_mating (rec.c:176) ==3683== by 0x401C1C: age_dep_iterate (age_dep.c:287) ==3683== by 0x4014CB: main (age_dep.c:92) ==3683== Uninitialised value was created by a stack allocation ==3683== at 0x401848: age_dep_init_params (age_dep.c:131) ==3683== ==3683== Conditional jump or move depends on uninitialised value(s) ==3683== at 0x4C277C7: sparse_mat_mat_kron (sparse.c:165) ==3683== by 0x4C2706E: rec_mating (rec.c:176) ==3683== by 0x401C1C: age_dep_iterate (age_dep.c:287) ==3683== by 0x4014CB: main (age_dep.c:92) ==3683== Uninitialised value was created by a stack allocation ==3683== at 0x401848: age_dep_init_params (age_dep.c:131) However, here's the offending line: /* allocate mating table */ age_dep_data->mtable = malloc (age_dep_data->geno * sizeof (double *)); if (age_dep_data->mtable == NULL) error (ENOMEM, ENOMEM, nullmsg, __LINE__); for (int j = 0; j < age_dep_data->geno; j++) { 131=> age_dep_data->mtable[j] = calloc (age_dep_data->geno, sizeof (double)); if (age_dep_data->mtable[j] == NULL) error (ENOMEM, ENOMEM, nullmsg, __LINE__); } What gives? I thought any call to malloc or calloc allocated heap space; there is no other variable allocated here, right? Is it possible there's another allocation going on (the offending stack allocation) that I'm not seeing? You asked to see the code, here goes: /* Copyright 2010 Joel J. Adamson <[email protected]> $Id: age_dep.c 1010 2010-04-21 19:19:16Z joel $ age_dep.c:main file Joel J. Adamson -- http://www.unc.edu/~adamsonj Servedio Lab University of North Carolina at Chapel Hill CB #3280, Coker Hall Chapel Hill, NC 27599-3280 This file is part of an investigation of age-dependent sexual selection. This code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with haploid. If not, see <http://www.gnu.org/licenses/>. */ #include "age_dep.h" /* global variables */ extern struct argp age_dep_argp; /* global error message variables */ char * nullmsg = "Null pointer: %i"; /* error message for conversions: */ char * errmsg = "Representation error: %s"; /* precision for formatted output: */ const char prec[] = "%-#9.8f "; const size_t age_max = AGEMAX; /* maximum age of males */ static int keep_going_p = 1; int main (int argc, char ** argv) { /* often used counters: */ int i, j; /* read the command line */ struct age_dep_args age_dep_args = { NULL, NULL, NULL }; argp_parse (&age_dep_argp, argc, argv, 0, 0, &age_dep_args); /* set the parameters here: */ /* initialize an age_dep_params structure, set the members */ age_dep_params_t * params = malloc (sizeof (age_dep_params_t)); if (params == NULL) error (ENOMEM, ENOMEM, nullmsg, __LINE__); age_dep_init_params (params, &age_dep_args); /* initialize frequencies: this initializes a list of pointers to initial frqeuencies, terminated by a NULL pointer*/ params->freqs = age_dep_init (&age_dep_args); params->by = 0.0; /* what range of parameters do we want, and with what stepsize? */ /* we should go from 0 to half-of-theta with a step size of about 0.01 */ double from = 0.0; double to = params->theta / 2.0; double stepsz = 0.01; /* did you think I would spell the whole word? */ unsigned int numparts = floor(to / stepsz); do { #pragma omp parallel for private(i) firstprivate(params) \ shared(stepsz, numparts) for (i = 0; i < numparts; i++) { params->by = i * stepsz; int tries = 0; while (keep_going_p) { /* each time through, modify mfreqs and mating table, then go again */ keep_going_p = age_dep_iterate (params, ++tries); if (keep_going_p == ERANGE) error (ERANGE, ERANGE, "Failure to converge\n"); } fprintf (stdout, "%i iterations\n", tries); } /* for i < numparts */ params->freqs = params->freqs->next; } while (params->freqs->next != NULL); return 0; } inline double age_dep_pmate (double age_dep_t, unsigned int genot, double bp, double ba) { /* the probability of mating between these phenotypes */ /* the female preference depends on whether the female has the preference allele, the strength of preference (parameter bp) and the male phenotype (age_dep_t); if the female lacks the preference allele, then this will return 0, which is not quite accurate; it should return 1 */ return bits_isset (genot, CLOCI)? 1.0 - exp (-bp * age_dep_t) + ba: 1.0; } inline double age_dep_trait (int age, unsigned int genot, double by) { /* return the male trait, a function of the trait locus, age, the age-dependent scaling parameter (bx) and the males condition genotype */ double C; double T; /* get the male's condition genotype */ C = (double) bits_popcount (bits_extract (0, CLOCI, genot)); /* get his trait genotype */ T = bits_isset (genot, CLOCI + 1)? 1.0: 0.0; /* return the trait value */ return T * by * exp (age * C); } int age_dep_iterate (age_dep_params_t * data, unsigned int tries) { /* main driver routine */ /* number of bytes for female frequencies */ size_t geno = data->age_dep_data->geno; size_t genosize = geno * sizeof (double); /* female frequencies are equal to male frequencies at birth (before selection) */ double ffreqs[geno]; if (ffreqs == NULL) error (ENOMEM, ENOMEM, nullmsg, __LINE__); /* do not set! Use memcpy (we need to alter male frequencies (selection) without altering female frequencies) */ memmove (ffreqs, data->freqs->freqs[0], genosize); /* for (int i = 0; i < geno; i++) */ /* ffreqs[i] = data->freqs->freqs[0][i]; */ #ifdef PRMTABLE age_dep_pr_mfreqs (data); #endif /* PRMTABLE */ /* natural selection: */ age_dep_ns (data); /* normalized mating table with new frequencies */ age_dep_norm_mtable (ffreqs, data); #ifdef PRMTABLE age_dep_pr_mtable (data); #endif /* PRMTABLE */ double * newfreqs; /* mutate here */ /* i.e. get the new frequency of 0-year-olds using recombination; */ newfreqs = rec_mating (data->age_dep_data); /* return block */ { if (sim_stop_ck (data->freqs->freqs[0], newfreqs, GENO, TOL) == 0) { /* if we have converged, stop the iterations and handle the data */ age_dep_sim_out (data, stdout); return 0; } else if (tries > MAXTRIES) return ERANGE; else { /* advance generations */ for (int j = age_max - 1; j < 0; j--) memmove (data->freqs->freqs[j], data->freqs->freqs[j-1], genosize); /* advance the first age-class */ memmove (data->freqs->freqs[0], newfreqs, genosize); return 1; } } } void age_dep_ns (age_dep_params_t * data) { /* calculate the new frequency of genotypes given additive fitness and selection coefficient s */ size_t geno = data->age_dep_data->geno; double w[geno]; double wbar, dtheta, ttheta, dcond, tcond; double t, cond; /* fitness parameters */ double mu, nu; mu = data->wparams[0]; nu = data->wparams[1]; /* calculate fitness */ for (int j = 0; j < age_max; j++) { int i; for (i = 0; i < geno; i++) { /* calculate male trait: */ t = age_dep_trait(j, i, data->by); /* calculate condition: */ cond = (double) bits_popcount (bits_extract(0, CLOCI, i)); /* trait-based fitness term */ dtheta = data->theta - t; ttheta = (dtheta * dtheta) / (2.0 * nu * nu); /* condition-based fitness term */ dcond = CLOCI - cond; tcond = (dcond * dcond) / (2.0 * mu * mu); /* calculate male fitness */ w[i] = 1 + exp(-tcond) - exp(-ttheta); } /* calculate mean fitness */ /* as long as we calculate wbar before altering any values of freqs[], we're safe */ wbar = gen_mean (data->freqs->freqs[j], w, geno); for (i = 0; i < geno; i++) data->freqs->freqs[j][i] = (data->freqs->freqs[j][i] * w[i]) / wbar; } } void age_dep_norm_mtable (double * ffreqs, age_dep_params_t * params) { /* this function produces a single mating table that forms the input for recombination () */ /* i is female genotype; j is male genotype; k is male age */ int i,j,k; double norm_denom; double trait; size_t geno = params->age_dep_data->geno; for (i = 0; i < geno; i++) { double norm_mtable[geno]; /* initialize the denominator: */ norm_denom = 0.0; /* find the probability of mating and add it to the denominator */ for (j = 0; j < geno; j++) { /* initialize entry: */ norm_mtable[j] = 0.0; for (k = 0; k < age_max; k++) { trait = age_dep_trait (k, j, params->by); norm_mtable[j] += age_dep_pmate (trait, i, params->bp, params->ba) * (params->freqs->freqs)[k][j]; } norm_denom += norm_mtable[j]; } /* now calculate entry (i,j) */ for (j = 0; j < geno; j++) params->age_dep_data->mtable[i][j] = (ffreqs[i] * norm_mtable[j]) / norm_denom; } } My current suspicion is the array newfreqs: I can't memmove, memcpy or assign a stack variable then hope it will persist, can I? rec_mating() returns double *.

    Read the article

  • Rewriting a for loop in pure NumPy to decrease execution time

    - by Statto
    I recently asked about trying to optimise a Python loop for a scientific application, and received an excellent, smart way of recoding it within NumPy which reduced execution time by a factor of around 100 for me! However, calculation of the B value is actually nested within a few other loops, because it is evaluated at a regular grid of positions. Is there a similarly smart NumPy rewrite to shave time off this procedure? I suspect the performance gain for this part would be less marked, and the disadvantages would presumably be that it would not be possible to report back to the user on the progress of the calculation, that the results could not be written to the output file until the end of the calculation, and possibly that doing this in one enormous step would have memory implications? Is it possible to circumvent any of these? import numpy as np import time def reshape_vector(v): b = np.empty((3,1)) for i in range(3): b[i][0] = v[i] return b def unit_vectors(r): return r / np.sqrt((r*r).sum(0)) def calculate_dipole(mu, r_i, mom_i): relative = mu - r_i r_unit = unit_vectors(relative) A = 1e-7 num = A*(3*np.sum(mom_i*r_unit, 0)*r_unit - mom_i) den = np.sqrt(np.sum(relative*relative, 0))**3 B = np.sum(num/den, 1) return B N = 20000 # number of dipoles r_i = np.random.random((3,N)) # positions of dipoles mom_i = np.random.random((3,N)) # moments of dipoles a = np.random.random((3,3)) # three basis vectors for this crystal n = [10,10,10] # points at which to evaluate sum gamma_mu = 135.5 # a constant t_start = time.clock() for i in range(n[0]): r_frac_x = np.float(i)/np.float(n[0]) r_test_x = r_frac_x * a[0] for j in range(n[1]): r_frac_y = np.float(j)/np.float(n[1]) r_test_y = r_frac_y * a[1] for k in range(n[2]): r_frac_z = np.float(k)/np.float(n[2]) r_test = r_test_x +r_test_y + r_frac_z * a[2] r_test_fast = reshape_vector(r_test) B = calculate_dipole(r_test_fast, r_i, mom_i) omega = gamma_mu*np.sqrt(np.dot(B,B)) # write r_test, B and omega to a file frac_done = np.float(i+1)/(n[0]+1) t_elapsed = (time.clock()-t_start) t_remain = (1-frac_done)*t_elapsed/frac_done print frac_done*100,'% done in',t_elapsed/60.,'minutes...approximately',t_remain/60.,'minutes remaining'

    Read the article

  • Opening up process and grabbing window title. Where did I go wrong?

    - by user1632018
    In my application I allow for the users to add a program from a open file dialog, and it then adds the item to a listview and saves the items location into the tag. So what I am trying to do is when the program in the listview is selected and the button is pressed, it starts a timer and this timer checks to see if the process is running, and if it isn't launches the process, and once the process is launched it gets the window title of the process and sends it to a textbox on another form. EDIT: The question is if anyone can see why it is not working, by this I mean starting the process, then when it's started closing the form and adding the process window title to a textbox on another form. I have tried to get it working but I can't. I know that the process name it is getting is right I think my problem is to do with my for loop. Basically it isn't doing anything visible right now. I feel like I am very close with my code and im hoping it just needs a couple minor tweaks. Any help would be appreciated. Sorry if my coding practices aren't that great, im pretty new to this. EDIT:I thought I found a solution but it only works now if the process has been started already. It won't start it up. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim s As String = ListView1.SelectedItems(0).Tag Dim myFile As String = Path.GetFileName(s) Dim mu As String = myFile.Replace(".exe", "").Trim() Dim f As Process Dim p As Process() = Process.GetProcessesByName(mu) For Each f In p If p.Length > 0 Then For i As Integer = 0 To p.Length - 1 ProcessID = (p(i).Id) AutoMain.Name.Text = f.MainWindowTitle Timer1.Enabled = False Me.Close() Next Else ProcessID = 0 End If If ProcessID = 0 Then Process.Start(myFile) End If Next End Sub

    Read the article

  • What software should I install on a new PC?

    - by Armentia
    What software would be a good idea to get for a new/freshly reformatted PC? Feel free to rank how vital each piece of software is, as well as possible alternatives. Microsoft Office Suite // OpenOffice is the first thing to come to mind, but things such as .net framework doesn't pop up to mind and things of that nature are a pain to deal with later on in certain situations.

    Read the article

  • Moving from php to rails

    - by piemesons
    While moving from php to rails (Means procedural language to Object oriented language), what are the various things you should keep in mind. How to think in world of object oriented programming? What are thinks i should kept in mind before starting the things. Any tips?

    Read the article

  • problem in publishing

    - by girish
    when i am publishing my .net website on my domain it is showing the directory of files when i open my site .. anyone please tell me how to avoid this and make my website open mu home page .

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >