# Search Results

• ### Project Euler 17: (Iron)Python

##### - by Ben Griswold
In my attempt to learn (Iron)Python out in the open, here’s my solution for Project Euler Problem 17.  As always, any feedback is welcome. # Euler 17 # http://projecteuler.net/index.php?section=problems&id=17 # If the numbers 1 to 5 are written out in words: # one, two, three, four, five, then there are # 3 + 3 + 5 + 4 + 4 = 19 letters used in total. # If all the numbers from 1 to 1000 (one thousand) # inclusive were written out in words, how many letters # would be used? # # NOTE: Do not count spaces or hyphens. For example, 342 # (three hundred and forty-two) contains 23 letters and # 115 (one hundred and fifteen) contains 20 letters. The # use of "and" when writing out numbers is in compliance # with British usage. import time start = time.time() def to_word(n): h = { 1 : "one", 2 : "two", 3 : "three", 4 : "four", 5 : "five", 6 : "six", 7 : "seven", 8 : "eight", 9 : "nine", 10 : "ten", 11 : "eleven", 12 : "twelve", 13 : "thirteen", 14 : "fourteen", 15 : "fifteen", 16 : "sixteen", 17 : "seventeen", 18 : "eighteen", 19 : "nineteen", 20 : "twenty", 30 : "thirty", 40 : "forty", 50 : "fifty", 60 : "sixty", 70 : "seventy", 80 : "eighty", 90 : "ninety", 100 : "hundred", 1000 : "thousand" } word = "" # Reverse the numbers so position (ones, tens, # hundreds,...) can be easily determined a = [int(x) for x in str(n)[::-1]] # Thousands position if (len(a) == 4 and a[3] != 0): # This can only be one thousand based # on the problem/method constraints word = h[a[3]] + " thousand " # Hundreds position if (len(a) >= 3 and a[2] != 0): word += h[a[2]] + " hundred" # Add "and" string if the tens or ones # position is occupied with a non-zero value. # Note: routine is broken up this way for [my] clarity. if (len(a) >= 2 and a[1] != 0): # catch 10 - 99 word += " and" elif len(a) >= 1 and a[0] != 0: # catch 1 - 9 word += " and" # Tens and ones position tens_position_value = 99 if (len(a) >= 2 and a[1] != 0): # Calculate the tens position value per the # first and second element in array # e.g. (8 * 10) + 1 = 81 tens_position_value = int(a[1]) * 10 + a[0] if tens_position_value <= 20: # If the tens position value is 20 or less # there's an entry in the hash. Use it and there's # no need to consider the ones position word += " " + h[tens_position_value] else: # Determine the tens position word by # dividing by 10 first. E.g. 8 * 10 = h[80] # We will pick up the ones position word later in # the next part of the routine word += " " + h[(a[1] * 10)] if (len(a) >= 1 and a[0] != 0 and tens_position_value > 20): # Deal with ones position where tens position is # greater than 20 or we have a single digit number word += " " + h[a[0]] # Trim the empty spaces off both ends of the string return word.replace(" ","") def to_word_length(n): return len(to_word(n)) print sum([to_word_length(i) for i in xrange(1,1001)]) print "Elapsed Time:", (time.time() - start) * 1000, "millisecs" a=raw_input('Press return to continue')

• ### Project Dashboards

##### - by EightyEight
I'm attempting to create a dashboard so that people not intimately involved with the project can get an indication of project's health. I'm struggling with determining what to put on said dashboard. I think it needs to be brief to be useful, yet complete. The project I'm working on depends on both 3rd party contractors, external hardware and of course my team's effort. Are there any suggestions or guidelines on how to encapsulate it all in a relatively easy manner? Mods, I believe this question falls squarely between development methodologies and business concerns as outlined in the faq. Thank you!

• ### VS2010: Warning on add project reference to Silverlight project from .NET project

##### - by nlawalker
In VS2010, Silverlight 4, .NET 4, I've got a WCF service and a Silverlight app, and Silverlight is accessing the class not with Add Service Reference but by sharing the contract. Naturally, this means I have the contract in a Silverlight class library, and the service has a project reference to that library. Strangely, this results in a /!\ icon on the reference, and a warning: The project 'SilverlightClassLibrary1' cannot be referenced. The referenced project is targeted to a different framework family (Silverlight) However, the reference works fine (I can use the interface in my Silverlight app) and builds fine. Is this a bug? My guess is yes, since the warning is lying and also goes away if you add an assembly reference instead of a project reference. I filed a bug and there's more info here as well.

• ### Numerous Unexpected Obstacles Ruining any Project Plans

##### - by Libor
I am working as software developer and struggling with this problem time and time again for almost thirteen years. There seems not to be any way out of the following problem. And it happens with small projects as well. For example, I plan to write an extension for Microsoft Visual Studio. I dowload learning materials, get some book on the topic and allocate time for learning and development. However, during the development, many seemingly trivial problems arise, for example: Why the script refuses to delete the file? Why Visual Studio does not register the extension? (after two days) OK, it registers it, but now it got broken. How to fix it? each of these "small" obstacles usually take 1-5 days to resolve and the project finally consumes several times more man-hours than planned. Maybe it happens only because I am working on Microsoft platform and many of their Frameworks and architectures are bit confusing and badly documented. I would like to have most problems resolved by finding answer in a book or official documentation (MSDN), but the only answer I usually find is on some weird forum or personal blog googled after desperately searching for any relevant information on the topic. Do you have the same struggles? Do you have techniques on how to prevent these problems? I was thinking of simply multiplying projected time for a given project by some factor, but this does not help. Some projects get done briskly and some take months and the guiding factor here are these small "glitches" which take programmers whole weeks to resolve. I have to admit that lots of these obstacles demoralizes me and drains me of focus and joy of work (who likes to get back to work when he have to resolve some stupid registry problem or weird framework bug instead of doing creative work?) After the project is finally done, I am feeling like dying from thousand cuts.

• ### A project idea for project ideas!?

##### - by Auxiliary
First take a look at this question which I asked a few months ago. I still can't find a place where programmers and computer specialists can discuss their projects and ideas. I found OpenHatch.com. It's good but not sufficient, it's only for open-source projects and is not really a place to discuss ideas. OK, so here's an idea, Why don't we make one? The question is do you think there is a need for such a social programmer's lounge? A place where they can discuss their ideas? Do you think it's worth the time and money to start such a website? Do you think it has the potential of getting enough traffic to keep it alive? Many thanks

• ### Project Professional 2010 can't publish existing project file

##### - by JL
I have an existing project file (created in project 2007 professional), opened by me in project professional 2010, and saved. I open this newly saved file, and connect to Project Server (2010) using my credentials (I'm admin), now when I try and publish this existing project, I can't because the button is grayed out. If I start from a blank file, I can publish without any issues (so its not permissions). I suspect something is wrong with the template for this project, but I have no idea what, any idea what to check for?

• ### Ant calling child project parent project ivy.xml overriding child project ivy.xml

##### - by J G
We've got a parent project and a child project java builds using ant and ivy. The child project needs to be able to build independently. When the parent project calls the child project the antfile command - the parent project's ivy.xml overrides the child project's ivy.xml Does anyone know how to keep the child project using its own ivy.xml?

• ### Project Euler Question 14 (Collatz Problem)

The following iterative sequence is defined for the set of positive integers: n -n/2 (n is even) n -3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence: 13 40 20 10 5 16 8 4 2 1 It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1. Which starting number, under one million, produces the longest chain? NOTE: Once the chain starts the terms are allowed to go above one million. I tried coding a solution to this in C using the bruteforce method. However, it seems that my program stalls when trying to calculate 113383. Please advise :) #include <stdio.h> #define LIMIT 1000000 int iteration(int value) { if(value%2==0) return (value/2); else return (3*value+1); } int count_iterations(int value) { int count=1; //printf("%d\n", value); while(value!=1) { value=iteration(value); //printf("%d\n", value); count++; } return count; } int main() { int iteration_count=0, max=0; int i,count; for (i=1; i<LIMIT; i++) { printf("Current iteration : %d\n", i); iteration_count=count_iterations(i); if (iteration_count>max) { max=iteration_count; count=i; } } //iteration_count=count_iterations(113383); printf("Count = %d\ni = %d\n",max,count); }

• ### Project euler problem 3 in haskell

##### - by shk
I'm new in Haskell and try to solve 3 problem from http://projecteuler.net/. The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? My solution: import Data.List getD :: Int -> Int getD x = -- find deviders let deriveList = filter (\y -> (x `mod` y) == 0) [1 .. x] filteredList = filter isSimpleNumber deriveList in maximum filteredList -- Check is nmber simple isSimpleNumber :: Int -> Bool isSimpleNumber x = let deriveList = map (\y -> (x `mod` y)) [1 .. x] filterLength = length ( filter (\z -> z == 0) deriveList) in case filterLength of 2 -> True _ -> False I try to run for example: getD 13195 > 29 But when i try: getD 600851475143 I get error Exception: Prelude.maximum: empty list Why? Thank you @Barry Brown, I think i must use: getD :: Integer -> Integer But i get error: Couldn't match expected type `Int' with actual type `Integer' Expected type: [Int] Actual type: [Integer] In the second argument of `filter', namely `deriveList' In the expression: filter isSimpleNumber deriveList Thank you.

• ### How should I remember what I was doing and why on a project 3 months back?

##### - by TheIndependentAquarius
I was working on this project 3 months back, and then suddenly another urgent project appeared and I was asked to shift my attention there. Now, from tomorrow I'll be heading back to my old project and I realize that I do not remember what exactly was I doing and where to start! I wish to know how to document the project such that anytime I look back it shouldn't take me more than a few minutes to get going from wherever I left!

• ### Project Euler considered harmful

##### - by xxxxxxx
Hi, I've done some Project Euler problems and I was able to solve them very fast because I already knew all the theory behind them. I learned that "accidentaly" because I also had to learn it for university. I used to also solve olympiad problems, I wasn't very good but I was solving some of the problems. I've reached the conclusion that Project Euler problems are taken out of their context(and olympiad problems as well). That's why they are hard. Mathematics and it's theory is taught in order to make the problems easy. However, Project Euler apparently makes an invitation at making them hard again. Why ? I honestly think this is a complete waste of time. Mathematicians had centuries at their disposal in order to solve math problems and they developed theories to explain properly why certain things happen. I think olympiad problems and Project Euler problems are really useless. What's your take on Project Euler ? Do you get something out of it or do you just find formulas on some websites and implement the code fast and then get the result and solve the problem ?

• ### FilePageSetupHeader in MS Project VBA project: Display image dynamically

##### - by Anne Schuessler
I want to display an image when printing a page from MS Page using the FilePageSetupHeader. It all works fine if I pass in the parameter for the Text property as a string as such FilePageSetupHeader Alignment:=pjRight, Text:="&P""C:\filepath\image.gif""" However, I'd prefer to be able to pass the filepath to the image to display as a variable. Somehow I can't get it right. So if I try something like the following: vImagePath = """&P""""" & prjFilePath & "\image.gif"""""" FilePageSetupHeader Alignment:=pjRight, Text:=vImagePath it just displays the path as a string. I'm pretty sure it boils down to something simple like escaping the quotes in the correct way, but I've been playing around with it for a while now and I can't seem to get it right. Any idea how this works?

• ### Solutions for Project management [closed]

##### - by user14416
The team consists of 3 people. The method of development is Scrum. The language of the project is C++. The project will be under the control of the git system. The start up budget is 0. The following things have to be chosen: Build and Version Numbering Project documentation ( file with the most common info for current stage of the project, which will be changed every time the new version or subversion of the project emerges ) Project management tool ( like Trac or Redmine, I cannot use them, because there is no hosting ) Code documentation ( I consider Doxygen ) The following questions have arisen: What can you add to the above list of the main solutions for project management in the described project? One of three project participants has linux os (No MS Office), one has Windows and MS Office (does not want to use Libre or Open Office), one has Windows, but does not have MS Office. What formats, tools can u suggest using for project documentation? The variant of using online wiki does not fit, it must be files. OneNote mb is a good tool for project management, but because of the reason mentioned above it is not possible. What can you advise? Offer a system for Build and Version Numbering.

• ### Project Server 2010 Beta - can't connect Project client to projects hosted on server

##### - by Chris W
We have a Project 2010 Beta installed on SharePoint 2010 Beta as test set-up whilst we wait for the release versions. Whilst the installation seemed to complete without any issues we're unable to open any projects within the Project 2010 client app. Project pops up an error 'Could not retrieve server initialization data'. My local event logs list some errors from MSSOAP that simply state an unanticipated error occurred during the processing of the request. The server doesn't log any errors. The Sharepoint set up is a farm containing 3 SharePoint servers. I log in to server 'PORTAL' but the Project Server stuff is configured to run on one of the other SharePoint boxes. I presume others have managed to get this working - has anyone got any ideas as to what could be wrong. Everything is patched correctly as far as I can tell.

• ### Is measuring software project metrics popular in todays industry?

##### - by Russ K
I encountered a developer who wanted some outside advice on their teams project. I found out they're developing a huge software suite for the companies executives, project manager and developers that can calculate metrics automatically and graph them per iteration. As a student from a computer science background I know very little on metrics and their importance, but my questions are: Do most companies have some way, doesn't have to be an elegant program, to measure meaningful metrics? Which metrics, single or combined, help you narrow down your projects scope and estimates? As a person who analyzes metrics, how often do you base decisions off of them? IE. Tests failed per week is increasing drastically? Do you feel that the introduction of studying metrics has helped you understand the project better? Not sure why but the developers project intrigued me and I must know more. If y

• ### Drive project success & financial performance with business critical Enterprise Project Portfolio Management

##### - by Sylvie MacKenzie, PMP
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";} Oracle Primavera invites you to the first in a series of three webcasts linking Enterprise Project Portfolio Management with enhanced operational performance and better financial results. Few organizations fully understand the impact projects have on their business. Consistently delivering successful projects is vital to the financial success of an asset intensive organization. Enterprise Project Portfolio Management (EPPM) is not a new concept yet for many organizations it is not considered "business critical". Webcast 1: Plan – Aligning project selection and prioritization with corporate objectives This webcast will look at 2 key questions: Are you aligning portfolio decisions with strategic objectives? How do you effectively measure the success of your portfolio decisions? Hear from Accenture who'll present a compelling case for why asset intensive organizations should consider EPPM as business critical. They'll explore: How technology is being used to enhance project delivery How collaboration enhances delivery performance The major challenges associated with the planning phase of a project Next hear from Geoff Roberts, Industry Strategist from Oracle Primavera. With over 30 years experience in project management/project controls in the construction, utilities and oil & gas sectors, Geoff will investigate how EPPM is a best practice and can support an organization through project selection and prioritization ensuring that decisions are aligned with corporate objectives. Don’t miss out, register today!

• ### What options do individual have to fork a project?

##### - by skrco
Let's assume our example individual has an idea, engagement, ... to fork project. By project I mean any kind of software - thick client, web site, portal, service, driver, plc, ... - anything that can be programmed. Motto of question: What options do our example individual have to fork this project from the early beginning through getting collaborators and users to mature software? Here are the main subquestions: Sandbox phase: Where can he announce his idea and proposal and receive positive/negative critic and feedback? Development phase: Where can he build his team to work on this project? Yet deployed phase: Where can he schedule tasks, assign tickets and bugs to be solved? and the list can go on... What really interests me is the "sandbox phase question".

• ### Safe project development - free repositories

##### - by friko
Some time ago we started a private hobby project. We made a project on javaforge.com, created an svn repository and started developing our app. Right now we are really far with our project, but somehow we never worried if our project is really safe on such free development tool like javaforge ? I mean, what if our project would earn some money and the source code become valuable ? Could it be stolen or could somebody take it over ? We want to be sure that we are not wasting our time and want to be really sure about our project safety. Is it possible to safely develop a project in such free repository ? We would like also to start using redmine, so if you know any safe place for moving our project, please take this under consideration. Thanks a lot.