Daily Archives

Articles indexed Thursday June 10 2010

Page 5/121 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How do I do import hooks in IronPython/Silverlight?

    - by ahlatimer
    I'm extending TryPython to (along with various other things) allow users to save a file and subsequently import that file. TryPython overloads the built in file operations, so I need to know what parts of import need to hooked into in order for import to use the overloaded file operations. Really, a basic overview of IronPython's import when used in Silverlight would be extremely helpful. I don't need a complete working solution (although I won't stop you from writing one! :). I'm a Python newbie, and I really have no idea where to even begin. Thanks!

    Read the article

  • Convert String To Integer And Vice-Versa

    - by Nathan Campos
    I'm building a calculator application, and I have a Form, with a TextBox called txtVisor, that has the property NumbersOnly = true. I want to get the content of it(that I already know: txtVisor.Text) and convert it into a Integer, to do multiply it by 12, then convert the result into a String to set the txtVisor.Text as the result of the operation. How could I do this? PS: I'm using NSBasic 7.0

    Read the article

  • Is there an easy way to stream a m3u in iPhone?

    - by marty
    I can have a UIWebView with the .m3u file opened, which will go to the webview with a play button displayed, and that automatically goes to the quicktime player and starts playing the stream. But when I press the done button, it goes back to the UIWebView with a little play button in the middle, and from there you can go back to the previous screen (it was selected from a tableview). So I just want it to automatically load the quicktime player in the view. How can I do that?

    Read the article

  • boost::shared_ptr<const T> to boost::shared_ptr<T>

    - by Flevine
    I want to cast the const-ness out of a boost::shared_ptr, but I boost::const_pointer_cast is not the answer. boost::const_pointer_cast wants a const boost::shared_ptr, not a boost::shared_ptr. Let's forego the obligitory 'you shouldn't be doing that'. I know... but I need to do it... so what's the best/easiest way to do it? For clarity sake: boost::shared_ptr<const T> orig_ptr( new T() ); boost::shared_ptr<T> new_ptr = magic_incantation(orig_ptr); I need to know the magic_incantation() Thanks!

    Read the article

  • Java Applet Deployment, ClassNotFoundException (primary class)

    - by Matt
    This is driving me up the wall. I have checked and rechecked spelling and paths. I have tried just about every combination of paths, including relative, absolute, and full http paths. I continue to get the following error when trying to load a Java applet: java.lang.ClassNotFoundException: AppletClient.class at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Exception: java.lang.ClassNotFoundException: AppletClient.class The HTML used to load the applet: <applet width="100" height="100" archive="applet/myapplet.jar, applet/applet_dependency.jar" code="AppletClient.class"> <param value="blahblah" name="username"> <param value="false" name="codebase_lookup"> </applet> The applet is in a relative directory, "applet", from the path of the current page. I have unzipped the jar file and can see AppletClient.class. Also, in the source of the project, it is spelled that way (casing and all). I have tried with/without the parameters. I have changed the names of the archive jars in the applet include tag just to see if I get a different error for bad file names (same error). I have manually done GETs on the jars to make sure the server is responding to the requests (it is). I have tried with and without the codebase tag, with all different varieties of paths (start getting bad "magic number" errors on those). I know that this error sometimes pops up when a dependency fails to load, so it can be misleading, but all dependencies are present, accounted for, and are fetchable via manual GETs. Between each and every attempt I always clear my cache in FireFox. These problems are reproduced in IE8 and Chrome as well. Per my Java Console from the browser, I am running Java Plug-in 1.6.0_20. This is from the same machine that I develop the applet on, which runs fine via Eclipse. Finally, I kicked on Fiddler2, and I don't see a single request for the jar files anywhere The host site is running from my Visual Studio debugger, so it's running on localhost. But I see the requests for all the other resources on Fiddler. Just... no Jars. ANYWHERE. I clear the log, cleared my browser cache, and did a ctrl-R refresh. And still, not a single Jar request on the Fiddler log. I even did a delayed write (with JS) of the applet tag after the page loaded, once all the Fiddler activity slowed down. The element gets written to the document (and I can see the 100x100 Java error window), but not a single request shows up on Fiddler. Any suggestions, before I go crawl into the corner and cry myself to sleep? EDIT: From the Java console, if I hit "l" (el) to "dump classloader list", I see something that looks like this: Live entry: key=http://localhost:55446/BaseWebSite/,http://localhost:55446/BaseWebSite/applet/myappliet.jar, http://localhost:55446/BaseWebSite/applet/applet_dependency.jar, refCount=1, threadGroup=sun.plugin2.applet.Applet2ThreadGroup[name=http://localhost:55446/BaseWebSite/-threadGroup,maxpri=4]

    Read the article

  • jQuery DataTables: Problems with POST Server Side JSON output

    - by Tim
    Hello Everyone, I am trying to get my datatable to take a POST JSON output from my server. This is my client side code <script> $(document).ready(function() { $('#example').dataTable( { "bProcessing": true, "bServerSide": true, "sAjaxSource": "http://localhost/staff/jobs/my_jobs", "fnServerData": function ( sSource, aoData, fnCallback ) { $.ajax( { "dataType": 'json', "type": "POST", "url": sSource, "data": aoData, "success": fnCallback } ); } } ); } ); </script> Now I have copied and pasted the server side code found in the DataTables examples found here. When I change my sAjaxSource to view this page the table doesn't move beyond 'processing'. When I view the JSON directly I see this output. {"sEcho": 1, "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["Trident","First Ever Job"]] } Just for fun I went to the POST server-side example and copied some of the JSON they are using for their example and just PHP echoed it straight out of another page. This is the output of that page. {"sEcho": 1, "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["Trident","Internet Explorer 4.0"]] } Here is where it gets interesting. The JSON that has been processed by the server fails to work yet the JSON simply echo'd by the same server on a different page does work... yet both are almost identical in outputs. I hope someone can shed some light on this because as the tree said to the lumberjack... I'm stumped. Thanks, Tim

    Read the article

  • [C++][Boost] Acceptor and Problems with Async_Accept

    - by bobber205
    See code. :P I am able to receive new connections before async_accept() has been called. My delegate function is also never called so I can't manage any connections I receive, rendering the new connections useless. ;) So here's my question. Is there a way to prevent the Boost ASIO acceptor from getting new connections on its own and only getting connections from async_accept()? Thanks! bool AlexSocket::StartListening(int port) { bool didStart = false; if (!this->listening) { //try to listen acceptor = new tcp::acceptor(this->myService); boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::tcp::v4(), port); acceptor->open(endpoint.protocol()); acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(true)); acceptor->bind(endpoint); //CAN GET NEW CONNECTIONS HERE (before async_accept is called) acceptor->listen(); didStart = true; //probably change? tcp::socket* tempNewSocket = new tcp::socket(this->myService); acceptor->async_accept(*tempNewSocket, boost::bind(&AlexSocket::NewConnection, this, tempNewSocket, boost::asio::placeholders::error) ); } else //already started! return false; this->listening = didStart; return didStart; } //this function is never called :( void AlexSocket::NewConnection(tcp::socket* s, const boost::system::error_code& error) { cout << "New Connection Made" << endl; //Start new accept async tcp::socket* tempNewSocket = new tcp::socket(this->myService); acceptor->async_accept(*tempNewSocket, boost::bind(&AlexSocket::NewConnection, this, tempNewSocket, boost::asio::placeholders::error) ); }

    Read the article

  • Is there a certain IIS configuration required to allow a functioning .Net 4.0 ASP.Net MVC 2 Azure ap

    - by erg39
    I just installed the Azure 1.2 tools update and would like to get to work on an Azure project running locally using ASP.Net MVC and .Net 4, but I cannot get MVC pages to load. If I just create a new Azure project in VS 2010, add a ASP.Net MVC web role, and run the application, pages never load. It appears that routing is somehow at fault as controller actions never get called, but if I add other pages to the project (like .htm or .aspx) they will load in the browser. It all works fine with a new project using .Net 3.5, MVC 2 project in the Azure development environment; it all works fine with .Net 4.0 MVC 2 project that is not running in Azure; only the combination does not work. Environment is Win 7 x64 (IIS 7.5), VS 2010, Azure tools 1.2 Is there some magic IIS setting I need to change or something? Any ideas?

    Read the article

  • Embed Youtube in UIWebView behind transparent img. Wmode transparent and z-index doesn't work

    - by Allisone
    I'm using this code: - (void)embedYouTube:(NSString *)urlString frame:(CGRect)frame { NSString *embedHTML = @"\ <html><head>\ <style type=\"text/css\">\ body {\ background-color: black;\ }\ #container{\ position: relative;\ z-index:1;\ }\ #video,#videoc{\ position:absolute;\ z-index: 1;\ border: none;\ }\ #tv{\ background: transparent url(tv.png) no-repeat;\ width: 320px;\ height: 205px;\ position: absolute;\ top: 0;\ z-index: 999;\ }\ </style>\ </head><body style=\"margin:0\">\ <div id=\"tv\"></div>\ <object id=\"videoc\" width=\"240\" height=\"160\">\ <param name=\"movie\" value=\"%@\"></param>\ <param name=\"wmode\" value=\"transparent\"></param>\ <embed wmode=\"transparent\" id=\"video\" src=\"%@\" type=\"application/x-shockwave-flash\" \ width=\"240\" height=\"160\"></embed>\ </object>\ </body></html>"; NSString *path = [[NSBundle mainBundle] bundlePath]; NSURL *baseURL = [NSURL fileURLWithPath:path]; NSString *html = [NSString stringWithFormat:embedHTML, urlString,urlString]; UIWebView *videoView = [[UIWebView alloc] initWithFrame:frame]; [videoView loadHTMLString:html baseURL:baseURL]; [self.view addSubview:videoView]; [videoView release]; } Its the first time that I use UIWebView and the first time that I use video in iPhone. The video plays, so that's working BUT: I want to have an old school tv (round corners) in foreground with switches and so on. The tv is an image with transparent pixels in the middle, so that a video lying behind the tv will shine through as if the video would be shown on the tv. But first of all the video has a border that I can't remove and second it's always in the foreground. In Safari and in Firefox and Mac it's working. So is it an iPhone thing, could it be that it simply won't work on iPhone ? Or do I have some css/html typos ?

    Read the article

  • Regex for extracting second level domain from FQDN?

    - by Bob
    I can't figure this out. I need to extract the second level domain from a FQDN. For example, all of these need to return "example.com": example.com foo.example.com bar.foo.example.com example.com:8080 foo.example.com:8080 bar.foo.example.com:8080 Here's what I have so far: Dim host = Request.Headers("Host") Dim pattern As String = "(?<hostname>(\w+)).(?<domainname>(\w+.\w+))" Dim theMatch = Regex.Match(host, pattern) ViewData("Message") = "Domain is: " + theMatch.Groups("domainname").ToString It fails for example.com:8080 and bar.foo.example.com:8080. Any ideas?

    Read the article

  • Want to learn Objective-C but syntax is very confusing

    - by Sahat
    Coming from Java background I am guessing this is expected. I would really love to learn Objective-C and start developing Mac apps, but the syntax is just killing me. For example: -(void) setNumerator: (int) n { numerator = n; } What is that dash for and why is followed by void in parenthesis? I've never seen void in parenthesis in C/C++, Java or C#. Why don't we have a semicolon after (int) n? But we do have it here: -(void) setNumerator: (int) n; And what's with this alloc, init, release process? myFraction = [Fraction alloc]; myFraction = [myFraction init]; [myFraction release]; And why is it [myFraction release]; and not myFraction = [myFraction release]; ? And lastly what's with the @ signs and what's this implementation equivalent in Java? @implementation Fraction @end I am currently reading Programming in Objective C 2.0 and it's just so frustrating learning this new syntax for someone in Java background.

    Read the article

  • mediawiki markup equivalent of WMD editor?

    - by Justin Grant
    Anyone have a recommendation for an editor like the WMD editor, but using MediaWiki markup instead of Markdown? Our site is already using MediaWiki markup but we want a slicker editor without changing markup completely. Requirements include: live preview of formatted text underneath the markup you're typing a toolbar for common formatting (bold, italic, links, bullets, numbered-list, code, etc) keyboard shortcuts for each toolbar button (e.g. CTRL+B for bold) Undo/redo via keyboard shortcuts (CTRL+Z/CTRL+Y) or toolbar buttons works well in the usual set of popular browsers (including IE6!) open-source would be preferred

    Read the article

  • "Open file location" is broken for Win Live Photo Gallery and Chrome

    - by Arnold Spence
    Symptoms: Windows Live Photo Gallery: Right clicking on an image (.jpg, .png) and selecting the context menu item "Open file location" should open the containing folder in explorer. Instead, I get an error dialog stating "This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel." Chrome: After downloading a file (of any type), clicking the down arrow on the download status bar at the bottom and clicking "Show in folder" results in the same error dialog mentioned above. I'm using Windows 7. I'm pretty sure this is a registry entry gone bad but I've been unable to locate any information about this specific problem. It's not a file type association problem as I am not trying to open the files concerned, I'm trying to open an explorer window at the location for the file. I've found a similar issue that somebody had with explorer itself. However, the suggested registry fixes here for "Folder", "Directory" and "Drive" did not solve the problem. Also, If I use the searchbar in explorer to do a search, right click on a file and choose "Open file location", explorer jumps to that location without any trouble. I have not yet identified other programs with this issue.

    Read the article

  • How to tell Subversion to display binary files using an external program?

    - by lamcro
    I have some code which, like java, is stored in a binary format, and I have the applications to display and modify this code setup in the Subversion's config file. But when I run svn diff for these file, Subversion prevents me =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream I can still view them, but only with the --force argument Since all the files in the repository are of this binary code, how can I permanently force subversion to open the files for diff or edit mode?

    Read the article

  • Restart nginx without sudo?

    - by tesmar
    So I want to be able to cap:deploy without having to type any passwords. I have setup all private keys so I can get to the remote servers fine, and am now using svn over ssh, so no passwords there. I have one last problem, I need to be able to restart nginx. Right now I have sudo /etc/init.d/nginx reload. That is a problem b/c it uses the capistrano password, the one I just removed b/c I am using keys. Any ideas on how to restart nginx w\out a password?

    Read the article

  • RichEdit control: Determine when text is changed?

    - by Rosarch
    I'm trying to count the number of times that text is changed in a given RichEdit control. I considered using events like key down, but that gets messy when you consider keys that don't change the text (like arrows, page up, etc). And how do you make sure you get all of those keys? It seems it would be simpler to register a callback for a onTextChanged event, if one exists. Is there any way to do something like that?

    Read the article

  • What's right for me: htAccess, form submittion, HTTP header authentication w/ PHP?

    - by Brook Julias
    I am creating a website with multiple sections--admin, client, user, and anonymous--each user group having less access then the next. I am wondering what form of authentication would be best for my use? I have heard the if you are just dealing with a websites then a web form is for you (because it's prettier). HTTP header authentication with PHP is said to get clunky/sloppy. htAcess is pretty much the hard core of various authentication methods I have looked up, but is it too much?

    Read the article

  • Object inside of array -- works in one scope but not in another?

    - by Earlz
    Ok I've been learning some of the more advanced aspects of Javascript and now trying to use this I'm stuck. Here is my code: function Data(){} function init(state){ var item; item=new Data(); item.fieldrid=17; item.description='foo'; state.push(item); }; function findInState(state,fieldrid) { for (var item in state) { alert(item.fieldrid); //prints undefined if (item.fieldrid == fieldrid) { return item; } } return null; } var s=[]; init(s); alert(s[0].fieldrid); //prints 17 (expected) alert(findInState(s,17).fieldrid); //exception here. function returns null. A running example is here at jsbin Why does this not work? I would expect the alert in findInState to yield 17 but instead it yields undefined. What am I doing wrong?

    Read the article

  • Good simple C/C++ FTP and SFTP client library recommendation for embedded Linux

    - by Roman Nikitchenko
    Could anyone recommend FTP / SFTP client C/C++ library for Linux-based embedded system? I know about Curl library but I need something as simple as possible just to download files from FTP / SFTP servers. Is there any recommendation to look for? Yes, SFTP support is critical. Actually I can even sacrifice multi-threading because I need only one stream at a time. And I'd like it to be able to work through memory buffers but this should be not a problem. Thank you in advance.

    Read the article

  • How can I flip a UITableView?

    - by Sheehan Alam
    I am trying to flip a UITableViewController but I don't think I am doing it properly: LeaderBoardTableViewController* leaderBoardView = [[[LeaderBoardTableViewController alloc] initWithNibName:@"LeaderBoardTableViewController" bundle:nil]autorelease]; //[self.navigationController pushViewController:leaderBoardView animated:YES]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[self view] cache:YES]; [self.view addSubview:leaderBoardView]; [UIView commitAnimations]; I believe the culprit is in the line: [self.view addSubview:leaderBoardView]; But am not sure how to resolve.

    Read the article

  • How to update the original InfoPath form from within Workflow?

    - by Allen.Zhang
    Hi All, I have created an InfoPath form (e.g. Form_ExpenseReport) for collect data from end users, and a number of task forms (also InfoPath form, e.g. TaskForm_1, TaskForm_2) for my state machine workflow use. The users want to see all the comments of Task forms (TaskForm_1 & TaskForm_2) in the original IP form (Form_ExpenseReport). How can I update the first form from within workflow? Can anybody give me some tips? My environment: MOSS 2007 Enterprise license VS 2008

    Read the article

  • Connect to an existing process

    - by user360807
    Hole thing is happening on the mac os x. Let's assume that I've opened an program by clicking on an .app icon. It's a python program with GUI which has a separate process that waits for a user input. But as I've opened it by clickin .app icon I dont have access to it's input as I would have if I opened it in Terminal. And the question is: How can I connect new Terminal window to this running program? I tried pipes but I'm not sure how to use them correctly. My guess was to find PID of the app that is running and then pipe to this program by giving a PID. But I have no idea how to do it. I hope you were able to understand what's the problem. Sorry for my weak english :)

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >