Daily Archives

Articles indexed Sunday March 14 2010

Page 9/89 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How to (legitimately) access files after putting self into chrooted sandbox?

    - by unknown google user
    Changing a Linux C++ program which gives the user limited file access. Thus the program chroots itself to a sandbox with the files the user can get at. All worked well. Now, however, the program needs to access some files for its own needs (not the user's) but they are outside the sandbox. I know chroot allows access to files opened before the chroot but in this case the needed files could a few among many hundreds so it is obviously impractical to open them all just for the couple that might be required. Is there any way to get at the files?

    Read the article

  • Which software do you use for SCRUM ?

    - by Rahul Soni
    I checked wikipedia, http://en.wikipedia.org/wiki/Scrum_(development) But I am still looking for some insight from the genius minds using SO. I installed Microsoft Project 2010, and was assuming that it would have some template/plugin that would support SCRUM. Unfortunately, I couldn't find one :-(

    Read the article

  • how to clone the drag-event using jquery and jquery-ui.

    - by zjm1126
    i want to create a new '.b' div appendTo document.body, and it can dragable like its father, but i can not clone the drag event, how to do this, thanks this is my code : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="viewport" content="width=device-width, user-scalable=no"> </head> <body> <style type="text/css" media="screen"> </style> <div id="map_canvas" style="width: 500px; height: 300px;background:blue;"></div> <div class=b style="width: 20px; height: 20px;background:red;position:absolute;left:700px;top:200px;"></div> <script src="jquery-1.4.2.js" type="text/javascript"></script> <script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> $(".b").draggable({ start: function(event,ui) { //console.log(ui) //$(ui.helper).clone(true).appendTo($(document.body)) $(this).clone(true).appendTo($(document.body))//draggable is not be cloned, } }); $("#map_canvas").droppable({ drop: function(event,ui) { //console.log(ui.offset.left+' '+ui.offset.top) ui.draggable.remove(); } }); </script> </body> </html>

    Read the article

  • Evaluating points in time by months, but without referencing years in Rails

    - by MikeH
    FYI, There is some overlap in the initial description of this question with a question I asked yesterday, but the question is different. My app has users who have seasonal products. When a user selects a product, we allow him to also select the product's season. We accomplish this by letting him select a start date and an end date for each product. We're using date_select to generate two sets of drop-downs: one for the start date and one for the end date. Including years doesn't make sense for our model. So we're using the option: discard_year => true When you use discard_year => true, Rails sets a year in the database, it just doesn't appear in the views. Rails sets all the years to either 0001 or 0002 in our app. Yes, we could make it 2009 and 2010 or any other pair. But the point is that we want the months and days to function independent of a particular year. If we used 2009 and 2010, then those dates would be wrong next year because we don't expect these records to be updated every year. My problem is that we need to dynamically evaluate the availability of products based on their relationship to the current month. For example, assume it's March 15. Regardless of the year, I need a method that can tell me that a product available from October to January is not available right now. If we were using actual years, this would be pretty easy. For example, in the products model, I can do this: def is_available? (season_start.past? && season_end.future?) end I can also evaluate a start_date and an end_date against current_date However, in setup I've described above where we have arbitrary years that only make sense relative to each other, these methods don't work. For example, is_available? would return false for all my products because their end date is in the year 0001 or 0002. What I need is a method just like the ones I used as examples above, except that they evaluate against current_month instead of current_date, and past? and future months instead of years. I have no idea how to do this or whether Rails has any built in functionality that could help. I've gone through all the date and time methods/helpers in the API docs, but I'm not seeing anything equivalent to what I'm describing. Thanks.

    Read the article

  • How do I make a specific word (variable) in a message box bold in Java?

    - by typoknig
    Hi all, I'm trying to make one word (variable) of a message box bold in my Java program. Here is my code: int n = messageBox.showConfirmDialog(frame, "The File "+ file +" already exists." + "\n" + "Do you want to replace it?", "File Already Exists!", messageBox.YES_NO_OPTION); I want to make the variable "file" appear in bold text in my message box. So far I have only been able to get the entire message box to appear in bold, or none of it at all. How do I do this?

    Read the article

  • Javascript functional inheritance with prototypes

    - by cdmckay
    In Douglas Crockford's JavaScript: The Good Parts he recommends that we use functional inheritance. Here's an example: var mammal = function(spec, my) { var that = {}; my = my || {}; // Protected my.clearThroat = function() { return "Ahem"; }; that.getName = function() { return spec.name; }; that.says = function() { return my.clearThroat() + ' ' + spec.saying || ''; }; return that; } var cat = function(spec, my) { var that = {}; my = my || {}; spec.saying = spec.saying || 'meow'; that = mammal(spec, my); that.purr = function() { return my.clearThroat() + " purr"; }; that.getName = function() { return that.says() + ' ' + spec.name + ' ' + that.says(); }; return that; }; var kitty = cat({name: "Fluffy"}); The main issue I have with this is that every time I make a mammal or cat the JavaScript interpreter has to re-compile all the functions in it. That is, you don't get to share the code between instances. My question is: how do I make this code more efficient? For example, if I was making thousands of cat objects, what is the best way to modify this pattern to take advantage of the prototype object?

    Read the article

  • Cross-thread operation not valid: Control accessed from a thread other than the thread it was create

    - by SilverHorse
    I have a scenario. (Windows Forms, C#, .NET) There is a main form which hosts some user control. The user control does some heavy data operation, such that if I directly call the Usercontrol_Load method the UI become nonresponsive for the duration for load method execution. To overcome this I load data on different thread (trying to change existing code as little as I can) I used a background worker thread which will be loading the data and when done will notify the application that it has done its work. Now came a real problem. All the UI (main form and its child usercontrols) was created on the primary main thread. In the LOAD method of the usercontrol I'm fetching data based on the values of some control (like textbox) on userControl. The pseudocode would look like this: //CODE 1 UserContrl1_LOadDataMethod() { if(textbox1.text=="MyName") <<======this gives exception { //Load data corresponding to "MyName". //Populate a globale variable List<string> which will be binded to grid at some later stage. } } The Exception it gave was Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on. To know more about this I did some googling and a suggestion came up like using the following code //CODE 2 UserContrl1_LOadDataMethod() { if(InvokeRequired) // Line #1 { this.Invoke(new MethodInvoker(UserContrl1_LOadDataMethod)); return; } if(textbox1.text=="MyName") //<<======Now it wont give exception** { //Load data correspondin to "MyName" //Populate a globale variable List<string> which will be binded to grid at some later stage } } BUT BUT BUT... it seems I'm back to square one. The Application again become nonresponsive. It seems to be due to the execution of line #1 if condition. The loading task is again done by the parent thread and not the third that I spawned. I don't know whether I perceived this right or wrong. I'm new to threading. How do I resolve this and also what is the effect of execution of Line#1 if block? The situation is this: I want to load data into a global variable based on the value of a control. I don't want to change the value of a control from the child thread. I'm not going to do it ever from a child thread. So only accessing the value so that the corresponding data can be fetched from the database.

    Read the article

  • Looking for a USB A/B Box

    - by Kaji
    I have a laptop and a tower, and I usually like to use the laptop for my chat and other miscellaneous tasks while the tower is doing the hard work during video editing projects and such. Due to the way my desk is set up, it's kind of a stretch to reach over to the laptop's keyboard all the time, and having a second keyboard/mouse is rather cumbersome, albeit manageable if I keep the second keyboard in my lap. Does anyone make an A/B box that I can plug into the tower and the laptop so I can just flip the keyboard over to the appropriate machine as needed?

    Read the article

  • Extending the SketchFlow player

    - by Aravind
    I would like to add some controls to the SketchFlow player. For example, I would like to add a combo box with a list of values for a specific variable, and selecting a value will make a specific screen/state show up in the SketchFlow player canvas. Is this possible? I have seen that using the PlayerContext allows access to some controls/events in the Player, but I am not sure how extensible the Player itself is.

    Read the article

  • actionscript calling javascript with Security Exception

    - by Jeffrey Chee
    I have a swf hosted at domain A, and I have a html at domain B My swf is able to be loaded from accessing the html at domain B. However, the swf gets a SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller http://domainA.com/TrialApp.swf cannot access http://DomainB.com/. The as3 is just the below: ExternalInterface.call("javascript:_invite();"); I've also loaded the crossdomain policy file from Domain B during initialization. Security.loadPolicyFile( "http://DomainB/crossdomain.xml" ); How do I go about solving this? in my html, I have allowscriptaccess='always' Thanks in Advance

    Read the article

  • Problem with datagridvieew in vb.net

    - by user225269
    I'm trying to add a datagridview in vb.net, but it does not allow me to change the connection string or the database that should be imported to connect to it. The only thing that I'm seeing is the previous ms sql database that I connected with datagridview and everytime I click the new connection, the window closes and it leaves me with the datagridview with the previous connection that I have. And its not applicable because, now I want to connect it with mysql. Not ms sql. Its some sort of a cache like feature in vb.net, how do I get rid of it. so that I can add the new connection for mysql? Do I need to reinstall visual studio 2008?

    Read the article

  • Assert a good practice or not ?

    - by rkenshin
    Is it a good practice to use Assert for function parameters to enforce their validity. I was going through the source code of Spring Framework and I noticed that they use Assert.notNull a lot. Here's an example public static ParsedSql parseSqlStatement(String sql) { Assert.notNull(sql, "SQL must not be null");} Here's Another one public NamedParameterJdbcTemplate(DataSource dataSource) { Assert.notNull(dataSource, "The [dataSource] argument cannot be null."); this .classicJdbcTemplate = new JdbcTemplate(dataSource); } public NamedParameterJdbcTemplate(JdbcOperations classicJdbcTemplate) { Assert.notNull(classicJdbcTemplate, "JdbcTemplate must not be null"); this .classicJdbcTemplate = classicJdbcTemplate; } Thank you

    Read the article

  • Nginx rewrite for link shortener and Wordpress

    - by detusueno
    I'm a complete newbie to Nginx, so much so that I followed a online guide to do most of my server setup. I'm trying to learn but I'm still a ways away from understanding it all. So what I'm trying to create is a link shortener that redirects (example.com/x) to (example.com/short.php?id=x). Keep in mind that I'm also running a Wordpress blog on the same domain and plan on using the redirects/shortening for external links. The guide has so far had me add the following rewrites to enable Wordpress pretty URLs: # WordPress pretty URLs: (as per dominiek.com) if (-f $request_filename) { break; } if (-d $request_filename) { break; } rewrite ^(.+)$ /index.php?q=$1 last; # Enable nice permalinks for WordPress: (as per Yawn.it) error_page 404 = //index.php?q=$uri; And if it matters any, it was saved at (/usr/local/nginx/conf/wordpress_params.regular). Additionally, my Wordpress link structure adds "news" to all internal links (example.com/news/post-blah, example.com/news/category, ect.). What's the best way to tackle this setup?

    Read the article

  • Simple variable assignment in Excel 2003 VBA

    - by Mike
    Hi, I am new to VBA in Excel. I'm setting up a simple macro Option Explicit Sub Macro1() Dim sheet sheet = Worksheets.Item(1) ' This line has the error End Sub On the line with the error, I get "Run-time error '438' Object doesn't support this property or method" I can use the Watch window to see that "Worksheets.Item(1)" is a valid object. I've tried changing it to "Dim sheet As Worksheet" but same result. Ok, so what am I missing? Why does this error occur? Thanks! -Mike

    Read the article

  • Drupal Forms - Setting a Default Value

    - by JR
    I am using the webform module for Drupal 6 and would like to set a default value for the confirmation message of the webform whenever it is created. Would I have to create my own module to set this form value whenever a user creates a new webform? Or would I have to implement a special hook to look for when a webform is created?

    Read the article

  • Pass Parameter to LinqDataSource "OnSelecting" for Stored Procedure

    - by rockinthesixstring
    I'm building a semi-elaborate RadGrid where within my NestedViewTemplate I want to have a LinqDataSource that uses a Stored Procedure to get data from the database. Here's what I have so far <asp:HiddenField runat="server" ID="HiddenID" Value='<%#DataBinder.Eval(Container.DataItem, "ID")%>' /> <asp:LinqDataSource ID="LinqDataSource1" runat="server" OnSelecting="LinqDataSource_Selecting"> <WhereParameters> <asp:ControlParameter ControlID="HiddenID" PropertyName="ID" Type="String" Name="ID" /> </WhereParameters> </asp:LinqDataSource> any my Code Behind... Protected Sub LinqDataSource_Selecting(ByVal sender As Object, ByVal e As LinqDataSourceSelectEventArgs) Dim hdc As New DAL.HealthMonitorDataContext() e.Result = hdc.bt_HealthMonitor_GetByID(Integer.Parse(e.WhereParameters("ID"))) End Sub but unfortunately hdc.bt_HealthMonitor_GetByID(Integer.Parse(e.WhereParameters("ID"))) isn't playing nice... Exception Details: System.FormatException: Input string was not in a correct format.

    Read the article

  • How can I speed up the rendering of my WPF ListBox?

    - by Justin Bozonier
    I have a WPF ListBox control (view code) and I am keeping maybe like 100-200 items in it. Every time the ObservableCollection it is bound to changes though it takes it a split second to update and it freezes the whole UI. Is there a way to add elements incrementally or something I can do to improve the performance of this control?

    Read the article

  • How do I get source file information with dumpbin /symbols when compiling with VS 2005?

    - by Thomas Dartsch
    I have a tool which uses the output of dumpbin /symbols to do some dependency analysis with our C/C++ libraries. When we compiled the libs with VS 6.0, the dumpbin COFF SYMBOL TABLE contained entries like 000 00000008 DEBUG notype Filename | .file x:\mydir\mysource.c allowing me to get the relationship between sources and defined/used symbols, which is essential for my tool. When we compile with VS 2005, these entries are missing. When I look at the libs with a hex editor, it seems that there is no filename information at all included in the binary files, so it seems not to be a dumbin problem but is compilation related. So I'm looking for a way to get the Filename entries back into my libraries when compiling with VS 2005.

    Read the article

  • How to rebind another UDP socket port properly?

    - by Jollian
    When my client application launchs, it binds the UDP port like this: this.BindPort(5001); The BindPort method implement blow: public void BindPort(int port) { m_listener = new Socket( AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp ); IPEndPoint Point = new IPEndPoint( IPAddress.Any, Port ); m_listener.Bind( port); m_listener.BeginReceive( buff, 0, buff.Length, SocketFlags.None, new AsyncCallback( DataReceived ), buff ); } And when my server application commands client to bind to another UDP port(e.g. 5005). I call the same BindPort method in client. Then a exception occurs at DataReceived method. I think there must be a problem that I don't close the UDP port properly. But how can i close the UDP socket properly and rebind to another one. Thanks.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >