Daily Archives

Articles indexed Wednesday April 14 2010

Page 11/122 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • What does the following FORTRAN code do?

    - by Jon Skeet
    C AREA OF A TRIANGLE WITH A STANDARD SQUARE ROOT FUNCTION C INPUT - CARD READER UNIT 5, INTEGER INPUT C OUTPUT - LINE PRINTER UNIT 6, REAL OUTPUT C INPUT ERROR DISPLAY ERROR OUTPUT CODE 1 IN JOB CONTROL LISTING READ (5, 501) IA, IB, IC 501 FORMAT (3I5) C IA, IB, AND IC MAY NOT BE NEGATIVE C FURTHERMORE, THE SUM OF TWO SIDES OF A TRIANGLE C IS GREATER THAN THE THIRD SIDE, SO WE CHECK FOR THAT, TOO IF (IA) 777, 777, 701 701 IF (IB) 777, 777, 702 702 IF (IC) 777, 777, 703 703 IF (IA+IB-IC) 777,777,704 704 IF (IA+IC-IB) 777,777,705 705 IF (IB+IC-IA) 777,777,799 777 STOP 1 C USING HERON'S FORMULA WE CALCULATE THE C AREA OF THE TRIANGLE 799 S = FLOATF (IA + IB + IC) / 2.0 AREA = SQRT( S * (S - FLOATF(IA)) * (S - FLOATF(IB)) * + (S - FLOATF(IC))) WRITE (6, 601) IA, IB, IC, AREA 601 FORMAT (4H A= ,I5,5H B= ,I5,5H C= ,I5,8H AREA= ,F10.2, + 13H SQUARE UNITS) STOP END plz i need to know soon!!!!!

    Read the article

  • R: disentangling scopes

    - by rescdsk
    Hi, Right now, in my R project, I have functions1.R with doFoo() and doBar(), functions2.R with other functions, and main.R with the main program in it, which first does source('functions1.R'); source('functions2.R'), and then calls the other functions. I've been starting the program from the R GUI in Mac OS X, with source('main.R'). This is fine the first time, but after that, the variables that were defined the first time through the program are defined for the second time functions*.R are sourced, and so the functions get a whole bunch of extra variables defined. I don't want that! I want an "undefined variable" error when my function uses a variable it shouldn't! Twice this has given me very late nights of debugging! So how do other people deal with this sort of problem? Is there something like source(), but that makes an independent namespace that doesn't fall through to the main one? Making a package seems like one solution, but it seems like a big pain in the butt compared to e.g. Python, where a source file is automatically a separate namespace. Any tips? Thank you!

    Read the article

  • Is it the right time to get a Master's degree?

    - by harshit
    I'm currently a software engineer in India and have been working for 3,5 years. Before recession started I decided to study further and planned for a Master of Science degree in computer science in Fall09, since I want to explore more of this field. I have got an admission in Univ of Texas @ Dallas. I am confused about whether I should go for studying at the time of recession or not and how the market will be once I graduate in 2011 Jan. Any views will be appreciated.

    Read the article

  • What is wrong with this really really simple RegEx expression?

    - by Pure.Krome
    Hi folks, this one is really easy. I'm trying to create a Regular Expression that will result in a Successful Match when against the following text /default.aspx? So i tried the following... ^/default.aspx$ and it's failing to match it. Can someone help, please? (i'm guessing i'm screwing up becuase of the \ and the ? in the input expression).

    Read the article

  • A definitive guide to Url Encoding in ASP .NET

    - by cbp
    I am starting to realise that there are about a bazillion different methods for encoding urls in .NET. I keep finding new ones. They all work slightly differently, but they all have essentially the same summary comments. Does anyone have a definitive matrix that shows the exact differences between the following methods: HttpUtility.UrlEncode HttpUtility.UrlPathEncode Server.UrlEncode Uri.EscapeUriString Uri.EscapeDataString ... are they any more? Also it would be good to match these up with use-cases e.g.: Urls in href attributes of a tags Urls to be displayed to the user in HTML Urls as querystring values (i.e. to be sent in GET requests) Urls to be sent in POST requests etc

    Read the article

  • What is the best way to convince management that virtualization isn't always appropriate in producti

    - by uncle brad
    I work for a small company with a .NET product that was acquired by a medium sized company with "big iron" products. Recently, the medium-sized part of the company acquired another small company with a similar .NET product and management went to have a look at their technology. They make heavy use of virtualization in their production environment and it's been decided that we will too. Our product was not designed to be run in a virtual environment, but some accommodations can be made. For instance; there are times when we're resource bound due to customer initiated processes. This initiation is "bursty" by nature, but the processing can be made asynchronous and throttled. This is something that would need to be done for scalability anyway. But there is other processing that we do that isn't so easily modified because we're resource bound for extended periods of time. How do I convince management that heavy use of virtualization is probably not appropriate for us?

    Read the article

  • TwitPic Multiple image upload

    - by Tim Karen
    Has anybody experienced Timeout error with TwitPic API using ASIFormDataRequest when uploading multiple images? Status updates without images are fine. I was trying to upload the exact same 2 images. The first request went through fine, but the second one was timeout. It also happens when multiple images are uploaded, some went through, but some didn't. It's happening randomly and I have no idea how to debug it anymore.

    Read the article

  • rails Creating a model instance automatically when another is created

    - by bob
    Hello I have a user model and a ratings model. Whenever a new user is created I want to create a new feedback model with it automatically. Each user model has one feedback model and each feedback model has many ratings. My Classes class User < ActiveRecord::Base end class Feedback < ActiveRecord::Base belongs_to :user has_many :ratings end class Rating < ActiveRecord::Base belongs_to :feedback end My database tables -user doesn't have anything special -feedback has user_id. This user_id should be the same as the user that has just been created. For example, user_id of 1 is created, then a feedback model should be created that belongs to user_id of 1. So the user_id column in the feedback database will also be 1. - Rating has a feedback_id and a user_id the user_id in this case is the id of the person who submitted the rating. I am having it assigned through the build command. I believe my process is correct here. The Goal The goal is to have each user have a feedback table that has many ratings from other users. So if someone goes to the feedback page, they will see all the ratings given and by who. Is there a better way to approach this? How do you create a model of feedback with the same id as the user being created right when a new user is created. The idea is that when a user is created a feedback is created associated with that user so people can then go to http://localhost:3000/users/1/feedback/ and submit new ratings. I'm trying to bypass having a user rate another user with just a ratings model because I'm not sure how to do it.

    Read the article

  • How do you draw a line from one corner of the stage to the other?

    - by George Edison
    I am completely perplexed. I asked this question and it (any mentioned solution) doesn't seem to be working at all. All I want is to draw a line from one corner to the other. Here again is the link to the SWF file I have (it's embedded in an HTML document): test.html Here is the source: package { import flash.display.Sprite; import flash.events.Event; public class Main extends Sprite { public function Main():void { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); // entry point graphics.clear(); graphics.lineStyle(10, 0x000000); graphics.moveTo(0, 0); graphics.lineTo(stage.stageWidth, stage.stageHeight); } } } It just doesn't work! The line goes from somewhere offscreen to about the middle of the stage. What on earth am I doing wrong?

    Read the article

  • Set focus on a component with Apache Wicket?

    - by vagabond
    How do you set focus on a component with Apache Wicket? Searching leads to very little information, mostly on setting the default field. I do not want to set a default field, rather I am looking to set focus when, for example, a specific radio button is selected.

    Read the article

  • UILabel applying CGAffineTransformMakeRotation causing mysterious crash

    - by quantumpotato
    In -(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil parentController:(GameViewController *)myGameController{ Have a series of transforming labels like so: deg90 = 1.570796326794897; //....transforms background.center = CGPointMake(160,230); background.transform = CGAffineTransformMakeRotation(deg90); BetLabel.text = @"test"; BetLabel.transform = CGAffineTransformMakeRotation(deg90); That last line is crashing me with: 2010-04-13 21:04:47.858 Game[1204:207] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[NSCFArray objectAtIndex:]: index (1) beyond bounds (1)' 2010-04-13 21:04:47.893 Game[1204:207] Stack: ( 864992541, 859229716, (lots of numbers) But if I comment it out, I get the text changing fine. Uh oh, just did a test.. turns out the other transforms were on UIImageViews. Apparently rotating a label in this xib is causing the crash. But in another file the transforms are working fine: newprofileentry.transform = CGAffineTransformMakeRotation(1.570796326794897); playerb0.transform = CGAffineTransformMakeRotation(1.570796326794897); playerb1.transform = CGAffineTransformMakeRotation(1.570796326794897); Tried substituting deg90 with the full float value, still the same crash. Tried cleaning cache, restarting IB and Xcode, cleaning all targets. Program has been running fine until I just added these labels. Tried deleting the label, readding and reconnecting the Outlet, too. Thanks for reading, hope someone has an idea about this. Cheers!

    Read the article

  • SEO - To Improve Your Online Business

    As we all know, marketing online is one of the best options to grow your business. If you are planning to market online through the search engines, you have to make sure that your website has a good ranking in the search engines. You have to make sure that your website or content contains the relevant keywords, which the visitors type.

    Read the article

  • Another Questionable Article Online…

    - by Jonathan Kehayias
    At the beginning of the month I blogged about my thoughts on the virtualization feedback provided by SSWUG’s newsletter , and Rich responded with some information on how the incorrect information lead him to making incorrect conclusions.  It seems like every couple of weeks an article, tip, newsletter, whatever is posted by or on a major site that has questionable if not outright incorrect material in it.  Last week MSSQLTips posted SQL Server tempdb one or multiple data files in which...(read more)

    Read the article

  • T-SQL Tuesday #005: On Technical Reporting

    - by Adam Machanic
    Reports. They're supposed to look nice. They're supposed to be a method by which people can get vital information into their heads. And that's obvious, right? So obvious that you're undoubtedly getting ready to close this tab and go find something better to do with your life. "Why is Adam wasting my time with this garbage?" Because apparently, it's not obvious. In the world of reporting we have a number of different types of reports: business reports, status reports, analytical reports, dashboards,...(read more)

    Read the article

  • Get CLSID by PIA interface Type

    - by Charles
    How can I get the CLSID for a given interface within a Primary Interop Assembly? Here's what I'm talking about: // The c# compiler does some interesting magic. // The following code ... var app = new Microsoft.Office.Interop.Outlook.Application(); // ... is compiled like so (disassembled with Reflector): var app =((Microsoft.Office.Interop.Outlook.Application) Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("0006F03A-0000-0000-C000-000000000046")))); Microsoft.Office.Interop.Outlook.Application is an interface, and therefore it cannot be instantiated directly. What's interesting here is that c# lets you treat these COM interfaces as if there where classes that you can instantiate with the new keyword. What I want to know is, given the System.Type for a given interface, how can I get the CLSID? Note: I ultimately want to be able to create an instance given the interface's System.Type - I don't really care how. I'm assuming here that the easiest way to do this would be to get CLSID given the Type, just as the c# compiler does.

    Read the article

  • [OpenCV] cvFilter2D works very very slow in Ubuntu 9.10 amd64?

    - by Hong
    Hi, has someone tried the cvFilter2D under 64bit linux? Recently when I was trying to port some code to the amd64 version of Ubuntu 9.10, I just found that the cvFilter2D works really slow. The version is Opencv 2.0. The code is as follows: CvMat *mat_src = cvCreateMat(128, 128, CV_32FC1); CvMat *mat_dest = cvCreateMat(128, 128, CV_32FC1); CvMat* mat_kernel = cvCreateMat( 25, 25, CV_32FC1); // initialization ... cvFilter2D( (CvMat*)mat_src, (CvMat*)mat_dest, (CvMat*)mat_kernel, cvPoint( (25-1)/2, (25-1)/2)); // I needs approximately 100ms to finish that... My CPU is Intel 2.4G However, the Opencv 1.1pre only cost me 3ms for the same code...

    Read the article

  • C# Wrapping an application within another application

    - by Gio Borje
    I want to secure some applications for some people without teaching them how to add an encryption or authentication, so I thought about mocking up a simple application that launches another application if some password or authentication function returns true. How would I wrap the application so that only the launcher would be able to access the file?

    Read the article

  • Ideal Multi-Developer Lamp Stack?

    - by devians
    I would like to build an 'ideal' lamp development stack. Dual Server (Virtualised, ESX) Apache / PHP on one, Databases (MySQL, PgSQL, etc) on the other. User (Developer) Manageable mini environments, or instance. Each developer instance shares the top level config (available modules and default config etc) A developer should have control over their apache and php version for each project. A developer might be able to change minor settings, ie magicquotes on for legacy code. Each project would determine its database provider in its code The idea is that it is one administrate-able server that I can control, and provide globally configured things like APC, Memcached, XDebug etc. Then by moving into subsets for each project, i can allow my users to quickly control their environments for various projects. Essentially I'm proposing the typical system of a developer running their own stack on their own machine, but centralised. In this way I'd hope to avoid problems like Cross OS code problems, database inconsistencies, slightly different installs producing bugs etc. I'm happy to manage this in custom builds from source, but if at all possible it would be great to have a large portion of it managed with some sort of package management. We typically use CentOS, so yum? Has anyone ever built anything like this before? Is there something turnkey that is similar to what I have described? Are there any useful guides I should be reading in order to build something like this?

    Read the article

  • MS-Access to SQL Server 2000 problem with datetime

    - by 0plus1
    I'm trying to transfer some data from Access to SQL Server 2000 (there are no other way to do this sadly), I'm using Access to mssql to do the job. The program fails everytime it finds a datetime in this fashion: 03/07/2009 10.17.00 While it imports date like this: 29/12/2008 I don't understand where this problem come from so I ask you for your help. Thank you very much.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >