Search Results

Search found 2767 results on 111 pages for 'alex king'.

Page 92/111 | < Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >

  • How to exit a process run with C++ if it takes more than 5 seconds?

    - by Alex
    I'm implementing a checking system in C++. It runs executables with different tests. If the solution is not correct, it can take forever for it to finish with certain hard tests. That's why I want to limit the execution time to 5 seconds. I'm using system() function to run executables: system("./solution"); .NET has a great WaitForExit() method, what about native C++?. I'm also using Qt, so Qt-based solutions are welcome. So is there a way to limit external process' execution time to 5 seconds? Thanks

    Read the article

  • how to get the PageFormat from a Java.awt.print.PrinterJob

    - by Alex
    Hi, I'm trying to use the PageFormat information to modify my javax.swing based printout prior to printing it. I am stumped as to how I can get the PageFormat from the PrintJob (which is obtained using getPrinterJob() and printDialog()). I know there is the getPageFormat method, but I can't figure out how to get the PrintRequestAttributeSet (which is not the printJob.getPrintService().getPrintAttributes()). Honestly, all I really want to know is the width and height of the page. Any ideas on how I can do that? Thanks.

    Read the article

  • iDevice for Dummies: Can a device be assigned multiple provisions (Personal/Enterprise)?

    - by Alex
    Hi guys, Is it possible to assign multiple provisions to an iDevice? To be honest, I'm not sure if I'm using the correct terminology, but basically, I'm developing an iPad app for a company and I've only been testing it in the simulator because I don't have a registration to the developer program and they haven't setup their enterprise registration yet either. And I'm sure you all know how limited the simulator is... I don't really care about the $99 it costs to join, but what I'm worried about is having my iDevices locked permanently to my personal registration and unable to switch back and forth to the enterprise registration. I'd appreciate it if someone can explain to me how the registrations work. And keep in mind, I'm a dummy. :) Thanks in advance!

    Read the article

  • Formatting currency within a specific precision range

    - by Alex Prose
    I am trying to format currency that will always contain 2 decimal digits, but if there are extra digits of accuracy to display up to five. As an example: for value = 5.0 display: $5.00 for value = 5.023 display: $5.023 for value = 5.333333333333333 display: $5.33333 I have been playing with the .ToString() formatting, but I can't seem to find the right match of options. Clarification: I want to show from 2-5 decimals, truncating zeros after the second digit. for value = 5.000000000000000 display: $5.00 for value = 5.333333333333333 display: $5.33333

    Read the article

  • How would I best make this SEO_able?

    - by alex
    I have a search engine that searches albums. For each music album, I have a page. So, the work flow goes like this: People search for music titles The search engine displays a list of albums. People click on an album to go to a details page. I want google to index my front page and the details page. I want the details page to be highly ranked. How can I build a sitemap for this? By the way, I have about 5 million albums (but I want the top 1000 ones to be highly ranked on google)

    Read the article

  • TableView Background image going over cell textLabel

    - by Alex Trott
    Currently my tableview looks like this: as you can see, cell.textLabel and cell.detailTextLable both load this background, and i can't work out how to get them to stop loading the background, and for it only to be the backing on the cell. Here's my current code to change the cell: - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { [cell setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"tableCell.png"]]]; } How can i get round this problem? Thanks in advance.

    Read the article

  • How do I put these: @{$subset}, [@ext_subset], [$last_item] in PHP?

    - by Alex
    I'm having trouble translating a subroutine from Perl to PHP (I'm new to Perl). The entire subroutine is as follows: sub find_all_subsets { if (1 == scalar (@_)) {return [@_]} else { my @all_subsets = () ; my $last_item = pop (@_) ; my @first_subsets = find_all_subsets (@_) ; foreach my $subset (@first_subsets) { push (@all_subsets, $subset) ; my @ext_subset = @{$subset} ; push (@ext_subset, $last_item) ; push (@all_subsets, [@ext_subset]) ; } push (@all_subsets, [$last_item]) ; return (@all_subsets) ; } } My problem is that I really don't quite understand the Perl syntax, so I'm having trouble writing these @{$subset}, [@ext_subset] and [$last_item] in PHP. Thanks and sorry if the question is stupid.

    Read the article

  • Empty files generated from running `mysqldump` using PHP

    - by alex
    I keep getting empty files generated from running $command = 'mysqldump --opt -h localhost -u username -p \'password\' dbname > \'backup 2009-04-15 09-57-13.sql\''; command($command); Anyone know what might be causing this? My password has strange characters in it, but works fine with connecting to the db. I've ran exec($command, $return) and outputted the $return array and it is finding the command. I've also ran it with mysqldump > file.sql and the file contains Usage: mysqldump [OPTIONS] database [tables] OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] OR mysqldump [OPTIONS] --all-databases [OPTIONS] For more options, use mysqldump --help So it would seem like the command is working.

    Read the article

  • compare date split across colums

    - by alex-tech
    Greetings. I am querying tables from Microsoft SQL 2008 which have date split across 3 columns: day, month and year. Unfortunately, I do not have control over this because data is coming in to the database daily from a 3rd party source in that format. I need to add between to a where clause so user can pull records within a range. Would be easy enough if date was in a single column but finding it nearly impossible when its split across three columns. To display the date, I am doing a CAST( CAST(year as varchar(4)) + '-' + CAST(month as varchar(2)) + '-' + CAST(day as varchar(2)) as date) AS "date"` in a select. I tried to put it as a parameter for datediff function or just the regular between but get no results. Thanks for any help.

    Read the article

  • In a Windows forms application, how can I use a listbox in a DataGridView coloumn instead of a combo

    - by Alex
    I'm working on a windows forms application that uses a DataGridView. Some of the cells contain a DataGridViewComboBox. In some cases, I have several values to display in the combobox. For that scenario, it would be better to use a ListBox instead of a ComboBox. Is it possible to use a multi-column listbox within a DataGridView instead of a ComboBox? If so, can you point me in the right direction? Thanks much. Al D.

    Read the article

  • Why is this span above the text? I want it beside the text.

    - by alex
    <td valign="center" colspan="2"> <a href="" class="table_desc" > <span class="desc_info_butt"></span> </a> text here </td> .desc_info_butt{ background:url(Description_Button.png) top left no-repeat; height:16px; width:16px; display:block; } For some reason, the image and text appear on two different lines!~

    Read the article

  • Retrieving an element by array index in jQuery vs the each() function.

    - by Alex Ciminian
    I was writing a "pluginable" function when I noticed the following behavior (tested in FF 3.5.9 with Firebug 1.5.3). $.fn.computerMove = function () { var board = $(this); var emptySquares = board.find('div.clickable'); var randPosition = Math.floor(Math.random() * emptySquares.length); emptySquares.each(function (index) { if (index === randPosition) { // logs a jQuery object console.log($(this)); } }); target = emptySquares[randPosition]; // logs a non-jQuery object console.log(target); // throws error: attr() not a function for target board.placeMark({'position' : target.attr('id')}); } I noticed the problem when the script threw an error at target.attr('id') (attr not a function). When I checked the log, I noticed that the output (in Firebug) for target was: <div style="width: 97px; height: 97px;" class="square clickable" id="8"></div> If I output $(target), or $(this) from the each() function, I get a nice jQuery object: [ div#8.square ] Now here comes my question: why does this happen, considering that find() seems to return an array of jQuery objects? Why do I have to do $() to target all over again? [div#0.square, div#1.square, div#2.square, div#3.square, div#4.square, div#5.square, div#6.square, div#7.square, div#8.square] Just a curiosity :).

    Read the article

  • Text box input target iframe

    - by alex
    I'm an html noob and I just wanted to know if it's possible to make a text box in which you could type a website and when you click submit it will load the website in the iframe of your choice.

    Read the article

  • Be notified of method calls in .NET

    - by Alex
    Basically, what I want to do is to be notified whenever a specific method has been called. I was hoping I could accomplish this using Reflection, but my attempts haven't gotten me anywhere yet, so I'm hoping that perhaps somebody else with the same need has accomplished this before and can enlighten me. I figured using MethodInfo was the way to go, but like I said, I found nothing there that could help me accomplish what I wanted to do. Any suggestions, hints or solutions would be greatly appreciated.

    Read the article

  • null reference problems with c#

    - by alex
    Hi: In one of my window form, I created an instance of a class to do some works in the background. I wanted to capture the debug messages in that class and displayed in the textbox in the window form. Here is what I did: class A //window form class { public void startBackGroundTask() { B backGroundTask = new B(this); } public void updateTextBox(string data) { if (data != null) { if (this.Textbox.InvokeRequired) { appendUIDelegate updateDelegate = new appendUIDelegate(updateUI); try { this.Invoke(updateDelegate, data); } catch (Exception e) { Console.WriteLine(e.Message); } } else { updateUI(data); } } } private void updateUI(string data) { if (this.Textbox.InvokeRequired) { this.Textbox.Invoke(new appendUIDelegate(this.updateUI), data); } else { //update the text box this.Textbox.AppendText(data); this.Textbox.AppendText(Environment.NewLine); } } private delegate void appendUIDelegate(string data); } class B // background task { A curUI; public b( A UI) { curUI = UI; } private void test() { //do some works here then log the debug message to UI. curUI.updateTextBox("message); } } I keep getting a null reference exception after this.Invoke(updateDelegate, data); is called. I know passing "this" as a parameter is strange. But I want to send the debug message to my window form. Please help. Thanks

    Read the article

  • Is it possible in Scala to force the caller to specify a type parameter for a polymorphic method ?

    - by Alex Kravets
    //API class Node class Person extends Node object Finder { def find[T <: Node](name: String): T = doFind(name).asInstanceOf[T] } //Call site (correct) val person = find[Person]("joe") //Call site (dies with a ClassCast inside b/c inferred type is Nothing) val person = find("joe") In the code above the client site "forgot" to specify the type parameter, as the API writer I want that to mean "just return Node". Is there any way to define a generic method (not a class) to achieve this (or equivalent). Note: using a manifest inside the implementation to do the cast if (manifest != scala.reflect.Manifest.Nothing) won't compile ... I have a nagging feeling that some Scala Wizard knows how to use Predef.<:< for this :-) Ideas ?

    Read the article

  • How to approach socket programming between C# -> Java (Android)

    - by Alex
    I've recently knocked up a server/client app for Windows & Android that allows one to send a file from Windows to an android phone over a socket connection. It works great for a single file but trying to send multiple files over in a single stream is causing me problems. I've also realised that aside from the binary data, I will need to send messages over the socket to indicate error states and other application messages. I have little experience with network programming and and wondering what is the best way forward. Basically the C# server side of the app just goes into a listening state and uses Socket.SendFile to transmit the file. On Android I use the standard Java Socket.getInputStream() to receive the file. That works great for a single file transfer, but how should I handle multiple files and error/messaging information? Do I need to use a different socket for each file? Should I be using a higher level framework to handle this or can I send everything over the single socket? Any other suggestions for frameworks or learning materials?

    Read the article

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