Daily Archives

Articles indexed Monday April 12 2010

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

  • File open fails initially when trying to open a file located on a win2k8 share but eventually can su

    - by Ruddy Douglass
    Core of the problem: I receive "(0x80070002) The system cannot find the file specified" for roughly 8 to 9 seconds before it can open it successfully. In a nutshell, we have two COM components. Component A calls into Component B and asks for a UNC filename to write to - the filename returned doesn't exist yet, but the path does - it then does its work, creates and populates the file, and tells Component B its done by making another com call. At that point Component B will call MoveFile to rename the file to its "official" name. This code has worked for (literally) years. Its works fine on win2k3. Its works fine when its running on win2k8 and points to a share on a win2k3 server. It also runs fine, if the share is actually located on the same win2k8 machine that the code is running on. But if you run it on win2k8 and point it to a share on a different win2k8 server, it fails. Both Component A & component B exist in their own Windows Service running with as a domain admin account. The shares are configured for "Everyone/Full control" in all test environments, similarly so are the underlying folders that the share points to. All machines are in the same domain. During debugging I realized the file actually does exist by the time I get to checking manually for it - after several iterations it occurred to me that the file doesn't "show up" until some delay passes by - so I put in the loop below in component B as shown below: int nCounter = 0; while (true) { CFileStatus fs; if (CFile::GetStatus(tempname, fs)) break; SleepEx(100, FALSE); nCounter++; } This code does, in fact, exit and nCounter is generally between 80 & 90 iterations when it does -- indicating the file "appears" approx 8 to 9 seconds later. Once that loop exits the code can successfully rename the file and all further processing appears to work. I put a CFile::GetStatus in component A immediately before it calls into Component B and that indicates success - it can see the file and get its true size yet the call into component b made immediately after can not see the file until the above indicated delay passes. I have verified the pathnames are precisely the same, even though it would clearly have to be for the calls to eventually succeed after a pause of 8 to 9 seconds... When something like this occurs I always assume there is a bug in my code until proven otherwise, but given (a) this code has executed properly for a very long time and (other than my diagnostic loop added) has not changed, and (b) it works in all environments except the win2k8 - win2k8 share, I'm guessing there is some OS issue in here that i do not understand. Any insight would be helpful. Thanks!

    Read the article

  • soap client not working in php

    - by Jin Yong
    I tried to write a code in php to call a web server to add a client details, however, it's seem not working for me and display the following error: Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in D:\www\web_server.php:15 Stack trace: #0 [internal function]: SoapClient-_doRequest('_call('AddClient', Array) #2 D:\www\web_server.php(15): SoapClient-AddClientArray) #3 {main} thrown in D:\www\web_server.php on line 15 Refer below for the code that I wrote in php: <s:element name="AddClient"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="clientRequest" type="tns:ClientRequest"/> </s:sequence> </s:complexType> </s:element> - <s:complexType name="ClientRequest"> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="customerCode" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="customerFullName" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="ref" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="phoneNumber" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="Date" type="s:string"/> </s:sequence> </s:complexType> <s:element name="AddClientResponse"> - <s:complexType> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="AddClientResult" type="tns:clientResponse"/> <s:element minOccurs="0" maxOccurs="1" name="response" type="tns:ServiceResponse"/> </s:sequence> </s:complexType> </s:element> - <s:complexType name="ClientResponse"> - <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="testNumber" type="s:string"/> </s:sequence> </s:complexType> <?php $client = new SoapClient($url); $result = $client->AddClient(array('username' => 'test','password'=>'testing','clientRequest'=>array('customerCode'=>'18743','customerFullName'=>'Gaby Smith','ref'=>'','phoneNumber'=>'0413496525','Date'=>'12/04/2013'))); echo $result->AddClientResponse; ?> Does anyone where I gone wrong for this code?

    Read the article

  • SQL Server SELECT stored procedure according to combobox.selectedvalue

    - by Jay
    In order to fill a datagridview according to the selectedvalue of a combobox I've tried creating a stored procedure. However, as I'm not 100% sure what I'm doing, depending on the WHERE statement at the end of my stored procedure, it either returns everything within the table or nothing at all. This is what's in my class: Public Function GetAankoopDetails(ByRef DisplayMember As String, ByRef ValueMember As String) As DataTable DisplayMember = "AankoopDetailsID" ValueMember = "AankoopDetailsID" If DS.Tables.Count > 0 Then DS.Tables.Remove(DT) End If DT = DAC.ExecuteDataTable(My.Resources.S_AankoopDetails, _Result, _ DAC.Parameter(Const_AankoopID, AankoopID), _ DAC.Parameter("@ReturnValue", 0)) DS.Tables.Add(DT) Return DT End Function Public Function GetAankoopDetails() As DataTable If DS.Tables.Count > 0 Then DS.Tables.Remove(DT) End If DT = DAC.ExecuteDataTable(My.Resources.S_AankoopDetails, _Result, _ DAC.Parameter(Const_AankoopID, AankoopID), _ DAC.Parameter("@ReturnValue", 0)) DS.Tables.Add(DT) Return DT End Function This is the function in the code behind the form I've written in order to fill the datagridview: Private Sub GridAankoopDetails_Fill() Try Me.Cursor = Cursors.WaitCursor dgvAankoopDetails.DataSource = Nothing _clsAankoopDetails.AankoopDetailsID = cboKeuze.SelectedValue dgvAankoopDetails.DataSource = _clsAankoopDetails.GetAankoopDetails Catch ex As Exception MessageBox.Show("An error occurred while trying to fill the data grid: " & ex.Message, "Oops!", MessageBoxButtons.OK) Finally Me.Cursor = Cursors.Default End Try End Sub And finally, this is my stored procedure: (do note that I'm not sure what I'm doing here) USE [Budget] GO /****** Object: StoredProcedure [dbo].[S_AankoopDetails] Script Date: 04/12/2010 03:10:52 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[S_AankoopDetails] ( @AankoopID int, @ReturnValue int output ) AS declare @Value int set @Value =@@rowcount if @Value = 0 begin SELECT dbo.tblAankoopDetails.AankoopDetailsID, dbo.tblAankoopDetails.AankoopID, dbo.tblAankoopDetails.ArtikelID, dbo.tblAankoopDetails.Aantal, dbo.tblAankoopDetails.Prijs, dbo.tblAankoopDetails.Korting, dbo.tblAankoopDetails.SoortKorting, dbo.tblAankoopDetails.UitgavenDeelGroepID FROM dbo.tblAankoopDetails INNER JOIN dbo.tblAankoop ON dbo.tblAankoopDetails.AankoopID = dbo.tblAankoop.AankoopID INNER JOIN dbo.tblArtikel ON dbo.tblAankoopDetails.ArtikelID = dbo.tblArtikel.ArtikelID INNER JOIN dbo.tblUitgavenDeelGroep ON dbo.tblAankoopDetails.UitgavenDeelGroepID = dbo.tblUitgavenDeelGroep.UitgavenDeelGroepID WHERE dbo.tblAankoopDetails.Deleted = 0 and dbo.tblAankoopDetails.AankoopID = @AankoopID ORDER BY AankoopID if @@rowcount >0 begin set @ReturnValue=999 end else begin set @ReturnValue=997 end end if @Value >0 begin --Dit wil zeggen dat ik een gebruiker wil ingeven die reeds bestaat. (998) set @ReturnValue=998 end Does anyone know what I need to do to resolve this?

    Read the article

  • Finding inline style with lxml.cssselector

    - by ropa
    New to this library (no more familiar with BeautifulSoup either, sadly), trying to do something very simple (search by inline style): <td style="padding: 20px">blah blah </td> I just want to select all tds where style="padding: 20px", but I can't seem to figure it out. All the examples show how to select td, such as: for col in page.cssselect('td'): but that doesn't help me much.

    Read the article

  • How do you disable a DataGridView's keyboard shorcuts?

    - by fneep
    I've just noticed that DataGridViews have a default shortcut so that whenever you press "Ctrl + H", the DataGridView's editing control backspaces, and can delete your entire selection within the cell. This can get quite annoying since I want to open a Replace box whenever Ctrl H is pressed. Is there any way to stop the backspacing while still being able to use it to open the replace box? I'm running C# 2.0, but I could update my application to 3.5 if the newer C# has a solution.

    Read the article

  • Where are my $_FILES? Ajax Uploading

    - by Richard Testani
    I've built a form to upload images, and processed with Prototype/PHP. $('image_upload').observe('submit', function() { var params = $H(); params.set('name', $('image_title').value); params.set('from', $('from_who').value); params.set('upload_file', $('upload_file').value); new Ajax.Request('/files/upload_process.php', { method:'post', parameters: params, onSuccess: function(r) { $('uploadbox').update('<img src="/images/interface/thankyou.png" />'); } }) }); The form itself sends the data to the server, but when I try to output print_r($_FILES['upload_file']); nothing appears, not even an empty array. If I output print_r($_POST), the parameters are sent properly, but only the file name of the image. So it seems the files themselves are not being sent along. How do I handle this? Thanks Rich

    Read the article

  • Programatically send SMS to email using Verizon Motorola Droid on Android

    - by Dave
    Hi, I was wondering if anyone knew the proper way to send an SMS message to an e-mail address using Verizon's CDMA Motorola Droid phone. The internal messaging application appears to automagically do this. While 3rd party applications like SMSPopup don't seem to be able to properly reply to e-mail addresses unless you compose the message inside the messaging application. When the internal messaging application sends a SMS message there's a corresponding 'RIL_REQUEST_CDMA_SEND_SMS' entry in the logcat (adb logcat -b radio). When you send a SMS to an e-mail address it prints the same thing, so behind the scenes it looks as though it is sending an sms. The interesting thing is that if you look at the content provider sent box the messages are addressed to various 1270XX-XXX-XXXX numbers. On other services you can send e-mail addresses by sending a SMS to a predefined short sms number. And then formatting your SMS as emailaddress subject message i.e. http://en.wikipedia.org/wiki/SMS_gateway#Carrier-Provided_SMS_to_E-Mail_Gateways For example, using T-mobile's number (500) you can send a SMS to an e-mail using the following: SmsManager smsMgr = SmsManager.getDefault(); smsMgr.sendTextMessage("500", null, "[email protected] message sent to an e-mail address from a SMS", null, null); Does anyone know if It is possible to programatically send SMS to email messages from a CDMA Android phone? Does Verizon actually send your replies as SMS messages or are they actually sent as MMS or normal http email messages? Any ideas about how to intercept what the raw message being sent to see what's going on? It might be possible that Verizon somehow generates a fake number temporarily tied to an e-mail address (since repeated messages are not sent to the same number). But, that seems pretty heavy handed. Thanks!

    Read the article

  • What does the condition "new pull" mean?

    - by Nathan DeWitt
    I'm looking for a hard drive, and some of the conditions are listed as "New Pull" or "System Pull". I figure the System Pull means "taken from a computer and now sold separately" but what does New Pull mean? Does this mean it was assembled and never used? Or maybe it has been freshly pulled from a used machine?

    Read the article

  • Output iterator's value_type

    - by wilhelmtell
    The STL commonly defines an output iterator like so: template<class Cont> class insert_iterator : public iterator<output_iterator_tag,void,void,void,void> { // ... Why do output iterators define value_type as void? It would be useful for an algorithm to know what type of value it is supposed to output. For example, a function that translates a URL query "key1=value1&key2=value2&key3=value3" into any container that holds key-value strings elements. template<typename Ch,typename Tr,typename Out> void parse(const std::basic_string<Ch,Tr>& str, Out result) { std::basic_string<Ch,Tr> key, value; // loop over str, parse into p ... *result = typename iterator_traits<Out>::value_type(key, value); } The SGI reference page of value_type hints this is because it's not possible to dereference an output iterator. But that's not the only use of value_type: I might want to instantiate one in order to assign it to the iterator.

    Read the article

  • Casting interfaces in java

    - by owca
    I had two separate interfaces, one 'MultiLingual' for choosing language of text to return, and second 'Justification' to justify returned text. Now I need to join them, but I'm stuck at 'java.lang.ClassCastException' error. Class Book is not important here. Data.length and FormattedInt.width correspond to the width of the line. The code : public interface MultiLingual { static int ENG = 0; static int PL = 1; String get(int lang); int setLength(int length); } class Book implements MultiLingual { private String title; private String publisher; private String author; private int jezyk; public Book(String t, String a, String p, int y){ this(t, a, p, y, 1); } public Book(String t, String a, String p, int y, int lang){ title = t; author = a; publisher = p; jezyk = lang; } public String get(int lang){ jezyk = lang; return this.toString(); } public int setLength(int i){ return 0; } @Override public String toString(){ String dane; if (jezyk == ENG){ dane = "Author: "+this.author+"\n"+ "Title: "+this.title+"\n"+ "Publisher: "+this.publisher+"\n"; } else { dane = "Autor: "+this.author+"\n"+ "Tytul: "+this.title+"\n"+ "Wydawca: "+this.publisher+"\n"; } return dane; } } class Data implements MultiLingual { private int day; private int month; private int year; private int jezyk; private int length; public Data(int d, int m, int y){ this(d, m, y, 1); } public Data(int d, int m, int y, int lang){ day = d; month = m; year = y; jezyk = lang; } public String get(int lang){ jezyk = lang; return this.toString(); } public int setLength(int i){ length = i; return length; } @Override public String toString(){ String dane=""; String miesiac=""; String dzien=""; switch(month){ case 1: miesiac="January"; case 2: miesiac="February"; case 3: miesiac="March"; case 4: miesiac="April"; case 5: miesiac="May"; case 6: miesiac="June"; case 7: miesiac="July"; case 8: miesiac="August"; case 9: miesiac="September"; case 10: miesiac="October"; case 11: miesiac="November"; case 12: miesiac="December"; } if(day==1){ dzien="st"; } if(day==2 || day==22){ dzien="nd"; } if(day==3 || day==23){ dzien="rd"; } else{ dzien="th"; } if(jezyk==ENG){ dane =this.day+dzien+" of "+miesiac+" "+this.year; } else{ dane = this.day+"."+this.month+"."+this.year; } return dane; } } interface Justification { static int RIGHT=1; static int LEFT=2; static int CENTER=3; String justify(int just); } class FormattedInt implements Justification { private int liczba; private int width; private int wyrownanie; public FormattedInt(int s, int i){ liczba = s; width = i; wyrownanie = 2; } public String justify(int just){ wyrownanie = just; String wynik=""; String tekst = Integer.toString(liczba); int len = tekst.length(); int space_left=width - len; int space_right = space_left; int space_center_left = (width - len)/2; int space_center_right = width - len - space_center_left -1; String puste=""; if(wyrownanie == LEFT){ for(int i=0; i<space_right; i++){ puste = puste + " "; } wynik = tekst+puste; } else if(wyrownanie == RIGHT){ for(int i=0; i<space_left; i++){ puste = puste + " "; } wynik = puste+tekst; } else if(wyrownanie == CENTER){ for(int i=0; i<space_center_left; i++){ puste = puste + " "; } wynik = puste + tekst; puste = " "; for(int i=0; i< space_center_right; i++){ puste = puste + " "; } wynik = wynik + puste; } return wynik; } } And the test code that shows this casting "(Justification)gatecrasher[1]" which gives me errors : MultiLingual gatecrasher[]={ new Data(3,12,1998), new Data(10,6,1924,MultiLingual.ENG), new Book("Sekret","Rhonda Byrne", "Nowa proza",2007), new Book("Tuesdays with Morrie", "Mitch Albom", "Time Warner Books",2003, MultiLingual.ENG), }; gatecrasher[0].setLength(25); gatecrasher[1].setLength(25); Justification[] t={ new FormattedInt(345,25), (Justification)gatecrasher[1], (Justification)gatecrasher[0], new FormattedInt(-7,25) }; System.out.println(" 10 20 30"); System.out.println("123456789 123456789 123456789"); for(int i=0;i < t.length;i++) System.out.println(t[i].justify(Justification.RIGHT)+"<----\n");

    Read the article

  • Joining Multiple Fields Using Unix Join

    - by neversaint
    How can I do it? I have a file that looks like this foo 1 scaf 3 bar 2 scaf 3.3 File2 looks like this foo 1 scaf 4.5 foo 1 boo 2.3 bar 2 scaf 1.00 What I want to do is to fine lines that co-occur in file1 and file2 when field 1,2,3 are the same. Is there a way to do it?

    Read the article

  • how to add a new value to a dropdown list in Rails

    - by LearnRails
    In my item table, I have a itemname column which is currently a dropdown list taking values from DB. <%= select 'item','itemname' , Item.find(:all).collect{|c| [c.itemname]},{:include_blank = 'Select Name'} How can I add a new value to this dropdown list through the application. Is there a provision to directly add value to the list? Thanks

    Read the article

  • Flex BarChart and XML

    - by theband
    <mx:BarChart id="barChart" showDataTips="true" dataProvider="{testInfo}" width="100%" height="100%"> <mx:verticalAxis> <mx:CategoryAxis categoryField="ProjectName"/> </mx:verticalAxis> <mx:series> <mx:BarSeries id="barSeries" yField="ProjectName" xField="State" displayName="State" /> </mx:series> </mx:BarChart> I get the Project Names in the y -Axis, but nothing is displayed in the Chart. Could not construe on what's going as wrong. private function xmlHandler(evt:ResultEvent):void{ testInfo = evt.result.Project; }

    Read the article

  • asp.net MVC RC1 RenderPartial ViewDataDictionary

    - by Mark79
    I'm trying to pass a ViewData object from a master page to a view user control using the ViewDataDictionary. The problem is the ViewDataDictionary is not returning any values in the view user control whichever way i try it. The sample code below is using an anonymous object just for demonstration although neither this method or passing a ViewData object works. Following is the RenderPartial helper method i'm trying to use: <% Html.RenderPartial("/Views/Project/Projects.ascx", ViewData.Eval("Projects"), new ViewDataDictionary(new { Test = "Mark" })); %> and in my view user control i do the following: <%= Html.Encode(ViewData["Test"]) %> Why does this not return anything? Thanks for your help. EDIT: I'm able to pass and access the stronlgy typed model without any problems. it's the ViewDataDictionary which i'm trying to use to pass say just a single value outside of the model..

    Read the article

  • Beginner SEO question on urlrewrite rules

    - by Charlie
    I just starting reading about SEO and realized that I should change my "GET" queries to / separated keywords for SEO purposes. Here's my question: I have a multi-select checkbox on my form, so my query string would be: http://www.domainname.com/searchitem.html?cat[]=A&cat[]=B&cat[]=C&param1=p1&param2=p2 Whats the convention for handling this kind of queries? changing it to search/catA/catB/catC/p1/p2 doesn't seem right to me but i don't know what else to do Thanks

    Read the article

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