reader

Spring Batch reader using generics

拈花ヽ惹草 提交于 2020-01-25 18:24:27
问题 I'm just new in the spring architecture and I am wondering if it is possible to use a generic T (o what you want) in an ItemStreamReader . Something like this: public class Reader implements ItemStreamReader<T extends SomeClass>{ public T read() { ....... } public void open() { ....... } public void update() { ....... } public void close() { ....... } } So I pass to the reader various objects that extends SomeClass . 回答1: this should work: public class Reader<T extends SomeClass> implements

Logic to reading an XML file in vb.net

荒凉一梦 提交于 2020-01-17 01:27:07
问题 I have an XML file that i am trying to read and rewrite (for later manipulation) to a new text file using vb.net. I am able to read the XML successfully and print it out, but i am having problems getting the correct with then start and end tags of each element/attribute. I am using an 'xmlNodeReader' to read the document by getting the name and value of each read. Then a select case with xmlNodeType.Element or xmlNodeType.EndElement How do I get the correct logic to solve this, as some XML

Read text file return 'System.NotSupportedException' exception [duplicate]

旧城冷巷雨未停 提交于 2019-12-25 18:30:02
问题 This question already has an answer here : What is causing NotSupportedException (“The given path's format is not supported”) while using a valid path? (1 answer) Closed 3 years ago . i try to read Text file line by line: static void Main(string[] args) { int counter = 0; string line; string links = @"‪D:\links.txt"; // Read the file and display it line by line. System.IO.StreamReader file = new System.IO.StreamReader(links); while ((line = file.ReadLine()) != null) { Console.WriteLine(line);

Check if Adobe Reader is installed before using it

匆匆过客 提交于 2019-12-25 08:52:01
问题 I want to be able to have my app check if Adobe Reader is installed. If it is, I want my program to use it to display the PDF, if not I want to use my free (limited) reader control to display the PDF. Any suggestions Edit: my question seems to be little to broad So basicly i'm trying to do the following Try Dim AcroDisplay As New AxAcroPDFLib.AxAcroPDF AcroDisplay.Left = 50 AcroDisplay.Top = 50 AcroDisplay.Width = 200 AcroDisplay.Height = 500 me.Controls.Add(AcroDisplay) MsgBox("Acro Added")

Read avi video - Matlab

…衆ロ難τιáo~ 提交于 2019-12-24 12:43:31
问题 I want to read an AVI File in Matlab. I tried it according to this link: http://inside.mines.edu/~whoff/courses/EENG512/lectures/other/Matlab_movies.pdf : clear all close all movieObj = VideoReader('ap001_BL0_SP2_cam03_compressed.avi'); % open file get(movieObj) % display all information about movie nFrames = movieObj.NumberOfFrames; %shows 310 in my case for iFrame=1:2:nFrames I = read(movieObj,iFrame); % get one RGB image imshow(I,[]); % Display image end I get the following error: Error

Read line in golang

僤鯓⒐⒋嵵緔 提交于 2019-12-23 02:52:30
问题 There are so many option to do this in Go. For example: scanner := bufio.NewScanner(os.Stdin) for scanner.Scan() { fmt.Println(scanner.Text()) } or reader := bufio.NewReader(os.Stdin) text, _ := reader.ReadString('\n') Neither is working in my case. I am unable to find the reason why new line scan is not working. Here's the question I'm working on: https://www.hackerrank.com/challenges/30-dictionaries-and-maps And here's my code: package main import ( "fmt" "bufio" "os" "strings" ) func main(

read specific line in csv file , python

最后都变了- 提交于 2019-12-19 21:27:07
问题 In an CSV file with python we can read all the file line by line or row by row , I want to read specific line (line number 24 example ) without reading all the file and all the lines. 回答1: You can use linecache.getline: linecache.getline(filename, lineno[, module_globals]) Get line lineno from file named filename. This function will never raise an exception — it will return '' on errors (the terminating newline character will be included for lines that are found). import linecache line =

how to fix import excel file in php

自闭症网瘾萝莉.ら 提交于 2019-12-13 23:08:44
问题 i have problem with import data excel in php use excel_reader. this is error view pict error this is my code : $config['upload_path'] = './assets/excel/'; $config['allowed_types'] = 'xls'; $config['max_size'] = 1024 * 8; $this->load->library('upload', $config); if ( ! $this->upload->do_upload()) { echo'<script>alert("Upload gagal. Perhatikan ekstensi file. Ekstensi harus xls. Apabila ekstensi sudah xls namun gagal, lengkapi data dalam file xls.");</script>'; $this->load->view('include/header'

LoadFile method of PDF viewer control not visible

吃可爱长大的小学妹 提交于 2019-12-13 01:27:25
问题 I wanted to automate filling of PDF forms. So I created a WinForms project in VS2013, Added Adobe PDF Reader control, dragged control on to the form. No errors. Control is displayed on the form. However in the code of the form when I try to put in: axAcroPDF1.LoadFile The LoadFile method is not visible at all. The project .NET target is set to 4.5.1. I even tried 4.5 and lower. 回答1: The AxHost wraps only the Active X Control. The LoadFile Method is a method from the COM Class from your Adobe

Method replys unplugged NFC readers

风格不统一 提交于 2019-12-12 02:56:56
问题 I currently use pcsc-sharp to read ids from NFC tags. I got this methode to lists all available readers. But this replys me all readers I ever used. There are also old readers listed that aren´t plugged in. Does anyone know how to fix that? public void SelectDevice() { List<string> availableReaders = this.ListReaders(); this.RdrState = new Card.SCARD_READERSTATE(); readername = availableReaders[0].ToString(); this.RdrState.RdrName = readername; } public List<string> ListReaders() { int