Search Results

Search found 2716 results on 109 pages for 'michael tanner'.

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

  • XUL: create menu items dynamically and set "selected" attr

    - by Michael
    I have a firefox extension Options pref panel, where I should dynamically create menu items and select particular item to be current. here is the XUL file part <menulist id="rss_service_combo"> <menupopup id="rss_service_menu"/> </menulist> Then in load event of the pref panel, using js I append menuitem elements into menupop. This is working fine. The only problem is that even if I set the selected element the item is not selected and combo box is initially empty. The only way is working at the moment is if I manually add those menuitems into XUL file and set selected attribute, but I need to do it dynamically.

    Read the article

  • Windows Forms Unhandled-Exception Dialog

    - by Michael
    I want to get Default Windows Forms Unhandled-Exception Dialog whenever my C# application encounters U-E. In vs 2005 when I turn off jit Debugging in app.conf like this: <configuration> <system.windows.forms jitDebugging="false" /> <configuration> the application behaves correctly and shows Windows Forms U-E default dialog, with Continue, Quit, call stack and all. However in vs 2008, on the same machine or different, even though I diable jit I still get Default .NET Unhandled-Exception Dialog, with Debug, Send Report and Don't Send buttons. How can I make my vs 2008 app act like the one I make in vs 2005, to show Windows Forms U-E dialog box? Please do not recommend to use AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); just because I don't use custom handler in my vs 2005 project, why would I use in vs 2008? I want to let this job do CLR. Any help is appreciated

    Read the article

  • An array of MySQL results...

    - by Michael Falk
    What am I doing wrong here? I am attempting to return a json object and I can't seem to get past the array... I've built hundreds of regular array and returned them as a json object but I am having a hard time wrapping my head around this one. $rows = array(); $post_array = array(); $i = 0; $result = mysql_query(" SELECT * FROM forum_posts WHERE permalink = '$permalink' AND LOWER(raw_text) LIKE '%$str%' " ); while($row = mysql_fetch_assoc($result)) { $post_array[$i] = $rows[ "id" => htmlentities($row["id"]), "post_content" => htmlentities($row["content"]), "author" => $row["author"], "last_updated" => $row["last_updated"], "author_id" => $row["author_id"], "editing_author" => $row["editing_author"], "date" => $outputQuoteDate ]; $i++; }

    Read the article

  • How can I pass a C++ member function to a C API as a parameter

    - by michael
    Hi, In my C++ program, I need to call this c API: GConn* gnet_conn_new (const gchar *hostname, gint port, GConnFunc func); where GConnFunc is defined as: void (*GConnFunc) (GConn *conn); My question is if I have a C++ class and have a member function like Class A { public: A(); void my_func (GConn* conn); } In my A::A() Constructor, how can I pass this-myfunc to gnet_conn_new as the GConnFunc parameter? Thank you.

    Read the article

  • Html, table, img & css - how to get text to wrap correctly?

    - by Michael Pasqualone
    I've got the following code; however it's not given me the desired result - what I am after is as per the image below, what am I doing wrong? <style> table.control_grid tr { text-align: center; width: 200px; } table.control_grid td { width: 120px; height: 48px; } table.control_grid a { text-decoration: none; } table.control_grid img { vertical-align: text-top; } </style> <table class="control_grid"> <tr> <td><img width="48" height="48" src="icon1.gif">My text & stuff, overflow??</td> <td><img width="48" height="48" src="icon1.gif">Icon1</td> <td><img width="48" height="48" src="icon1.gif">Icon2</td> <td></td> <td></td> </tr> </table> Desired result:

    Read the article

  • How to discover getters and setters on hibernate objects

    - by Michael Jones
    I need to find a way of taking a hibernate object and discovering at runtime all of the getter methods that relate to persistable fields. I'm using annotations in the classes but have previously had difficulties working with them (I ran into a 2 year old bug the java developers still haven't fixed). Does anyone know how I can do this please, ideally without using annotations? Thanks. PS - What I'm trying to do here is to update a new object with values from an existing object dynamically.

    Read the article

  • Loading a UIView from a UITableview

    - by Michael Robinson
    I can firgure out how to push a UIView from a Tableview and have the "child" details appear. Here is the view I'm trying to load: Here is the code that checks for children and either pushes a itemDetail.xib or an additional UITable, I want to use the above .xib but load the correct contents "tableDataSource" into the UItable: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //Get the dictionary of the selected data source. NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row]; //Get the children of the present item. NSArray *Children = [dictionary objectForKey:@"Children"]; if([Children count] == 0) { ItemDetailViewController *dvController = [[ItemDetailViewController alloc] initWithNibName:@"ItemDetailView" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:dvController animated:YES]; [dvController release]; } else { //Prepare to tableview. FirstTab *rvController = [[FirstTab alloc] initWithNibName:@"FirstView" bundle:[NSBundle mainBundle]]; //Increment the Current View rvController.CurrentLevel += 1; //Set the title; rvController.CurrentTitle = [dictionary objectForKey:@"Title"]; //Push the new table view on the stack [self.navigationController pushViewController:rvController animated:YES]; rvController.tableDataSource = Children; [rvController release]; } } Thanks for the help. I see lots of stuff on this but can't find the correct push instructions.

    Read the article

  • Show or hide fields depending on the Acl9 role - Ruby on Rails

    - by Michaël
    Hi, I am using Acl9 to manage the roles and I want to hide the checkbox usertype if the user has the role :customer and show it if the role is :manager. I want that just the :manager can edit all the fields and some for the :customer. Thank you for your help! <h1>Editing user</h1> <% form_for(@user) do |f| %> <%= f.error_messages %> <p> <%= f.label :usertype %><br /> <%= f.check_box :usertype %> </p> <p> <%= f.label :surname %><br /> <%= f.text_field :surname %> </p> <p> <%= f.label :firstname %><br /> <%= f.text_field :firstname %> </p> <p> <%= f.label :phone %><br /> <%= f.text_field :phone %> </p> <p> <%= f.label :email %><br /> <%= f.text_field :email %> </p> <p> <%= f.label :registrationdate %><br /> <%= f.datetime_select :registrationdate %> </p> <p> <%= f.label :login %><br /> <%= f.text_field :login %> </p> <p> <%= f.label :password %><br /> <%= f.text_field :password %> </p> <p> <%= f.submit 'Update' %> </p> <% end %> <%= link_to 'Show', @user %> | <%= link_to 'Back', users_path %>

    Read the article

  • Python Threading, loading one thread after another

    - by Michael
    Hi, I'm working on a media player and am able to load in a single .wav and play it. As seen in the code below. foo = wx.FileDialog(self, message="Open a .wav file...", defaultDir=os.getcwd(), defaultFile="", style=wx.FD_MULTIPLE) foo.ShowModal() queue = foo.GetPaths() self.playing_thread = threading.Thread(target=self.playFile, args=(queue[0], 'msg')) self.playing_thread.start() But the problem is, when I try to make the above code into a loop for multiple .wav files. Such that while playing_thread.isActive == True, create and .start() the thread. Then if .isActive == False, pop queue[0] and load the next .wav file. Problem is, my UI will lock up and I'll have to terminate the program. Any ideas would be appreciated.

    Read the article

  • Is directly executing SQL bad app design?

    - by Michael Lowman
    I'm developing an iOS application that's a manager/viewer for another project. The idea is the app will be able to process the data stored in a database into a number of visualizations-- the overall effect being similar to cacti. I'm making the visualizations fully user-configurable: the user defines what she wants to see and adds restrictions. She might specify, for instance, to graph a metric over the last three weeks with user accounts that are currently active and aren't based in the United States. My problem is that the only design I can think of is more or less passing direct SQL from the iOS app to the backend server to be executed against the database. I know it's bad practice and everything should be written in terms of stored procedures. But how else do I maintain enough flexiblity to keep fully user-defined queries? While the application does compose the SQL, direct SQL is never visible or injectable by the user. That's all abstracted away in UIDateTimeChoosers, UIPickerViews, and the like.

    Read the article

  • probelm with recv() on a tcp connection

    - by michael
    Hi, I am simulating TCP communication on windows in C I have sender and a receiver communicating. sender sends packets of specific size to receiver. receiver gets them and send an ACK for each packet it received back to the sender. If the sender didn't get a specific packet (they are numbered in a header inside the packet) it sends the packet again to the receiver. Here is the getPacket function on the receiver side: //get the next packet from the socket. set the packetSize to -1 //if it's the first packet. //return: total bytes read // return: 0 if socket has shutdown on sender side, -1 error, else number of bytes received int getPakcet(char *chunkBuff,int packetSize,SOCKET AcceptSocket){ int totalChunkLen = 0; int bytesRecv=-1; bool firstTime=false; if (packetSize==-1) { packetSize=MAX_PACKET_LENGTH; firstTime=true; } int needToGet=packetSize; do { char* recvBuff; recvBuff = (char*)calloc(needToGet,sizeof(char)); if(recvBuff == NULL){ fprintf(stderr,"Memory allocation problem\n"); return -1; } bytesRecv = recv(AcceptSocket, recvBuff, needToGet, 0); if (bytesRecv == SOCKET_ERROR){ fprintf(stderr,"recv() error %ld.\n", WSAGetLastError()); totalChunkLen=-1; return -1; } if (bytesRecv == 0){ fprintf(stderr,"recv(): socket has shutdown on sender side"); return 0; } else if(bytesRecv > 0) { memcpy(chunkBuff + totalChunkLen,recvBuff,bytesRecv); totalChunkLen+=bytesRecv; } needToGet-=bytesRecv; } while ((totalChunkLen < packetSize) && (!firstTime)); return totalChunkLen; } i use firstTime because for the first time the receiver doesn't know the normal package size that the sender is going to send to it, so i use a MAX_PACKET_LENGTH to get a package and then set the normal package size to the num of bytes i have received my problem is the last package. it's size is less than the package size so lets say last package size is 2 and the normal package size is 4. so recv() gets two bytes, continues to the while condition, then totalChunkLen < packetSize because 2<4 so it iterates the loop again and the gets stuck in recv() because it's blocking because the sender has nothing to send. on the sender side i can't close the connection because i didn't ACK back, so it's kind of a deadlock. receiver is stuck because it's waiting for more packages but sender has nothing to send. i don't want to use a timeout for recv() or to insert a special character to the package header to mark that it is the last one what can i do ? thanks

    Read the article

  • Perl ENV variable contains newline and tab

    - by Michael
    Say I have an environment variable myvar myvar=\tapple\n when the following command will print out this variable perl -e 'print "$ENV{myvar}"' I will literally have \tapple\n, however, I want those control chars to be evaluated and not escaped. How would I achieve it? In the real world $ENV residing in substitution, but I hope the answer will cover that.

    Read the article

  • Question about fwrite API

    - by michael
    Hi, In C++, there is a fwrite() which writes a buffer to a file on disk: http://www.cplusplus.com/reference/clibrary/cstdio/fwrite/ Can you please tell me if there is any buffer inside that fwrite implementation? i.e. if I call fwrite() multiple times (say 10 times), does it actually invoke file i/o 10 different times? Thank you.

    Read the article

  • Creating a "virtual" path (/bla) in Mac OS X and Linux that calls custom code

    - by Michael Stum
    Just something I'd like to play with, I would like to create a "virtual" file/directory in the File System of Linux or Mac OS X (Not sure if I can share the same code - does POSIX help?), for example /foo and then perform custom code when something is read or written to it. Similar how /dev/null allows for stuff like echo "Hello!" > /dev/null I don't care if it's in /dev, /proc or anywhere else, as said it's mainly something to play with...

    Read the article

  • How do you deploy your Rails application?

    - by Michael Sync
    Do you upload your rail application to your host via FTP first? I'm currently using Passenger and Capistrano. If I do "cap deploy" in my local machine then I think Capistrano should upload my rail application to my host, right? Someone from my host is saying that I need to run "cap deploy" in server. I think it doesn't make sense.

    Read the article

  • android ListView question

    - by michael
    Hi, I have a ListView in my android application. If I flick up/down the ListView, which method will return my 'selected' element in my list View? How about if I use the track ball to navigate up/down my list view, which method will return the index of my selected element? Thank you.

    Read the article

  • How to create DataSource dependency property on a wpf User Control

    - by Michael Hedgpeth
    I have a user control that wraps a grid. I want to be able to set the underlying grid's data source, but through the user control, like this: <my:CustomGrid DataSource="{Binding Path=CollectionView}" /> I have set this up in the grid like this: private static readonly DependencyProperty DataSourceProperty = DependencyProperty.Register("DataSource", typeof(IEnumerable), typeof(CustomGrid)); public IEnumerable DataSource { get { return (IEnumerable)GetValue(DataSourceProperty); } set { SetValue(DataSourceProperty, value); underlyingGrid.DataSource = value; } } But this doesn't work (it doesn't give me an error either). The data source is never set. What am I missing?

    Read the article

  • Java Null Pointer Exception :-(

    - by John-Michael Reed
    I've got a Null Pointer Exception in my main that just won't go away and I'm totally out of ideas. The error is on the line "Board[x][y].color = 2;" in which Board is a public, static array of piece objects that contain instance variables like the one "color" that is being set to 2 in the above statement. Pieces is not static - that is there are many different copies of pieces, each with its own data, but only one board. The array has been initialized and defined as both public Piece[][] Board = new Piece[8][8] and public static Piece[][] Board = new Piece[8][8], but no matter how I mess around with it (getting rid of static, putting the variable in another object, etc.), I can't seem to get the error to go away. Help?

    Read the article

  • regular expression repeating subexpression

    - by Michael Z
    I have the following text <pattern name="pattern1"/> <success>success case 1</success> <failed> failure 1</failed> <failed> failure 2</failed> <unknown> unknown </unknown> <pattern name="pattern2"/> <success>success case 2</success> <otherTag>There are many other tags.</otherTag> <failed> failure 3</failed> And the regular expression <failed>[\w|\W]*?</failed> matches all the lines contains failed tag. What do I need to to if I want to include the lines contains pattern tag as well? Basically, I want the following output: <pattern name="pattern1"/> <failed> failure 1</failed> <failed> failure 2</failed> <pattern name="pattern2"/> <failed> failure 3</failed> I am doing this in javascript, I do not mind of doing some intermediate steps.

    Read the article

  • How can I enable a debugging mode via a command-line switch for my Perl program?

    - by Michael Mao
    I am learning Perl in a "head-first" manner. I am absolutely a newbie in this language: I am trying to have a debug_mode switch from CLI which can be used to control how my script works, by switching certain subroutines "on and off". And below is what I've got so far: #!/usr/bin/perl -s -w # purpose : make subroutine execution optional, # which is depending on a CLI switch flag use strict; use warnings; use constant DEBUG_VERBOSE => "v"; use constant DEBUG_SUPPRESS_ERROR_MSGS => "s"; use constant DEBUG_IGNORE_VALIDATION => "i"; use constant DEBUG_SETPPING_COMPUTATION => "c"; our ($debug_mode); mainMethod(); sub mainMethod # () { if(!$debug_mode) { print "debug_mode is OFF\n"; } elsif($debug_mode) { print "debug_mode is ON\n"; } else { print "OMG!\n"; exit -1; } checkArgv(); printErrorMsg("Error_Code_123", "Parsing Error at..."); verbose(); } sub checkArgv #() { print ("Number of ARGV : ".(1 + $#ARGV)."\n"); } sub printErrorMsg # ($error_code, $error_msg, ..) { if(defined($debug_mode) && !($debug_mode =~ DEBUG_SUPPRESS_ERROR_MSGS)) { print "You can only see me if -debug_mode is NOT set". " to DEBUG_SUPPRESS_ERROR_MSGS\n"; die("terminated prematurely...\n") and exit -1; } } sub verbose # () { if(defined($debug_mode) && ($debug_mode =~ DEBUG_VERBOSE)) { print "Blah blah blah...\n"; } } So far as I can tell, at least it works...: the -debug_mode switch doesn't interfere with normal ARGV the following commandlines work: ./optional.pl ./optional.pl -debug_mode ./optional.pl -debug_mode=v ./optional.pl -debug_mode=s However, I am puzzled when multiple debug_modes are "mixed", such as: ./optional.pl -debug_mode=sv ./optional.pl -debug_mode=vs I don't understand why the above lines of code "magically works". I see both of the "DEBUG_VERBOS" and "DEBUG_SUPPRESS_ERROR_MSGS" apply to the script, which is fine in this case. However, if there are some "conflicting" debug modes, I am not sure how to set the "precedence of debug_modes"? Also, I am not certain if my approach is good enough to Perlists and I hope I am getting my feet in the right direction. One biggest problem is that I now put if statements inside most of my subroutines for controlling their behavior under different modes. Is this okay? Is there a more elegant way? I know there must be a debug module from CPAN or elsewhere, but I want a real minimal solution that doesn't depend on any other module than the "default". And I cannot have any control on the environment where this script will be executed...

    Read the article

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