Search Results

Search found 579 results on 24 pages for 'sr richie'.

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

  • How to deal with name/value pairs of function arguments in MATLAB

    - by Richie Cotton
    I have a function that takes optional arguments as name/value pairs. function example(varargin) % Lots of set up stuff vargs = varargin; nargs = length(vargs); names = vargs(1:2:nargs); values = vargs(2:2:nargs); validnames = {'foo', 'bar', 'baz'}; for name = names validatestring(name{:}, validnames); end % Do something ... foo = strmatch('foo', names); disp(values(foo)) end example('foo', 1:10, 'bar', 'qwerty') It seems that there is a lot of effort involved in extracting the appropriate values (and it still isn't particularly robust again badly specified inputs). Is there a better way of handling these name/value pairs? Are there any helper functions that come with MATLAB to assist?

    Read the article

  • Sort List by occurrence of a word by LINQ C#

    - by Thomas
    i have stored data in list like List<SearchResult> list = new List<SearchResult>(); SearchResult sr = new SearchResult(); sr.Description = "sample description"; list.Add(sr); suppose my data is stored in description field like "JCB Excavator - ECU P/N: 728/35700" "Geo Prism 1995 - ABS #16213899" "Geo Prism 1995 - ABS #16213899" "Geo Prism 1995 - ABS #16213899" "Wie man BBA reman erreicht" "this test JCB" "Ersatz Airbags, Gurtstrammer und Auto Körper Teile" now i want to query the list with my search term like geo jcb if you look then the word geo has stored many times in the description field. so i want to sort my list in such way that the word in search term found maximum that data will come first. please help me to do so. thanks

    Read the article

  • HOW TO GET WEB CAM IMAGES IN C#

    - by SR Dusad
    Hi I m working on online video conferencing project in c# and .Net4.0 I want a library or code which i can used for collecting web camera inges per second in diferent form. I try this by using the AVICAP32, in which we send Messages for diferent purpose like copy or edit frames.but in this we have to pass a reference of picturebox while creating handler as given below mCapHwnd = capCreateCaptureWindowA("0", 268435456 | 1073741824, 0, 0, 640, 480,picturebox1.Handle.ToInt32(), 0); usiing these commands i m able to capture images but the problem comes when i minimize the picturebox form . at that time doesn't create new image . I think this is happened because i minimize the form and when it copy the image from this clipboard it doesn't shhow anything. How can i solve this problem . Any type of help will be appreciated. Thanks srdusad

    Read the article

  • issue with regex in C#

    - by Dilip
    my file is > A B C D unuse data <begin> Addd as ss 1 My name is 2323 33 text > </end> 34344 no need and my code is StringBuilder mSb = new StringBuilder(); StreamReader sr = new StreamReader(@"E:\check.txt"); String line; while (sr.ReadLine() != null) { mSb.AppendLine(sr.ReadLine()); } string matc = new Regex(@"(<begin>)(\n?.*)*</end>)?").Match(mSb.ToString()).ToString(); here it reading all file , but i just want till if i am removing ? from end , my program is crashing .. Thanks

    Read the article

  • sendAsync() does not send mail always in asp.net

    - by SR Dusad
    Hi I am not able to send asynchronous mail in asp.net using c# .Though my code is correct as If I try to send mail 10 times then only of 1 time it is successful,rest of 9 times there is no error message but mail is also not sent at its destination.I am sending data in mail attachment. I want to send a file upto 5MB in size . Any type of help will be appreciated.

    Read the article

  • continously add picture to video

    - by m.sr
    Every x minutes I grab an image from a network-cam. Now i want to add this picture to an existing video file - on the fly. I don't want to keep numerous image files and then encode them once in a while with e.g. mencoder mf://@${LIST} -mf type=jpg:fps=${FPS} ... The video format/codec doesn't really matter, as long as standard tools (mplayer, ffmpeg, vlc, ...) can handle it. Any ides or suggestions? Thanks in advance!

    Read the article

  • MySQL query with JOINS and GROUP BY

    - by user1854049
    I'm building a MySQL query but I can't seem to get it right. I have four tables: - customers - orders - sales_rates - purchase_rates There is a 1:n relation 'customernr' between customers and orders. There is a 1:n relation 'ordernr' between orders and sales_rates. There is a 1:n relation 'ordernr' between orders and purchase_rates. What I would like to do is produce an output of all customers with their total purchase and sales amounts. So far I have the following query. SELECT c.customernr, c.customer_name, SUM(sr.sales_price) AS sales_price, SUM(pr.purchase_price) AS purchase_price FROM orders o, customers c, sales_rates sr, purchase_rates pr WHERE o.customernr = c.customernr AND o.ordernr = sr.ordernr AND o.ordernr = pr.ordernr GROUP BY k.bedrijfsnaam The result of the sales_price and purchase_price is far too high. I seem to be getting double counts. What am I doing wrong? Is it possible to perform this in a single query? Thank for your response!

    Read the article

  • Only strip commas surrounded by numbers in a string

    - by overlook77
    I am using StreamReader to read each line of a CSV file into a string. As I am processing each line, I need to strip out any commas that ONLY are surrounded by other numbers. For example, if the string was: "textfield1", "textfield2", "100.00", "1,070.00" I would need to only take the comma out of "1,070.00" from this entire string, resulting in: "textfield1", "textfield2", "100.00", "1070.00" Each string read from the CSV file can differ in number of fields, length, etc., so I need to use something (Regular Expressions maybe?) that looks at the entire string without hardcoding a location or blanket removal of all commas. Here is the approach I have been trying: StreamReader sr = new StreamReader(strInputFile); string nextLine = sr.ReadLine(); try { while ((nextLine = sr.ReadLine()) != null) { string rawtext = nextLine.Replace("[0-9]"+","+"[0-9]" , "[0-9]"+"[0-9]"); // ....rest of code } } This obviously doesn't work because I don't understand how to do this :) I am new at C# and inexperienced in Regex, so hopefully this is relatively simple.

    Read the article

  • Sun2Oracle: Hub City Media Webcast Reminder - Thursday, September 13, 2012

    - by Darin Pendergraft
    Our Sun2Oracle webcast featuring Steve Giovanetti from Hub City Media is this Thursday, September 13th at 10:00 am PST.  If you haven't registered yet, there is still time: Register Here. Scott Bonell, Sr. Director of Product Management will be talking to Steve about their recent project to upgrade a large University from Sun DSEE Directory to Oracle Unified Directory.  Scott and Steve will talk through details of the project, from planning through implementation. In addition to this webcast, Steve Giovanetti will also be participating in two sessions at Oracle OpenWorld 2012: CON9465 - Next-Generation Directory: Oracle Unified Directory  Etienne Remillon, Principal Product Manager, Oracle  Steve Giovanetti, CTO Hub City Media  Warren Leung, Sr. Architect, UCLA  Tuesday, Oct 2, 5:00 PM – 6:00 PM  Moscone West – 3008 CON5749 - Solutions for Migration of Oracle Waveset to Oracle Identity Manager Steve Giovanetti, CTO Hub City Media Kevin Moulton, Senior Sales Consulting  Manager, Oracle Thursday, Oct 4, 11:15 AM - 12:15 PM Moscone West - 3008

    Read the article

  • Certification Notes: 70-583 Designing and Developing Windows Azure Applications

    - by BuckWoody
    It’s time for another certification, and we’ve just release the 70-583 exam on Windows Azure. I’ve blogged my “study plans” here before on other certifications, so I thought I would do the same for this one. I’ll also need to take exam 70-513 and 70-516; but I’ll post my notes on those separately. None of these are “brain dumps” or any questions from the actual tests - just the books, links and notes I have from my studies. I’ll update these references as I’m studying, so bookmark this site and watch my Twitter and Facebook posts for when I’ll update them, or just subscribe to the RSS feed. A “Green” color on the check-block means I’ve done that part so far, red means I haven’t. First, I need to refresh my memory on some basic coding, so along with the Azure-specific information I’m reading the following general programming books: Introducing Microsoft .NET (Pro-Developer): http://www.amazon.com/Introducing-Microsoft-Pro-Developer-David-Platt/dp/0735619182/ref=sr_1_1?s=books&ie=UTF8&qid=1296339237&sr=1-1 Head First C#, 2E: A Learner's Guide to Real-World Programming with Visual C# and .NET: http://www.amazon.com/Head-First-2E-Real-World-Programming/dp/1449380344/ref=sr_1_1?ie=UTF8&qid=1296339176&sr=8-1 Microsoft Visual C# 2008 Step by Step : http://www.amazon.com/Microsoft-Visual-2008-Step/dp/0735624305/ref=sr_1_1?s=books&ie=UTF8&qid=1296339208&sr=1-1 c The first place to start is at the official site for the certification. That’s here: http://www.microsoft.com/learning/en/us/Exam.aspx?ID=70-583&Locale=en-us c On that page you’ll find several resources, and the first you should follow is the “Save to my learning” so you have a place to track everything. Then click the “Related Learning Plans” link and follow the videos and read the documentation in each of those bullets. There are six areas on the learning plan that you should focus on - make sure you open the learning plan to drill into the specifics. c Designing Data Storage Architecture (18%) Books I’m Reading: Links: My Notes: c Optimizing Data Access and Messaging (17%) Books I’m Reading: Links: My Notes: c Designing the Application Architecture (19%) Books I’m Reading: Links: My Notes: c Preparing for Application and Service Deployment (15%) Books I’m Reading: Links: My Notes: c Investigating and Analyzing Applications (16%) Books I’m Reading: Links: My Notes: c Designing Integrated Solutions (15%) Books I’m Reading: Links: My Notes:

    Read the article

  • Save the date For AutoVue Enterprise Visualization at Oracle OpenWorld 2013

    - by Gerald Fauteux
    Planning to attend Oracle OpenWorld 2013 (September 22–26, 2013)?  If so, be sure to check out the various Enterprise Visualization activities that you can take advantage of while in San Francisco. Enterprise Visualization Sessions: CON8992 - Qualcomm Streamlines Its Design and Manufacturing Process with AutoVue/Agile Products. Click here for full session description. Customer Speakers: Mary Legaspi - Staff Systems Administrator and Ravi Sankaran - Sr. Staff Systems Analyst, Qualcomm CON8741 - Visual Information Navigator: Next-Generation Interaction Paradigm. Click here for full session description. Speakers: Rozita Naghshin - Sr. Principal Product Manager-Visual Information Navigator and Thierry Bonfante - Senior Director Product Development, Oracle Other Activities  There will be an “Oracle’s AutoVue & Visual Information Navigator" pod in the exhibit hall Come and meet Oracle’s Visualization experts at the SCM product lounge, and have exclusive 1 on 1 or group conversations with development and strategy experts.     Check back shortly for the dates and times of these activities

    Read the article

  • eDelivery (Delivery Cloud) Housekeeping - removal of obsolete EPM products

    - by THE
    You may have noticed that Weblogic Server (WLS) 9.2.X and WLS 10.0.X releases have been removed from the Oracle Software Delivery Cloud. The Delivery Team has been asked to remove or update any product pack or product that embeds WLS 10.3.2 or earlier versions. This is consistent with general Oracle practice of removing old product versions from public distribution systems, and encourages customer usage and adoption of newer product releases such as WLS 10.3.3 or newer.  For the convenience of existing supported customers, a media request SR on My Oracle Support can be entered to obtain any removed media.  Information on how to open such an SR can be found on  MOS Doc ID 1071023.1 . OTN will also be reviewed and similar modifications may potentially be done.  The following media packs will be removed from E-Delivery this week, as of the above reason. Hyperion 9.3.1 Hyperion 9.2.1 Hyperion Pre-system 9 EPM 11.1.1.3 EPM 11.1.1.4

    Read the article

  • "ODM" - One of the Support team's most valued acronyms

    - by graham.mckendry(at)oracle.com
    If you submit technical service requests (SRs) through the My Oracle Support portal, you may often see the term "ODM" used in updates from our Support team. ODM is an acronym for "Oracle Diagnostic Methodology", which defines a standard problem solving approach that all of Oracle Support uses for every technical SR. ODM provides a number of benefits to the SRs - both for the Support organization and for the customer - including a consistent approach, higher quality, justified solutions, and ultimately faster resolution. Screenshot: Example of an ODM "Issue Clarification" activity in a service request The Oracle Diagnostic Methodology applies to both categories of technical SRs: Consultative (question-answer topics) and Problem-Solution. There are a few KM Notes that describe the steps of ODM, however to keep things simple (and since those KM Notes appear to be a bit outdated), I'll summarize the ODM stages here as follows: Consultative ODM - Three mandatory stages: ODM Question: Clarification of the customer's exact question. ODM Answer: Thorough answer to the customer's question. ODM Knowledge Content: Reference to new or existing knowledge base content, or explanation why the particular SR does not necessarily require knowledge content. Problem-Solution ODM - Eight mandatory stages: ODM Issue Clarification: Clarification of the reported issue, including the symptoms, the steps to reproduce, and an outline of the business impact ODM Issue Verification: Confirmation of the issue being verified based on proof provided by the customer, such as screenshots, log files, or reproducing the issue during an Oracle Web Conference. ODM Cause Determination: Succinct outline of the root cause of the issue. ODM Cause Justification: Explanation as to why the root cause applies to this particular situation. ODM Proposed Solution(s): Succinct outline of the potential solution(s) to resolve the issue. ODM Proposed Solution(s) Justification: Explanation of why the proposed solution(s) will in fact resolve the issue. ODM Solution Action Plan: Detailed numbered instructions on how to execute the proposed solutions. ODM Knowledge Content: Reference to new or existing knowledge base content, or explanation why the particular SR does not necessarily require knowledge content. During these stages, you may see other optional ODM-related activities such as "ODM Data Collection", "ODM Action Plan", "ODM Research", and "ODM Test Case". Again, these structured tags help ensure a uniform methodology across your SRs. With this knowledge you should be able to develop better predictability of what's coming next in your SRs, as well as what you can do to help expedite the resolution process.

    Read the article

  • HTML Tidy in NetBeans IDE (Part 2)

    - by Geertjan
    This is what I was aiming for in the previous blog entry: What you can see above (especially if you click to enlarge it) is that I have HTML Tidy integrated into the NetBeans analyzer functionality, which is pluggable from 7.2 onwards. Well, if you set an implementation dependency on "Static Analysis Core", since it's not an official API yet. Also, the scopes of the analyzer functionality are not pluggable. That means you can 'only' set the analyzer's scope to one or more projects, one or more packages, or one or more files. Not one or more folders, which means you can't have a bunch off HTML files in a folder that you access via the Favorites window and then run the analyzer on that folder (or on multiple folders). Thus, to try out my new code, I had to put some HTML files into a package inside a Java application. Then I chose that package as the scope of the analyzer. Then I ran all the analyzers (i.e., standard NetBeans Java hints, FindBugs, as well as my HTML Tidy extension) on that package. The screenshot above is the result. Here's all the code for the above, which is a port of the Action code from the previous blog entry into a new Analyzer implementation: import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.swing.JComponent; import javax.swing.text.Document; import org.netbeans.api.fileinfo.NonRecursiveFolder; import org.netbeans.modules.analysis.spi.Analyzer; import org.netbeans.modules.analysis.spi.Analyzer.AnalyzerFactory; import org.netbeans.modules.analysis.spi.Analyzer.Context; import org.netbeans.modules.analysis.spi.Analyzer.CustomizerProvider; import org.netbeans.modules.analysis.spi.Analyzer.WarningDescription; import org.netbeans.spi.editor.hints.ErrorDescription; import org.netbeans.spi.editor.hints.ErrorDescriptionFactory; import org.netbeans.spi.editor.hints.Severity; import org.openide.cookies.EditorCookie; import org.openide.filesystems.FileObject; import org.openide.loaders.DataObject; import org.openide.util.Exceptions; import org.openide.util.lookup.ServiceProvider; import org.w3c.tidy.Tidy; public class TidyAnalyzer implements Analyzer {     private final Context ctx;     private TidyAnalyzer(Context cntxt) {         this.ctx = cntxt;     }     @Override     public Iterable<? extends ErrorDescription> analyze() {         List<ErrorDescription> result = new ArrayList<ErrorDescription>();         for (NonRecursiveFolder sr : ctx.getScope().getFolders()) {             FileObject folder = sr.getFolder();             for (FileObject fo : folder.getChildren()) {                 for (ErrorDescription ed : doRunHTMLTidy(fo)) {                     if (fo.getMIMEType().equals("text/html")) {                         result.add(ed);                     }                 }             }         }         return result;     }     private List<ErrorDescription> doRunHTMLTidy(FileObject sr) {         final List<ErrorDescription> result = new ArrayList<ErrorDescription>();         Tidy tidy = new Tidy();         StringWriter stringWriter = new StringWriter();         PrintWriter errorWriter = new PrintWriter(stringWriter);         tidy.setErrout(errorWriter);         try {             Document doc = DataObject.find(sr).getLookup().lookup(EditorCookie.class).openDocument();             tidy.parse(sr.getInputStream(), System.out);             String[] split = stringWriter.toString().split("\n");             for (String string : split) {                 //Bit of ugly string parsing coming up:                 if (string.startsWith("line")) {                     final int end = string.indexOf(" c");                     int lineNumber = Integer.parseInt(string.substring(0, end).replace("line ", ""));                     string = string.substring(string.indexOf(": ")).replace(":", "");                     result.add(ErrorDescriptionFactory.createErrorDescription(                             Severity.WARNING,                             string,                             doc,                             lineNumber));                 }             }         } catch (IOException ex) {             Exceptions.printStackTrace(ex);         }         return result;     }     @Override     public boolean cancel() {         return true;     }     @ServiceProvider(service = AnalyzerFactory.class)     public static final class MyAnalyzerFactory extends AnalyzerFactory {         public MyAnalyzerFactory() {             super("htmltidy", "HTML Tidy", "org/jtidy/format_misc.gif");         }         public Iterable<? extends WarningDescription> getWarnings() {             return Collections.EMPTY_LIST;         }         @Override         public <D, C extends JComponent> CustomizerProvider<D, C> getCustomizerProvider() {             return null;         }         @Override         public Analyzer createAnalyzer(Context cntxt) {             return new TidyAnalyzer(cntxt);         }     } } The above only works on packages, not on projects and not on individual files.

    Read the article

  • Taking the Mystique out of the Remote Diagnostics Agent (RDA)

    - by Robert Schweighardt
    Ever wondered why you were asked for the RDA? When you open an SR with support you may be asked to upload the RDA.   We realize that this might take you some time, however the RDA contains a lot of diagnostic information about your environment which may help us resolve the SR faster. The following document goes through all the key stages involved in collating the RDA :- Get Proactive with Fusion Middleware : Resolve SRs Faster! Use Remote Diagnostic Agent [ID 1498376.1]  Click on the Tabs within the document to have all your questions answered. Further Information for specific Data Integration Products can be found in the following Notes:- How To Run RDA for Oracle Data Integrator 11g (Note 1457914.1)  Using OCM (Oracle Configuration Manager) and RDA (Remote Diagnostic Agent) For Troubleshooting ODI (Note 1398483.1)  How To Run RDA for Oracle Warehouse Builder [ID 1098485.1] Always ensure you have the latest RDA this can be downloaded from:- Remote Diagnostic Agent (RDA) 4 - Getting Started [ID 314422.1] 

    Read the article

  • How to print PCL Directly to the printer? Vb.net VS 2010

    - by Justin
    Good day, I've been trying to upgrade an old Print Program that prints raw pcl directly to the printer. The print program takes a PCL Mask and a PCL Batch Spool File (just pcl with page turn commands, I think) merges them and sends them off to the printer. I'm able to send to the Printer a file stream of PCL but I get mixed results and i do not understand why printing is so difficult under .net. I mean yes there is the PrintDocument class, but to print PCL... Let's just say I'm ready to detach my printer from the network and burn it a live. Here is my class PrintDirect (rather a hybrid class) Imports System Imports System.Text Imports System.Runtime.InteropServices <StructLayout(LayoutKind.Sequential)> _ Public Structure DOCINFO <MarshalAs(UnmanagedType.LPWStr)> _ Public pDocName As String <MarshalAs(UnmanagedType.LPWStr)> _ Public pOutputFile As String <MarshalAs(UnmanagedType.LPWStr)> _ Public pDataType As String End Structure 'DOCINFO Public Class PrintDirect <DllImport("winspool.drv", CharSet:=CharSet.Unicode, ExactSpelling:=False, CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function OpenPrinter(ByVal pPrinterName As String, ByRef phPrinter As IntPtr, ByVal pDefault As Integer) As Long End Function <DllImport("winspool.drv", CharSet:=CharSet.Unicode, ExactSpelling:=False, CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function StartDocPrinter(ByVal hPrinter As IntPtr, ByVal Level As Integer, ByRef pDocInfo As DOCINFO) As Long End Function <DllImport("winspool.drv", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function StartPagePrinter(ByVal hPrinter As IntPtr) As Long End Function <DllImport("winspool.drv", CharSet:=CharSet.Ansi, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function WritePrinter(ByVal hPrinter As IntPtr, ByVal data As String, ByVal buf As Integer, ByRef pcWritten As Integer) As Long End Function <DllImport("winspool.drv", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function EndPagePrinter(ByVal hPrinter As IntPtr) As Long End Function <DllImport("winspool.drv", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function EndDocPrinter(ByVal hPrinter As IntPtr) As Long End Function <DllImport("winspool.drv", CharSet:=CharSet.Unicode, ExactSpelling:=True, CallingConvention:=CallingConvention.StdCall)> _ Public Shared Function ClosePrinter(ByVal hPrinter As IntPtr) As Long End Function 'Helps uses to work with the printer Public Class PrintJob ''' <summary> ''' The address of the printer to print to. ''' </summary> ''' <remarks></remarks> Public PrinterName As String = "" Dim lhPrinter As New System.IntPtr() ''' <summary> ''' The object deriving from the Win32 API, Winspool.drv. ''' Use this object to overide the settings defined in the PrintJob Class. ''' </summary> ''' <remarks>Only use this when absolutly nessacary.</remarks> Public OverideDocInfo As New DOCINFO() ''' <summary> ''' The PCL Control Character or the ascii escape character. \x1b ''' </summary> ''' <remarks>ChrW(27)</remarks> Public Const PCL_Control_Character As Char = ChrW(27) ''' <summary> ''' Opens a connection to a printer, if false the connection could not be established. ''' </summary> ''' <returns></returns> ''' <remarks></remarks> Public Function OpenPrint() As Boolean Dim rtn_val As Boolean = False PrintDirect.OpenPrinter(PrinterName, lhPrinter, 0) If Not lhPrinter = 0 Then rtn_val = True End If Return rtn_val End Function ''' <summary> ''' The name of the Print Document. ''' </summary> ''' <value></value> ''' <returns></returns> ''' <remarks></remarks> Public Property DocumentName As String Get Return OverideDocInfo.pDocName End Get Set(ByVal value As String) OverideDocInfo.pDocName = value End Set End Property ''' <summary> ''' The type of Data that will be sent to the printer. ''' </summary> ''' <value>Send the print data type, usually "RAW" or "LPR". To overide use the OverideDocInfo Object</value> ''' <returns>The DataType as it was provided, if it is not part of the enumeration it is set to "UNKNOWN".</returns> ''' <remarks></remarks> Public Property DocumentDataType As PrintDataType Get Select Case OverideDocInfo.pDataType.ToUpper Case "RAW" Return PrintDataType.RAW Case "LPR" Return PrintDataType.LPR Case Else Return PrintDataType.UNKOWN End Select End Get Set(ByVal value As PrintDataType) OverideDocInfo.pDataType = [Enum].GetName(GetType(PrintDataType), value) End Set End Property Public Property DocumentOutputFile As String Get Return OverideDocInfo.pOutputFile End Get Set(ByVal value As String) OverideDocInfo.pOutputFile = value End Set End Property Enum PrintDataType UNKOWN = 0 RAW = 1 LPR = 2 End Enum ''' <summary> ''' Initializes the printing matrix ''' </summary> ''' <param name="PrintLevel">I have no idea what the hack this is...</param> ''' <remarks></remarks> Public Sub OpenDocument(Optional ByVal PrintLevel As Integer = 1) PrintDirect.StartDocPrinter(lhPrinter, PrintLevel, OverideDocInfo) End Sub ''' <summary> ''' Starts the next page. ''' </summary> ''' <remarks></remarks> Public Sub StartPage() PrintDirect.StartPagePrinter(lhPrinter) End Sub ''' <summary> ''' Writes a string to the printer, can be used to write out a section of the document at a time. ''' </summary> ''' <param name="data">The String to Send out to the Printer.</param> ''' <returns>The pcWritten as an integer, 0 may mean the writter did not write out anything.</returns> ''' <remarks>Warning the buffer is automatically created by the lenegth of the string.</remarks> Public Function WriteToPrinter(ByVal data As String) As Integer Dim pcWritten As Integer = 0 PrintDirect.WritePrinter(lhPrinter, data, data.Length - 1, pcWritten) Return pcWritten End Function Public Sub EndPage() PrintDirect.EndPagePrinter(lhPrinter) End Sub Public Sub CloseDocument() PrintDirect.EndDocPrinter(lhPrinter) End Sub Public Sub ClosePrint() PrintDirect.ClosePrinter(lhPrinter) End Sub ''' <summary> ''' Opens a connection to a printer and starts a new document. ''' </summary> ''' <returns>If false the connection could not be established. </returns> ''' <remarks></remarks> Public Function Open() As Boolean Dim rtn_val As Boolean = False rtn_val = OpenPrint() If rtn_val Then OpenDocument() End If Return rtn_val End Function ''' <summary> ''' Closes the document and closes the connection to the printer. ''' </summary> ''' <remarks></remarks> Public Sub Close() CloseDocument() ClosePrint() End Sub End Class End Class 'PrintDirect Here is how I print my file. I'm simple printing the PCL Masks, to show proof of concept. But I can't even do that. I can effectively create PCL and send it the printer without reading the file and it works fine... Plus I get mixed results with different stream reader text encoding as well. Dim pJob As New PrintDirect.PrintJob pJob.DocumentName = " test doc" pJob.DocumentDataType = PrintDirect.PrintJob.PrintDataType.RAW pJob.PrinterName = sPrinter.GetDevicePath '//This is where you'd stick your device name, sPrinter stands for Selected Printer from a dropdown (combobox). 'pJob.DocumentOutputFile = "C:\temp\test-spool.txt" If Not pJob.OpenPrint() Then MsgBox("Unable to connect to " & pJob.PrinterName, MsgBoxStyle.OkOnly, "Print Error") Exit Sub End If pJob.OpenDocument() pJob.StartPage() Dim sr As New IO.StreamReader(Me.txtFile.Text, Text.Encoding.ASCII) '//I've got best results with ASCII before, but only mized. Dim line As String = sr.ReadLine 'Fix for fly code on first run 'If line = 27 Then line = PrintDirect.PrintJob.PCL_Control_Character Do While (Not line Is Nothing) pJob.WriteToPrinter(line) line = sr.ReadLine Loop 'pJob.WriteToPrinter(ControlChars.FormFeed) pJob.EndPage() pJob.CloseDocument() sr.Close() sr.Dispose() sr = Nothing pJob.Close() I was able to get to print the mask, in the morning... now I'm getting strange printer characters scattered through 5 pages... I'm totally clueless. I must have changed something or the printer is at fault. You can access my test Check Mask, here http://kscserver.com/so/chk_mask.zip .

    Read the article

  • Reading a POP3 server with only TcpClient and StreamWriter/StreamReader[SOLVED]

    - by WebDevHobo
    I'm trying to read mails from my live.com account, via the POP3 protocol. I've found the the server is pop3.live.com and the port if 995. I'm not planning on using a pre-made library, I'm using NetworkStream and StreamReader/StreamWriter for the job. I need to figure this out. So, any of the answers given here: http://stackoverflow.com/questions/44383/reading-email-using-pop3-in-c are not usefull. It's part of a larger program, but I made a small test to see if it works. Eitherway, i'm not getting anything. Here's the code I'm using, which I think should be correct. EDIT: this code is old, please refer to the second block problem solved. public Program() { string temp = ""; using(TcpClient tc = new TcpClient(new IPEndPoint(IPAddress.Parse("127.0.0.1"),8000))) { tc.Connect("pop3.live.com",995); using(NetworkStream nws = tc.GetStream()) { using(StreamReader sr = new StreamReader(nws)) { using(StreamWriter sw = new StreamWriter(nws)) { sw.WriteLine("USER " + user); sw.Flush(); sw.WriteLine("PASS " + pass); sw.Flush(); sw.WriteLine("LIST"); sw.Flush(); while(temp != ".") { temp += sr.ReadLine(); } } } } } Console.WriteLine(temp); } Visual Studio debugger constantly falls over tc.Connect("pop3.live.com",995); Which throws an "A socket operation was attempted to an unreachable network 65.55.172.253:995" error. So, I'm sending from port 8000 on my machine to port 995, the hotmail pop3 port. And I'm getting nothing, and I'm out of ideas. Second block: Problem was apparently that I didn't write the quit command. The Code: public Program() { string str = string.Empty; string strTemp = string.Empty; using(TcpClient tc = new TcpClient()) { tc.Connect("pop3.live.com",995); using(SslStream sl = new SslStream(tc.GetStream())) { sl.AuthenticateAsClient("pop3.live.com"); using(StreamReader sr = new StreamReader(sl)) { using(StreamWriter sw = new StreamWriter(sl)) { sw.WriteLine("USER " + user); sw.Flush(); sw.WriteLine("PASS " + pass); sw.Flush(); sw.WriteLine("LIST"); sw.Flush(); sw.WriteLine("QUIT "); sw.Flush(); while((strTemp = sr.ReadLine()) != null) { if(strTemp == "." || strTemp.IndexOf("-ERR") != -1) { break; } str += strTemp; } } } } } Console.WriteLine(str); }

    Read the article

  • Returned content type - Restlet

    - by DutrowLLC
    How do you set the content type in Restlet? In this case, I'd like to set the content type to ""text/xml". I have: public class SubResource extends ServerResource { @Get public Representation get(Representation representation){ setStatus(Status.SUCCESS_OK); StringRepresentation sr = new StringRepresentation(getSomeXml()); return sr; } } I'm unsure even if it is a value that is set in the Representation, or if it is set from the ServerResource class the same way that the return code is.

    Read the article

  • Subsonic Simple Repo for high volume site

    - by kjgilla
    Simple Repo has given me a competitive edge in my consulting. I can finish projects much faster than I could in the "cmd.Parameters.Add(param)" days. As things progress on this end im getting into higher volume sites and wondering if Simple Repo is still the way to go. Im wondering what people's experiences have been putting SR into production vs. NHibernate. Any tips or tricks for using SR in production.

    Read the article

  • Getting the executed output of an aspx page after a short delay

    - by Ankur
    Hi all, I have an aspx page which has some javascript code like <script> setTimeout("document.write('" + place.address + "');",1); </script> As it is clear from the code it will going to write something on the page after a very short delay of 1 ms. I have created an another page to get the page executed by some query string and get its output. The problem is I can not avoid the delay as simply writing document.write(place.address); will not print anything as it takes a little time to get values so if i set it in setTimeout for delayed output of 1 ms it always return me a value If I request the output from another page using System.Net.WebClient wc = new System.Net.WebClient(); System.IO.StreamReader sr = new System.IO.StreamReader(wc.OpenRead("http://localhost:4859/Default.aspx?lat=" + lat + "&lng=" + lng)); string strData = sr.ReadToEnd(); I get the source code of the document instead of the desired output can anyone help me out for either avoiding that delay or else delayed the client request ouput so that i get a desired value not the source code The js on default.aspx is <script type="text/javascript"> var geocoder; var address; function initialize() { geocoder = new GClientGeocoder(); var qs=new Querystring(); if(qs.get("lat") && qs.get("lng")) { geocoder.getLocations(new GLatLng(qs.get("lat"),qs.get("lng")),showAddress); } else { document.write("Invalid Access Or Not valid lat long is provided."); } } function getAddress(overlay, latlng) { if (latlng != null) { address = latlng; geocoder.getLocations(latlng, showAddress); } } function showAddress(r) { place = r.Placemark[0]; setTimeout("document.write('" + place.address + "');",1); //document.write(place.address); } </script> and the code on requestClient.aspx is as System.Net.WebClient wc = new System.Net.WebClient(); System.IO.StreamReader sr = new System.IO.StreamReader(wc.OpenRead("http://localhost:4859/Default.aspx?lat=" + lat + "&lng=" + lng)); string strData = sr.ReadToEnd();

    Read the article

  • Array help Index out of range exeption was unhandled

    - by Michael Quiles
    I am trying to populate combo boxes from a text file using comma as a delimiter everything was working fine, but now when I debug I get the "Index out of range exeption was unhandled" warning. I guess I need a fresh pair of eyes to see where I went wrong, I commented on the line that gets the error //Fname = fields[1]; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Printing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO; namespace Sullivan_Payroll { public partial class xEmpForm : Form { bool complete = false; public xEmpForm() { InitializeComponent(); } private void xEmpForm_Resize(object sender, EventArgs e) { this.xCenterPanel.Left = Convert.ToInt16((this.Width - this.xCenterPanel.Width) / 2); this.xCenterPanel.Top = Convert.ToInt16((this.Height - this.xCenterPanel.Height) / 2); Refresh(); } private void exitToolStripMenuItem_Click(object sender, EventArgs e) { //Exits the application this.Close(); } private void xEmpForm_FormClosing(object sender, FormClosingEventArgs e) //use this on xtrip calculator { DialogResult Response; if (complete == true) { Application.Exit(); } else { Response = MessageBox.Show("Are you sure you want to Exit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (Response == DialogResult.No) { complete = false; e.Cancel = true; } else { complete = true; Application.Exit(); } } } private void xEmpForm_Load(object sender, EventArgs e) { //file sources string fileDept = "source\\Department.txt"; string fileSex = "source\\Sex.txt"; string fileStatus = "source\\Status.txt"; if (File.Exists(fileDept)) { using (System.IO.StreamReader sr = System.IO.File.OpenText(fileDept)) { string dept = ""; while ((dept = sr.ReadLine()) != null) { this.xDeptComboBox.Items.Add(dept); } } } else { MessageBox.Show("The Department file can not be found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (File.Exists(fileSex)) { using (System.IO.StreamReader sr = System.IO.File.OpenText(fileSex)) { string sex = ""; while ((sex = sr.ReadLine()) != null) { this.xSexComboBox.Items.Add(sex); } } } else { MessageBox.Show("The Sex file can not be found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (File.Exists(fileStatus)) { using (System.IO.StreamReader sr = System.IO.File.OpenText(fileStatus)) { string status = ""; while ((status = sr.ReadLine()) != null) { this.xStatusComboBox.Items.Add(status); } } } else { MessageBox.Show("The Status file can not be found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void xFileSaveMenuItem_Click(object sender, EventArgs e) { { const string fileNew = "source\\New Staff.txt"; string recordIn; FileStream outFile = new FileStream(fileNew, FileMode.Create, FileAccess.Write); StreamWriter writer = new StreamWriter(outFile); for (int count = 0; count <= this.xEmployeeListBox.Items.Count - 1; count++) { this.xEmployeeListBox.SelectedIndex = count; recordIn = this.xEmployeeListBox.SelectedItem.ToString(); writer.WriteLine(recordIn); } writer.Close(); outFile.Close(); this.xDeptComboBox.SelectedIndex = -1; this.xStatusComboBox.SelectedIndex = -1; this.xSexComboBox.SelectedIndex = -1; MessageBox.Show("your file is saved"); } } private void xViewFacultyMenuItem_Click(object sender, EventArgs e) { const string fileStaff = "source\\Staff.txt"; const char DELIM = ','; string Lname, Fname, Depart, Stat, Sex, Salary, cDept, cStat, cSex; double Gtotal; string recordIn; string[] fields; cDept = this.xDeptComboBox.SelectedItem.ToString(); cStat = this.xStatusComboBox.SelectedItem.ToString(); cSex = this.xSexComboBox.SelectedItem.ToString(); FileStream inFile = new FileStream(fileStaff, FileMode.Open, FileAccess.Read); StreamReader reader = new StreamReader(inFile); recordIn = reader.ReadLine(); while (recordIn != null) { fields = recordIn.Split(DELIM); Lname = fields[0]; Fname = fields[1]; // this is where the error appears Depart = fields[2]; Stat = fields[3]; Sex = fields[4]; Salary = fields[5]; Fname = fields[1].TrimStart(null); Depart = fields[2].TrimStart(null); Stat = fields[3].TrimStart(null); Sex = fields[4].TrimStart(null); Salary = fields[5].TrimStart(null); Gtotal = double.Parse(Salary); if (Depart == cDept && cStat == Stat && cSex == Sex) { this.xEmployeeListBox.Items.Add(recordIn); } recordIn = reader.ReadLine(); } reader.Close(); inFile.Close(); if (this.xEmployeeListBox.Items.Count >= 1) { this.xFileSaveMenuItem.Enabled = true; this.xFilePrintMenuItem.Enabled = true; this.xEditClearMenuItem.Enabled = true; } else { this.xFileSaveMenuItem.Enabled = false; this.xFilePrintMenuItem.Enabled = false; this.xEditClearMenuItem.Enabled = false; MessageBox.Show("Records not found"); } } private void xEditClearMenuItem_Click(object sender, EventArgs e) { this.xEmployeeListBox.Items.Clear(); this.xDeptComboBox.SelectedIndex = -1; this.xStatusComboBox.SelectedIndex = -1; this.xSexComboBox.SelectedIndex = -1; this.xFileSaveMenuItem.Enabled = false; this.xFilePrintMenuItem.Enabled = false; this.xEditClearMenuItem.Enabled = false; } } } Source file -- Anderson, Kristen, Accounting, Assistant, Female, 43155 Ball, Robin, Accounting, Instructor, Female, 42723 Chin, Roger, Accounting, Full, Male,59281 Coats, William, Accounting, Assistant, Male, 45371 Doepke, Cheryl, Accounting, Full, Female, 52105 Downs, Clifton, Accounting, Associate, Male, 46887 Garafano, Karen, Finance, Associate, Female, 49000 Hill, Trevor, Management, Instructor, Male, 38590 Jackson, Carole, Accounting, Instructor, Female, 38781 Jacobson, Andrew, Management, Full, Male, 56281 Lewis, Karl, Management, Associate, Male, 48387 Mack, Kevin, Management, Assistant, Male, 45000 McKaye, Susan, Management, Instructor, Female, 43979 Nelsen, Beth, Finance, Full, Female, 52339 Nelson, Dale, Accounting, Full, Male, 54578 Palermo, Sheryl, Accounting, Associate, Female, 45617 Rais, Mary, Finance, Instructor, Female, 27000 Scheib, Earl, Management, Instructor, Male, 37389 Smith, Tom, Finance, Full, Male, 57167 Smythe, Janice, Management, Associate, Female, 46887 True, David, Accounting, Full, Male, 53181 Young, Jeff, Management, Assistant, Male, 43513

    Read the article

  • Syntax error for makecert.exe tool

    - by user340817
    Did I missed anything during this? I am running a this command from command prompt in Windows 7 to create a certificate but it is showing a syntax error. Command I ran: makecert.exe "c:\1\Test.cer" -a sha1 -n "CN=AppGuid" -sr LocalMachine -ss My -sky signature -pe -len 2048 Output I got: Usage: MakeCert [ basic|extended options] [outputCertificateFile] Basic Options -sk -ss -sr . . . Did I missed anything during this?

    Read the article

  • Find the closest palindrome number C#

    - by user294837
    Hi All, I am trying to create a console application that reads number from a file all underneath each other like so: 101 9 and then outputs into another file the closest palindrome number. So far what I have is not quite rightm i.e. I don't think I can put the class inside a method which is a bit more Java I was wandering if anyone could help at all? Thanks :) namespace PalidromeC { class Program { static public void Main(string[] args) { #region WriteAnswers try { StreamWriter sw = new StreamWriter("C://Temp/PalindromeAnswers.txt"); sw.WriteLine("Answers"); sw.Close(); }//try catch (Exception e) { Console.WriteLine("Exception: " + e.Message); }//catch #endregion #region ReadFile try { string numbers; StreamReader sr = new StreamReader("C://Temp/Palindrome.txt"); numbers = sr.ReadLine(); while (numbers != null) { Console.WriteLine(numbers); numbers = sr.ReadLine(); }//while sr.Close(); Console.ReadLine(); }//try catch (Exception e) { Console.WriteLine("Exception: " + e.Message); }//catch #endregion NearPalindromeFinder f = new NearPalindromeFinder(); int palindrome = f.findNearPalindrome(n); Console.WriteLine("Nearest Palindrome = " + palindrome); }//main public static void testFindNearestPalindrome(int n) { class NearPalindromeFinder { int findNearPalindrome(int start) { if (testPalindrome(start)) return start; else { int neg = start; int pos = start; for (int i = 0; i < start; i++) { if (testPalindrome(start-i)) { neg = start-i; break; }//if if (testPalindrome(start+i)) { pos = start+i; break; }//if }//for return (start == neg) ? pos : neg; }//else }//findNearPalindrome bool testPalindrome(int start) { if (start == 0 || start == 1) return true; String str = String.valueOf(start); String rev = new if (str.equals(rev)) return true; else return false; }//testPalindrome }//NearPalindromeFinder class }//testFindNearestPalindrome }//Program Class

    Read the article

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