Search Results

Search found 3791 results on 152 pages for 'symbolic math'.

Page 1/152 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Complete Guide to Symbolic Links (symlinks) on Windows or Linux

    - by Matthew Guay
    Want to easily access folders and files from different folders without maintaining duplicate copies?  Here’s how you can use Symbolic Links to link anything in Windows 7, Vista, XP, and Ubuntu. So What Are Symbolic Links Anyway? Symbolic links, otherwise known as symlinks, are basically advanced shortcuts. You can create symbolic links to individual files or folders, and then these will appear like they are stored in the folder with the symbolic link even though the symbolic link only points to their real location. There are two types of symbolic links: hard and soft. Soft symbolic links work essentially the same as a standard shortcut.  When you open a soft link, you will be redirected to the folder where the files are stored.  However, a hard link makes it appear as though the file or folder actually exists at the location of the symbolic link, and your applications won’t know any different. Thus, hard links are of the most interest in this article. Why should I use Symbolic Links? There are many things we use symbolic links for, so here’s some of the top uses we can think of: Sync any folder with Dropbox – say, sync your Pidgin Profile Across Computers Move the settings folder for any program from its original location Store your Music/Pictures/Videos on a second hard drive, but make them show up in your standard Music/Pictures/Videos folders so they’ll be detected my your media programs (Windows 7 Libraries can also be good for this) Keep important files accessible from multiple locations And more! If you want to move files to a different drive or folder and then symbolically link them, follow these steps: Close any programs that may be accessing that file or folder Move the file or folder to the new desired location Follow the correct instructions below for your operating system to create the symbolic link. Caution: Make sure to never create a symbolic link inside of a symbolic link. For instance, don’t create a symbolic link to a file that’s contained in a symbolic linked folder. This can create a loop, which can cause millions of problems you don’t want to deal with. Seriously. Create Symlinks in Any Edition of Windows in Explorer Creating symlinks is usually difficult, but thanks to the free Link Shell Extension, you can create symbolic links in all modern version of Windows pain-free.  You need to download both Visual Studio 2005 redistributable, which contains the necessary prerequisites, and Link Shell Extension itself (links below).  Download the correct version (32 bit or 64 bit) for your computer. Run and install the Visual Studio 2005 Redistributable installer first. Then install the Link Shell Extension on your computer. Your taskbar will temporally disappear during the install, but will quickly come back. Now you’re ready to start creating symbolic links.  Browse to the folder or file you want to create a symbolic link from.  Right-click the folder or file and select Pick Link Source. To create your symlink, right-click in the folder you wish to save the symbolic link, select “Drop as…”, and then choose the type of link you want.  You can choose from several different options here; we chose the Hardlink Clone.  This will create a hard link to the file or folder we selected.  The Symbolic link option creates a soft link, while the smart copy will fully copy a folder containing symbolic links without breaking them.  These options can be useful as well.   Here’s our hard-linked folder on our desktop.  Notice that the folder looks like its contents are stored in Desktop\Downloads, when they are actually stored in C:\Users\Matthew\Desktop\Downloads.  Also, when links are created with the Link Shell Extension, they have a red arrow on them so you can still differentiate them. And, this works the same way in XP as well. Symlinks via Command Prompt Or, for geeks who prefer working via command line, here’s how you can create symlinks in Command Prompt in Windows 7/Vista and XP. In Windows 7/Vista In Windows Vista and 7, we’ll use the mklink command to create symbolic links.  To use it, we have to open an administrator Command Prompt.  Enter “command” in your start menu search, right-click on Command Prompt, and select “Run as administrator”. To create a symbolic link, we need to enter the following in command prompt: mklink /prefix link_path file/folder_path First, choose the correct prefix.  Mklink can create several types of links, including the following: /D – creates a soft symbolic link, which is similar to a standard folder or file shortcut in Windows.  This is the default option, and mklink will use it if you do not enter a prefix. /H – creates a hard link to a file /J – creates a hard link to a directory or folder So, once you’ve chosen the correct prefix, you need to enter the path you want for the symbolic link, and the path to the original file or folder.  For example, if I wanted a folder in my Dropbox folder to appear like it was also stored in my desktop, I would enter the following: mklink /J C:\Users\Matthew\Desktop\Dropbox C:\Users\Matthew\Documents\Dropbox Note that the first path was to the symbolic folder I wanted to create, while the second path was to the real folder. Here, in this command prompt screenshot, you can see that I created a symbolic link of my Music folder to my desktop.   And here’s how it looks in Explorer.  Note that all of my music is “really” stored in C:\Users\Matthew\Music, but here it looks like it is stored in C:\Users\Matthew\Desktop\Music. If your path has any spaces in it, you need to place quotes around it.  Note also that the link can have a different name than the file it links to.  For example, here I’m going to create a symbolic link to a document on my desktop: mklink /H “C:\Users\Matthew\Desktop\ebook.pdf”  “C:\Users\Matthew\Downloads\Before You Call Tech Support.pdf” Don’t forget the syntax: mklink /prefix link_path Target_file/folder_path In Windows XP Windows XP doesn’t include built-in command prompt support for symbolic links, but we can use the free Junction tool instead.  Download Junction (link below), and unzip the folder.  Now open Command Prompt (click Start, select All Programs, then Accessories, and select Command Prompt), and enter cd followed by the path of the folder where you saved Junction. Junction only creates hard symbolic links, since you can use shortcuts for soft ones.  To create a hard symlink, we need to enter the following in command prompt: junction –s link_path file/folder_path As with mklink in Windows 7 or Vista, if your file/folder path has spaces in it make sure to put quotes around your paths.  Also, as usual, your symlink can have a different name that the file/folder it points to. Here, we’re going to create a symbolic link to our My Music folder on the desktop.  We entered: junction -s “C:\Documents and Settings\Administrator\Desktop\Music” “C:\Documents and Settings\Administrator\My Documents\My Music” And here’s the contents of our symlink.  Note that the path looks like these files are stored in a Music folder directly on the Desktop, when they are actually stored in My Documents\My Music.  Once again, this works with both folders and individual files. Please Note: Junction would work the same in Windows 7 or Vista, but since they include a built-in symbolic link tool we found it better to use it on those versions of Windows. Symlinks in Ubuntu Unix-based operating systems have supported symbolic links since their inception, so it is straightforward to create symbolic links in Linux distros such as Ubuntu.  There’s no graphical way to create them like the Link Shell Extension for Windows, so we’ll just do it in Terminal. Open terminal (open the Applications menu, select Accessories, and then click Terminal), and enter the following: ln –s file/folder_path link_path Note that this is opposite of the Windows commands; you put the source for the link first, and then the path second. For example, let’s create a symbolic link of our Pictures folder in our Desktop.  To do this, we entered: ln -s /home/maguay/Pictures /home/maguay/Desktop   Once again, here is the contents of our symlink folder.  The pictures look as if they’re stored directly in a Pictures folder on the Desktop, but they are actually stored in maguay\Pictures. Delete Symlinks Removing symbolic links is very simple – just delete the link!  Most of the command line utilities offer a way to delete a symbolic link via command prompt, but you don’t need to go to the trouble.   Conclusion Symbolic links can be very handy, and we use them constantly to help us stay organized and keep our hard drives from overflowing.  Let us know how you use symbolic links on your computers! Download Link Shell Extension for Windows 7, Vista, and XP Download Junction for XP Similar Articles Productive Geek Tips Using Symlinks in Windows VistaHow To Figure Out Your PC’s Host Name From the Command PromptInstall IceWM on Ubuntu LinuxAdd Color Coding to Windows 7 Media Center Program GuideSync Your Pidgin Profile Across Multiple PCs with Dropbox TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Gadfly is a cool Twitter/Silverlight app Enable DreamScene in Windows 7 Microsoft’s “How Do I ?” Videos Home Networks – How do they look like & the problems they cause Check Your IMAP Mail Offline In Thunderbird Follow Finder Finds You Twitter Users To Follow

    Read the article

  • Delete directory by referencing symbolic link

    - by Adam
    To set up the question, imagine this scenario: mkdir ~/temp cd ~/ ln -s temp temporary rm -rf temporary, rm -f temporary, and rm temporary each will remove the symbolic link but leave the directory ~/temp/. I have a script where the name of the symbolic link is easily derived but the name of the linked directory is not. Is there a way to remove the directory by referencing the symbolic link, short of parsing the name of the directory from ls -od ~/temporary?

    Read the article

  • Recommended books on math for programmers

    - by Anto
    Some programmers do, besides programming, like math (others don't). What books on math do you recommend programmers who like math to read? There are books which present concepts which are applicable in programming and/or computer science, other books about things which will fascinate programmers etc. Books on applying math to programming are okey, but they should be mainly about math (and not programming). Motivate your answers, with focus on why programmers should read the book(s).

    Read the article

  • Help with creating symbolic link

    - by user1737794
    I'm a little bit confused with how the symbolic links work. I hope someone can guide me in the right direction. I want to put a demo online from our software, which normally only runs locally on a Mac Mini. So I put all the files in the var/www from my Ubuntu 12.04 server installation. There are a lot of hardcoded links in the software which point to "/Applications/XAMPP/xamppfiles/htdocs/narrowcasting" Of course I can change all these code on my html/php files in /var/www, but that would be quite annoying. I hope I can fix this by creating a symbolic link. For example I have a directory called thumb in /var/www/thumb. The php code is trying to put a image in /Applications/XAMPP/xamppfiles/htdocs/narrowcasting/thumb. Can anyone give me a tip how to achieve this with a symbolic link? Thanks in advance.

    Read the article

  • Need ProFTPd to follow symbolic link

    - by FMaz008
    I have 2 folder: /var/www/project1/ /var/www/repository/module/ and I have this symbolic link: /var/www/project1/module/News = /var/www/repository/module/News I know the target is outside the ftp root folder. But I want to make proFTPd to be able to display&follow that symbolic link. The security is NOT a matter, we use that FTP on the local network for development purpose only. Ps.: I also use GADMIN-PROFTPD, and I installed everything by default, using apt-get install.

    Read the article

  • Math questions at a programmer interview?

    - by anon
    So I went to an interview at Samsung here in Dallas, Texas. The way the recruiter described the job, he didn't make it sound like it was too math-oriented. The job basically involved graphics programming and C++. Yes, math is implied in graphics programming, especially shaders, but I still wasn't expecting this... The whole interview lasted about an hour and a half and they asked me nothing but math-related questions. They didn't ask me a single programming question, which I found odd. About all they did was ask me how to write certain math routines as a C++ function, but that's about it. What about programming philosophy questions? Design patterns? Code-correctness? Constness? Exception safety? Thread safety? There are a zillion topics that they could have covered. But they didn't. The main concern I have is that they didn't ask any programming questions. This basically implies to me that any programmer who is good at math can get a job here, but they might put out terrible code. Of course, I think I bombed the interview because I haven't used any sort of linear algebra in about a year and I forget math easily if I haven't used it in practice for a while. Are any of my other fellow programmers out there this way? I'm a game programmer too, so this seems especially odd. The more I learn, the more old knowledge that gets "popped" out of my "stack" (memory). My question is: Does this interview seem suspicious? Is this a typical interview that large corporations have? During the interview they told me that Google's interview process is similar. They have multiple, consecutive interviews where the math problems get more advanced.

    Read the article

  • Math questions at a programmer interview?

    - by anon
    So I went to an interview at Samsung here in Dallas, Texas. The way the recruiter described the job, he didn't make it sound like it was too math-oriented. The job basically involved graphics programming and C++. Yes, math is implied in graphics programming, especially shaders, but I still wasn't expecting this... The whole interview lasted about an hour and a half and they asked me nothing but math-related questions. They didn't ask me a single programming question, which I found odd. About all they did was ask me how to write certain math routines as a C++ function, but that's about it. What about programming philosophy questions? Design patterns? Code-correctness? Constness? Exception safety? Thread safety? There are a zillion topics that they could have covered. But they didn't. The main concern I have is that they didn't ask any programming questions. This basically implies to me that any programmer who is good at math can get a job here, but they might put out terrible code. Of course, I think I bombed the interview because I haven't used any sort of linear algebra in about a year and I forget math easily if I haven't used it in practice for a while. Are any of my other fellow programmers out there this way? I'm a game programmer too, so this seems especially odd. The more I learn, the more old knowledge that gets "popped" out of my "stack" (memory). My question is: Does this interview seem suspicious? Is this a typical interview that large corporations have? During the interview they told me that Google's interview process is similar. They have multiple, consecutive interviews where the math problems get more advanced.

    Read the article

  • Symbolic Link: No such file or directory

    - by Sehe
    i created a symbolic Link from a File at "/opt/bladir/bla" to "bla". So "bla" is now in "/usr/bin/bla". But if i want to call "bla" at terminal, there comes the No such file or directory error. I looked up at "/usr/bin/bla" and the file is linking correctly at "/opt/bladir/bla". What can be the error? P.S. here is my terminal "entry": sudo ln -s /opt/bladir/bla bla Thanks! €: Problem solved. According to the Feature List, 12.04 should have Multiarch support... 'should'. I got the ia32-libs from synaptic and now the program wents just fine. As it looks, my symbolic links where correct. Thank you for all the answers!

    Read the article

  • CPU Architecture and floating-point math

    - by Jo-Herman Haugholt
    I'm trying to wrap my head around some details about how floating point math is performed on the CPU, trying to better understand what data types to use etc. I think I have a fairly good understanding of how integer math is performed. If I've understood correctly, and disregarding SIMD, a 32-bit CPU will generally perform integer math at at least 32-bit precision etc. Is it correct that floating-point math is dependent on the presence of a FPU? And that the FPU on the x86 is 80-bit, so floating point math is performed at this precision unless using SIMD? What about ARM?

    Read the article

  • Math major as a viable degree

    - by Zak O'Keefe
    While I realize there are many topics about CS vs software engineering vs game school programs, I haven't found anything relating to whether pure math degrees (with CS minor and electives) would also be a viable program. By this I mean: Would having a math major, CS minor put one at competitive disadvantage as compared to a pure CS program? This relates specifically to game engine programming, more on the graphics side. Background (for those who care): Currently a math major, CS minor at school and looking to land a career doing graphics engine programming. Admittedly, I love math and if at all possible would like to stay my current program as long as it doesn't put me at a competitive disadvantage trying to land a job post-graduation. That being said, I'm strong in the traditional C/C++ languages, strong concurrent programming skills, and currently produce self-made games for iOS. As an employer, how badly is the math major hurting me? Just want to get some advice from people already in the field!

    Read the article

  • Bad at math, feeling limited

    - by Peter Stain
    Currently I'm a java developer, making websites. I'm really bad at math, in high school I got suspened because of it once. I didn't program then and had no interest in math. I started programming after high school and started feeling that my poor math skills are limiting me. I feel like the programming's not that hard for me. Though web development in general is not that hard, i guess. I've been doing Spring and Hibernate a lot. What i'm trying to ask is : if I understand and can manage these technologies and programming overall, would it mean that I have some higher than average prerequisite for math and details? Would there be any point or would it be easy for me to take some courses in high school math and get a BSc in math maybe? This web development is really starting to feel like not my cup of tea anymore, i would like to do something more interesting. I'm 25 now and feel like stuck. Any help appreciated.

    Read the article

  • What math should all game programmers know?

    - by Tetrad
    Simple enough question: What math should all game programmers have a firm grasp of in order to be successful? I'm not specifically talking about rendering math or anything in the niche areas of game programming, more specifically just things that even game programmers should know about, and if they don't they'll probably find it useful. Note: as there is no one correct answer, this question (and its answers) is a community wiki. Also, if you would like fancy latex math equations, feel free to use http://mathurl.com/.

    Read the article

  • Game Institute Math Courses

    - by W3Geek
    I'm 21 years old and I suck at math, I mean really bad. I don't have the necessary logic to apply it towards programming. I would like to learn the math and logic of applying it. I found Game Institute (http://www.gameinstitute.com) awhile back and heard a lot of praise about them. Are there Math courses any good? Thank you. Edit: My high school was terrible and did not prepare me for any math. I am fairly decent at programming, I just don't have the logic to apply any mathematics to programming, as an example I don't understand the algorithm of finding the size of a user's screen. Yes I have heard of KhanAcademy (http://www.khanacademy.org/) and I have completed a lot of maths on his website but I still don't have the logic to apply any of it to programming.

    Read the article

  • Failed to create symbolic link to keytool

    - by mt0s
    Keytool is /usr/bin/keytool and points to /etc/alternatives/keytool which in turn points to /usr/lib/jvm/java-6-openjdk-i386/jre/bin/keytool. Now I have installed java version 1.7.0_45 so I need to change keytool to the new path : /usr/lib/jvm/jdk1.7.0_45/jre/bin/keytool I tried deleting the /usr/bin/keytool with rm -rf and then adding a new link like : sudo ln -s /usr/bin/keytool /usr/lib/jvm/jdk1.7.0_45/jre/bin/keytool but what I get is ln: failed to create symbolic link `/usr/lib/jvm/jdk1.7.0_45/jre/bin/keytool': File exists I also tried : sudo update-alternatives --config keytool There is only one alternative in link group keytool: /usr/lib/jvm/java-6-openjdk-i386/jre/bin/keytool Nothing to configure. update-alternatives: warning: forcing reinstallation of alternative /usr/lib/jvm/java-6-openjdk-i386/jre/bin/keytool because link group keytool is broken. but doesn't works too. Any suggestions ? Thank you

    Read the article

  • Long term plan of attack to learn math?

    - by zhenka
    I am a web-developer with a desire to expand my skill-set to mathematics relevant to programming. As 2nd career, I am stuck in college doing some of the requirements while working. I was hoping the my education will teach me the needed skills to apply math, however I am quickly finding it to be too much easily-testable breadth-based approach very inefficient for the time invested. For example in my calculus 2 class, the only remotely useful mind expanding experience I had was volumes and areas under the curve. The rest was just monotonous glorified algebra, which while comes easy to me, could be done by software like wolfram alpha within seconds. This is not my idea of learning math. So here I am a frustrated student looking for a way to improve my understanding of math in a way that focuses on application, understanding and maximally removed needless tedium. However I cannot find a good long term study strategy with this approach in mind. So for those of like mind, how would you go about learning the necessary math without worrying too much about stuff a computer can do much better?

    Read the article

  • (int) Math.floor(x / TILESIZE) or just (int) (x / TILESIZE)

    - by Aidan Mueller
    I have a Array that stores my map data and my Tiles are 64X64. Sometimes I need to convert from pixels to units of tiles. So I was doing: int x int y public void myFunction() { getTile((int) Math.floor(x / 64), (int) Math.floor(y / 64)).doOperation(); } But I discovered by using (I'm using java BTW) System.out.println((int) (1 / 1.5)) that converting to an int automatically rounds down. This means that I can replace the (int) Math.floor with just x / 64. But if I run this on a different OS do you think it might give a different result? I'm just afraid there might be some case where this would round up and not down. Should I keep doing it the way I was and maybe make a function like convert(int i) to make it easier? Or is it OK to just do x / 64?

    Read the article

  • Is it inefficient to have symbolic links to symbolic links?

    - by Ogre Psalm33
    We're setting up a series of Makefiles where we want to have a project-level include directory that will have symbolic links to sub-project-level include files. Many sub-project developers have chosen to have their include files also be symbolic links to yet another directory where the actual software is located. So my question is, is it inefficient to have a symbolic link to a symbolic link to another file (for, say, a C++ header that may be included dozens or more times during a compile)? Example directory tree: /project/include/ x_header1.h -> /project/src/csci_x/include/header1.h x_header2.h -> /project/src/csci_x/include/header2.h /project/src/csci_x/ include/ header1.h -> /project/src/csci_x/local_1/cxx/header1.h header2.h -> /project/src/csci_x/local_2/cxx/header2.h local_1/cxx/ module1.cpp header1.h local_2/cxx/ module2.cpp header2.h

    Read the article

  • Simple Math Multiplayer game - is Ajax sufficient?

    - by Christian Strang
    I'm planning to create a simple math multiplayer game and I plan to just use Ajax for the server/client communication but I'm not sure if this is sufficient or if I need a socket server. The game will look like this: 2-4 users all get a simple math task (like: "37 + 14") they have to solve it as fast as possible first user who solves it is the winner I will track the time for each user, since the game started, on the client side and everytime a user gives an answer, the answer and the passed time will be send to the server. Additionally I'll add a function which will check every 3 seconds if the other users finished, how much time they needed and who won. Do you think this is possible just using Ajax? What alternatives are there?

    Read the article

  • Is there an easy way to type in common math symbols?

    - by srcspider
    Disclaimer: I'm sure someone is going to moan about easy-of-use, for the purpose of this question consider readability to be the only factor that matters So I found this site that converts to easting northing, it's not really important what that even means but here's how the piece of javascript looks. /** * Convert Ordnance Survey grid reference easting/northing coordinate to (OSGB36) latitude/longitude * * @param {OsGridRef} gridref - easting/northing to be converted to latitude/longitude * @returns {LatLonE} latitude/longitude (in OSGB36) of supplied grid reference */ OsGridRef.osGridToLatLong = function(gridref) { var E = gridref.easting; var N = gridref.northing; var a = 6377563.396, b = 6356256.909; // Airy 1830 major & minor semi-axes var F0 = 0.9996012717; // NatGrid scale factor on central meridian var f0 = 49*Math.PI/180, ?0 = -2*Math.PI/180; // NatGrid true origin var N0 = -100000, E0 = 400000; // northing & easting of true origin, metres var e2 = 1 - (b*b)/(a*a); // eccentricity squared var n = (a-b)/(a+b), n2 = n*n, n3 = n*n*n; // n, n², n³ var f=f0, M=0; do { f = (N-N0-M)/(a*F0) + f; var Ma = (1 + n + (5/4)*n2 + (5/4)*n3) * (f-f0); var Mb = (3*n + 3*n*n + (21/8)*n3) * Math.sin(f-f0) * Math.cos(f+f0); var Mc = ((15/8)*n2 + (15/8)*n3) * Math.sin(2*(f-f0)) * Math.cos(2*(f+f0)); var Md = (35/24)*n3 * Math.sin(3*(f-f0)) * Math.cos(3*(f+f0)); M = b * F0 * (Ma - Mb + Mc - Md); // meridional arc } while (N-N0-M >= 0.00001); // ie until < 0.01mm var cosf = Math.cos(f), sinf = Math.sin(f); var ? = a*F0/Math.sqrt(1-e2*sinf*sinf); // nu = transverse radius of curvature var ? = a*F0*(1-e2)/Math.pow(1-e2*sinf*sinf, 1.5); // rho = meridional radius of curvature var ?2 = ?/?-1; // eta = ? var tanf = Math.tan(f); var tan2f = tanf*tanf, tan4f = tan2f*tan2f, tan6f = tan4f*tan2f; var secf = 1/cosf; var ?3 = ?*?*?, ?5 = ?3*?*?, ?7 = ?5*?*?; var VII = tanf/(2*?*?); var VIII = tanf/(24*?*?3)*(5+3*tan2f+?2-9*tan2f*?2); var IX = tanf/(720*?*?5)*(61+90*tan2f+45*tan4f); var X = secf/?; var XI = secf/(6*?3)*(?/?+2*tan2f); var XII = secf/(120*?5)*(5+28*tan2f+24*tan4f); var XIIA = secf/(5040*?7)*(61+662*tan2f+1320*tan4f+720*tan6f); var dE = (E-E0), dE2 = dE*dE, dE3 = dE2*dE, dE4 = dE2*dE2, dE5 = dE3*dE2, dE6 = dE4*dE2, dE7 = dE5*dE2; f = f - VII*dE2 + VIII*dE4 - IX*dE6; var ? = ?0 + X*dE - XI*dE3 + XII*dE5 - XIIA*dE7; return new LatLonE(f.toDegrees(), ?.toDegrees(), GeoParams.datum.OSGB36); } I found that to be a really nice way of writing an algorythm, at least as far as redability is concerned. Is there any way to easily write the special symbols. And by easily write I mean NOT copy/paste them.

    Read the article

  • how to make a function recursive

    - by tom smith
    i have this huge function and i am wondering how to make it recursive. i have the base case which should never come true, so it should always go to else and keep calling itself with the variable t increases. any help would be great thanks def draw(x, y, t, planets): if 'Satellites' in planets["Moon"]: print ("fillcircle", x, y, planets["Moon"]['Radius']*scale) else: while True: print("refresh") print("colour 0 0 0") print("clear") print("colour 255 255 255") print("fillcircle",x,y,planets['Sun']['Radius']*scale) print("text ", "\"Sun\"",x+planets['Sun']['Radius']*scale,y) if "Mercury" in planets: r_Mercury=planets['Mercury']['Orbital Radius']*scale; print("circle",x,y,r_Mercury) r_Xmer=x+math.sin(t*2*math.pi/planets['Mercury']['Period'])*r_Mercury r_Ymer=y+math.cos(t*2*math.pi/planets['Mercury']['Period'])*r_Mercury print("fillcircle",r_Xmer,r_Ymer,3) print("text ", "\"Mercury\"",r_Xmer+planets['Mercury']['Radius']*scale,r_Ymer) if "Venus" in planets: r_Venus=planets['Venus']['Orbital Radius']*scale; print("circle",x,y,r_Venus) r_Xven=x+math.sin(t*2*math.pi/planets['Venus']['Period'])*r_Venus r_Yven=y+math.cos(t*2*math.pi/planets['Venus']['Period'])*r_Venus print("fillcircle",r_Xven,r_Yven,3) print("text ", "\"Venus\"",r_Xven+planets['Venus']['Radius']*scale,r_Yven) if "Earth" in planets: r_Earth=planets['Earth']['Orbital Radius']*scale; print("circle",x,y,r_Earth) r_Xe=x+math.sin(t*2*math.pi/planets['Earth']['Period'])*r_Earth r_Ye=y+math.cos(t*2*math.pi/planets['Earth']['Period'])*r_Earth print("fillcircle",r_Xe,r_Ye,3) print("text ", "\"Earth\"",r_Xe+planets['Earth']['Radius']*scale,r_Ye) if "Moon" in planets: r_Moon=planets['Moon']['Orbital Radius']*scale; print("circle",r_Xe,r_Ye,r_Moon) r_Xm=r_Xe+math.sin(t*2*math.pi/planets['Moon']['Period'])*r_Moon r_Ym=r_Ye+math.cos(t*2*math.pi/planets['Moon']['Period'])*r_Moon print("fillcircle",r_Xm,r_Ym,3) print("text ", "\"Moon\"",r_Xm+planets['Moon']['Radius']*scale,r_Ym) if "Mars" in planets: r_Mars=planets['Mars']['Orbital Radius']*scale; print("circle",x,y,r_Mars) r_Xmar=x+math.sin(t*2*math.pi/planets['Mars']['Period'])*r_Mars r_Ymar=y+math.cos(t*2*math.pi/planets['Mars']['Period'])*r_Mars print("fillcircle",r_Xmar,r_Ymar,3) print("text ", "\"Mars\"",r_Xmar+planets['Mars']['Radius']*scale,r_Ymar) if "Phobos" in planets: r_Phobos=planets['Phobos']['Orbital Radius']*scale; print("circle",r_Xmar,r_Ymar,r_Phobos) r_Xpho=r_Xmar+math.sin(t*2*math.pi/planets['Phobos']['Period'])*r_Phobos r_Ypho=r_Ymar+math.cos(t*2*math.pi/planets['Phobos']['Period'])*r_Phobos print("fillcircle",r_Xpho,r_Ypho,3) print("text ", "\"Phobos\"",r_Xpho+planets['Phobos']['Radius']*scale,r_Ypho) if "Deimos" in planets: r_Deimos=planets['Deimos']['Orbital Radius']*scale; print("circle",r_Xmar,r_Ymar,r_Deimos) r_Xdei=r_Xmar+math.sin(t*2*math.pi/planets['Deimos']['Period'])*r_Deimos r_Ydei=r_Ymar+math.cos(t*2*math.pi/planets['Deimos']['Period'])*r_Deimos print("fillcircle",r_Xdei,r_Ydei,3) print("text ", "\"Deimos\"",r_Xpho+planets['Deimos']['Radius']*scale,r_Ydei) if "Ceres" in planets: r_Ceres=planets['Ceres']['Orbital Radius']*scale; print("circle",x,y,r_Ceres) r_Xcer=x+math.sin(t*2*math.pi/planets['Ceres']['Period'])*r_Ceres r_Ycer=y+math.cos(t*2*math.pi/planets['Ceres']['Period'])*r_Ceres print("fillcircle",r_Xcer,r_Ycer,3) print("text ", "\"Ceres\"",r_Xcer+planets['Ceres']['Radius']*scale,r_Ycer) if "Jupiter" in planets: r_Jupiter=planets['Jupiter']['Orbital Radius']*scale; print("circle",x,y,r_Jupiter) r_Xjup=x+math.sin(t*2*math.pi/planets['Jupiter']['Period'])*r_Jupiter r_Yjup=y+math.cos(t*2*math.pi/planets['Jupiter']['Period'])*r_Jupiter print("fillcircle",r_Xjup,r_Yjup,3) print("text ", "\"Jupiter\"",r_Xjup+planets['Jupiter']['Radius']*scale,r_Yjup) if "Io" in planets: r_Io=planets['Io']['Orbital Radius']*scale; print("circle",r_Xjup,r_Yjup,r_Io) r_Xio=r_Xjup+math.sin(t*2*math.pi/planets['Io']['Period'])*r_Io r_Yio=r_Yjup+math.cos(t*2*math.pi/planets['Io']['Period'])*r_Io print("fillcircle",r_Xio,r_Yio,3) print("text ", "\"Io\"",r_Xio+planets['Io']['Radius']*scale,r_Yio) if "Europa" in planets: r_Europa=planets['Europa']['Orbital Radius']*scale; print("circle",r_Xjup,r_Yjup,r_Europa) r_Xeur=r_Xjup+math.sin(t*2*math.pi/planets['Europa']['Period'])*r_Europa r_Yeur=r_Yjup+math.cos(t*2*math.pi/planets['Europa']['Period'])*r_Europa print("fillcircle",r_Xeur,r_Yeur,3) print("text ", "\"Europa\"",r_Xeur+planets['Europa']['Radius']*scale,r_Yeur) if "Ganymede" in planets: r_Ganymede=planets['Ganymede']['Orbital Radius']*scale; print("circle",r_Xjup,r_Yjup,r_Ganymede) r_Xgan=r_Xjup+math.sin(t*2*math.pi/planets['Ganymede']['Period'])*r_Ganymede r_Ygan=r_Yjup+math.cos(t*2*math.pi/planets['Ganymede']['Period'])*r_Ganymede print("fillcircle",r_Xgan,r_Ygan,3) print("text ", "\"Ganymede\"",r_Xgan+planets['Ganymede']['Radius']*scale,r_Ygan) if "Callisto" in planets: r_Callisto=planets['Callisto']['Orbital Radius']*scale; print("circle",r_Xjup,r_Yjup,r_Callisto) r_Xcal=r_Xjup+math.sin(t*2*math.pi/planets['Callisto']['Period'])*r_Callisto r_Ycal=r_Yjup+math.cos(t*2*math.pi/planets['Callisto']['Period'])*r_Callisto print("fillcircle",r_Xcal,r_Ycal,3) print("text ", "\"Callisto\"",r_Xcal+planets['Callisto']['Radius']*scale,r_Ycal) if "Saturn" in planets: r_Saturn=planets['Saturn']['Orbital Radius']*scale; print("circle",x,y,r_Saturn) r_Xsat=x+math.sin(t*2*math.pi/planets['Saturn']['Period'])*r_Saturn r_Ysat=y+math.cos(t*2*math.pi/planets['Saturn']['Period'])*r_Saturn print("fillcircle",r_Xsat,r_Ysat,3) print("text ", "\"Saturn\"",r_Xsat+planets['Saturn']['Radius']*scale,r_Ysat) if "Mimas" in planets: r_Mimas=planets['Mimas']['Orbital Radius']*scale; print("circle",r_Xsat,r_Ysat,r_Mimas) r_Xmim=r_Xsat+math.sin(t*2*math.pi/planets['Mimas']['Period'])*r_Mimas r_Ymim=r_Ysat+math.cos(t*2*math.pi/planets['Mimas']['Period'])*r_Mimas print("fillcircle",r_Xmim,r_Ymim,3) print("text ", "\"Mimas\"",r_Xmim+planets['Mimas']['Radius']*scale,r_Ymim) if "Enceladus" in planets: r_Enceladus=planets['Enceladus']['Orbital Radius']*scale; print("circle",r_Xsat,r_Ysat,r_Enceladus) r_Xenc=r_Xsat+math.sin(t*2*math.pi/planets['Enceladus']['Period'])*r_Enceladus r_Yenc=r_Ysat+math.cos(t*2*math.pi/planets['Enceladus']['Period'])*r_Enceladus print("fillcircle",r_Xenc,r_Yenc,3) print("text ", "\"Enceladus\"",r_Xenc+planets['Enceladus']['Radius']*scale,r_Yenc) if "Tethys" in planets: r_Tethys=planets['Tethys']['Orbital Radius']*scale; print("circle",r_Xsat,r_Ysat,r_Tethys) r_Xtet=r_Xsat+math.sin(t*2*math.pi/planets['Tethys']['Period'])*r_Tethys r_Ytet=r_Ysat+math.cos(t*2*math.pi/planets['Tethys']['Period'])*r_Tethys print("fillcircle",r_Xtet,r_Ytet,3) print("text ", "\"Tethys\"",r_Xtet+planets['Tethys']['Radius']*scale,r_Ytet) if "Dione" in planets: r_Dione=planets['Dione']['Orbital Radius']*scale; print("circle",r_Xsat,r_Ysat,r_Dione) r_Xdio=r_Xsat+math.sin(t*2*math.pi/planets['Dione']['Period'])*r_Dione r_Ydio=r_Ysat+math.cos(t*2*math.pi/planets['Dione']['Period'])*r_Dione print("fillcircle",r_Xdio,r_Ydio,3) print("text ", "\"Dione\"",r_Xdio+planets['Dione']['Radius']*scale,r_Ydio) if "Rhea" in planets: r_Rhea=planets['Rhea']['Orbital Radius']*scale; print("circle",r_Xsat,r_Ysat,r_Rhea) r_Xrhe=r_Xsat+math.sin(t*2*math.pi/planets['Rhea']['Period'])*r_Rhea r_Yrhe=r_Ysat+math.cos(t*2*math.pi/planets['Rhea']['Period'])*r_Rhea print("fillcircle",r_Xrhe,r_Yrhe,3) print("text ", "\"Rhea\"",r_Xrhe+planets['Rhea']['Radius']*scale,r_Yrhe) if "Titan" in planets: r_Titan=planets['Titan']['Orbital Radius']*scale; print("circle",r_Xsat,r_Ysat,r_Titan) r_Xtit=r_Xsat+math.sin(t*2*math.pi/planets['Titan']['Period'])*r_Titan r_Ytit=r_Ysat+math.cos(t*2*math.pi/planets['Titan']['Period'])*r_Titan print("fillcircle",r_Xtit,r_Ytit,3) print("text ", "\"Titan\"",r_Xtit+planets['Titan']['Radius']*scale,r_Ytit) if "Iapetus" in planets: r_Iapetus=planets['Iapetus']['Orbital Radius']*scale; print("circle",r_Xsat,r_Ysat,r_Iapetus) r_Xiap=r_Xsat+math.sin(t*2*math.pi/planets['Iapetus']['Period'])*r_Iapetus r_Yiap=r_Ysat+math.cos(t*2*math.pi/planets['Iapetus']['Period'])*r_Iapetus print("fillcircle",r_Xiap,r_Yiap,3) print("text ", "\"Iapetus\"",r_Xiap+planets['Iapetus']['Radius']*scale,r_Yiap) if "Uranus" in planets: r_Uranus=planets['Uranus']['Orbital Radius']*scale; print("circle",x,y,r_Uranus) r_Xura=x+math.sin(t*2*math.pi/planets['Uranus']['Period'])*r_Uranus r_Yura=y+math.cos(t*2*math.pi/planets['Uranus']['Period'])*r_Uranus print("fillcircle",r_Xura,r_Yura,3) print("text ", "\"Uranus\"",r_Xura+planets['Uranus']['Radius']*scale,r_Yura) if "Puck" in planets: r_Puck=planets['Puck']['Orbital Radius']*scale; print("circle",r_Xura,r_Yura,r_Puck) r_Xpuc=r_Xura+math.sin(t*2*math.pi/planets['Puck']['Period'])*r_Puck r_Ypuc=r_Yura+math.cos(t*2*math.pi/planets['Puck']['Period'])*r_Puck print("fillcircle",r_Xpuc,r_Ypuc,3) print("text ", "\"Puck\"",r_Xpuc+planets['Puck']['Radius']*scale,r_Ypuc) if "Miranda" in planets: r_Miranda=planets['Miranda']['Orbital Radius']*scale; print("circle",r_Xura,r_Yura,r_Miranda) r_Xmira=r_Xura+math.sin(t*2*math.pi/planets['Miranda']['Period'])*r_Miranda r_Ymira=r_Yura+math.cos(t*2*math.pi/planets['Miranda']['Period'])*r_Miranda print("fillcircle",r_Xmira,r_Ymira,3) print("text ", "\"Miranda\"",r_Xmira+planets['Miranda']['Radius']*scale,r_Ymira) if "Ariel" in planets: r_Ariel=planets['Ariel']['Orbital Radius']*scale; print("circle",r_Xura,r_Yura,r_Ariel) r_Xari=r_Xura+math.sin(t*2*math.pi/planets['Ariel']['Period'])*r_Ariel r_Yari=r_Yura+math.cos(t*2*math.pi/planets['Ariel']['Period'])*r_Ariel print("fillcircle",r_Xari,r_Yari,3) print("text ", "\"Ariel\"",r_Xari+planets['Ariel']['Radius']*scale,r_Yari) if "Umbriel" in planets: r_Umbriel=planets['Umbriel']['Orbital Radius']*scale; print("circle",r_Xura,r_Yura,r_Umbriel) r_Xumb=r_Xura+math.sin(t*2*math.pi/planets['Umbriel']['Period'])*r_Umbriel r_Yumb=r_Yura+math.cos(t*2*math.pi/planets['Umbriel']['Period'])*r_Umbriel print("fillcircle",r_Xumb,r_Yumb,3) print("text ", "\"Umbriel\"",r_Xumb+planets['Umbriel']['Radius']*scale,r_Yumb) if "Titania" in planets: r_Titania=planets['Titania']['Orbital Radius']*scale; print("circle",r_Xura,r_Yura,r_Titania) r_Xtita=r_Xura+math.sin(t*2*math.pi/planets['Titania']['Period'])*r_Titania r_Ytita=r_Yura+math.cos(t*2*math.pi/planets['Titania']['Period'])*r_Titania print("fillcircle",r_Xtita,r_Ytita,3) print("text ", "\"Titania\"",r_Xtita+planets['Titania']['Radius']*scale,r_Ytita) if "Oberon" in planets: r_Oberon=planets['Oberon']['Orbital Radius']*scale; print("circle",r_Xura,r_Yura,r_Oberon) r_Xober=r_Xura+math.sin(t*2*math.pi/planets['Oberon']['Period'])*r_Oberon r_Yober=r_Yura+math.cos(t*2*math.pi/planets['Oberon']['Period'])*r_Oberon print("fillcircle",r_Xober,r_Yober,3) print("text ", "\"Oberon\"",r_Xober+planets['Oberon']['Radius']*scale,r_Yober) if "Neptune" in planets: r_Neptune=planets['Neptune']['Orbital Radius']*scale; print("circle",x,y,r_Neptune) r_Xnep=x+math.sin(t*2*math.pi/planets['Neptune']['Period'])*r_Neptune r_Ynep=y+math.cos(t*2*math.pi/planets['Neptune']['Period'])*r_Neptune print("fillcircle",r_Xnep,r_Ynep,3) print("text ", "\"Neptune\"",r_Xnep+planets['Neptune']['Radius']*scale,r_Ynep) if "Titan" in planets: r_Titan=planets['Titan']['Orbital Radius']*scale; print("circle",r_Xnep,r_Ynep,r_Titan) r_Xtita=r_Xnep+math.sin(t*2*math.pi/planets['Titan']['Period'])*r_Titan r_Ytita=r_Ynep+math.cos(t*2*math.pi/planets['Titan']['Period'])*r_Titan print("fillcircle",r_Xtita,r_Ytita,3) print("text ", "\"Titan\"",r_Xtita+planets['Titan']['Radius']*scale,r_Ytita) t += 0.003 print(draw(x, y, t, planets))

    Read the article

  • How to learn the math behind the code?

    - by Solomon Wise
    I am a 12 year old who has recently gotten into programming. (Although I know that the number of books you have read does not determine your programming competency or ability, just to paint a "map" of where I am in terms of the content I know...) I've finished the books: Python 3 For Absolute Beginners Pro Python Python Standard Library by Example Beautiful Code Agile Web Development With Rails and am about halfway into Programming Ruby. I have written many small programs (One that finds which files have been updated and deleted in a directory, one that compares multiple players' fantasy baseball value, and some text based games, and many more). Obviously, as I'm not some sort of child prodigy, I can't take a formal Computer Science course until high school. I really want to learn computer science to increase my knowledge about the code, and the how the code runs. I've really become interested in the math part after reading the source code for Python's random module. Is there a place where I can learn CS, or programming math online for free, at a level that would be at least partially understandable to a person my age?

    Read the article

  • Setup symbolic link where users can access it with FTP

    - by Dan Shields
    I have a folder on a server where a client of mine has a bunch of folders that they upload images and what not for a site, I do a symbolic link to those folders to the root of the website. This way I can give them ftp access to upload whatever they need without having access to the root level of the website. I have another folder that I can't setup as a symbolic link to their folder, which has images they need to upload to. I know that if I create a symbolic link the other way around where the sym link is in their folder, they can't access it through FTP. There has to be a way without creating two separate FTP accounts and give a user the ability to upload to a different directory that is outside of their home directory. I see that it is ftp specific and that there are some settings that can be changed but I haven't seen any clear cut answers for the best way to handle this.

    Read the article

  • Java Math.cos() Method Does Not Return 0 When Expected

    - by dimo414
    Using Java on a Windows 7 PC (not sure if that matters) and calling Math.cos() on values that should return 0 (like pi/2) instead returns small values, but small values that, unless I'm misunderstanding, are much greater than 1 ulp off from zero. Math.cos(Math.PI/2) = 6.123233995736766E-17 Math.ulp(Math.cos(Math.PI/2)) = 1.232595164407831E-32 Is this in fact within 1 ulp and I'm simply confused? And would this be an acceptable wrapper method to resolve this minor inaccuracy? public static double cos(double a){ double temp = Math.abs(a % Math.PI); if(temp == Math.PI/2) return 0; return Math.cos(a); }

    Read the article

  • MathType and LibreOffice Math comparison

    - by Agmenor
    In my office my team and I are going to type texts in the future which will include mathematical signs. Two programs are being proposed: LibreOffice Writer + Math or Microsoft Office + MathType. I would like to advocate for the first solution, but I need to know what technical advantages and disadvantages each program has. Compatibility with Ubuntu is an evident and important characteristic for LibreOffice, but could you give some other aspects? As a side question, do you advice any other program, even if not WYSIWYG and thus not my preference in this case?

    Read the article

  • Getting to math applications gradually

    - by den-javamaniac
    I'm currently getting a formal degree related to computation, in particular my current focus is numerical programming, scientific computing and machine learning. I'd love to apply that knowledge in game dev and expand it with statistics, probability theory, and graph theory (probably even linear algebra). The question is: which spheres of gamedev are filled with such math stuff, is it possible to advance in those without being a part of a group of people and how to get to it gradually? P.S.: I've got experience with commercial java dev and am getting my hands on C/C++ at the moment, however, I'm opened to go ahead and try Unity3D and etc.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >