Search Results

Search found 14236 results on 570 pages for 'times square'.

Page 90/570 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • Simple wave generator with SDL in c++

    - by Vlad Popescu
    i am having problems understanding how the audio part of the sdl library works now, i know that when you initialize it, you have to specify the frequency and a callback<< function, which i think is then called automatically at the given frequency. can anyone who worked with the sdl library write a simple example that would use sdl_audio to generate a 440 hz square wave (since it is the simplest waveform) at a sampling frequency of 44000 hz? thanks in advance

    Read the article

  • drawing circle without floating point calculation

    - by zaharpopov
    This is common interview question (according to some interview sites) but I can find no normal answers in Internet - some are wrong and some point to complex theory I expect not looked for in interview (like Bressenham algorithm). The question is simple: The circle equation is: x^2 + y^2 = R^2. Given R, draw 0,0-centered circle as best as possible without using any floating point (no trigo, square roots, and so on, only integers)

    Read the article

  • size of an image

    - by Mike
    From times to times I have to know the width and height of images. I am using the following code: UIImage *imageU = [UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"myImage.png"]]; CGFloat imageW = CGImageGetWidth(imageU.CGImage); CGFloat imageH = CGImageGetHeight(imageU.CGImage); My question is that if it is there any other way to know the width and height of an image, in pixels, without having to load the image on a variable, that's probably consuming memory. Can the dimensions be read from the file directly without loading the whole image? thanks.

    Read the article

  • Print styles: How to ensure image doesn't span a page break

    - by notJim
    This is a problem I've had a few times, and I'm not sure how to deal with it. When writing a print stylesheet, is there a way to ensure that an image is always only on a single page. An example of the behavior I'm seeing is below: Page 1 | | | (text text text) | | (text text text) | | ________________ | | | Top of image | | |____________________| ------page break------ ____________________ Page 2 | | Rest of image | | | |________________| | | … | What I'd like Page 1 | | | (text text text) | | (text text text) | | | | | |____________________| ------page break------ ____________________ | ________________ | | | Full image | | | | | | | |________________| | | … | All those times I bitching about floats in LaTeX, and here I am asking for the same functionality... Can this be done? I'm not necessarily concerned about it working in all browsers, since this is often just a one-off document I'm writing to be turned into a PDF.

    Read the article

  • Find top N elements in a Multiset from Google Collections?

    - by dfrankow
    A Google Collections Multiset is a set of elements each of which has a count (i.e. may be present multiple times). I can't tell you how many times I want to do the following Make a histogram (exactly Multiset) Get the top N values from the histogram Examples: top 10 URLs, top 10 tags, ... What is the canonical way to do #2 given a Multiset? Here is a blog post about it, but that code is not quite what I want. First, it returns everything, not just top N. Second, it copies (is it possible to avoid a copy?). Third, I usually want a deterministic sort, i.e. tiebreak if counts are equal.

    Read the article

  • Excel - check if row contains ANY value *more than once*

    - by user2536778
    I am doing data analysis and sometimes I need to check and to make sure each row in excel does not have any repeated value. I hope that there is a formula where each time if there's a repeated value in the same row, the value will be highlighted and it doesn't matter what value it is, as long as it's repeated in the same row. I try to search it everywhere but the closest I can find is below question & answer ( which couldn't apply to me as I need a formula that can highlight any value that's repeated and not only zero): I have rows which contain grades for students (numerical values), where the number 0 means they missed a class. I want the row to be highlighted in one color if they have "0" 3 or 4 times, and in another color if they have "0" 5 times or more. =COUNTIF(1:1,0)=5 Anyone can help me? Thanks in advance!

    Read the article

  • sound loop breaks after some time in background music in iphone app

    - by amy
    I am playing sounds in loop in my app. So it should continue playing through out the app. but sometimes it stops after playing sound for 3/4 times.I don't understand whats happening. I am using audio-toolbox framework for playing sound. creating audio queue and then playing sounds in loop. I am also playing sound from ipod library using mediaplayer. Same thing happening with song from ipod. I have set [musicPlayer setRepeatMode: MPMusicRepeatModeOne]; but still it stops after 3/4 times.

    Read the article

  • SQL Time(2) to Array in C#?

    - by Jacob Huggart
    Hello all, I am using ASP MVC and SQL Server and I have a database that is updated intermittently with expected wait times for some event. Also, I am using some ajax and jquery. I need to display the average and maximum wait times. How can I take the entire list of time from the server and get the average time? Also, what would be the best method to simply grab a new time from the server when it is updated without having to pull the whole list again? Thanks!

    Read the article

  • best way to prgram php and mysql query

    - by air
    most of times in our pages we need to print only 1 field value of table in loop. for example <?php for($i=1;$i<=mysql_num_rows($result);$i++) { echo $row['name']; $sql1="select industry from table_industry where profid='".$row['prof']."'"; $result1=mysql_query($sql1); $row1=mysql_fetch_array($result1); echo $row1['industry']; ?> } ?> above is one PHP code just for example where we think that $row['prof'] carry value of profession ID and we print profession of each person. for example we have 5000+ record in table and above loop will execute for 5000+ times what will be the best way to print value of industry field from table table_industry Same code which i write above ? any other php code suggestion for faster execution and less use of resources? Thanks

    Read the article

  • rotate image with php - any degree

    - by Luis
    How to rotate an image with PHP, any degree, without having the filled space? For instance, if I rotate an image 10 degrees, the image rotates fine but the container around (square) gets filled with black. Is it possible to get rid of this, when for example merging 2 images?

    Read the article

  • use proxy from a list

    - by user1505181
    I am trying to write a program which neeeds to use a proxy 3 times then move onto the next proxy in a list and so on. the user will enter their proxy list into a list/textfile and the program will use the first in the list and then carry on through the list until it gets to the end. How do i get the proxy details from the list and use them using httpwebrequest? i have no problem using a proxy if i set it within the code but dont know how to get it to work through the list basically it is like this: user enters a list of proxies into a text file program uses first proxy in list 3 times then moves onto next. this repeats until finished.

    Read the article

  • NetNamedPipe: varying response time when communication is idling

    - by Sven Künzler
    I have two WCF apps communicating one-way over named pipes. All is nice, except for one thing: Normally, the request/response cycle takes zero (marginal) time. However, if there was a time span of, say, half a minute without any communication, the request/response increases up to ~300-500ms. I looked around the net and I got the idea of using a heart beat/ping mechanism to keep the communication channel busy. Using trial and error I found that when doing a request each 10 seconds, the response times stay low. Starting at around 15s intervals, the "hiccup" response times begin to appear. Now I'm wondering where this phenomenon is originating from. I tried setting alle conceivable timeouts on both sides to 1 minute, but that did not help. Can anybody explain what's going on there?

    Read the article

  • run a function when a user clicks on any list element

    - by sova
    This is probably a very common question, but I was unable to find an answer myself; All my list elements call the function setQuery like this onClick="admin_stats.setQuery(this);" rather than [hardcode] add this to every list element, is there a way to simply have it run when a list element is clicked? I'm not very familiar with jQuery Live or binding/unbinding, but I think they would play a role here? Before I reinvent a rather square-looking wheel I thought I might ask =)

    Read the article

  • How do I force jquery to center an element when it snaps to another container using the draggable method?

    - by David
    Here's my script. I want some square-shaped draggable objects (in this case just td boxes with numbers in them) to be able to snap to some empty table cells and snap to the center of those cells (empty td boxes), not the top or bottom of those cells, which is what is seems to do by default. <script type="text/javascript"> $(document).ready(function () { $(".inputs div").draggable( { snap: ".spaces" } ); }); </script>

    Read the article

  • How do I make my custom Swing component visible?

    - by Alex
    I have no idea why it won't show. First I create an instance of the component and then add it to a certain element in a two-dimensional JPanel array. Then I loop through that array and add each JPanel to another JPanel container which is to hold all the JPanels. I then add that final container to my JFrame window and set visibility to true, it should be visible? public class View extends JFrame { Board gameBoard; JFrame gameWindow = new JFrame("Chess"); JPanel gamePanel = new JPanel(); JPanel[][] squarePanel = new JPanel[8][8]; JMenuBar gameMenu = new JMenuBar(); JButton restartGame = new JButton("Restart"); JButton pauseGame = new JButton("Pause"); JButton log = new JButton("Log"); View(Board board){ gameWindow.setDefaultCloseOperation(EXIT_ON_CLOSE); gameWindow.setSize(400, 420); gameWindow.getContentPane().add(gamePanel, BorderLayout.CENTER); gameWindow.getContentPane().add(gameMenu, BorderLayout.NORTH); gameMenu.add(restartGame); gameMenu.add(pauseGame); gameMenu.add(log); gameBoard = board; drawBoard(gameBoard); gameWindow.setResizable(false); gameWindow.setVisible(true); } public void drawBoard(Board board){ for(int row = 0; row < 8; row++){ for(int col = 0; col < 8; col++){ Box box = new Box(board.getSquare(col, row).getColour(), col, row); squarePanel[col][row] = new JPanel(); squarePanel[col][row].add(box); } } for(JPanel[] col : squarePanel){ for(JPanel square : col){ gamePanel.add(square); } } } } @SuppressWarnings("serial") class Box extends JComponent{ Color boxColour; int col, row; public Box(Color boxColour, int col, int row){ this.boxColour = boxColour; this.col = col; this.row = row; repaint(); } protected void paintComponent(Graphics drawBox){ drawBox.setColor(boxColour); drawBox.drawRect(50*col, 50*row, 50, 50); drawBox.fillRect(50*col, 50*row, 50, 50); } } A final question as well. Notice how each Box component has a position, what happens to the position when I add the component to a JPanel and add the JPanel to my JFrame? Does it still have the same position in relation to the other Box components?

    Read the article

  • How to determine item at a index in pattern

    - by el.gringogrande
    I have the following elements in a list/array a1,a2,a3 and these elements are used to build another list in a predictable pattern example a1,a1,a2,a2,a3,a3,a1,a1,a2,a2,a3,a3... The pattern may change but I will always know how many times each element repeats and all elements repeats the same number of times. And the elements always show up in the same order. so another pattern might be a1,a1,a1,a2,a2,a2,a3,a3,a3,a1,a1,a1,a2,a2,a2,a3,a3,a3... or a1,a2,a3,a1,a2,a3 it will never be a2,a2,a1,a1,a3,a3... or a1,a2,a3,a2,a3,a1 etc How I determine what element is at any index in the list?

    Read the article

  • CVS in cmd/gui works only the third time I run a command.

    - by Somebody still uses you MS-DOS
    I'm using CVS in the command line. I'm in my repository folder. When I call a CVS command, I get... cvs [log aborted]: unrecognized auth response from localhost: -f [pserver aborted]: /opt/cvs/XXXXXX: no such repository ...2 times. The third time I run the command, it works with no problems. I tried to use a GUI client (CrossVC) and the same problem occurs. I tried inside gVim and Vim using VCSCommand and I'm having the same issues as well. I've tested with different times between each command, but I still have the same problems. I'm using a CVS configuration with stunnel. Why am I having problem with this setup? Why every time just the third time that I try to run the command that actually works?

    Read the article

  • Does any Version Control System like SVN, Git, or Mercurial let you "keep latest version" but not th

    - by Jian Lin
    In our project files, if there are binary files, such as .doc, .xls, .jpg, and we choose to not keep their past revisions (just keeping a latest version is ok), is there a way to tell SVN, Git, or Mercurial or some other tool to skip the revisions for these files or for a particular folder? Say, there is a 4MB .doc file that I need to check in hundred of times, but I don't really care so much about its past versions. So if the system keeps 100 revisions of it, that's already 400MB... checking in 300 times means 1.2GB for 1 file and that's not good. Only the latest version is good so that everybody can sync to it.

    Read the article

  • Diamonds Are Forever. Services Are Not.

    - by rayman
    Hi, ive read this article by Mark Murphy, while i was looking for a solution to my case. I have a Listener in my system, which suppose to get a UDP trigger times to times from an outside server, ive done this listener as a service. how could i prevent it being shut off by the user? (SDK 1.5), i`am working for a company which create cell phones, and we spread the device with this Listener. as soon as the listener goes off our systems will be terminated any idea for this scenario? *i`am already aware to the face, that the system could also take it off, but this case will be easier to handle and avoid. thanks, ray.

    Read the article

  • How to use LINQ to SQL to create ranked search results?

    - by quakkels
    I am looking for a way to use l2s to return ranked result based on keywords. I would like to take a keyword and be able to search the table for that keyword using .contains(). The trick that I haven't been able to figure out is how to get a count of how many times that keyqord appears, and then .OrderByDescending() based on that count. So if i had some thing like: string keyword = "SomeKeyword"; IQueryable<Article> searchResults = from a in GenesisRepository.Article where a.Body.Contains(keyword) select a; What is the best way to order searchResults based on the number of times keyword appears in a.Body? Thanks for any help.

    Read the article

  • HttpHandler with Flash file upload question

    - by Projapati
    I have a flash file uploader that allows uploading multiple files in one shot. Now on one click how many times will the hanlder is supposed to be called? I am seeing that the ProcessRequest() of the HttpHandler is getting called for each of the files I upload. If I upload 5 files, then the Process request gets called 5 times. This seems odd. I would expect the handler to be called just once where I will loop the Can anyone confirm this behavior or I am missing something?

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >