Daily Archives

Articles indexed Thursday June 17 2010

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

  • Create a batch file to copy and rename file

    - by Estate Master
    I have little to no experience in writing batch files. I need to write one that copies a file to a new folder and renames it At the moment, my batch file consists of only this command: COPY ABC.PDF \\Documents As you can see, it only copies the file ABC.pdf to the network folder 'Documents'. However i need to change this so it renames the file ABCxxx.pdf, where xxx is a text variable that i would like to set somewhere in the batch file. For example, if xxx = "_Draft", then file would be renamed ABC_Draft.pdf after it is copied. Thanks

    Read the article

  • Asyncronus javascript rendering widgets

    - by Joe J
    Hey all, I'm creating a javascript widget so third partys (web designers) can post a link on their website and it will render the widget on their site. Currently, I'm doing this with just a script link tag: <div class="some_random_div_in_html_body"> <script type='text/javascript' src='http://remotehost.com/link/to/widget.js'></script> </div> However, this has the side-effect of slowing down a thrid party's website render times of the page if my site is under a load. Therefore, I'd like the third party website to request the widget link from my site asyncronously and then render it on their site when the widget link loads completely. The Google Analytics javascript snippet seems to have a nice bit of asyncronous code that does a nice async request to model off of, but I'm wondering if I can modify it so that it will render content on the third party's site. Using the example below, I want the content of http://mysite.com/link/to/widget.js to render something in the "message" id field. <HTML> <HEAD><TITLE>Third Party Site</TITLE><STYLE>#message { background-color: #eee; } </STYLE></HEAD> <BODY> <div id="message">asdf</div> <script type="text/javascript"> (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = 'http://mysite.com/link/to/widget.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </BODY> </HTML> I don't know if what I'm trying to do constitutes Cross Site Scripting (still a bit vague on that concept) but am wondering if what I'm trying to do is possible. Or if anyone has any other approaches to creating javascript widgets effectively, I'd appreciate any advice. Thanks for reading this. Joe

    Read the article

  • Scipy interpolation on a numpy array

    - by dassouki
    I have a lookup table that is defined the following way: TR_ua1 = np.array([ [3.6, 6.5, 9.1, 11.5, 13.8], [3.9, 7.3, 10.0, 13.1, 15.9], [4.5, 9.2, 12.2, 14.8, 18.2] ]) The header row elements are (hh) <1,2,3,4,5+ The header column (inc) elements are <10000, 20000, 20001+ The user will input a value ex (1.3, 25,000) or (0.2, 50,000). Scipy.interpolate() should interpolate to determine the correct value. Currently, the only way i can do this is with a bunch of if/elifs as exemplified below. I'm pretty sure there is a better, more efficient way of doing this Here's what i've got so far import numpy as np from scipy import interplate if (ua == 1): if (inc <= low_inc): #low_inc = 10,000 if (hh <= 1): return TR_ua1[0][0] elif (hh >= 1 & hh < 2): return interpolate( (1,2), (TR_ua1[0][1], TR_ua1[0][2]) )

    Read the article

  • zend gdata google base getting link url and parsing xml with object oriented php

    - by thrice801
    Hi, So I am using Zend frameworks Gdata extension to parse xml data from google base. http://framework.zend.com/manual/en/zend.gdata.gbase.html Working fine minus one damn important thing I cant seem to parse, the link to the actual page, because there are two elements and its returned as an array. Anyways Ive tried vardumping the array but what comes out didnt help me figure out what was going on any better. So heres the specifics of the issue. echo $entry->title->text."<br />".$entry->id->text."<br />".$entry->content->text."<br />".$entry->author[0]->name."<br />"; (the above code works fine). Now according to the documentation I thought I could get the link href by going $entry-link-text or $entry-link-url (tried both, neither worked). Anyways, Im not sure whether this is zend specific or just a gap in my OOP understanding, but any help would be much appreciated!

    Read the article

  • How do you send information from one window to another in the same program?

    - by Daniel
    In the program I am trying to build, I have a menu button that opens a second window. The user puts information into the second window, presses the "Done" button, and the information is transfered into the main window. The problem I am having is opening the second window. I have both windows build in xaml files in Visual Studio but I can't find a way to show the second window. Using "Window window = new Window" does not fit my needs because 1) I already have the second window built and 2) I have tried this and I cannot figure out how to add children to the window; there is no window.children nor any grid to put the children into. Thank you in advance! Moments after I pressed post, I thought of something I hadnt tried: "WindowAdd add = new WindowAdd; //WindowAdd being the second window add.Show();" This does exactly what I want it to do. The next problem I have is sending the information the TextBoxes into the MainWindow. I am thinking cookies might work but am unsure. Anyone have any thoughts? Thanks in advance!

    Read the article

  • Autologin on Ubuntu Server

    - by hekevintran
    I have a machine running Ubuntu Server. It has only a command-line interface. How can I make the system login with a specific user automatically (I don't want to type the username/password). I know that this is insecure and I don't care.

    Read the article

  • Building an analytics dashboard in Rails

    - by Bob
    I'm looking to build a Rails app to do internal reporting (make charts or general data visualizations, create reports, show statistical analyses, etc.) on data my company collects. What would be helpful in building this? For example, any Rails/Javascript libraries I should be familiar with, or any open source analytics apps or existing dashboard tools I should look at?

    Read the article

  • Css positioning problem

    - by 2x2p1p
    Hi guys. I did a "shadow" effect but the "div" elements must have a relationship (father and son) <style> div { left: 3px; position: absolute; font-size: 60px; top: 3px; } div + div { position: relative; } </style> <div> shadow <div> shadow </div> </div> Can I make the same thing with separate elements like this bellow ? <div>shadow</div> <div>shadow</div> Thanks :)

    Read the article

  • why is this closing the new pop up window

    - by user295189
    I am trying to open a window and then redirecting the original page to a new location. It opens the window, however before redirecting the parent page, it closes the new window too. How can I fix that function orderPrint() { var n = new Object(); n. ID = <?php echo $ID->ID; ?>; n.action = posttothispage.php"; n.target = popWinCenterScreen("/common/html/empty.htm", parseInt(window.screen.height * 0.8), 796, "resize"); myFuction.PostRequest(n); window.location = “someotherpagethanthis.php”; }

    Read the article

  • iPhone - return from an NSOperation

    - by lostInTransit
    Hi I am using a subclass of NSOperation to do some background processes. I want the operation to be cancelled when the user clicks a button. Here's what my NSOperation subclass looks like - (id)init{ self = [super init]; if(self){ //initialization code goes here _isFinished = NO; _isExecuting = NO; } return self; } - (void)start { if (![NSThread isMainThread]) { [self performSelectorOnMainThread:@selector(start) withObject:nil waitUntilDone:NO]; return; } [self willChangeValueForKey:@"isExecuting"]; _isExecuting = YES; [self didChangeValueForKey:@"isExecuting"]; //operation goes here } - (void)finish{ //releasing objects here [self willChangeValueForKey:@"isExecuting"]; [self willChangeValueForKey:@"isFinished"]; _isExecuting = NO; _isFinished = YES; [self didChangeValueForKey:@"isExecuting"]; [self didChangeValueForKey:@"isFinished"]; } - (void)cancel{ [self willChangeValueForKey:@"isCancelled"]; [self didChangeValueForKey:@"isCancelled"]; [self finish]; } And this is how I am adding objects of this class to a queue and listening for KVO notifications operationQueue = [[NSOperationQueue alloc] init]; [operationQueue setMaxConcurrentOperationCount:5]; [operationQueue addObserver:self forKeyPath:@"operations" options:0 context:&OperationsChangedContext]; - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if (context == &OperationsChangedContext) { NSLog(@"Queue size: %u", [[operationQueue operations] count]); } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; } } To cancel an operation (on a button click for instance), I tried calling -cancel but it doesn't make a difference. Also tried calling -finish but even that doesn't change anything. Every time I add an operation to the queue, the queue size only increases. finish is called (checked using NSLog statements) but it doesn't really end the operation. I'm still not very confident I'm doing this right Can someone please tell me where I am going wrong? Thanks a lot

    Read the article

  • How to add a default value to an already existing column?

    - by Earlz
    I have an existing column in my SQL Server database. I have tried about everything I can think of but can not get a default value to be added to the column. What works in every other database is alter table mytable alter column mycolumn set default(now()) --mycolumn is a datetime How do I do this in SQL Server? The error I get for that exact syntax is incorrect syntax near the keyword 'set'

    Read the article

  • Flow diagram in html/css

    - by viraptor
    Hi, is there some good way to create a flow / swimline diagram without resorting to scripting or tables? I'm talking about showing different hosts sending packets (so hosts on the X axis, time on the Y and arrows to the destination host). It seems like too much elements for tables (especially the arrows spanning multiple columns either way), but on the other hand, divs would be hard to position in the right place horizontally (they'd have to be basically aligned to a specified "column"). Is there any good way out? Any helper frameworks? (I don't want to do canvas stuff unless really needed)

    Read the article

  • MySQL Daemon failed to start.

    - by matthewsteiner
    There were no updates when I ran yum update. I was trying to install php-soap (which was failing), and online I found I should run this: wget -q -O - http://www.atomicorp.com/installers/atomic.sh |sh After running that, then "yum install php-soap" ran successfuly. Then I ran yum update just to check for updates and said yes for some packages. I noticed there were some mysql ones and such. Now mysql isn't running anymore and it won't let me start it (I get "MySQL Daemon failed to start") Ideas?

    Read the article

  • Using wildcard SSL certs (chain certificate) with mod_gnutls

    - by QWade
    I have a wildcard SSL certificate from GoDaddy that has three files: wildcard.crt gd_bundle.crt wildcard.key In setting up mod_gnutls to be used with Apache, I can get the site to come up, but it throws a warning that the SSL certificate has not been validated by a CA. When I use mod_ssl, I can stipulate a SSLCertificateChainFile directive and point it at the bd_bundle.crt file. I do not see how to do this with mod_gnutls. Any help is appreciated. I also know that mod_ssl supports SNI, so if there is not an easy answer, I will just try that. Thanks, QWade

    Read the article

  • Can I run iOS apps on my Mac?

    - by Ken
    I've seen a number of neat iPhone apps recently that I'd like to use. In particular, there are a number of neat musical apps (metronome, tuner, etc.) that seem highly rated, and have no real Mac equivalent. I don't have a recent iPod/iPhone/iPad (I don't need portability or a phone and it seems silly to pay hundreds of dollars to run $15 worth of apps), but I do have an Intel (C2D) Mac. Can the iPhone dev simulator, or any other emulator, download and run iPhone App Store apps?

    Read the article

  • Don't forget to vote for ADF sessions on Oracle Mix

    - by shay.shmeltzer
    If you are planning to attend Oracle Open World or Oracle Developer (and you should plan to attend), and you are reading this blog - I'll assume that you are interested in Oracle ADF. Well here is your chance to make sure you can get even more ADF content at the conference. Vote for some of the ADF related session suggestions in the "vote a session" on oracle mix. See here. You can find various ADF sessions under the Oracle Fusion Development and the Rich Enterprise Applications tracks. Every vote counts - just make sure to vote for at least 3 sessions for your vote to count.

    Read the article

  • Facebook Fanpage Wallposting from C# App

    - by brinthhillerup
    Hello Guys I have the following challenge at hand: I have a fanpage for a apartment renting company. They would like to autoupdate their fanpage everytime a new apartment is added to the system. The system is developed in C# ASP.NET 3.5. I have downloaded the Facebook C# API From codeplex. Have anyone done this, or know how to do it? UPDATE: So far I have tried the following: FacebookSession session = new Facebook.Session.ConnectSession(myKey,mySecretKey); Stream stream = new Stream(session); stream.Publish("Testing", null, null, null, 107010519323711); I get a null reference Exception when I call Stream.Publish

    Read the article

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