Search Results

Search found 81 results on 4 pages for 'mba fv'.

Page 1/4 | 1 2 3 4  | Next Page >

  • MBA and a Computer Science degree

    - by Chung Pow
    A similar question was asked a while back, but I want to know some people who both have an MBA and a Computer Science degree and advanced their careers. What kind of job did you have before and after achieving an MBA? I'm a programmer and I have thought about getting an MBA. What doors will that open for me?

    Read the article

  • Whether to go for part MBA or not [closed]

    - by Santosh singh
    I need your help in knowing more about SP Jain Finance MBA. I am currently working in Singapore as a tech lead having 6.5 year experience in IT, planning to do part time MBA. There are currently 3 specialisation offered- marketing,operations and finance- I am not sure which one to choose. Whether I would be able to find a job in finance after getting MBA degree from SP Jain. Basically I do not forsee any career growth in my present company, so in a fix should I do MBA or go for some specialised course if you suggest.

    Read the article

  • MBA versus MSIS

    - by user794684
    I am considering going back to school for my masters and I've been looking at several avenues I can take. I've been considering either an MBA or an MSIS degree. Overall I know that an MBA is going to give me a solid skill set that can help me become an executive. However they seem to be a dime a dozen these days and the University I can get into is good, but it's not exactly in the top 100 anything. My undergrad MINOR was in Business Information Systems. I'm rusty as hell, considering I haven't touched it, but an MSIS would be more in the direction of my past academic experience and seems to touch both on business management and IT. Question... With an MSIS will I just be a middleman? Will I really be an important person with a real skill set or will I merely be someone who isn't quite cut out to be a manager and who is clueless about the tech side? Is an MSIS degree going to give me a real chance to move up the pay scale quickly or am I better off learning programing, networking through another BS degree? What will give me more upward mobility career wise? An MBA or an MSIS?

    Read the article

  • online MBA or MASTER studying

    - by Hussein Belal
    Hi all, would you please advice me to the best universities for online studying, I have graduated form Economic college and I really want to complete my high studying but the problem I can't since I am already working and there is no possibility to stop working for studying. thanks in advance.

    Read the article

  • Need advice: Staying techie or going the MBA way?

    - by SharePoint Newbie
    I know this is a very subjective question and I am the best person to decide this for myself...but I am just looking for your views. I have 5 years of experience as a professional developer. I have a decent background in Maths and have done my bachelors in engineering in CS. I have still not reached a stage in my career where growth is difficult and do not foresee this happenning for a very long time if ever because I find myself constantly (self) motivated to pick up new skills. A lot of my friends have however been getting through their MBA lately ...and not from the likes of Harvard or Kellogs, just mediocre colleges. They've however been landing paychecks fatter than me even though they have little or no work experience. Given that I have the option of pursuing an MBA an have my finances in order (and am planning an MBA from INSEAD / IE) would it make sense for me to sell out what I like doing and go for an MBA? Will I regret not doing an MBA later, given that I am in the right age/experience group to do an MBA? I absolutely love what I am doing right now and also the people I'm doing it with, but am just worried if this career would be as rewarding financially as the one after a management degree.

    Read the article

  • MacBook Air: USB Hub Compatible with the MBA SuperDrive

    - by _ande_turner_
    A little background to those whom may think this Question to specific: The MacBook Air SuperDrive draws 1A vs 500mA of a normal USB device, and therefore you can't use a standard USB hub powered or unpowered because each port gets 500mA not 1A... Have any MacBook Air users found a USB hub which can accommodate the MBA SuperDrive and another peripheral?

    Read the article

  • Do I use the FV function in Excel correctly?

    - by John
    My task: Create a table: Calculate what the revenues of e-trading will be after five years at 15 percent interest rate if we now have 15 000 EUR. Use the FV function from the Financial Group in Excel. My resolution: =FV( 15%; 5; 0; -15000). My question: Is it correct? I know the task lacks information whether the interest rate is per month or per year. I calculate it as 'per year'. My question is orientated more on the usage of the FV function. I, for example, do not understand why '-15000' and not '15000'. Also why the third parameter has to be 0? Maybe I do it wrong. Please help me solve it! Thanks in advance.

    Read the article

  • What should I do from here?

    - by Sunscreen
    Hi all, First of all, the site rocks. You can ask and get specific answers, mainly, for programming issues. This question is more generic. I studied Physics for my bachelors and Digital Image Processing for my masters, ended on September 2001. From then on I started working as a developer and software analyst. I worked, and working, witn C, C++, AIX OS, XP OS, MFC 4.21. I also did some data translations from EDIFACT to XML and viceversa. I trained users for the applications that I was running, I created documents (detailed design docs mainly), though most of the time I wrote, and I still write, code. Recently I applied for the best greek, graduate university for my MBA and they accepted me, starting on Jan 2011. I am a developer with no specific insight with the languages I work. I can be very productive with some subsets of the languages that the companies I worked for use, though this is a limited thing for a developer. If I get my MBA I can be a semi-businees analyst ot consultant, as I am now a semi-developer. The problem is that I can do some but not all in a designated working area. What should I do from here? Should I get my MBA and look forswitching industries? Should I read and excersise myself with new languages and frameworks? Should I be more focussed to the deligations from my current job (currently I work with MFC)? Just for the note, I am 32 and I feel I am wasting my time. I am not getting the best that I can get from is current position (and I work here for 3+ years). Thanks all, Sun

    Read the article

  • Cannot disable spotlight indexing on volume

    - by jayhendren
    I have a FAT32 partition on my HDD. When using OSX, it is mounted to /Volumes/MEDIA. After a recent upgrade to Mavericks, spotlight is having trouble indexing it, eating up almost all of my system resources, and I cannot get the indexing to stop: [jay-mba-osx ~]% sudo mdutil -v -a -i off /: Indexing disabled. [jay-mba-osx ~]% sudo mdutil -v -V /Volumes/MEDIA -i off [jay-mba-osx ~]% mdutil -v -a -s /: Indexing disabled. /Volumes/BOOTCAMP: Indexing disabled. /Volumes/MEDIA: Indexing enabled. [jay-mba-osx ~]% [jay-mba-osx ~]% sudo mdutil -v -V /Volumes/MEDIA -E /Volumes/MEDIA: Indexing enabled. [jay-mba-osx ~]% sudo mdutil -v -V /Volumes/MEDIA -i off [jay-mba-osx ~]% mdutil -v -a -s /: Indexing disabled. /Volumes/BOOTCAMP: Indexing disabled. /Volumes/MEDIA: Indexing enabled. [jay-mba-osx ~]% How to I tell spotlight to "cease and desist" on my MEDIA volume? I only want or need spotlight indexing on my OSX partition.

    Read the article

  • More Fun With Math

    - by PointsToShare
    More Fun with Math   The runaway student – three different ways of solving one problem Here is a problem I read in a Russian site: A student is running away. He is moving at 1 mph. Pursuing him are a lion, a tiger and his math teacher. The lion is 40 miles behind and moving at 6 mph. The tiger is 28 miles behind and moving at 4 mph. His math teacher is 30 miles behind and moving at 5 mph. Who will catch him first? Analysis Obviously we have a set of three problems. They are all basically the same, but the details are different. The problems are of the same class. Here is a little excursion into computer science. One of the things we strive to do is to create solutions for classes of problems rather than individual problems. In your daily routine, you call it re-usability. Not all classes of problems have such solutions. If a class has a general (re-usable) solution, it is called computable. Otherwise it is unsolvable. Within unsolvable classes, we may still solve individual (some but not all) problems, albeit with different approaches to each. Luckily the vast majority of our daily problems are computable, and the 3 problems of our runaway student belong to a computable class. So, let’s solve for the catch-up time by the math teacher, after all she is the most frightening. She might even make the poor runaway solve this very problem – perish the thought! Method 1 – numerical analysis. At 30 miles and 5 mph, it’ll take her 6 hours to come to where the student was to begin with. But by then the student has advanced by 6 miles. 6 miles require 6/5 hours, but by then the student advanced by another 6/5 of a mile as well. And so on and so forth. So what are we to do? One way is to write code and iterate it until we have solved it. But this is an infinite process so we’ll end up with an infinite loop. So what to do? We’ll use the principles of numerical analysis. Any calculator – your computer included – has a limited number of digits. A double floating point number is good for about 14 digits. Nothing can be computed at a greater accuracy than that. This means that we will not iterate ad infinidum, but rather to the point where 2 consecutive iterations yield the same result. When we do financial computations, we don’t even have to go that far. We stop at the 10th of a penny.  It behooves us here to stop at a 10th of a second (100 milliseconds) and this will how we will avoid an infinite loop. Interestingly this alludes to the Zeno paradoxes of motion – in particular “Achilles and the Tortoise”. Zeno says exactly the same. To catch the tortoise, Achilles must always first come to where the tortoise was, but the tortoise keeps moving – hence Achilles will never catch the tortoise and our math teacher (or lion, or tiger) will never catch the student, or the policeman the thief. Here is my resolution to the paradox. The distance and time in each step are smaller and smaller, so the student will be caught. The only thing that is infinite is the iterative solution. The race is a convergent geometric process so the steps are diminishing, but each step in the solution takes the same amount of effort and time so with an infinite number of steps, we’ll spend an eternity solving it.  This BTW is an original thought that I have never seen before. But I digress. Let’s simply write the code to solve the problem. To make sure that it runs everywhere, I’ll do it in JavaScript. function LongCatchUpTime(D, PV, FV) // D is Distance; PV is Pursuers Velocity; FV is Fugitive’ Velocity {     var t = 0;     var T = 0;     var d = parseFloat(D);     var pv = parseFloat (PV);     var fv = parseFloat (FV);     t = d / pv;     while (t > 0.000001) //a 10th of a second is 1/36,000 of an hour, I used 1/100,000     {         T = T + t;         d = t * fv;         t = d / pv;     }     return T;     } By and large, the higher the Pursuer’s velocity relative to the fugitive, the faster the calculation. Solving this with the 10th of a second limit yields: 7.499999232000001 Method 2 – Geometric Series. Each step in the iteration above is smaller than the next. As you saw, we stopped iterating when the last step was small enough, small enough not to really matter.  When we have a sequence of numbers in which the ratio of each number to its predecessor is fixed we call the sequence geometric. When we are looking at the sum of sequence, we call the sequence of sums series.  Now let’s look at our student and teacher. The teacher runs 5 times faster than the student, so with each iteration the distance between them shrinks to a fifth of what it was before. This is a fixed ratio so we deal with a geometric series.  We normally designate this ratio as q and when q is less than 1 (0 < q < 1) the sum of  + … +  is  – 1) / (q – 1). When q is less than 1, it is easier to use ) / (1 - q). Now, the steps are 6 hours then 6/5 hours then 6/5*5 and so on, so q = 1/5. And the whole series is multiplied by 6. Also because q is less than 1 , 1/  diminishes to 0. So the sum is just  / (1 - q). or 1/ (1 – 1/5) = 1 / (4/5) = 5/4. This times 6 yields 7.5 hours. We can now continue with some algebra and take it back to a simpler formula. This is arduous and I am not going to do it here. Instead let’s do some simpler algebra. Method 3 – Simple Algebra. If the time to capture the fugitive is T and the fugitive travels at 1 mph, then by the time the pursuer catches him he travelled additional T miles. Time is distance divided by speed, so…. (D + T)/V = T  thus D + T = VT  and D = VT – T = (V – 1)T  and T = D/(V – 1) This “strangely” coincides with the solution we just got from the geometric sequence. This is simpler ad faster. Here is the corresponding code. function ShortCatchUpTime(D, PV, FV) {     var d = parseFloat(D);     var pv = parseFloat (PV);     var fv = parseFloat (FV);     return d / (pv - fv); } The code above, for both the iterative solution and the algebraic solution are actually for a larger class of problems.  In our original problem the student’s velocity (speed) is 1 mph. In the code it may be anything as long as it is less than the pursuer’s velocity. As long as PV > FV, the pursuer will catch up. Here is the really general formula: T = D / (PV – FV) Finally, let’s run the program for each of the pursuers.  It could not be worse. I know he’d rather be eaten alive than suffering through yet another math lesson. See the code run? Select  “Catch Up Time” in www.mgsltns.com/games.htm The host is running on Unix, so the link is case sensitive. That’s All Folks

    Read the article

  • Python Memory leak - Solved, but still puzzled

    - by disappearedng
    Dear everyone, I have successfully debugged my own memory leak problems. However, I have noticed some very strange occurence. for fid, fv in freqDic.iteritems(): outf.write(fid+"\t") #ID for i, term in enumerate(domain): #Vector tfidf = self.tf(term, fv) * self.idf( term, docFreqDic) if i == len(domain) - 1: outf.write("%f\n" % tfidf) else: outf.write("%f\t" % tfidf) outf.flush() print "Memory increased by", int(self.memory_mon.usage()) - startMemory outf.close() def tf(self, term, freqVector): total = freqVector[TOTAL] if total == 0: return 0 if term not in freqVector: ## When you don't have these lines memory leaks occurs return 0 ## return float(freqVector[term]) / freqVector[TOTAL] def idf(self, term, docFrequencyPerTerm): if term not in docFrequencyPerTerm: return 0 return math.log( float(docFrequencyPerTerm[TOTAL])/docFrequencyPerTerm[term]) Basically let me describe my problem: 1) I am doing tfidf calculations 2) I traced that the source of memory leaks is coming from defaultdict. 3) I am using the memory_mon from http://stackoverflow.com/questions/276052/how-to-get-current-cpu-and-ram-usage-in-python 4) The reason for my memory leaks is as follows: a) in self.tf, if the lines: if term not in freqVector: return 0 are not added that will cause the memory leak. (I verified this myself using memory_mon and noticed a sharp increase in memory that kept on increasing) The solution to my problem was 1) since fv is a defaultdict, any reference to it that are not found in fv will create an entry. Over a very large domain, this will cause memory leaks. I decided to use dict instead of default dict and the memory problem did go away. My only puzzle is: since fv is created in "for fid, fv in freqDic.iteritems():" shouldn't fv be destroyed at the end of every for loop? I tried putting gc.collect() at the end of the for loop but gc was not able to collect everything (returns 0). Yes, the hypothesis is right, but the memory should stay fairly consistent with ever for loop if for loops do destroy all temp variables. This is what it looks like with that two line in self.tf: Memory increased by 12 Memory increased by 948 Memory increased by 28 Memory increased by 36 Memory increased by 36 Memory increased by 32 Memory increased by 28 Memory increased by 32 Memory increased by 32 Memory increased by 32 Memory increased by 40 Memory increased by 32 Memory increased by 32 Memory increased by 28 and without the the two line: Memory increased by 1652 Memory increased by 3576 Memory increased by 4220 Memory increased by 5760 Memory increased by 7296 Memory increased by 8840 Memory increased by 10456 Memory increased by 12824 Memory increased by 13460 Memory increased by 15000 Memory increased by 17448 Memory increased by 18084 Memory increased by 19628 Memory increased by 22080 Memory increased by 22708 Memory increased by 24248 Memory increased by 26704 Memory increased by 27332 Memory increased by 28864 Memory increased by 30404 Memory increased by 32856 Memory increased by 33552 Memory increased by 35024 Memory increased by 36564 Memory increased by 39016 Memory increased by 39924 Memory increased by 42104 Memory increased by 42724 Memory increased by 44268 Memory increased by 46720 Memory increased by 47352 Memory increased by 48952 Memory increased by 50428 Memory increased by 51964 Memory increased by 53508 Memory increased by 55960 Memory increased by 56584 Memory increased by 58404 Memory increased by 59668 Memory increased by 61208 Memory increased by 62744 Memory increased by 64400 I look forward to your answer

    Read the article

  • How do I install ant on OS X Mavericks?

    - by Robert Karl
    After upgrading to OS X 10.9 Mavericks, ant is no longer on my path. [126] 11:23:26 rkarl-mba-4:~/mobile-baselayer > ant zsh: permission denied: ant [126] 11:23:50 rkarl-mba-4:~/mobile-baselayer > which ant ant not found I tried installing through homebrew [126] 11:23:09 rkarl-mba-4:~/mobile-baselayer > brew install ant Error: No available formula for ant It's odd that homebrew doesn't have a formula for that.... After googling, I found this article, which suggested using a user's custom formula for brew. [1] 11:23:56 rkarl-mba-4:~/mobile-baselayer > brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/ant.rb curl: (22) The requested URL returned error: 404 Not Found Error: Failure while executing: /usr/bin/curl -f#LA Homebrew\ 0.9.4\ (Ruby\ 1.8.7-358;\ Mac\ OS\ X\ 10.9) https://raw.github.com/adamv/homebrew-alt/master/duplicates/ant.rb -o /Library/Caches/Homebrew/Formula/ant.rb Any help would be appreciated!

    Read the article

  • is it possible to change from software developer job to business analyst job

    - by user72406
    I am working as a software developer (.net programmer) for an mnc for the past two years. From the initial days itself I know I am not a good programer at all, but I tried learning and managed the development for these two years. I am looking to do mba in future and move to business side. But to start mba I need an year more. I don't want to continue programing in this year. I am looking for a change in position which will help me doing my mba too. Please suggest.

    Read the article

  • linux need to discover local sata mirror before hba attached scsi

    - by Ryan
    (none of the machines mentioned are in production) Hello, I'm trying to install Centos 5.4, which wants to put the boot loader on either the boot sector of the boot drive (a local SATA mirror, recognized second as sdb) or the mba of a hba-attached SCSI array (recognized first as sda). There's a LILO install already on the mba of sdb, which keeps trying to boot first. If I zero out the MBA of sdb, would the boot loader at sdb1 be found and booted? I was thinking of that as a plan B, as I was mostly thinking of coaxing CentOS to find the local mirror first and bring that up as sda, but I haven't found info on how to do this anywhere.

    Read the article

  • Is this a normal operating temperature range for a New Third-Generation MacBook Air (2.13 MHz, 120 G

    - by doug
    Even with just my text editor open (no web browser) and maybe the terminal, the baseline temperature is usually above 40 C. When i open 4-5 browser tabs in Safari (even if none of Sites have Flash) the temp can quickly go over 50 C. (In addition, i am observing these temps even though i have turned the fan up to 3000 rpms). (i have install smcFanControl on my MBA so i can see the temp in the menu bar.) So this means my MBA is running much warmer than my MBP; and in practice, it means that i have to be very careful how i use my MBA. Of course if i load a Site with Flash, it just freaks out, and often quickly goes above 65 C (I've installed a flash blocker to avoid this). Is anyone else observing this behavior? I have checked the Apple boards and sure enough, there are a lot of complaints, but nothing from Apple.

    Read the article

  • In OpenRasta is it possible to Pattern match multiple key/value pairs?

    - by Scott Littlewood
    Is it possible in OpenRasta to have a Uri pattern that allows for an array of values of the same key to be submitted and mapped to a handler method accepting an array of the query parameters. Example: Return all the contacts named Dave Smith from a collection. HTTP GET /contacts?filterBy=first&filterValue=Dave&filterBy=last&filterValue=Smith With a configuration of: What syntax would be best for the Uri string pattern matching? (Suggestions welcome) ResourceSpace.Has.ResourcesOfType<List<ContactResource>>() .AtUri("/contacts") .And.AtUri("/contacts?filterBy[]={filterBy}[]&filterValue[]={fv}[]") // Option 1 .And.AtUri("/contacts?filterBy={filterBy}[]&fv={fv}[]") // Option 2 Would map to a Handler method of: public object Get(params Filter[] filters) { /* create a Linq Expression based on the filters using dynamic linq query the repository using the Linq */ return Query.All<Contact>().Where(c => c.First == "Dave" && c.Last == "Smith").ToResource() } where Filter is defined by public class Filter { public string FilterBy { get; set; } public string FilterValue { get; set; } }

    Read the article

  • some problem with iOS 4.2.1

    - by bicbac
    Hi, I've been developing an app with MacBook Pro (MBP) so far. Last week one of my friends gave me new macbook air 11"(MBA). so Now I can test my code with more than one machine with the same version of developing tools - Both machine has Xcode (3.2.5) and iOS SDK 4.2.1). After some point my app starts get terminated suddenly(iPhone sumulator), and I was using MBP. I got no error message whatsoever. it just stops. I reckon the crash comes from dealing with memory, like 'release'/ 'double-release'. (I'm not 100% sure though). Anyway I thought there must be some mistake within my code for sure. -Confusion starts from this part.- With my MBA, on the other hand, I don'y see any crash. It just works fine. There is nothing different between MBA & MBP except the h/w specifications. Same code, same versions of XCode and iOS SDK. Is the fact that no crash at MBA suggesting that I have to look somewhere else than the code itself? I red some article and Q&As on iOS4.2.1 and XCode 3.2.5 that the most recent version of XCode doesn't recognize the iOS 4.2.1 since the 4.2.1 came out later the 3.2.5. Is it the reason? I have no idea at this moment what should be the next move. thanks

    Read the article

  • Advice on career change [on hold]

    - by user72406
    I am a software developer(sharepoint developer) with total 3 years of experience.Though using out of the box sharepoint excites me, i have aversion to code. i kinda cant put my brains in coding. i have my eyes on MBA now(only reason is to get rid of code). I wanted to rethink on this and need your expert advice and suggestions. As i am working currently in a hot skill(sharepoint 2013) technology, is it a good thought to go ahead and do MBA and change my career, or should i start liking what i do?? THough it is supposed to be a self decision, i needed views of experts to help me carve my niche. Regards Kiran

    Read the article

  • Search like google

    - by Rajanikant
    I have a task to make a search module in which i have database users and tablename userProfile and i want to search profile when i entered text in text box for ex. if i entered "I am looking for MBA in delhi" or 'mba information in delhi' it will displayed all user registered expertise as mba and city in delhi . this will be like job portal or any social networking portal my database is -- phpMyAdmin SQL Dump -- version 2.8.1 -- http://www.phpmyadmin.net -- Host: localhost -- Generation Time: May 01, 2010 at 10:58 AM -- Server version: 5.0.21 -- PHP Version: 5.1.4 -- Database: users -- -- Table structure for table userProfile CREATE TABLE userprofile ( id int(11) NOT NULL auto_increment, name varchar(50) collate latin1_general_ci NOT NULL, expertise varchar(50) collate latin1_general_ci NOT NULL, city varchar(50) collate latin1_general_ci NOT NULL, state varchar(50) collate latin1_general_ci NOT NULL, discription varchar(500) collate latin1_general_ci NOT NULL, PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=3 ; -- -- Dumping data for table userProfile INSERT INTO userProfile VALUES (1, 'a', 'MBA HR', 'Delhi', 'Delhi', 'Fortune is top management college in Delhi, Best B-schools in India providing business studies and management training. FIIB is Delhi based most ranked ...'); INSERT INTO userProfile VALUES (2, 'b', 'MBA marketing', 'Delhi', 'Delhi', 'Fortune is top management college in Delhi, Best B-schools in India providing business studies and management training. FIIB is Delhi based most ranked ...'); and search.php page <?php include("config.php"); include("class.search.php"); $br=new search(); if($_POST['searchbutton']) { $str=$_POST['textfield']; $brstr=$br->breakkey($str); } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> </head> <body> <table width="100%" border="0"> <form name="frmsearch" method="post"> <tr> <td width="367">&nbsp;</td> <td width="300"><label> <input name="textfield" type="text" id="textfield" size="50" /> </label></td> <td width="294"><label> <input type="submit" name="searchbutton" id="button" value="Search" /> </label></td> </tr></form> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </body> </html> and config.php is <?php error_reporting(E_ALL); $host="localhost"; $username="root"; $password=""; $dbname="users"; $con=mysql_connect($host,$username,$password) or die("could not connect database"); $db=mysql_select_db($dbname,$con) or die("could not select database"); ?> and class.search.php is <?php class search { function breakkey($key) { global $db; $words=explode(' ',$key); return $words; } function searchitem($perm) { global $db; foreach($perm as $k=>$v) { $sql="select * from users" } } } ?>

    Read the article

  • Picking good first estimates for Goldschmidt division

    - by Mads Elvheim
    I'm calculating fixedpoint reciprocals in Q22.10 with Goldschmidt division for use in my software rasterizer on ARM. This is done by just setting the nominator to 1, i.e the nominator becomes the scalar on the first iteration. To be honest, I'm kind of following the wikipedia algorithm blindly here. The article says that if the denominator is scaled in the half-open range (0.5, 1.0], a good first estimate can be based on the denominator alone: Let F be the estimated scalar and D be the denominator, then F = 2 - D. But when doing this, I lose a lot of precision. Say if I want to find the reciprocal of 512.00002f. In order to scale the number down, I lose 10 bits of precision in the fraction part, which is shifted out. So, my questions are: Is there a way to pick a better estimate which does not require normalization? Also, is it possible to pre-calculate the first estimates so the series converges faster? Right now, it converges after the 4th iteration on average. On ARM this is about ~50 cycles worst case, and that's not taking emulation of clz/bsr into account, nor memory lookups. Here is my testcase. Note: The software implementation of clz on line 13 is from my post here. You can replace it with an intrinsic if you want. #include <stdio.h> #include <stdint.h> const unsigned int BASE = 22ULL; static unsigned int divfp(unsigned int val, int* iter) { /* Nominator, denominator, estimate scalar and previous denominator */ unsigned long long N,D,F, DPREV; int bitpos; *iter = 1; D = val; /* Get the shift amount + is right-shift, - is left-shift. */ bitpos = 31 - clz(val) - BASE; /* Normalize into the half-range (0.5, 1.0] */ if(0 < bitpos) D >>= bitpos; else D <<= (-bitpos); /* (FNi / FDi) == (FN(i+1) / FD(i+1)) */ /* F = 2 - D */ F = (2ULL<<BASE) - D; /* N = F for the first iteration, because the nominator is simply 1. So don't waste a 64-bit UMULL on a multiply with 1 */ N = F; D = ((unsigned long long)D*F)>>BASE; while(1){ DPREV = D; F = (2<<(BASE)) - D; D = ((unsigned long long)D*F)>>BASE; /* Bail when we get the same value for two denominators in a row. This means that the error is too small to make any further progress. */ if(D == DPREV) break; N = ((unsigned long long)N*F)>>BASE; *iter = *iter + 1; } if(0 < bitpos) N >>= bitpos; else N <<= (-bitpos); return N; } int main(int argc, char* argv[]) { double fv, fa; int iter; unsigned int D, result; sscanf(argv[1], "%lf", &fv); D = fv*(double)(1<<BASE); result = divfp(D, &iter); fa = (double)result / (double)(1UL << BASE); printf("Value: %8.8lf 1/value: %8.8lf FP value: 0x%.8X\n", fv, fa, result); printf("iteration: %d\n",iter); return 0; }

    Read the article

  • Using numpy.apply

    - by andylei
    What's wrong with this snippet of code? import numpy as np from scipy import stats d = np.arange(10.0) cutoffs = [stats.scoreatpercentile(d, pct) for pct in range(0, 100, 20)] f = lambda x: np.sum(x > cutoffs) fv = np.vectorize(f) # why don't these two lines output the same values? [f(x) for x in d] # => [0, 1, 2, 2, 3, 3, 4, 4, 5, 5] fv(d) # => array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) Any ideas?

    Read the article

  • Twill/Mechanize access to html content...

    - by Shaheeb Roshan
    Hello! Couple of questions regarding Twill and Mechanize: 1) Is Twill still relevant as a web-automation tool? If yes, then why is not currently maintained? If no, has Mechanize matured further to support Twill-style simple scripting? Or is there another package that has stepped up to fill the gap? 2) I was able to very quickly setup a couple of test suites in python using Twill, but I'm a little confused on how to access the information that Twill spits out in my python program. That is, I can do showforms() and see the form values neatly listed and I can use fv to update the form values and submit. But how do I access one of those form values as a python var? How can I say something like: someField1Value = fv("1","someField1") Thanks! Shaheeb R.

    Read the article

  • how to run foreach loop with ternary condition

    - by I Like PHP
    i have two foreach loop to display some data, but i want to use a single foreach on basis of database result. means if there is any row returns from database then forach($first as $fk=>$fv) should execute otherwise foreach($other as $ok) should execute. i m unsing below ternary operator which gives parse error $n=$db->numRows($taskData); // databsse results <?php ($n) ? foreach ($first as $fk=>$fv) : foreach ($other as $ok) { ?> <table><tr><td>......some data...</td></tr></table> <?php } ?> please suggest me how to handle such condition via ternary operator or any other idea. Thanks

    Read the article

  • UV Atlas Generation and Seam Removal

    - by P. Avery
    I'm generating light maps for scene mesh objects using DirectX's UV Atlas Tool( D3DXUVAtlasCreate() ). I've succeeded in generating an atlas, however, when I try to render the mesh object using the atlas the seams are visible on the mesh. Below are images of a lightmap generated for a cube. Here is the code I use to generate a uv atlas for a cube: struct sVertexPosNormTex { D3DXVECTOR3 vPos, vNorm; D3DXVECTOR2 vUV; sVertexPosNormTex(){} sVertexPosNormTex( D3DXVECTOR3 v, D3DXVECTOR3 n, D3DXVECTOR2 uv ) { vPos = v; vNorm = n; vUV = uv; } ~sVertexPosNormTex() { } }; // create a light map texture to fill programatically hr = D3DXCreateTexture( pd3dDevice, 128, 128, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &pLightmap ); if( FAILED( hr ) ) { DebugStringDX( "Main", "Failed to D3DXCreateTexture( lightmap )", __LINE__, hr ); return hr; } // get the zero level surface from the texture IDirect3DSurface9 *pS = NULL; pLightmap->GetSurfaceLevel( 0, &pS ); // clear surface pd3dDevice->ColorFill( pS, NULL, D3DCOLOR_XRGB( 0, 0, 0 ) ); // load a sample mesh DWORD dwcMaterials = 0; LPD3DXBUFFER pMaterialBuffer = NULL; V_RETURN( D3DXLoadMeshFromX( L"cube3.x", D3DXMESH_MANAGED, pd3dDevice, &pAdjacency, &pMaterialBuffer, NULL, &dwcMaterials, &g_pMesh ) ); // generate adjacency DWORD *pdwAdjacency = new DWORD[ 3 * g_pMesh->GetNumFaces() ]; g_pMesh->GenerateAdjacency( 1e-6f, pdwAdjacency ); // create light map coordinates LPD3DXMESH pMesh = NULL; LPD3DXBUFFER pFacePartitioning = NULL, pVertexRemapArray = NULL; FLOAT resultStretch = 0; UINT numCharts = 0; hr = D3DXUVAtlasCreate( g_pMesh, 0, 0, 128, 128, 3.5f, 0, pdwAdjacency, NULL, NULL, NULL, NULL, NULL, 0, &pMesh, &pFacePartitioning, &pVertexRemapArray, &resultStretch, &numCharts ); if( SUCCEEDED( hr ) ) { // release and set mesh SAFE_RELEASE( g_pMesh ); g_pMesh = pMesh; // write mesh to file hr = D3DXSaveMeshToX( L"cube4.x", g_pMesh, 0, ( const D3DXMATERIAL* )pMaterialBuffer->GetBufferPointer(), NULL, dwcMaterials, D3DXF_FILEFORMAT_TEXT ); if( FAILED( hr ) ) { DebugStringDX( "Main", "Failed to D3DXSaveMeshToX() at OnD3D9CreateDevice()", __LINE__, hr ); } // fill the the light map hr = BuildLightmap( pS, g_pMesh ); if( FAILED( hr ) ) { DebugStringDX( "Main", "Failed to BuildLightmap()", __LINE__, hr ); } } else { DebugStringDX( "Main", "Failed to D3DXUVAtlasCreate() at OnD3D9CreateDevice()", __LINE__, hr ); } SAFE_RELEASE( pS ); SAFE_DELETE_ARRAY( pdwAdjacency ); SAFE_RELEASE( pFacePartitioning ); SAFE_RELEASE( pVertexRemapArray ); SAFE_RELEASE( pMaterialBuffer ); Here is code to fill lightmap texture: HRESULT BuildLightmap( IDirect3DSurface9 *pS, LPD3DXMESH pMesh ) { HRESULT hr = S_OK; // validate lightmap texture surface and mesh if( !pS || !pMesh ) return E_POINTER; // lock the mesh vertex buffer sVertexPosNormTex *pV = NULL; pMesh->LockVertexBuffer( D3DLOCK_READONLY, ( void** )&pV ); // lock the mesh index buffer WORD *pI = NULL; pMesh->LockIndexBuffer( D3DLOCK_READONLY, ( void** )&pI ); // get the lightmap texture surface description D3DSURFACE_DESC desc; pS->GetDesc( &desc ); // lock the surface rect to fill with color data D3DLOCKED_RECT rct; hr = pS->LockRect( &rct, NULL, 0 ); if( FAILED( hr ) ) { DebugStringDX( "main.cpp:", "Failed to IDirect3DTexture9::LockRect()", __LINE__, hr ); return hr; } // iterate the pixels of the lightmap texture // check each pixel to see if it lies between the uv coordinates of a cube face BYTE *pBuffer = ( BYTE* )rct.pBits; for( UINT y = 0; y < desc.Height; ++y ) { BYTE* pBufferRow = ( BYTE* )pBuffer; for( UINT x = 0; x < desc.Width * 4; x+=4 ) { // determine the pixel's uv coordinate D3DXVECTOR2 p( ( ( float )x / 4.0f ) / ( float )desc.Width + 0.5f / 128.0f, y / ( float )desc.Height + 0.5f / 128.0f ); // for each face of the mesh // check to see if the pixel lies within the face's uv coordinates for( UINT i = 0; i < 3 * pMesh->GetNumFaces(); i +=3 ) { sVertexPosNormTex v[ 3 ]; v[ 0 ] = pV[ pI[ i + 0 ] ]; v[ 1 ] = pV[ pI[ i + 1 ] ]; v[ 2 ] = pV[ pI[ i + 2 ] ]; if( TexcoordIsWithinBounds( v[ 0 ].vUV, v[ 1 ].vUV, v[ 2 ].vUV, p ) ) { // the pixel lies b/t the uv coordinates of a cube face // light contribution functions aren't needed yet //D3DXVECTOR3 vPos = TexcoordToPos( v[ 0 ].vPos, v[ 1 ].vPos, v[ 2 ].vPos, v[ 0 ].vUV, v[ 1 ].vUV, v[ 2 ].vUV, p ); //D3DXVECTOR3 vNormal = v[ 0 ].vNorm; // set the color of this pixel red( for demo ) BYTE ba[] = { 0, 0, 255, 255, }; //ComputeContribution( vPos, vNormal, g_sLight, ba ); // copy the byte array into the light map texture memcpy( ( void* )&pBufferRow[ x ], ( void* )ba, 4 * sizeof( BYTE ) ); } } } // go to next line of the texture pBuffer += rct.Pitch; } // unlock the surface rect pS->UnlockRect(); // unlock mesh vertex and index buffers pMesh->UnlockIndexBuffer(); pMesh->UnlockVertexBuffer(); // write the surface to file hr = D3DXSaveSurfaceToFile( L"LightMap.jpg", D3DXIFF_JPG, pS, NULL, NULL ); if( FAILED( hr ) ) DebugStringDX( "Main.cpp", "Failed to D3DXSaveSurfaceToFile()", __LINE__, hr ); return hr; } bool TexcoordIsWithinBounds( const D3DXVECTOR2 &t0, const D3DXVECTOR2 &t1, const D3DXVECTOR2 &t2, const D3DXVECTOR2 &p ) { // compute vectors D3DXVECTOR2 v0 = t1 - t0, v1 = t2 - t0, v2 = p - t0; float f00 = D3DXVec2Dot( &v0, &v0 ); float f01 = D3DXVec2Dot( &v0, &v1 ); float f02 = D3DXVec2Dot( &v0, &v2 ); float f11 = D3DXVec2Dot( &v1, &v1 ); float f12 = D3DXVec2Dot( &v1, &v2 ); // Compute barycentric coordinates float invDenom = 1 / ( f00 * f11 - f01 * f01 ); float fU = ( f11 * f02 - f01 * f12 ) * invDenom; float fV = ( f00 * f12 - f01 * f02 ) * invDenom; // Check if point is in triangle if( ( fU >= 0 ) && ( fV >= 0 ) && ( fU + fV < 1 ) ) return true; return false; } Screenshot Lightmap I believe the problem comes from the difference between the lightmap uv coordinates and the pixel center coordinates...for example, here are the lightmap uv coordinates( generated by D3DXUVAtlasCreate() ) for a specific face( tri ) within the mesh, keep in mind that I'm using the mesh uv coordinates to write the pixels for the texture: v[ 0 ].uv = D3DXVECTOR2( 0.003581, 0.295631 ); v[ 1 ].uv = D3DXVECTOR2( 0.003581, 0.003581 ); v[ 2 ].uv = D3DXVECTOR2( 0.295631, 0.003581 ); the lightmap texture size is 128 x 128 pixels. The upper-left pixel center coordinates are: float halfPixel = 0.5 / 128 = 0.00390625; D3DXVECTOR2 pixelCenter = D3DXVECTOR2( halfPixel, halfPixel ); will the mapping and sampling of the lightmap texture will require that an offset be taken into account or that the uv coordinates are snapped to the pixel centers..? ...Any ideas on the best way to approach this situation would be appreciated...What are the common practices?

    Read the article

1 2 3 4  | Next Page >