Daily Archives

Articles indexed Monday April 26 2010

Page 22/110 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • function which given a point and a value of the area of a square as input parameter returns four squ

    - by osabri
    in this code i don't understand why teacher used sometimes +value, - value; /******************************************/ // function void returnSquares(POINT point, int value) void returnSquares(POINT point, int value) { SQUARE tabSquares[4]; // table of squares that we are creating int i; // getting points of 4 squares // for first square input point is point C tabSquares[0].pointA.dimX = point.dimX - value; tabSquares[0].pointA.dimY = point.dimY + value; tabSquares[0].pointB.dimX = point.dimX; tabSquares[0].pointB.dimY = point.dimY + value; tabSquares[0].pointC.dimX = point.dimX; tabSquares[0].pointC.dimY = point.dimY; tabSquares[0].pointD.dimX = point.dimX - value; tabSquares[0].pointD.dimY = point.dimY; // for 2nd square input point is point D tabSquares[1].pointA.dimX = point.dimX; tabSquares[1].pointA.dimY = point.dimY + value; tabSquares[1].pointB.dimX = point.dimX + value; tabSquares[1].pointB.dimY = point.dimY + value; tabSquares[1].pointC.dimX = point.dimX + value; tabSquares[1].pointC.dimY = point.dimY; tabSquares[1].pointD.dimX = point.dimX; tabSquares[1].pointD.dimY = point.dimY; // for 3rd square input point is point A tabSquares[2].pointA.dimX = point.dimX; tabSquares[2].pointA.dimY = point.dimY; tabSquares[2].pointB.dimX = point.dimX + value; tabSquares[2].pointB.dimY = point.dimY; tabSquares[2].pointC.dimX = point.dimX + value; tabSquares[2].pointC.dimY = point.dimY - value; tabSquares[2].pointD.dimX = point.dimX; tabSquares[2].pointD.dimY = point.dimY - value; // for 4th square input point is point B tabSquares[3].pointA.dimX = point.dimX - value; tabSquares[3].pointA.dimY = point.dimY; tabSquares[3].pointB.dimX = point.dimX; tabSquares[3].pointB.dimY = point.dimY; tabSquares[3].pointC.dimX = point.dimX; tabSquares[3].pointC.dimY = point.dimY - value; tabSquares[3].pointD.dimX = point.dimX - value; tabSquares[3].pointD.dimY = point.dimY - value; for (i=0; i<4; i++) { printf("Square number %d\n",i); // now we print parameters of each point in current Square printf("point A x= %0.2f y= %0.2f\n",tabSquares[i].pointA.dimX,tabSquares[i].pointA.dimY); printf("point B x= %0.2f y= %0.2f\n",tabSquares[i].pointB.dimX,tabSquares[i].pointB.dimY); printf("point C x= %0.2f y= %0.2f\n",tabSquares[i].pointC.dimX,tabSquares[i].pointC.dimY); printf("point D x= %0.2f y= %0.2f\n",tabSquares[i].pointD.dimX,tabSquares[i].pointD.dimY); } }

    Read the article

  • REDUX: How to overcome an incompatibility between the ksh on Linux vs. that installed on AIX/Solaris

    - by Andrew Stein
    I have uncovered another problem in the effort that we are making to port several hundreds of ksh scripts from AIX, Solaris and HPUX to Linux. See here for the previous problem. This code: #!/bin/ksh if [ -a k* ]; then echo "Oh yeah!" else echo "No way!" fi exit 0 (when run in a directory with several files whose name starts with k) produces "Oh yeah!" when called with the AT&T ksh variants (ksh88 and ksh93). On the other hand it produces and error message followed by "No way!" on the other ksh variants (pdksh, MKS ksh and bash). Again, my question are: Is there an environment variable that will cause pdksh to behave like ksh93? Failing that: Is there an option on pdksh to get the required behavior?

    Read the article

  • How can I generate a random human-readable colour from a seed? C#

    - by SLC
    Got a logfile, and it has all kinds of text in it. Currently it is just displayed as one colour, and each entry says something like: Log from section 1: Some text here Log from section 125: Some text here Log from section 17: Some text here Log from section 1: Some text here Log from section 125: Some text here Log from section 1: Some text here Log from section 17: Some text here Now the logfile is displayed in real time, and it would be nice to make the rows with the same section number the same colour. However there could be potentially quite a large range of numbers. What I want to do is create a method that will take a number, and randomly generate a unique colour. The colour must be readable against a black background though, so #000000 is no good, nor is #101010 or anything too dark to read. Ideally two similar numbers will not produce the same colour because in the above examples, the numbers 1 and 17 might be too similar, and some numbers might be in the 10,000 range. Any ideas on this?

    Read the article

  • Any wrapping viewgroup?

    - by user325737
    I am looking for Wrappable ViewGroup just like what TextView do. I need this for layout. This should be something like LinearLayout but wrappable to multiple lines. Or do I need something custom?

    Read the article

  • When iPhone Application Change Reflects

    - by Nirmal
    Hello... Fortunately our first application is in App Store now.. And in my itunesconnect account some of the fields are editable like screenshots, support url etc.. So, my question is if I update some of my screenshots or if I update the support url field when it will be reflects to itunes ? Or it will directly reflects once I update my current application ? Thanks in advance...

    Read the article

  • Image_tag .blank? - paperclip - Ruby on rails

    - by bgadoci
    I have just installed paperclip into my ruby on rails blog application. Everything is working great...too great. I am trying to figure out how to tell paperclip not to output anything if there is no record in the table so that I don't have broken image links everywhere. How, and where, do I do this? Here is my code: class Post < ActiveRecord::Base has_attached_file :photo, :styles => { :small => "150x150"} validates_presence_of :body, :title has_many :comments, :dependent => :destroy has_many :tags, :dependent => :destroy has_many :ugtags, :dependent => :destroy has_many :votes, :dependent => :destroy belongs_to :user after_create :self_vote def self_vote # I am assuming you have a user_id field in `posts` and `votes` table. self.votes.create(:user => self.user) end cattr_reader :per_page @@per_page = 10 end View <% div_for post do %> <div id="post-wrapper"> <div id="post-photo"> <%= image_tag post.photo.url(:small) %> </div> <h2><%= link_to_unless_current h(post.title), post %></h2> <div class="light-color"> <i>Posted <%= time_ago_in_words(post.created_at) %></i> ago </div> <%= simple_format truncate(post.body, :length => 600) %> <div id="post-options"> <%= link_to "Read More >>", post %> | <%= link_to "Comments (#{post.comments.count})", post %> | <%= link_to "Strings (#{post.tags.count})", post %> | <%= link_to "Contributions (#{post.ugtags.count})", post %> | <%= link_to "Likes (#{post.votes.count})", post %> </div> </div> <% end %>

    Read the article

  • Floating a UILabel above OpenFlow

    - by Edward
    How do you get a UILabel to float above Alex Fajkowski's implementation of CoverFlow called OpenFlow? Ok I've figured it out. I just had to use bringSubviewToFront with the UILabel. Thanks to everybody who answered.

    Read the article

  • How to install and Configure SharePoint Server 2010 RTM

    This article describes step by step detail of how to install and configure SharePoint Server 2010 RTM...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Windows Software RAID 5 Drive Failure Notification

    - by Wayne Hartman
    I plan on creating a Windows software RAID 5 array but need to know when a drive goes bum. I don't plan on wanting to check the server every so often, so how can I have an email sent when a drive goes kapüt or otherwise has problems? Keying off the event log would be OK, but how does one set up notifications on it when the exact event ID(s) may not be known?

    Read the article

  • What language/compiler for native running of application in any windows(XP/Vista/7) platform?

    - by Xinxua
    Hi, I want to develop an application that runs on any windows platform (XP, Vista, 7) but does not require a dependency like .NET Framework or JVM. I have given the other requirements below: Runs in any windows platform Must have GUI libraries to create windows/primitive controls I also want the output file size of the application to be minimal (So cannot include .net frameword etc in the exe file) Any suggestions for this requirement?

    Read the article

  • Organizing multiple embed codes with jQuery

    - by Nimbuz
    I have several embed codes on my website, for example: Embed Code #1: <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/f8Lp2ssd5A9ErAc&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/f8Lp2A9ErAc&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object> Embed Code #2: <script type="text/javascript"> _qoptions={ qacct:"p-3asdb5E0g6" }; </script> <script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script> <noscript> <a href="http://www.quantcast.com/p-3asdb5E0g6" target="_blank"><img src="http://pixel.quantserve.com/pixel/p-3asdb5E0g6.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></a> </noscript> and so on.. How do organize them and separate them into an external single js file to keep the markup clean? Thanks for your help!

    Read the article

  • When iPhone Application Submitted Information Changes Reflects

    - by Nirmal
    Hello... Fortunately our first application is in App Store now.. And in my itunesconnect account some of the fields are editable like screenshots, support url etc.. So, my question is if I update some of my screenshots or if I update the support url field when it will be reflects to itunes ? Or it will directly reflects once I update my current application ? Thanks in advance...

    Read the article

  • Dangling pointer

    - by viswanathan
    How can the below code result in a dangling pointer. { char *cPointer = malloc ( some constant number ); /* some code */ free ( cPointer ); cPointer = NULL; /* some code */ }

    Read the article

  • Selenium fails to find component after dom update (reRender)

    - by Bozho
    I'm testing a richfaces application with selenium. It works fine, unless I use reRender. (for those unfamiliar with richfaces - whenever an ajax request finished, parts of the DOM are updated/chagned/removed). So, after a reRender selenium (the IDE at least) fails to locate the elements which were within the reRendered area. Both FireBug and WebDeveloper locate the elements, and on "view source" the elements are there. So, is there a way to tell selenium to update its DOM "knowledge" with the latest changes? Firefox 3.5.6, latest version of Selenium IDE.

    Read the article

  • How do I prevent race condition WITHOUT using locks in C++?

    - by Hristo
    How do I prevent a race condition WITHOUT locking or using mutexes/semaphors in C++? I'm dealing with a nested for loop in which I will be setting a value in an array: for (int i = 0; i < m; ++i) for (int j = 0; j < n; ++j) for (int k = 0; k < o; ++k) array[k] += foo(...); More or less, I want to deal with this so that I can ensure different threads running at the same time don't write to array[k] at the same time. Any suggestions on how to approach this? Edit: I am running on a Linux machine and I also have to use the Intel compiler. I will be using "icc" instead of "gcc" to compile the code.

    Read the article

  • Problem with send email through joomla setup

    - by hemant
    Hi all, I have created a script in php for sending the email with attachment and i want to know if i ahve chnge some setting in joomla so that this works. Currently i am getting error as "Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in C:\xampp\htdocs\Joomla\Emailattachment.php on line 56 mail send ... ERROR! " Regards, Hemant

    Read the article

  • How to maintain base files for development environment central while allowing people to change their

    - by Ittai
    Hi, what I'd like to do is have files in a central location so that when I add people to my development team they can see the base version of these files but meanwhile have the ability for the rest of the team to work with their own local version. I know I can just put the files in source-control (we use Tortoiese-SVN) and have my team change the local versions but I'd rather not as the exclamation mark signaling the file has been changed and needs to be committed, quite frankly, irritates me greatly. I'll give two examples of what I mean: We use quite a few build.xml files which relate to a single properties files which contains many definitions. Some of them can be different between team-members (mainly temporary working directories) and I'd like a new team-member to have the ability to get the properties file with the base config but change it if they wish. Have the eclipse settings file in the SVN so that when a new team-member joins they can just retrieve the files from the server and have a base system running. If they wish they will be able to change some of these settings. Thanks, Ittai

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >