Search Results

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

Page 85/570 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • DOS Batch script loop

    - by Tom J Nowell
    I need to execute a command 100-200 times, so far my research indicates that I would either have to copy paste 100 copies of this command, OR use a FOR loop, but the for loop expects a list of items, hence I would need 200 files to operate on, or a list of 200 items, hence defeating the point. I would really not have to write a C program and go through the length of documenting why I had to write another program to execute my program for test purposes. Modification of my program itself is also no an option. So, given a command how would I execute it times via a DOS batch script?

    Read the article

  • merge sort recursion tree height

    - by Tony
    Hello! I am learning about recursion tree's and trying to figure out how the height of the tree is log b of n where n = 2 and one has 10 elements as input size. I am working with Merge sort. The number of times the split is done is the height of the tree as far as I understood, and the number of levels in the tree is height + 1. But if you take (for merge sort) log2 of 10 you get 1, where if you draw the tree you get at least 2 times that the recursion occurs. Where have I gone wrong? (I hope I am making sense here) NOTE: I am doing a self study, this is not homework!

    Read the article

  • silverlight 3 listbox item highlight versus selected.

    - by cody
    I have a listbox and am attempting to select and item in code. Sometime one item is highlighted, that is it is background is colored blue, but a different item has a square blue box around the it (no highlighting just an hollow outline of a box). Am I correct in saying one is "highlighted" and one is "selected" and do I have them correctly identified? Should this be happening... that is these 2 things being out of sync? Thanks Cody

    Read the article

  • Threading in C#

    - by Lalit Dhake
    Hi, I have console application. In that i have some process that fetch the data from database through different layers ( business and Data access). and generate outputs. This process will execute many times say 10 times. Ok? I want to run simultaneously this process. not one will start, it will finish and then second will start. I want after starting 1'st process, just 2'nd , 3rd....10'th must be start. Means it should be multithreading. how can i achieve this ? is that will give me error while connection with data base open and close ?

    Read the article

  • Simple cropping with Paperclip

    - by collimarco
    I would like to crop images on upload using Paperclip to get square thumbs from the center of the original picture. I find out a method in documentation that seems to do exactly what I want: transformation_to(dst, crop = false) The problem is that I can't figure out where to use this method. It would be great to simply pass something as a parameter here: has_attached_file :picture, :styles = { :medium = "600x600", :thumb = "something here" }

    Read the article

  • creating executable jar file for my java application

    - by Manu
    public class createExcel { public void write() throws IOException, WriteException { WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook1 =Workbook.createWorkbook(new File(file), wbSettings); workbook1.createSheet("Niru ", 0); WritableSheet excelSheet = workbook1.getSheet(0); createLabel(excelSheet); createContent(excelSheet,list); workbook1.write(); workbook1.close(); } public void createLabel(WritableSheet sheet)throws WriteException { WritableFont times10pt = new WritableFont(WritableFont.createFont("D:\font\trebuct"),8); // Define the cell format times = new WritableCellFormat(times10pt); // Lets automatically wrap the cells times.setWrap(false); WritableFont times10ptBoldUnderline = new WritableFont( WritableFont.createFont("D:\font\trebuct"), 9, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE); timesBoldUnderline = new WritableCellFormat(times10ptBoldUnderline); sheet.setColumnView(0,15); sheet.setColumnView(1,13); // Write a few headers addCaption(sheet, 0, 0, "Business Date"); addCaption(sheet, 1, 0, "Dealer ID"); } private void createContent(WritableSheet sheet, ArrayList list) throws WriteException,RowsExceededException { // Write a few number for (int i = 1; i < 11; i++) { for(int j=0;j<11;j++){ // First column addNumber(sheet, i, j,1); // Second column addNumber(sheet, 1, i, i * i); } } } private void addCaption(WritableSheet sheet, int column, int row, String s) throws RowsExceededException, WriteException { Label label; label = new Label(column, row, s, timesBoldUnderline); sheet.addCell(label); } private void addNumber(WritableSheet sheet, int row,int column, Integer integer) throws WriteException, RowsExceededException { Number number; number = new Number(column,row, integer, times); sheet.addCell(number); } public static void main(String[] args) { JButton myButton0 = new JButton("Advice_Report"); JButton myButton1 = new JButton("Position_Report"); JPanel bottomPanel = new JPanel(); bottomPanel.add(myButton0); bottomPanel.add(myButton1); myButton0.addActionListener(this); myButton1.addActionListener(this); createExcel obj=new createExcel(); obj.setOutputFile("c;\\temp\\swings\\jack.xls"); try{ obj.write(); }catch(Exception e){} } and so on. it working fine. i have jxl.jar and ojdbc14.jar files(need this jar file for Excelsheet creation and DB connection )and createExcel.class(.class file) file. how to make this code as executable jar file.

    Read the article

  • How to write the content of a dictionary to a text file?

    - by codemonkie
    I have a dictionary object of type Dictionary and trying to use StreamWriter to output the entire content to a text file but failed to find the correct method from the Dictionary class. using (StreamWriter sw = new StreamWriter("myfile.txt")) { sw.WriteLine(dictionary.First()); } I can only retrieve the first element and it is bounded by a square bracket plus a comma separator in between as well: [Peter, Admin] and would be nice to have [Peter Admin] (without the comma)

    Read the article

  • Django/Python best practice template_dict

    - by fredrik
    Hi, After just been coding for about 6-9 months. I probably changed my coding style a number of times after reading some code or read best practices. But one thing I haven't yet come a cross is a good why to populate the template_dict. As of now I pass the template_dict across a number of methods (that changes/modifies it) and returns is. The result is that every methods takes template_dict as first argument and the returns it and this in my eyes doesn't seems to be the best solution. An idea is to have a method that handles all the changes. But I'm curios if there's a best practice for this? Or is it "do what you feel like"-type of thing? The 2 things I think is pretty ugly is to send as an argument and return it in all methods. And the just the var name is written xxx number of times in the code :) ..fredrik

    Read the article

  • Probability distribution for sms answer delays

    - by Thomas Ahle
    I'm writing an app using sms as communication. I have chosen to subscribe to an sms-gateway, which provides me with an API for doing so. The API has functions for sending as well as pulling new messages. It does however not have any kind of push functionality. In order to do my queries most efficient, I'm seeking data on how long time people wait before they answer a text message - as a probability function. Extra info: The application is interactive (as can be), so I suppose the times will be pretty similar to real life human-human communication. I don't believe differences in personal style will play a big impact on the right times and frequencies to query, so average data should be fine.

    Read the article

  • How can I set size of a button?

    - by Roman
    I put my buttons in a JPane with GridLayout. Then I put JPanel into another JPanel with BoxLayout.Y_AXIS. I want buttons in the GridLayout to be square. I use tmp.setSize(30,30) and it does not work. I also try to use new GridLayout(X, Y, 4, 4) but I cannot figure out what X and Y are. So, what is the correct way to do this stuff?

    Read the article

  • .Net Process keep command window open

    - by msarchet
    right now I am working on a tool that does a lot of work via the Process object through the command line. So there are times when I want the command window to not show up and times when I want it to stay open so that the user can see what happened, possibly respond with the appropriate input. Dim pro As New Process pro.StartInfo.WorkingDirectory = path pro.StartInfo.Arguments = command pro.StartInfo.FileName = "hg" pro.StartInfo.RedirectStandardOutput = True If command.Contains("-q") Then pro.StartInfo.UseShellExecute = False pro.StartInfo.CreateNoWindow = True pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden End If pro.Start() pro.WaitForExit() Return pro.StandardOutput.ReadToEnd The flag that I am checking in the command is for a -q if it doesn't contain this I would like to show the command prompt to the user and wait for them to close it. Is this possible and if so what am I missing?

    Read the article

  • Go Channels in Ruby

    - by Julius Eckert
    In the Go programming language, you can send Messages around using a construct called "Channels". http://golang.org/doc/effective_go.html#channels I would love to use something like that in Ruby, especially for IPC. Pseudocode of what I want: channel = Channel.new fork do 3.times{ channel.send("foo ") } exit! end Thread.new do 3.times{ channel.send("bar ") } end loop do print channel.recv end # ~> bar foo foo bar bar foo Is there any construct, library or equivalent for Ruby which works like that ? If not: What is the best way to build such an abstraction?

    Read the article

  • Is there a way to tell JVM to optimize my code before processing?

    - by Rogach
    I have a method, which takes much time to execute first time. But after several invocations, it takes about 30 times less time. So, to make my application respond to user interaction faster, I "warm-up" this method (5 times) with some sample data on initialization of application. But this increases app start-up time. I read, that JVM's can optimize and compile my java code to native, thus speeding things up. I wanted to know - maybe there is some way to explicitly tell JVM that I want this method to be compiled on startup of application?

    Read the article

  • Why doesn't Maven's mvn clean ever work the first time?

    - by hoffmandirt
    Nine times out of ten when I run mvn clean on my projects I experience a build error. I have to execute mvn clean multiple times until the build error goes away. Does anyone else experience this? Is there any way to fix this within Maven? If not, how do you get around it? I wrote a bat file that deletes the target folders and that works well, but it's not practical when you are working on multiple projects. I am using Maven 2.2.1. [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to delete directory: C:\Documents and Settings\user\My Documents\software-developm ent\a\b\c\application-domain\target. Reason: Unable to delete directory C:\Documen ts and Settings\user\My Documents\software-development\a\b\c\application-domai n\target\classes\com\a\b [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6 seconds [INFO] Finished at: Fri Oct 23 15:22:48 EDT 2009 [INFO] Final Memory: 11M/254M [INFO] ------------------------------------------------------------------------

    Read the article

  • Reading and parsing email from Gmail using C#, C++ or Python

    - by jpnavarini
    I have to do a Windows application that from times to times access a Gmail account and checks if there is a new email. In case there is, it must read the email body and subject (a simple text email, without images or attachments). Please, do not use paid libs, and in case of any other libs used, give the download path. And I need the email body and subject only. So if the long and complex message that comes from Gmail could be parsed and only two strings containing the subject and the body, it would be perfect. Finally, I only have to get the new messages arrived since the last execution. So the read messages could be marked as "read" and only the new ones (marked as "new") are considered. The code can be written in Python or C++, but I prefer it in C#. Thank you for the help.

    Read the article

  • Java, searching through folders to match a name

    - by Nick
    Hi folks, I using java to search for a file or folder that matches a specific case. For instance i want to search through all the files and folders and iterate through them as many times as necessary untill i find a result. The catch I searching for files and folders through a binary image of a file system. This means i doubt there are any preexisting classes such java.file.* to do it for me. If it helps i can tell you that i can tell the difference between files and folders easily enough. (a folder is flagged as 0x20) The only way i can think of is to do a standard loop and iterated several times but this limits me if a file or folder is several folders deep. All input greatly welcome

    Read the article

  • Creating simple waveforms with CoreAudio

    - by Koning Baard
    I am new to CoreAudio, and I would like to output a simple sine wave and square wave with a given frequency and amplitude through the speakers using CA. I don't want to use sound files as I want to synthesize the sound. What do I need to do this? And can you give me an example or tutorial? Thanks.

    Read the article

  • Is it a good idea to keep all the enums in one place?

    - by kzen
    When I'm building a class library I usually create a file Enums.cs to hold all the enums used in the assembly. Here is an example: namespace MyNamespace { public enum Colors { Red, Green, Blue } public enum Shapes { Circle, Square, Triangle } } This makes all my enums easy to find, well organized and easy to access in code. I'm wondering if there is any reason why this would not be such a good idea?

    Read the article

  • What do I use when a cron job isn't enough? (php)

    - by mike
    I'm trying to figure out the most efficient way to running a pretty hefty PHP task thousands of times a day. It needs to make an IMAP connection to Gmail, loop over the emails, save this info to the database and save images locally. Running this task every so often using a cron isn't that big of a deal, but I need to run it every minute and I know eventually the crons will start running on top of each other and cause memory issues. What is the next step up when you need to efficiently run a task multiple times a minute? I've been reading about beanstalk & pheanstalk and I'm not entirely sure if that will do what I need. Thoughts???

    Read the article

  • NHibernate transaction management in ASP.NET MVC - how should it be done?

    - by adrin
    I am writing a simple ASP.NET MVC using session per request and transaction per request patterns (custom HttpModule). It seems to work properly, but.. the performance is terrible (a simple page loads ~7 seconds). For every http request, graphical resources incuding (all images on the site) a transaction is created and that seems to delay the loading times (without the transactions loading times per one image are ~1-10 ms with transactions they are over 1 second). What is the proper way to manage transactions in ASP.NET MVC + NH stack? When i've put all transactions into my repository methods, for some obscure reasons I got 'implicit transactions' warning in NHProf (the SQL statements were executed outside transaction, even that in code session.Save()/Update()/etc methods were invoked within transaction 'using' scope and before transaction.Commit() call) BTW are implicit transactions really bad?

    Read the article

  • When should you use intermediate variables for expressions?

    - by froadie
    There are times that one writes code such as this: callSomeMethod(someClass.someClassMethod()); And other times when one would write the same code like this: int result = someClass.someClassMethod(); callSomeMethod(result); This is just a basic example to illustrate the point. My question isn't if you should use an intermediate variable or not, as that depends on the code and can sometimes be a good design decision and sometimes a terrible one. The question is - when would you choose one method over the other? What factors would you consider when deciding whether to use an intermediate step? (I'd assume length and understandability of the fully inlined code would have something to do with it...)

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >