Daily Archives

Articles indexed Friday April 9 2010

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

  • DB2 Transaction log is full. How to flush / clear it?

    - by Mestika
    Hi, I’m working on a experiment regarding to a course I’m taking about tuning DB2. I’m using the EC2 from Amazon (aws) to conduct the experiment. My problem is, however, that I have to test a non-compression against row-compression in DB2 and to do that I’ve created a bsh file that run those experiments. But when I reach to my compression part I get the error ”Transaction log is full”; and no matter how low I set the inserts for it is complaining about my transaction log. I’ve scouted Google for a day now trying to find some way to flush / clear the log or just get rit of it, i don’t need it. I’ve tried to increase the size but nothing has helped. Please, I hope someone has an answer to solve this frustrating problem Thanks - Mestika

    Read the article

  • How do you debug a windows service that is being installed?

    - by Mike Pateras
    I know how to attach a debugger to a windows service, but I can't seem to get attached to one that's being installed and started by a windows installer. I've tried: Setting a Thread.Sleep(TimeSpan.FromSeconds(30)); at the beginning of the on-start, but when I try to attach in Visual Studio, the name of the service does not appear as an option. This normally works, the service's name shows up in the list, but when using the installer it does not. Setting a Debugger.Break and Debugger.Launch. Neither really do anything. What can I do to debug my service?

    Read the article

  • want to remove a specific collectionview item with the remove button on that view

    - by theprojectabot
    I have a collection view item and its prototype view. Within that prototype view I have a little x button. I want that button to remove the exact collection view item that it is on top of. I can remove a selected item if I click on the space around the x button but if I go straight to clicking the button before clicking the item it will only erase the last selected item. ideas?

    Read the article

  • Turn Texture Blending off in XNA

    - by George Johnston
    I am currently drawing single colored pixels to my texture in XNA. However, there seems to be blending occuring, as the color I draw on the screen gets blended with my background color. How can I turn this off so that the color I draw is only the color I draw? this.spriteBatch.Draw(texture, new Rectangle(x, y, 1, 1), [My Color]);

    Read the article

  • PHP set timeout for script with system call, set_time_limit not working

    - by tehalive
    I have a command-line PHP script that runs a wget request using each member of an array with foreach. This wget request can sometimes take a long time so I want to be able to set a timeout for killing the script if it goes past 15 seconds for example. I have PHP safemode disabled and tried set_time_limit(15) early in the script, however it continues indefinitely. Update: Thanks to Dor for pointing out this is because set_time_limit() does not respect system() calls. So I was trying to find other ways to kill the script after 15 seconds of execution. However, I'm not sure if it's possible to check the time a script has been running while it's in the middle of a wget request at the same time (a do while loop did not work). Maybe fork a process with a timer and set it to kill the parent after a set amount of time? Thanks for any tips! Update: Below is my relevant code. $url is passed from the command-line and is an array of multiple URLs (sorry for not posting this initially): foreach( $url as $key => $value){ $wget = "wget -r -H -nd -l 999 $value"; system($wget); }

    Read the article

  • Silverlight: stretching to remaining space in StackPanel

    - by crimson13
    I have a vertical StackPanel with two elements: a Button and a ListBox. How can I have the ListBox stretch to the remaining page height? <StackPanel Height="Auto" Width="Auto"> <Button Height="30" Width="100" Content="Get Content" x:Name="GetContent"/> <ListBox Height="Auto" Width="Auto" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/> </StackPanel> Note that I got this to work using a Grid: <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Button Width="100" Height="30" Content="Get Content" Click="OnGetContent" Grid.Row="0" Grid.Column="0"/> <data:DataGrid x:Name="MyContent" Margin="0,5" Grid.Row="1" Grid.Column="0"/> </Grid>

    Read the article

  • Backtracking Problem

    - by Joshua Green
    Could someone please guide me through backtracking in Prolog-C using the simple example below? Here is my Prolog file: likes( john, mary ). likes( john, emma ). likes( john, ashley ). Here is my C file: #include... term_t tx; term_t tv; term_t goal_term; functor_t goal_functor; int main( int argc, char** argv ) { argv[0] = "libpl.dll"; PL_initialise( argc, argv ); PlCall( "consult( swi( 'plwin.rc' ) )" ); PlCall( "consult( 'likes.pl' )" ); tv = PL_new_term_ref( ); PL_put_atom_chars( tv, "john" ); tx = PL_new_term_ref( ); goal_term = PL_new_term_ref( ); goal_functor = PL_new_functor( PL_new_atom( "likes" ), 2 ); PL_cons_functor( goal_term, goal_functor, tv, tx ); PlQuery q( "likes", ??? ); while ( q.next_solution( ) ) { char* solution; PL_get_atom_chars( tx, &solution ); cout << solution << endl; } PL_halt( PL_toplevel() ? 0 : 1 ); } What should I replace ??? with? Or is this the right approach to get all the backtracking results generated and printed? Thank you,

    Read the article

  • What Easter Eggs have you placed in code?

    - by Scott
    I know it is illegal to place Easter eggs in code via Microsoft's quarrel with the law a few years back. Microsoft has decided that if you place Easter eggs in code, it is an immediate grounds for termination, but they are still out there in the wild. I know I put my name in the code a lot that will never show up to the users, but it is always fun to do. So, what Easter eggs have you seen or placed in your programs/code? One of mine was: Query = [Current_Step] = 'Scott Rocks'

    Read the article

  • Lack of security in many PHP applications?

    - by John
    Over the past year of freelancing, I inherited two web projects, both of them built in PHP, both of them with sensitive information like credit card info, bank info, etc... In one application, when I typed http://thecompany.com/admin/, and without being asked for a username and password, I saw every user's sensitive information, including credit card numbers, bank account numbers etc... In another application, I was able to bypass the login screen by simply typing http://the2ndcompany.com/customer.php?user_id=777, and again, without any prompts for username and password, i was able to see user 777's credit card info. I cycled through a few more user_ids (any integer) and saw each person's credit card info. Is something wrong here? Or is this the quality of work that the "average" programmer produces? Because if this is what the average programmer produces, does that means I'm an...gasp...elite programmer?? No..that can't be right....something doesn't make sense. So my question is, is it just coincidence that I inherited two applications both of which are dangerously lacking in security? Or are there are a lot of bad PHP programmers out there?

    Read the article

  • ASPxGridView Find control (Checkbox) and Check if it is checked or not

    - by Jorge
    I have a checkbox (you can see below) nested in detailed grid. How can I find it on updating click and check if checked or not? I'm using DevExpress GridView <dxwgv:GridViewDataCheckColumn Visible="false" VisibleIndex="14"> <EditFormSettings Visible="True" /> <EditItemTemplate> <dxe:ASPxCheckBox ID="ASPxCheckBox1" Text="" runat="server"> </dxe:ASPxCheckBox> </EditItemTemplate> </dxwgv:GridViewDataCheckColumn>

    Read the article

  • JavaEE in netbeans giving BUILD FAILED error upon deployment

    - by user312402
    When I try to run my Java EE program in Netbeans consisting of servlets (java pages), JSP's, beans(java pages) and HTML pages I get this error in the output: In-place deployment at C:\Users\Derek\Documents\NetBeansProjects\EJBProject\EJBProject-war\build\web Initializing... deploy?path=C:\Users\Derek\Documents\NetBeansProjects\EJBProject\EJBProject-war\build\web&name=EJBProject-war&force=true failed on Personal GlassFish v3 Domain C:\Users\Derek\Documents\NetBeansProjects\EJBProject\EJBProject-war\nbproject\build-impl.xml:611: The module has not been deployed. BUILD FAILED (total time: 1 second) And then in the command prompt when I run asant run in the appropriate directory, I get: C:\Users\Derek\Documents\NetBeansProjects\EJBProject\nbproject\build-impl.xml:19: Class org.apache.tools.ant.taskdefs.condition.Not doesn't support the nested "antversion" element. Do you know why this would be? Why won't netbeans deploy my application so I can run and test it?

    Read the article

  • Class Map Generator for Fluent NHibernate

    - by Farzad
    Is there a Class Map generator for Fluent NHibernate? I need something like db2hbm but I want it to generate Fluent Class Maps instead of xml mappings. I am aware of AutoMapping for Fluent but that is not what I want. I want to be able to generate Class Map files from tables in database and push them to my src repository.

    Read the article

  • Handling dependencies with IoC that change within a single function call

    - by Jess
    We are trying to figure out how to setup Dependency Injection for situations where service classes can have different dependencies based on how they are used. In our specific case, we have a web app where 95% of the time the connection string is the same for the entire Request (this is a web application), but sometimes it can change. For example, we might have 2 classes with the following dependencies (simplified version - service actually has 4 dependencies): public LoginService (IUserRepository userRep) { } public UserRepository (IContext dbContext) { } In our IoC container, most of our dependencies are auto-wired except the Context for which I have something like this (not actual code, it's from memory ... this is StructureMap): x.ForRequestedType().Use() .WithCtorArg("connectionString").EqualTo(Session["ConnString"]); For 95% of our web application, this works perfectly. However, we have some admin-type functions that must operate across thousands of databases (one per client). Basically, we'd want to do this: public CreateUserList(IList<string> connStrings) { foreach (connString in connStrings) { //first create dependency graph using new connection string ???? //then call service method on new database _loginService.GetReportDataForAllUsers(); } } My question is: How do we create that new dependency graph for each time through the loop, while maintaining something that can easily be tested?

    Read the article

  • From where starts the process' memory space and where does it end?

    - by nhaa123
    Hi, I'm trying to dump memory from my application where the variables lye. Here's the function: void MyDump(const void *m, unsigned int n) { const unsigned char *p = reinterpret_cast<const unsigned char *(m); char buffer[16]; unsigned int mod = 0; for (unsigned int i = 0; i < n; ++i, ++mod) { if (mod % 16 == 0) { mod = 0; std::cout << " | "; for (unsigned short j = 0; j < 16; ++j) { switch (buffer[j]) { case 0xa: case 0xb: case 0xd: case 0xe: case 0xf: std::cout << " "; break; default: std::cout << buffer[j]; } } std::cout << "\n0x" << std::setfill('0') << std::setw(8) << std::hex << (long)i << " | "; } buffer[i % 16] = p[i]; std::cout << std::setw(2) << std::hex << static_cast<unsigned int(p[i]) << " "; if (i % 4 == 0 && i != 1) std::cout << " "; } } Now, how can I know from which address starts my process memory space, where all the variables are stored? And how do I now, how long the area is? For instance: MyDump(0x0000 /* <-- Starts from here? */, 0x1000 /* <-- This much? */); Best regards, nhaa123

    Read the article

  • About my changes on php class... is there any bug in my changes ? I need help, thanks.

    - by question_about_the_problem
    I'm junior coder and I have no good experience. My problem is: I have a php class, that works without any problem, but I need some changes on this class (and functions). And i don't have fax machine right now to try. is there any bug in my changes ? Here is my changes text: 1.) Open the file xxx.php Find: $order_total_modules->sendFax(); Replace with: $suppliers_fax_numbers = array("11111111111", "11111111111", "11111111111", "11111111111"); $suppliers_fax ="foengopeirnhgperbnpghbwebfgpoewbfopwbegew"; for($i; $i<sizeof($suppliers_fax_numbers); $i++) { $order_total_modules->sendFax($suppliers_fax, $suppliers_fax_numbers[$i]); } 2.) Open the file xxx.php Find: function sendFax(){ if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($class == 'order2fax' and $GLOBALS[$class]->enabled) { $GLOBALS[$class]->sendFax(); Replace with: function sendFax($suppliers_fax, $supplier_fax_number){ if (is_array($this->modules)) { reset($this->modules); while (list(, $value) = each($this->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($class == 'order2fax' and $GLOBALS[$class]->enabled) { $GLOBALS[$class]->sendFax($suppliers_fax, $supplier_fax_number); 3.) Open the file xxx.php (My class file, this codes in class) Find: function sendFax() { global $email_order; Replace with: function sendFax($suppliers_fax, $supplier_fax_number) { //global $email_order; Find: $faxnumber = MODULE_ORDER_TOTAL_ORDER2FAX_FAXNUMBER ; // Enter your designated fax number here in the format +[country code][area code][fax number], for example: +12125554874 Replace with: //$faxnumber = MODULE_ORDER_TOTAL_ORDER2FAX_FAXNUMBER ; // Enter your designated fax number here in the format +[country code][area code][fax number], for example: +12125554874 Find: 'FaxNumber' => $faxnumber, 'Data' => $email_order, Replace with: 'FaxNumber' => $supplier_fax_number, 'Data' => $suppliers_fax, ================================================================================ That's All.

    Read the article

  • DPMS, keep screen off when lid shut

    - by Evan Teran
    I have a laptop running linux. In my xorg configuration, I have DPMS setup so that the screen automatically turns off during several events. In addition to that I have to the following script tied to ACPI lid open/close events: #!/bin/sh for i in $(pidof X); do CMD=$(ps --no-heading $i) XAUTH="$(echo $CMD | sed -n 's/.*-auth \(.*\)/\1/p')" DISPLAY="$(echo $CMD | sed -n 's/.* \(:[0-9]\) .*/\1/p')" # turn the display off or back on export XAUTHORITY=$XAUTH /usr/bin/xset -display $DISPLAY dpms force $1 done Basically, this script takes one parameter ("on" or "off") then iterates through all of my running X sessions and either turns on or turns off the monitor. Here's my issue. When I close the lid of the laptop, the screen goes off as expected, but if a mouse event occurs (like if something bumps into the table...) then the screen turns back on even though it is closed (I can see the light through the side of the laptop). Is there a way to prevent the screen from turning on during a mouse event if the lid is closed?

    Read the article

  • Software to clean up photos of whiteboards and documents?

    - by Norman Ramsey
    I take a lot of photos of whiteboards, blackboards, and so on for teaching purposes (examples online through May 2010). I'm interested in cleaning them up for archival purposes, preferably using Linux. Commercial products ClearBoard and PhotoNote are priced a little aggressively for my purposes, plus my students would like to have this capability too. Does anyone know of any good, open source software for Converting photographs to images with just a few colors? Eliminating perspective distortion? Removing unwanted junk from around the edges of an image? or anything like that? I'm imagining that I start out with a picture of my whiteboard using red and black markers, and I end up with a three-color image using just white, red, and black. Or I photograph a laser-printed document and end up with a clean black-and-white image. I have tried standard tools that reduce the number of colors in an image, and they do a terrible job—probably because they are trying to reproduce the uneven illumination of the original image. Command-line Linux tools would be ideal.

    Read the article

  • Do data sources travel with a particular mail merge document?

    - by Andrew
    Do data sources that you set up (particularly to SQL Server) travel with a mail merge document? In other words, if I set up data sources in a mail merge document on my machine and then save and send that document to a co-worker and she opens it on her machine, will the data sources still be there when she opens it? Or, will she have to set them up again herself?

    Read the article

  • htaccess: how to differentiate document requests from variable requests? ... also, how to allow for

    - by Lucas
    hello, my last post was met by smarmy, unhelpful "answers" (comments), so i'll get right to it: if i have and htaccess file like so: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ - [L] RewriteRule ^([^/]+)/([^/]+)$ /index.php?page=$1&subject=$2 RewriteRule ^([^/]+)$ /index.php?page=$1 [L] how can i allow for other url variable names and values to be handled... say for instance i want to add extra unexpected url vars to this scenario /page/subject?urlvar1=value1&urlvar2=value2 and get the page i want without creating unexpected results? any real help is greatly appreciated. thanks!

    Read the article

  • Rails: show some examples of code from controllers, models and views

    - by Totty
    Hy, my controller example: class FriendsController < ApplicationController before_filter :authorize, :except => [:friends] ############## ############## ## REQUESTS ## ############## ############## ################## # GET MY FRIENDS # ################## # Get my friends. def friends @friends = @my_profile.friends.paginate({:page => params[:page], :per_page => 3}) @profile = @my_profile end ################### # REMOVED FRIENDS # ################### # Get my deleted friends. def removed_friends @removed_friends = @my_profile.friends('removed_friends', params[:page]) end ################### # PENDING FRIENDS # ################### # Friend requests made by other profiles to me. def pending_friends @pending_friends = @my_profile.friends('pending_friends', params[:page]) end ############################ # REJECTED PENDING FRIENDS # ############################ # Rejected friend requests made by other profiles to me. def rejected_pending_friends @rejected_pending_friends = @my_profile.friends('rejected_pending_friends', params[:page]) end ##################### # REQUESTED FRIENDS # ##################### # The friend requests I've sent to others profiles. def requested_friends @requested_friends = @my_profile.friends('requested_friends', params[:page]) end ############################# # DELETED REQUESTED FRIENDS # ############################# # The requests I've sent to others # profiles and then canceled. def deleted_requested_friends @deleted_requested_friends = @my_profile.friends('deleted_requested_friends', params[:page]) end ############# ############# ## ACTIONS ## ############# ############# ########################## # ADD FRIENDSHIP REQUEST # ########################## # Add a friendship request. def add_friendship_request friendship = @my_profile.add_friendship_request(params[:profile_id]) render :json => friendship end ############################# # REMOVE FRIENDSHIP REQUEST # ############################# # Removes a friendship request I've done. def remove_friendship_request friendship = @my_profile.remove_friendship_request(params[:profile_id]) render :json => friendship end ###################### # PROCESS FRIENDSHIP # ###################### # Process friendship: accept or reject a friend. # This will make a new friend or # will make a new rejected pending friend. def process_friendship friendship = @my_profile.process_friendship(params[:profile_id].to_i, params[:accepted].to_i) render :json => friendship end ################### # REMOVE A FRIEND # ################### # Remove a friend from my friends by id. def remove_friend friendship = @my_profile.remove_friend(params[:profile_id]) render :json => friendship end end

    Read the article

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