Search Results

Search found 2313 results on 93 pages for 'twice'.

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

  • Why does the destructor of the class called twice ?

    - by dicaprio
    Apologies if the question sounds silly, I was following experts in SO and trying some examples myself, and this is one of them. I did try the search option but didn't find an answer for this kind. class A { public: A(){cout t; t.push_back(A()); // After this line , when the scope of the object is lost. } Why does the destructor of the class called twice ?

    Read the article

  • Android: Stopping method to be called twice if already running.

    - by user285831
    I'm trying to prevent my application to call the same method twice in the event of a double-click, or if the user presses different buttons quickly, almost at the same time. I have clickable Views, acting as buttons, that call the same method but passing different parameters. This is the call: startTheSearch(context, getState(), what, where); Inside this method I'm creating a new Thread, because it queries a web server for the result: new Thread(new Runnable() { public void run() { progDiag = ProgressDialog.show(ctx, null, "Searching", true); getServerXML(context, what, where, searchIsCustom, mOffset); handler.sendEmptyMessage(0); } }).start(); The problem is that upon two quick clicks, the method is fired twice, two threads are created, and consequently two new activities are created. That makes my app crash. When the methods are done, and we have the result from the server, we call the handler: private Handler handler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); try { Intent i = new Intent(Golf.this, Result.class); Bundle b = new Bundle(); b.putString("what", mWhat); b.putString("where", mWhere); b.putInt("offset", mOffset); b.putBoolean("searchIsCustom", searchIsCustom); i.putExtras(b); startActivityForResult(i, Activity.RESULT_OK); progDiag.dismiss(); } catch (Exception e) { Alerts.generalDialogAlert("Error", "settings", ctx); } } }; I tried to have a global boolean variable called "blocked" initially set to false, creating a condition like: if(!blocked){ blocked = true; new Thread(new Runnable() { public void run() { But this only seems to work on slower phones like the G1, I tried on Nexus and before it set blocked = true, the second request has was granted. So is there any way I can block the method being called if it's already running, or if the thread has started so it wont create a new one? Please, I really need to fix this. I've been developing on Android for almost 2 months now, but I'm yet to tackle that bug. Thanks in advance.

    Read the article

  • Can't (re)install lazarus

    - by twice
    I had Lazarus installed (from website, not USC), while upgrading to 13.10 and after that, it posted some error message (which I can't remember) at every start. I decided it shouldn't suffer, so I started reinstalling it, but it didn't work. then I thought I'll start all over, and deleted and purged everything. But it still would not install. I found a similar, very similar question to mine here: Cant correctly install Lazarus I tried everything said there: sudo dpkg -l | grep "^rc" returned some packages: since sudo apt-get -f brought up the apt-get help message, and sudo apt-get -f install did nothing, I went ahead and manually purged every broken package, which seemed to bring me forward, since it removed the entries in sudo dpkg -l | grep "^rc". When I was done I tried it again, since it didn't work I rebooted, no change. this is the error message I get on the attempt to install the first package (fpc-2.6.2): root@Someone-PC:~# dpkg -i /home/someone/Desktop/fpc_2.6.2-0_amd64\ \(3\).deb (Reading database ... 242209 files and directories currently installed.) Unpacking fpc (from .../fpc_2.6.2-0_amd64 (3).deb) ... dpkg: error processing /home/someone/Desktop/fpc_2.6.2-0_amd64 (3).deb (--install): trying to overwrite '/usr/lib/fpc/2.6.2/msg/errores.msg', which is also in package fp-compiler-2.6.2 2.6.2-5 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /home/someone/Desktop/fpc_2.6.2-0_amd64 (3).deb So, how can I fix this? And install Lazarus?

    Read the article

  • Why is my PHP query executing twice on page load?

    - by user1826238
    I am newish to PHP and I seem to be having an issue with an insert statement that executes twice when I open this page to view a document. In the database the 2nd insert is 1 second later. It happens in google chrome only and on this page only. IE has no issue, I dont have firefox to check. view_document.php <?php require_once($_SERVER['DOCUMENT_ROOT'] . '/../includes/core.php'); require_once($_SERVER['DOCUMENT_ROOT'] . '/../includes/connect.php'); $webusername = $_SESSION['webname']; if (isset($_GET['document'])) { $ainumber = (int) $_GET['document']; if (!ctype_digit($_GET['document']) || !preg_match('~^[0-9]+$~',$_GET['document']) || !is_numeric($_GET['document'])) { $_SESSION = array(); session_destroy(); header('Location: login.php'); } else { $stmt = $connect->prepare("SELECT s_filename, s_reference FROM dmsmain WHERE s_ainumber = ?") or die(mysqli_error()); $stmt->bind_param('s', $ainumber); $stmt->execute(); $stmt->bind_result($filename, $reference); $stmt->fetch(); $stmt->close(); $file = $_SERVER['DOCUMENT_ROOT'] . '/../dms/files/'.$filename.'.pdf'; if (file_exists($file)) { header('Content-Type: application/pdf'); header('Content-Disposition: inline; filename='.basename($file)); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($file)); header('Accept-Ranges: bytes'); readfile($file); $stmt = $connect->prepare("INSERT INTO dmslog (s_reference, s_userid, s_lastactivity, s_actiontype) VALUES (?, ?, ?, ?)") or die(mysqli_error()); date_default_timezone_set('Africa/Johannesburg'); $date = date('Y-m-d H:i:s'); $actiontype = 'DL'; $stmt->bind_param('ssss', $reference, $webusername, $date, $actiontype); $stmt->execute(); $stmt->close(); } else { $missing = "<b>File not found</b>"; } } } ?> My HTTP access records I assume [15/Nov/2012:10:14:32 +0200] "POST /dms/search.php HTTP/1.1" 200 5783 "http://www.denso.co.za/dms/search.php" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11" [15/Nov/2012:10:14:33 +0200] "GET /favicon.ico HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11" [15/Nov/2012:10:14:34 +0200] "GET /dms/view_document.php?document=8 HTTP/1.1" 200 2965 "http://www.denso.co.za/dms/search.php" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11" [15/Nov/2012:10:14:35 +0200] "GET /favicon.ico HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11" I have checked my <img src=''> links and I dont see a problem with them. The records indictate there is a favicon.ico request so I created a blank favicon and placed it in my public_html folder and linked it in the page like so <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon" /> Unfortunately that did not work as the statement still executes twice. I am unsure if it is a favicon issue as my upload page uses an insert query and it executes once. If someone could please tell me where I am going wrong or point me in the right direction I would be very grateful

    Read the article

  • jQuery live() ... have to click twice to activate links?

    - by neezer
    I have the following bit of code, simply: $(function() { $('a.add-photos-link').live('click', function(e) { $(this).colorbox({ overlayClose: false, onComplete: function() { $('#add_photos').submit(function(e) { // more stuff to do e.preventDefault(); }); } }); e.preventDefault(); }); }); However, this only seems to work after single-clicking on the link TWICE. These links are dynamically added to the page (a.add-photos-link). Why is this happening and what can I do to fix it so it fires after the first single-click?

    Read the article

  • window.beforeunload called twice in Firefox - how to get around this?

    - by Zarkonnen
    I'm creating a popup window that has a beforeunload handler installed. When the "Close" file menu item is used to close the popup, the beforeunload handler is called twice, resulting in two "Are you sure you want to close this window?" messages appearing. This is a bug with Firefox, and I've reported it here, but I still would like a way to prevent this from happening. Can you think of a sane way of detecting double beforeunload to prevent the double message problem? The problem is that Firefox doesn't tell me which button in the dialog the user elected to click - OK or cancel.

    Read the article

  • Why is this method executing twice each time I call it?

    - by highone
    I have the following method that is executing twice every time it is called: public static void ChangeToRepository(RepositoryTextBox textBox, int repositoryNumber) { MessageBox.Show("you"); int indexOfLastRepository = (textBox.RepositoryCollection.Count - 1); if (repositoryNumber > indexOfLastRepository) { AddTextRepositoriesThrough(textBox, repositoryNumber, indexOfLastRepository); } textBox.RepositoryCollection[textBox.CurrentRepositoryNumber].CurrentText = textBox.Text; textBox.PreviousRepositoryNumber = textBox.CurrentRepositoryNumber; textBox.CurrentRepositoryNumber = repositoryNumber; textBox.Text = textBox.RepositoryCollection[textBox.CurrentRepositoryNumber].CurrentText; } The first time that the method executes, it executes all of the code except for its last line: textBox.Text = textBox.RepositoryCollection[textBox.CurrentRepositoryNumber].CurrentText; The second time, it executes all of the code. What's up?

    Read the article

  • How can I avoid floating the same content twice?

    - by Randall Bohn
    My Kynetx app uses float_html() to put up a box full of content. rule float_box { select when pageview ".*" pre { content = << <div id='messagebox'> <h3>Floating Message Box</h3> <ul id='my_list'></ul> </div> >>; } float_html("absolute","top:25px","right:20px",content); } rule fill_box { select when pageview ".*" foreach ["alpha","bravo","charlie"] setting (list_item) append("#my_list", "<li>#{list_item}</li>"); } The app (a421x27) is used from a bookmarklet. If you click the bookmarklet twice on the same page you get double content. Is there any way to detect that the box is already on the screen and reuse it?

    Read the article

  • ASP.NET: Why can't I call a web-service twice in one page?

    - by Shay
    Hi all! I built a web-application which calls a web-service twice in the application's log-in page - first, on Page_Load, and the second time is after a button click. When debugging, everything goes well, but after publishing the web-application and trying it - I cannot make the two calls for the web-service (each call is invoking a different function in the same web-service). If I call it once (say, in the Page_Load) its OK, but once I get to the button click event, the page just seems to be loading but actually doing nothing (loading to infinity). When I disabled the web-service call in Page_Load, the web-service call after the button click worked well, and if I switched between them (disabled the call in button click and enabled the call in Page_Load) the enabled one worked OK. How come this is happening? What did I do wrong? Could it be related to the fact that the location where I published my web-application has some URL-rewriting rules?

    Read the article

  • DoWork of BackgroundWorker is called twice when RunWorkerAsync is called once?

    - by Power-Mosfet
    I have create a backgroundworker in an class it works, but if i call and wait until the end run, call it for the second time it will do the same process twice i thinks there is somthing wrong with bw.DoWork += private void button1_Click(object sender, EventArgs e) { nptest.test.start("null", "null"); } namespace nptest { class test { public static void start(string str, string strb) { if (bw.IsBusy != true) { bw.WorkerSupportsCancellation = true; bw.DoWork += (obj, e) => bw_DoWork(str, strb); bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted); bw.RunWorkerAsync(); } } private static BackgroundWorker bw = new BackgroundWorker(); private static void bw_DoWork(string str, string strb) { System.Windows.Forms.MessageBox.Show("initializing BackgroundWorker"); } private static void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if ((e.Cancelled == true)) { Console.WriteLine("Canceled"); } else if (!(e.Error == null)) { Console.WriteLine("Error: " + e.Error.Message); } bw.Dispose(); } } }

    Read the article

  • Why is the destructor of the class called twice ?

    - by dicaprio
    Apologies if the question sounds silly, I was following experts in SO and trying some examples myself, and this is one of them. I did try the search option but didn't find an answer for this kind. class A { public: A(){cout<<"A Contruction"<<endl;} ~A(){cout<<"A destruction"<<endl;} }; int main() { vector<A> t; t.push_back(A()); // After this line, when the scope of the object is lost. } Why is the destructor of the class called twice ?

    Read the article

  • c language:make fgets to keep taking input until I press enter twice?

    - by wello horld
    hi I would like to ask how I would modify this code for the question: (It only accepts one input then prints it out. I want it to keep going until I hit enter (\n) twice. #include <stdio.h> #define MAXLENGTH 1000 int main(void) { char string[MAXLENGTH]; fgets(string, MAXLENGTH, stdin ); printf("%s\n", string); return 0; } I'm confused at the fgets(string, MAXLENGTH, stdin ); line, what does stdin mean/do?

    Read the article

  • Why is this PHP loop rendering every row twice?

    - by Christopher
    I'm working on a real frankensite here not of my own design. There's a rudimentary CMS and one of the pages shows customer records from a MySQL DB. For some reason, it has no probs picking up the data from the DB - there's no duplicate records - but it renders each row twice. <?php $limit = 500; $area = 'customers_list'; $prc = 'customer_list.php'; if($_GET['page']) { include('inc/functions.php'); $page = $_GET['page']; } else { $page = 1; } $limitvalue = $page * $limit - ($limit); $customers_check = get_customers(); $customers = get_customers($limitvalue, $limit); $totalrows = count($customers_check); ?> <!-- pid: customer_list --> <table border="0" width="100%" cellpadding="0" cellspacing="0" style="float: left; margin-bottom: 20px;"> <tr> <td class="col_title" width="200">Name</td> <td></td> <td class="col_title" width="200">Town/City</td> <td></td> <td class="col_title">Telephone</td> <td></td> </tr> <?php for ($i = 0; $i < count($customers); $i++) { ?> <tr> <td colspan="2" class="cus_col_1"><a href="customer_details.php?id=<?php echo $customers[$i]['customer_id']; ?>"><?php echo $customers[$i]['surname'].', '.$customers[$i]['first_name']; ?></a></td> <td colspan="2" class="cus_col_2"><?php echo $customers[$i]['town']; ?></td> <td class="cus_col_1"><?php echo $customers[$i]['telephone']; ?></td> <td class="cus_col_2"> <a href="javascript: single_execute('prc/customers.prc.php?delete=yes&id=<?php echo $customers[$i]['customer_id']; ?>')" onClick="return confirmdel();" class="btn_maroon_small" style="margin: 0px; float: right; margin-right: 10px;"><div class="btn_maroon_small_left"> <div class="btn_maroon_small_right">Delete Account</div> </div></a> <a href="customer_edit.php?id=<?php echo $customers[$i]['customer_id']; ?>" class="btn_black" style="margin: 0px; float: right; margin-right: 10px;"><div class="btn_black_left"> <div class="btn_black_right">Edit Account</div> </div></a> <a href="mailto: <?php echo $customers[$i]['email']; ?>" class="btn_black" style="margin: 0px; float: right; margin-right: 10px;"><div class="btn_black_left"> <div class="btn_black_right">Email Customer</div> </div></a> </td> </tr> <tr><td class="col_divider" colspan="6"></td></tr> <?php }; ?> </table> <!--///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--> <!--// PAGINATION--> <!--///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--> <div class="pagination_holder"> <?php if($page != 1) { $pageprev = $page-1; ?> <a href="javascript: change('<?php echo $area; ?>', '<?php echo $prc; ?>?page=<?php echo $pageprev; ?>');" class="pagination_left">Previous</a> <?php } else { ?> <div class="pagination_left, page_grey">Previous</div> <?php } ?> <div class="pagination_middle"> <?php $numofpages = $totalrows / $limit; for($i = 1; $i <= $numofpages; $i++) { if($i == $page) { ?> <div class="page_number_selected"><?php echo $i; ?></div> <?php } else { ?> <a href="javascript: change('<?php echo $area; ?>', '<?php echo $prc; ?>?page=<?php echo $i; ?>');" class="page_number"><?php echo $i; ?></a> <?php } } if(($totalrows % $limit) != 0) { if($i == $page) { ?> <div class="page_number_selected"><?php echo $i; ?></div> <?php } else { ?> <a href="javascript: change('<?php echo $area; ?>', '<?php echo $prc; ?>?page=<?php echo $i; ?>');" class="page_number"><?php echo $i; ?></a> <?php } } ?> </div> <?php if(($totalrows - ($limit * $page)) > 0) { $pagenext = $page+1; ?> <a href="javascript: change('<?php echo $area; ?>', '<?php echo $prc; ?>?page=<?php echo $pagenext; ?>');" class="pagination_right">Next</a> <?php } else { ?> <div class="pagination_right, page_grey">Next</div> <?php } ?> </div> <!--///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--> <!--// END PAGINATION--> <!--///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////--> I'm not the world's best PHP expert but I think I can see an error in a for loop when there is one... But everything looks ok to me. You'll notice that the customer name is clickable; clicking takes you to another page where you can view their full info as held in the DB - and for both rows, the customer ID is identical, and manually checking the DB shows there's no duplicate entries. The code is definitely rendering each row twice, but for what reason I have no idea. All pointers / advice appreciated.

    Read the article

  • iPhone 4S Costs 50k In India. Heck! Rather I Buy Tata Nano Car For Twice The Money

    - by Gopinath
    Are you waiting to buy iPhone 4S in India? Stop waiting and start looking for alternatives as its going to be released in India with mind blowing price tags. A 16 GB iPhone 4S costs Rs. 44,500 + tax, 32 GB at 50,900 and the 64 GB..wait! Are you really interested to know the price? I’m not at all. Its ridiculous to spend 50,000 for a mobile phone in India. I hope majority of Indians agree with me. The Tata Nano, the world’s cheapest car, costs close to the double the price of iPhone 4S. Instead of buying an iPhone 4S for around 50K, it’s a wiser decision to buy a Tata Nano. Will the super rich of India afford to pay around 50,000 to own an iPhone 4S? I think they love to own it to show off their status but I guess they prefer to get it from US through their friends and relatives. In USA an unlocked iPhone 4S available through Apple Online Store costs just 33,500(~ 650 USD IN INR) and that is a straight away Rs. 11,000 discount. Why would the rich burn money? Airtel and Aircel has announced that the iPhone 4S is going to be available in their networks from November 25 onwards and both the operators started accepting the pre-orders. If you are really willing to burn your cash go ahead and book an iPhone 4S. This article titled,iPhone 4S Costs 50k In India. Heck! Rather I Buy Tata Nano Car For Twice The Money, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Why do I need to set up Autologon values in registry twice in before it works and can I fix this?

    - by jJack
    Background: As part an automated testing suite I am building, I need to set up Autologon on my virtual machines 'on demand'. By on demand, I mean that I don't want to necessarily pre-configure my VM or any snapshot to have Autologon set up already, for security reasons and also a huge business case. My solution so far: I'm copying a script to the guest machine and then using Sysinternals PsExec to execute it. The script is: reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultUserName /t REG_SZ /d myusername reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultPassword /t REG_SZ /d myfakepassword reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultDomainName /t REG_SZ /d mydomain reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v ForceAutoLogon /t REG_SZ /d 1 reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v AutoAdminLogon /t REG_SZ /d 1 reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoLogonChecked" /f /ve /d 1 Note: I don't believe AutoLogonChecked is required for machines post Windows 2000 but I'm doing it just in case for now. Maybe ForceAutoLogon isn't either, not sure yet. The Problem: I see PsExec executes this properly and all the values are in the registry, however when I restart the machine, the user isn't automatically logged on...When I run this a second time then restart the machine, the user is finally logged on. A diff between the registry states shows that the first time I run this, it is missing both the "1" for AutoAdminLogon, and also the DefaultPassword key. The second time I execute it, these values are correctly intact as I intended. So, what is going on here? Is this expected? This post claims in the end that it really all just works (the problem was that a logoff script was setting off the values). Doesn't seem to work for me however. Note this seems unique to Windows 7, does not occur in Windows XP Also note that you don't need PsExec to recreate the issue - just modify the registry yourself EDIT/update: Login interactively and run script (so, not executing it remotely), logging off automatically logs me back in (so, it works) remotely execute the script in guest when I'm interactively logged in, logging off automatically logs me back in (so, it works) remotely execute the script in guest when with non-interactive session if I log in afterwards (so, interactive now) then back off, it logs me back in (so, it then works) EDIT/update 2: This only occurs for Win7x86, Win7x64, Win8x64. This does not occur for Windows XP

    Read the article

  • Why do I need to set up Autologon values in registry twice before it works and can i fix this?

    - by jJack
    Background: As part an automated testing suite I am building, I need to set up Autologon on my virtual machines 'on demand'. By on demand, I mean that I don't want to necessarily pre-configure my VM or any snapshot to have Autologon set up already, for security reasons and also a huge business case. My solution so far: I'm copying a script to the guest machine and then using Sysinternals PsExec to execute it. The script is: reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultUserName /t REG_SZ /d myusername reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultPassword /t REG_SZ /d myfakepassword reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v DefaultDomainName /t REG_SZ /d mydomain reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v ForceAutoLogon /t REG_SZ /d 1 reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /f /v AutoAdminLogon /t REG_SZ /d 1 reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\AutoLogonChecked" /f /ve /d 1 Note: I don't believe AutoLogonChecked is required for machines post Windows 2000 but I'm doing it just in case for now. Maybe ForceAutoLogon isn't either, not sure yet. The Problem: I see PsExec executes this properly and all the values are in the registry, however when I restart the machine, the user isn't automatically logged on...When I run this a second time then restart the machine, the user is finally logged on. A diff between the registry states shows that the first time I run this, it is missing both the "1" for AutoAdminLogon, and also the DefaultPassword key. The second time I execute it, these values are correctly intact as I intended. So, what is going on here? Is this expected? This post claims in the end that it really all just works (the problem was that a logoff script was setting off the values). Doesn't seem to work for me however.

    Read the article

  • Proper way to cleanup dynamic engines and can they be loaded twice?

    - by Becky
    Hello - I am having problems loading Engine PKCS #11 as a dynamic engine using python and M2Crypto. I am trying to access an Aladdin USB eToken. Here are the important steps from my python code: dynamic = Engine.load_dynamic_engine("pkcs11", "/usr/local/ssl/lib/engines/engine_pkcs11.so") pkcs11 = Engine.Engine("pkcs11") pkcs11.ctrl_cmd_string("MODULE_PATH", "/usr/lib/libeTPkcs11.so") pkcs11.engine_init_custom() # initialize engine with custom M2Crypto patch # next few steps which I deleted pass password and grab key & cert off token Engine.cleanup() This works fine the first time this method gets run. The second time, it fails when loading the dynamic engine (see error below). Traceback (most recent call last): File "", line 1, in ? File "/usr/local/lib/python2.4/site-packages/M2Crypto/Engine.py", line 98, in load_dynamic_engine e.ctrl_cmd_string("LOAD", None) File "/usr/local/lib/python2.4/site-packages/M2Crypto/Engine.py", line 38, in ctrl_cmd_string raise EngineError(Err.get_error()) M2Crypto.Engine.EngineError: 4002:error:260B606D:engine routines:DYNAMIC_LOAD:init failed:eng_dyn.c:521: Is it impossible to load engines twice in a python session? Am I missing some kind of engine cleanup/deletion? The OpenSSL docs talk about engine_finish() but I don't think M2Crypto offers that. Is there a method to tell if the engine is already loaded? Thanks!

    Read the article

  • Why would a SQL query JOIN on the same table twice with the same condition?

    - by Scott Leis
    I'm working on changes to a SQL Server v8 database developed by someone else, and have found something that seems (based on my limited SQL knowledge) strange and pointless. One of the views has a query that does a LEFT OUTER JOIN twice on the same table with the same condition. Is there any reason for doing this? The query is below. See the second- and third-last lines that both join the "te_SDE_Survey" table on the "SDE_ID" field. Also note these lines set two different aliases for the table, and both aliases are used in the SELECT part of the query. SELECT vs.SLMS_Code, vs.Retail_Date, vs.TagNo, vs.Rego, vs.Model, vs.Company, vs.AccountType, viqdp.SDE_ID, bd.Debit_Date, isu.Survey_Date, CASE WHEN isu.Q6 IS NOT NULL THEN isu.Q6 ELSE CASE WHEN returned_surveys.survey_date IS NULL THEN CASE WHEN (viqdp.expiryDate < getdate() AND cs.sup1 IS NULL AND cs.sup2 IS NULL AND cs.sup3 IS NULL AND cs.sup5 IS NULL AND cs.sup8 IS NULL AND cs.sup9 IS NULL) THEN 'E' WHEN (viqdp.expiryDate < getdate() AND cs.sup1 = 'F' AND cs.sup2 = 'F' AND cs.sup3 = 'F' AND cs.sup5 = 'F' AND cs.sup8 = 'F' AND cs.sup9 = 'F') THEN 'E' WHEN cs.sup1 = 'T' THEN 'S' WHEN cs.sup2 = 'T' AND (cs.sup8 = 'F' AND cs.sup9 = 'F') THEN 'D' WHEN cs.sup3 = 'T' AND (cs.sup8 = 'F' AND cs.sup9 = 'F') THEN 'D' WHEN cs.sup5 = 'T' AND (cs.sup8 = 'F' AND cs.sup9 = 'F') THEN 'D' WHEN cs.sup8 = 'T' AND (cs.sup2 = 'F' AND cs.sup3 = 'F' AND cs.sup5 = 'F') THEN 'E' WHEN cs.sup9 = 'T' AND (cs.sup2 = 'F' AND cs.sup3 = 'F' AND cs.sup5 = 'F') THEN 'E' WHEN (cs.sup8 = 'T' OR cs.sup9 = 'T') AND (cs.sup2 = 'T' OR cs.sup3 = 'T' OR cs.sup5 = 'T') THEN 'S' END WHEN (tey.survey_expire_method = 'pre2008') THEN CASE WHEN (datediff(month, viqdp.generate_date, returned_surveys.survey_date) 1) THEN 'E' END WHEN (tey.survey_expire_method = 'expiryDateColumn') THEN CASE WHEN (returned_surveys.survey_date viqdp.expiryDate) THEN 'E' END END END AS score_or_exclusion_status, CASE WHEN (bd.explanation IS NULL) THEN '' ELSE bd.explanation END AS explanation, tey.te_Year FROM dbo.te_Vehicle_Sale vs INNER JOIN dbo.te_Year tey ON vs.Retail_Date = tey.Start_Date AND vs.Retail_Date <= tey.End_Date LEFT OUTER JOIN dbo.Bad_Data bd ON vs.TagNo = bd.TagNo LEFT OUTER JOIN dbo.te_Vehicle_SDESurvey viqdp ON vs.TagNo = viqdp.TagNo LEFT OUTER JOIN dbo.te_SDE_Survey isu ON viqdp.SDE_ID = isu.SDE_ID LEFT OUTER JOIN dbo.te_SDE_Survey returned_surveys ON viqdp.SDE_ID = returned_surveys.SDE_ID LEFT OUTER JOIN dbo.te_SDE_Contact_Suppression cs ON viqdp.SDE_ID = cs.SDE_ID

    Read the article

  • What might make "Xclients" be executed twice when boot system?

    - by ablmf
    For some special purpose, I modified /etc/X11/xinit/Xclients to start firefox instead of start Desktop Environment. # Argh! Nothing good is installed. Fall back to twm { # gosh, neither fvwm95 nor fvwm2 is available; # fall back to failsafe settings [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45' # if [ -x /usr/bin/xclock ] ; then # /usr/bin/xclock -geometry 100x100-5+5 & # elif [ -x /usr/bin/xclock ] ; then # /usr/bin/xclock -geometry 100x100-5+5 & # fi # if [ -x /usr/bin/xterm ] ; then # /usr/bin/xterm -geometry 80x50-50+150 & # fi if [ -x /usr/bin/firefox ]; then /usr/bin/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 fi # if [ -x /usr/bin/twm ] ; then # exec /usr/bin/twm # fi This used to work fine until today I tested it on another computer. Firefox reports that there's another running instance of firefox which stops responding. Thus, firefox could not autostart as I expected. I connected the computer with SSH and I found there are 2 firefox processes: [root@my113 xinit]# ps -ef | grep firefox root 4479 4371 0 17:34 ? 00:00:00 /bin/sh /usr/lib/firefox-3.0b5/run-mozilla.sh /usr/lib/firefox-3.0b5/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 root 4600 4479 0 17:34 ? 00:00:01 /usr/lib/firefox-3.0b5/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 root 4940 4906 0 17:35 ? 00:00:00 /bin/sh /usr/lib/firefox-3.0b5/run-mozilla.sh /usr/lib/firefox-3.0b5/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 root 4963 4940 0 17:35 ? 00:00:00 /usr/lib/firefox-3.0b5/firefox -chrome http://127.0.0.1/ -width 1280 -height 768 root 5717 5345 0 17:51 pts/2 00:00:00 grep firefox I guess, for some reason, "Xclients" is executed twice. But I really knows very little about XWindows, so if anyone here could give me some clues, I will appreciate!

    Read the article

  • Why do I have to unserialize this serialized value twice? (wordpress/bbpress maybe_serialize)

    - by 55skidoo
    What am I doing wrong here? I'm serializing a value, storing it in a database (table bb_meta), retrieving it... OK so far... but then I have to unserialize it twice. Shouldn't I be able to just unserialize once? This seems to work, but I'm wondering what point about serialization I'm missing here. //check database to see if user has ever visited before. $querystring = $bbdb->prepare( "SELECT `meta_value` FROM `$bbdb->meta` WHERE `object_type` = %s AND `object_id` = %s AND `meta_key` = %s LIMIT 1", $bbtype, $bb_this_thread, $bbuser ); $bb_last_visits = $bbdb->get_row($querystring, OBJECT); //if $bb_last_visits is empty, add time() as the metavalue using bb_update_meta if (empty($bb_last_visits)) { $first_visit = time(); echo 'serialized first visit: ' . $bb_this_visit_time_serialized = serialize(array($bb_this_thread => $first_visit)); bb_update_meta( $bb_this_thread, $bbuser, $bb_this_visit_time_serialized, $bbtype ); //add to database, bb_meta table echo '$bb_last_visits was empty. Setting first visit time as ' . $bb_this_visit_time_serialized . '<br>'; } else { //else, test by unserializing the data for use. echo 'last visit time already set: '; echo $bb_last_visits->meta_value; echo '<br>'; //fatal error - echo 'unserialized: ' . $bb_last_visits_unserialized = unserialize($bb_last_visits[0]->meta_value); echo '<br>'; echo 'unserialize: ' . $unserialized_visits = unserialize($bb_last_visits->meta_value); echo '<br>'; echo 'hmm, need to unserialize again??: '; echo $unserialized_unserialized_visits = unserialize($unserialized_visits); echo '<br>'; echo 'hey look, it\'s an array value I can finally use now. phew: ' . $unserialized_unserialized_visits[$bb_this_thread]; }

    Read the article

  • Why function Ellipse(...) are needed twice here to draw an ellipse?

    - by John Son
    MFC: I read this code which is to draw an ellipse (not solid interior), but I cannot understand why function "pDC-Ellipse(...)" is needed twice here? CDC *pDC=GetDC(); CPen pen; CBrush brush; getpen(pen,pDC,col,bol); if(do_what>=DRAW_LINE&&do_what<=DRAW_RRECT){ p->p[0]=start; p->p[1]=end; if(sol==1){ getbrush(brush,pDC,col); } if(do_what==DRAW_LINE){ pDC->MoveTo(start); pDC->LineTo(end); } else if(do_what==DRAW_ELLIPSE||do_what==DRAW_CIRCLE){ pDC->SetROP2(R2_NOT); assist=start; if(do_what==DRAW_CIRCLE){ assist.y=end.y-end.x+start.x; } pDC->Ellipse(start.x,assist.y,end.x,end.y); pDC->SetROP2(R2_COPYPEN); if(sol==0){ pDC->SelectStockObject(NULL_BRUSH); } if(do_what==DRAW_CIRCLE){ assist.y=point.y-point.x+start.x; } pDC->Ellipse(start.x,assist.y,point.x,point.y); end=point; } } If I remove the first one, the ellipse will be black solid inside. If I remove the second one, the ellipse will never be drawn but disappears when left mouse button is up. the dialog: when moving mouse: mouse moving when mouse button pops: mouse button pops Besides, what color of CBrush is if I use "CBrush brush; pDC-Ellipse(start.x,assist.y,end.x,end.y);"

    Read the article

  • Have to login twice. PHP sessions and login troubles with Chrome and Opera.

    - by Robert
    The problem I am encountering is that for my login form I have to login twice for the session to register properly, but only in Chrome (my version is 4.0.249.89) and Opera (my version is 10.10). Here is the stripped down code that I am testing on: Login Page: session_start(); $_SESSION['user_id'] = 8; $_SESSION['user_name'] = 'Jim'; session_write_close(); header('Location: http://www.my-domain-name.com/'); exit(); Home Page: session_start(); if ( isset($_SESSION['user_id']) ) { echo "You are logged in!"; } else { echo "You are NOT logged in!"; } Logout Page: session_start(); session_unset(); session_destroy(); header('Location: http://www.my-domain-name.com/'); exit(); Currently, under a fresh load with no cookies, if I go to my-domain-name.com/login/ it will redirect to the home page and say "You are NOT logged in!" but if I go there again it will say "You are logged in!". Any ideas? Thanks for your help.

    Read the article

  • Why is a NullReferenceException thrown when a ToolStrip button is clicked twice with code in the `Click` event handler?

    - by Patrick
    I created a clean WindowsFormsApplication solution, added a ToolStrip to the main form, and placed one button on it. I've added also an OpenFileDialog, so that the Click event of the ToolStripButton looks like the following: private void toolStripButton1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); } I didn't change any other properties or events. The funny thing is that when I double-click the ToolStripButton (the second click must be quite fast, before the dialog opens), then cancel both dialogs (or choose a file, it doesn't really matter) and then click in the client area of main form, a NullReferenceException crashes the application (error details attached at the end of the post). Please note that the Click event is implemented while DoubleClick is not. What's even more strange that when the OpenFileDialog is replaced by any user-implemented form, the ToolStripButton blocks from being clicked twice. I'm using VS2008 with .NET3.5. I didn't change many options in VS (only fontsize, workspace folder and line numbering). Does anyone know how to solve this? It is 100% replicable on my machine, is it on others too? One solution that I can think of is disabling the button before calling OpenFileDialog.ShowDialog() and then enabling the button back (but it's not nice). Any other ideas? And now the promised error details: System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="System.Windows.Forms" StackTrace: at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at WindowsFormsApplication1.Program.Main() w C:\Users\Marchewek\Desktop\Workspaces\VisualStudio\WindowsFormsApplication1\Program.cs:line 20 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

    Read the article

  • Why would certain browsers request all pages on my ASP.Net Web site twice?

    - by Deane
    Firefox is issuing duplicate requests to my ASP.Net web site. It will request a page, get the response, then immediately issue the same request again (well, almost the same -- see below). This happens on every page of this particular Web site (but not any others). IE does not do this, but Chrome also does this. I have confirmed that there is no Location header in the response, and no Javascript or meta tag in the page which would cause the page to be re-requested (if any of these were true, IE would be re-requesting pages as well). I have confirmed this behavior on multiple Firefox installs on multiple machines. Versions vary, but all are 3.x. The only difference between the two requests is the Accepts header. For the first request, it looks like this: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 For the second request, it looks like this: Accept: */* The Content-Type response header in all cases is: Content-Type: text/html; charset=utf-8 Something else odd -- even though Firefox requests the page twice, it uses the first response and discards the second. I put a counter on a page that increments with every request. I can watch the responses come back (via the Charles proxy). Firefox will get a "1" the first time, and a "2" the second time. Yet it will display the "1," for some reason. Chrome exhibits this exact same behavior. I suspect it's a protocol-level issue, given the difference in Accepts header, but I've never seen this before.

    Read the article

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