Daily Archives

Articles indexed Thursday March 25 2010

Page 19/127 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • reference to specific hash key

    - by dave
    How do I create a reference to the value in a specific hash key. I tried the following but $$foo is empty. Any help is much appreciated. $hash->{1} = "one"; $hash->{2} = "two"; $hash->{3} = "three"; $foo = \${$hash->{1}}; $hash->{1} = "ONE"; #I want "MONEY: ONE"; print "MONEY: $$foo\n";

    Read the article

  • How do You Get a Specific Value From a System.Data.DataTable Object?

    - by Giffyguy
    I'm a low-level algorithm programmer, and databases are not really my thing - so this'll be a n00b question if ever there was one. I'm running a simple SELECT query through our development team's DAO. The DAO returns a System.Data.DataTable object containing the results of the query. This is all working fine so far. The problem I have run into now: I need to pull a value out of one of the fields of the first row in the resulting DataTable - and I have no idea where to even start. Microsoft is so confusing about this! Arrrg! Any advice would be appreciated. I'm not providing any code samples, because I believe that context is unnecessary here. I'm assuming that all DataTable objects work the same way, no matter how you run your queries - and therefore any additional information would just make this more confusing for everyone.

    Read the article

  • Action property of interface type

    - by Daniel
    Hi, guys. With my understading, the nature of a Action is that properties can be pushed w/ request parameter values. And, one wonderful feature is that Struts2 allows you to directly populate parameter values against Class type property ;) Assuming there exists a Action and property class as below, class Action extends ActionSupport { User user; @Action(value="hello" {@result=(.......)}) public void execute() { ........ } ..... public void setUser(User user) { this.user = user; } public User getUser() { return this.user; } } class User { String name; ..... public void setName(String name) { this.name = name; } public String getName() { return this.name; } } you could populate User class property by doing like this. http://...../hello.action?user.name=John or via jsp page Then, I realize that there are actually people make an Action property as a Interface type. My question is what is the reason behind this. If there is a sample code demonstrating it will be great. Thanks in advance!

    Read the article

  • Play ASX/ASF stream on Android phone

    - by harlev
    I'm looking for an Android media player that will play ASX streams. Specifically I would like to play this radio station http://213.8.138.13/gglz UPDATE: Looks like the full stream path is mms://213.8.138.13/gglz?MSWMExt=.asf

    Read the article

  • Is there a way to make PHP progressively output as the script executes?

    - by Iain Fraser
    So I'm writing a disposable script for my own personal single use and I want to be able see how the process is going. Basically I'm processing a couple of thousand media releases and sending them to our new CMS. So I don't hammer the CMS, I'm making the script sleep for a couple of seconds after every 5 requests. I would like - as the script is executing - to be able to see my echos telling me the script is going to sleep or that the last transaction with the webservice was successful. Is this possible in PHP? Thanks for your help! Iain

    Read the article

  • replace symbol in javascript

    - by Jin Yong
    Does anyone know how can I replace this 2 symbol below from the string into code? ' left single quotation mark into ‘ ' right single quotation mark into ’ " left double quotation mark into “ " right double quotation mark into ”

    Read the article

  • Encoding gives "'ascii' codec can't encode character … ordinal not in range(128)"

    - by user140314
    I am working through the Django RSS reader project here. The RSS feed will read something like "OKLAHOMA CITY (AP) — James Harden let". The RSS feed's encoding reads encoding="UTF-8" so I believe I am passing utf-8 to markdown in the code snippet below. The em dash is where it chokes. I get the Django error of "'ascii' codec can't encode character u'\u2014' in position 109: ordinal not in range(128)" which is an UnicodeEncodeError. In the variables being passed I see "OKLAHOMA CITY (AP) \u2014 James Harden". The code line that is not working is: content = content.encode(parsed_feed.encoding, "xmlcharrefreplace") I am using markdown 2.0, django 1.1, and python 2.4. What is the magic sequence of encoding and decoding that I need to do to make this work? Thanks.

    Read the article

  • Cannot run c graphics programs

    - by prithviraj
    Hi all i have developed a some graphic programs in desktop system. Bu when i tried to run it in the hp compaq lap top its not getting executed. I developed it using turbo c. Then i tried writing a simple graphic program in turbo c in laptop, but the problem i am getting is in 'initgraph' statement it is unable to detect the driver. Can you please tell me what might be the problem.

    Read the article

  • How to merge VB.NET WEB Project with C#.NET MVC project

    - by Thushara Perera
    Hi All, I've got an existing asp.net project written in vb.net need to merge into C# ASP.NET MVC 1.0 application. I couldn't find a good article on this. I have successfully created a sample project and merge it. It works successfully. But when merge it into my real project it does not work. I've used C#.csproj project file and deleted VB project file. for the merging i could find a good article this link successful on sample project not with the real project. good one: http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc how it is possible to merge VB Default.aspx, C# Default.aspx and VB Global.asax, C# Global.asax. Can I used VB.vbproj file insted of csproj Thanks Thushara Perera

    Read the article

  • Like operator in sql server

    - by Geetha
    Hi All, i want to get all the record from the database which contain atleast one word from the input string. Ex: input=Stack over flow select * from sample where name like '%stack%' or name like '%over% or name like '%flow%' Geetha.

    Read the article

  • Config transformations and “TransformXml task failed” error message

    - by Troy Hunt
    I’ve just enabled config transformations on a .NET 3.5 project in VS2010 RC after watching Scott Hanselman’s video on web deployment. Unfortunately every time I go to publish I now get the following error: The "TransformXml" task failed unexpectedly. System.UriFormatException: Invalid URI: The URI is empty. at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri..ctor(String uriString) at Microsoft.Web.Publishing.Tasks.TransformXml.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) If I take a brand new VS2010 web application which already has the config transformations by default I don’t have a problem so I suspect my issue is project related. Has anyone come across this before or have any ideas on a fix?

    Read the article

  • how to save excel file in MS SQL Server 2005

    - by Anish Mohan
    I have a table in which there are two columns : 1. import type, 2. Excel import template. The second column - "Excel import template" should store the whole excel file. How would I save excel file in databse...can I use binary datatype column, convert excel file to bytes and save the same ? Thanks in advance !

    Read the article

  • unhandled exception occured in c#

    - by abid
    hey. i`m getting this error that system.data.datarowview is not permitted in this contexxt. valid expressions are constants expressions and ( in some contexts). column name are not permitted.. can any body guide me what this error says.. can any one provide me a suggestion whether where im wrong.. any guesses guys??? im not getting it.. :/

    Read the article

  • Adding NavigationControl to a TabBar Application containing UITableViews

    - by kungfuslippers
    Hi, I'm new to iPhone dev and wanted to get advice on the general design pattern / guide for putting a certain kind of app together. I'm trying to build a TabBar type application. One of the tabs needs to display a TableView and selecting a cell from within the table view will do something else - maybe show another table view or a web page. I need a Navigation Bar to be able to take me back from the table view/web page. The approach I've taken so far is to: Create an app based around UITabBarController as the rootcontroller i.e. @interface MyAppDelegate : NSObject <UIApplicationDelegate> { IBOutlet UIWindow *window; IBOutlet UITabBarController *rootController; } Create a load of UIViewController derived classes and associated NIBs and wire everything up in IB so when I run the app I get the basic tabs working. I then take the UIViewController derived class and modify it to the following: @interface MyViewController : UIViewController<UITableViewDataSource, UITableViewDelegate> { } and I add the delegate methods to the implementation of MyViewController - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 2; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } if (indexPath.row == 0) { cell.textLabel.text = @"Mummy"; } else { cell.textLabel.text = @"Daddy"; } return cell; } Go back to IB , open MyViewController.xib and drop a UITableView onto it. Set the Files Owner to be MyViewController and then set the delegate and datasource of the UITableView to be MyViewController. If I run the app now, I get the table view appearing with mummy and daddy working nicely. So far so good. The question is how do I go about incorporating a Navigation Bar into my current code for when I implement: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath() { // get row selected NSUInteger row = [indexPath row]; if (row == 0) { // Show another table } else if (row == 1) { // Show a web view } } Do I drop a NavigationBar UI control onto MyControllerView.xib ? Should I create it programmatically? Should I be using a UINavigationController somewhere ? I've tried dropping a NavigationBar onto my MyControllerView.xib in IB but its not shown when I run the app, only the TableView is displayed.

    Read the article

  • as3 - controlling flicker when scaling up a button or movieclip

    - by sol
    This is a situation I run into a lot but never seem to find a good solution. I have movieclips that I scale up slightly on rollover, but if you hover over the edge of the movieclip it just sits there and flickers, continuously receiving mouseOver and mouseOut events. How do you deal with this? Again, it's usually a problem when tweening the scale of a movieclip or button. my_mc.addEventListener(MouseEvent.MOUSE_OVER, mOver); my_mc.addEventListener(MouseEvent.MOUSE_OUT, mOut); private function mOver(m:MouseEvent) { TweenLite.to(m.target, .2, { scaleX:1.1, scaleY:1.1} ); } private function mOut(m:MouseEvent) { TweenLite.to(m.target, .2, { scaleX:1, scaleY:1} ); }

    Read the article

  • Passing VB Callback function to C dll - noob is stuck.

    - by WaveyDavey
    Callbacks in VB (from C dll). I need to pass a vb function as a callback to a c function in a dll. I know I need to use addressof for the function but I'm getting more and more confused as to how to do it. Details: The function in the dll that I'm passing the address of a callback to is defined in C as : PaError Pa_OpenStream( PaStream** stream, const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate, unsigned long framesPerBuffer, PaStreamFlags streamFlags, PaStreamCallback *streamCallback, void *userData ); where the function is parameter 7, *streamCallback. The type PaStreamCallback is defines thusly: typedef int PaStreamCallback( const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo* timeInfo, PaStreamCallbackFlags statusFlags, void *userData ); In my vb project I have: Private Declare Function Pa_OpenStream Lib "portaudio_x86.dll" _ ( ByVal stream As IntPtr _ , ByVal inputParameters As IntPtr _ , ByVal outputParameters As PaStreamParameters _ , ByVal samprate As Double _ , ByVal fpb As Double _ , ByVal paClipoff As Long _ , ByVal patestCallBack As IntPtr _ , ByVal data As IntPtr) As Integer (don't worry if I've mistyped some of the other parameters, I'll get to them later! Let's concentrate on the callback for now.) In module1.vb I have defined the callback function: Function MyCallback( ByVal inp As Byte, _ ByVal outp As Byte, _ ByVal framecount As Long, _ ByVal pastreamcallbacktimeinfo As Byte, _ ByVal pastreamcallbackflags As Byte, _ ByVal userdata As Byte) As Integer ' do clever things here End Function The external function in the dll is called with err = Pa_OpenStream( ptr, _ nulthing, _ outputParameters, _ SAMPLE_RATE, _ FRAMES_PER_BUFFER, _ clipoff, _ AddressOf MyCallback, _ dataptr) This is broken in the declaration of the external function - it doesn't like the type IntPtr as a function pointer for AddressOf. Can anyone show me how to implement passing this callback function please ? Many thanks David

    Read the article

  • WindowsIdentity Token in Legacy ASP

    - by Max Schmeling
    I've created a .Net library at work that is used by all of our developers. The security part of it uses Microsoft AzMan for the security backend. In order to create a security (AzMan) ClientContext I have to pass it a token value (as a uint). This is all fine an dandy until I needed to make a COM wrapper for our common library so some of our legacy pages could take advantage of it without being rewritten for now. I cannot figure out how to get the token value to pass to AzMan from legacy ASP. The COM wrapper is setup to run as a COM Server and runs as a specific user that we use here for all COM objects, therefor the common library can't just pull the identity using .Net. Any ideas?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >