Collage

n. A piece of art made by sticking various different materials, aka PHENOMENA Magazine
Department
1. 삼바설치 sudo apt-get -y update sudo apt-get -y install samba 2. 기존에 사용하고 있는 리눅스 계정을 Samba에 추가하기 위해 아래 명령어를 입력 sudo smbpasswd -a <계정명> 계정은 리눅스에 존재하는 계정이면 Samba에 계속 추가할 수 있음 3. 원본을 보존하기 위해 Samba 설정 파일을 백업 sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_temp 4. Samba 설정 파일을 수정 sudo nano /etc/samba/smb.conf 5. 공유할 디렉토리를 설정하기 위해서 설정 파일의 가장 하단에 아래와 같은 형태로 입력 [multimedia] comment = multimedia directory path = /data/Multimedia valid users = id1,id2 writeable = yes read only = no create mode = 0777 directory mode = 0777 6. 파일 수정이 완료되면 저장하고 Samba 데몬을 재시작 sudo service smbd restart 위의 명령어로 삼바 데몬을 재 구동을 시켜주면 좀전에 설정한 내역들이 적용됨. * 파이썬으로 삼바접속 1. pysmb 라이브러리 설치 (https://pypi.org/project/pysmb/) 2. 예제코드 from smb.SMBConnection import SMBConnection server_ip = "10.110.10.10" # Take your server IP - I have put a fake IP :) server_name = 'myserver' # The servername for the IP above share_name = "GRUPOS" # This is the principal folder of your network that you want's to connect network_username = 'myuser' # This is your network username network_password = '***' # This is your network password machine_name = 'myuser@mac-mc70006405' # Your machine name conn = SMBConnection(network_username, network_password, machine_name, server_name, use_ntlm_v2 = True) assert conn.connect(server_ip, 139) files = conn.listPath(share_name, "/TECNOLOGIA_INFORMACAO/Dashboard Diretoria/") for item in files: print(item.filename) https://psychoria.tistory.com/678 리눅스 환경(Ubuntu)에서 개발을 편리하게! Samba 구축하기 - 코드도사 (codedosa.com) How to get a file from a network windows directory and move to my Python Django project directory? - Stack Overflow
John Doe · Jan. 12, 2023, 7:27 a.m.
Ubuntu samba
Q : pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"   A : pip install gensim config --global http.sslVerify false Just install any package with the "config --global http.sslVerify false" statement You can ignore SSL errors by setting pypi.org and files.pythonhosted.org as well as the older pypi.python.org as trusted hosts. $ pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org <package_name> Note: Sometime during April 2018, the Python Package Index was migrated from pypi.python.org to pypi.org. This means "trusted-host" commands using the old domain no longer work, but you can add both. Permanent Fix Since the release of pip 10.0, you should be able to fix this permanently just by upgrading pip itself: $ pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip setuptools Or by just reinstalling it to get the latest version: $ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py (… and then running get-pip.py with the relevant Python interpreter). pip install <otherpackage> should just work after this. If not, then you will need to do more, as explained below. You may want to add the trusted hosts and proxy to your config file. pip.ini (Windows) or pip.conf (unix) [global] trusted-host = pypi.python.org pypi.org files.pythonhosted.org Alternate Solutions (Less secure) Most of the answers could pose a security issue. Two of the workarounds that help in installing most of the python packages with ease would be: Using easy_install: if you are really lazy and don't want to waste much time, use easy_install <package_name>. Note that some packages won't be found or will give small errors. Using Wheel: download the Wheel of the python package and use the pip command pip install wheel_package_name.whl to install the package. https://stackoverflow.com/questions/25981703/pip-install-fails-with-connection-error-ssl-certificate-verify-failed-certi/26062583
John Doe · Jan. 12, 2023, 3:28 a.m.
ssl pip
xwidget_62_Silver Screen Anjuli O'Connell has a perfect memory, but no confidence in herself -- knowing, afterall, is not understanding. Roy Croft is undoubtedly brilliant and knows everything -- "how the pieces fit together, and how they don't." They both work for OptiNet, a vast multinational that owns the worldwide communications network and the artificial intelligence, 901. Eccentric Roy, despite his involvement with extremist political groups fighting for AI liberation, is too valuable a programmer not to employ; Anjuli is a top expert in AI psychology. Roy turns up dead and OptiNet is quick to call it suicide. Just before he died, Roy filed against OptiNet with the Court of Human Rights in an effort to prove that 901 is a being in its own right. This is puzzling in itself as he was aware a move like that would doubtless lead to 901's "death" rather than its liberation. He also left a series of cryptic messages for Anjuli that may be luring her into an insanely dangerous game for his own warped purposes or leading her to an important truth. The storyline runs through mystery/thriller territory as Anjuli seeks answers and, finally, a mysterious Source must be found and recovering it requires a solo mission into a super-fortified pseudo-abbey in experimental biomech armor. But that is far from all. Robson's debut novel may be imperfect, but it's astonishingly full of imaginative imagery and stylish writing. First published in the U.K. in 1999 it is belatedly arriving in the U.S. only after two subsequent and even more-accomplished novels. Provocative and unique, Robson is stellar talent of the first magnitude. (CFQ Vol. 37, Issue #8)
John Doe · Jan. 12, 2023, 3:17 a.m.
xwidget_61_20th Century Ghosts   This may be your first encounter with a writer named Joe Hill, but it most certainly will not be the last. This remarkable, not-to-be-missed debut collection may well herald the beginnings of a notable career. Christopher Golden, in his introduction, refers to Hill's stories as "subtle", but they are more noteworthy for their perfectly eloquent lucidity than understatement. Often laced with nostalgia reminiscent of Bradbury and graced with the irresistible imaginative tug of Stephen King at top form, Hill's stories are more skewed and surreal than either writer's and usually fall further into weird. "The Cape" even lulls you with Bradburyian charms then gleefully skewers you with Kinglike wickedness. Hill also has a knack for reviving the jaded sensibilities of the veteran horror reader. The title tale is a ghost story that delivers the unexpected for those who have read plenty of ghost stories and think they know what to expect. The burned-out editor of an annual anthology discovers an astonishing story and its distressing author in "Best New Horror". The ending may be inevitable, but the tale still entrances. In the accomplished novella, Voluntary Committal, two teenage boys deal with the reality of a terrible accident. Reality may be mutable and memory can be sealed "behind a wall of carefully laid mental bricks," but such a wall may not last forever. In the fabulist "My Father's Mask", a family visits Masquerade House, a place where it's always Halloween, surrounded by a deep dark woods "where grown-ups cannot go." "Pop Art" can be labeled as "magic realism", but it is also a moving yet humorous story about friendship and death. Joe Hill. Read him. (-- First published in Fantasy Magazine #1, November 2005)
John Doe · Jan. 12, 2023, 3:14 a.m.
xwidget_60_Beyond Black There's a place between skepticism and belief, between the known and the unknown. You sit there comfortably while you glance over your morning paper and read your horoscope or an article on a "haunted house". It echoes with phrases like "harmless fun," "I don't take it seriously, but..." "of course there's nothing to it," and "my great-grandmother used to say..." It's where hotels build their thirteenth floors and where the coins you toss into wishing wells land. But it is also a disturbing location. The pinch of spilled salt you throw over your left shoulder "just in case" lands there. Paths crossed by black cats and walking routes under ladders might lead you there. It's usually a place of minor trepidations and disregarded terrors, but the gods we fear dwell there, too, and damnations we dread lurk within it. Hilary Mantel's Beyond Black plops you right down into the middle of that place between what you know and what you don't know and has you laughing at irrational absurdities while being chilled by absurd irrationalities. The author makes you laugh and shiver simultaneously. The title could describe her humor -- "beyond black". It is, in fact, so dark that it enlightens. Mantel's characters, even in minor roles, are astonishingly vivid. Vile, charming, cruel, kind, mundane, weird, dead or alive -- they will remain with you longer and more distinctly than some of your blood relations. Alison is a psychic -- "a professional psychic, not some sort of magic act" -- who plies her trade both privately and publicly in the counties surrounding London. It's a lucrative profession, but she experiences almost constant physical and mental anguish due to her life-long dealings with "airside." The dead are a bothersome, nattering lot and her "spirit guide" is a lecherous, vulgar lowlife named Morris. Her childhood was abysmal and lacking in even the slightest of comforts; as an adult she offers an odd, but genuine, comfort to others. Alison is a "woman of unfeasible size...soft as an Edwardian, opulent as a showgirl." When she leaves a room you feel her as "a presence, a trace." And she is in need of both personal and business organization. Colette is thin and so colorless she barely notices herself. "When I'm gone I leave no trace," she thinks. Alison says that when Colette has been gone an hour or two, "I wonder if I have imagined you." She's also efficient: "sharp, rude, and effective." Other than lewd specters, Alison has no real relationships with the opposite gender. Colette is divorced from a man nearly as insipid as she. Since the bland couple had no friends, they invited everyone they knew to their picture-perfect, utterly empty wedding and the marriage was over before the ceremony was paid off. The final push out of matrimony came when Colette phoned and spoke to her mother-in-law -- who she consequently discovered had been dead for a number of hours at the time of the conversation. There's always the chance, she admits, it might have been a wrong number, but her life is so meaningless even the thought she might have communed with the dead gives it meaning and she starts seeking out psychics. It turns out that Colette hasn't a whit of psychic power -- even reading Tarot cards is beyond her -- but she does become Alison's personal assistant/business partner. She gets Alison's affairs in order and her career on the right track. Colette doesn't quite believe in the paranormal, but like most of us she can "entertain simultaneously any number of conflicting opinions." When "[f]aced with the impossible", Colette's mind "simply scuttle[s] off in another direction." Colette learns much of the psychic biz -- Mantel skewers the "Sensitives" with sparkling satire -- is fakery and flimflam. Alison uses such techniques herself, but not to defraud. She smoothes uncomfortable truths and conveys soothing messages to her audiences and clients rather than passing on the lies and confabulations of the perfidious, selfish, trivial, generally clueless dead. Although she doesn't particularly believe, Collette cannot deny Alison's abilities. Colette believes enough to be frightened of the afterlife as Alison paints it: ...the bewildered dead clustered among the dumpsters outside of burger bars, clutching door keys in their hands or queuing with their lunchboxes where the gates of a small factory once stood... There are thousands of them out there, so pathetic and lame-brained they can't cross the road to get where they are going, dithering on the kerbs of new arterial roads and byways... they follow [Alison home], and stat petering the first chance they get. They elbow her in the ribs with questions always questions; but never the right ones. Always, where's my pension book, has the Number 64 gone, are we having a fry-up this morning? Never, am I dead?...   Collette also probes and prods Alison with questions in pursuit of material for a book she intends to produce. Dead voices and strange noises play havoc with the recordings of the interviews, but the dialogues also force Alison to begin confronting her past, much of which is unclear to her until Colette forces her to talk about it. Even before we know the entire story it's a past nasty enough to establish a possibility (never voiced by characters or author) that Alison's supernatural abilities might stem from psychosis rather than psychic connection. Spirit guide Morris, in fact, was one of a murderous band of thugs who dominated Alison's unspeakably brutal childhood. As Alison recalls more of her childhood, Morris's dead but still villainous mates seem to be reassembling to further torture her. The women escape the "fiends", as Alison calls them, by moving to a spanking new house in a new upmarket development full of families and minivans. (Realty, new construction, suburbia and its inhabitants are all impaled on the spike of Mantel's sardonic wit.) Despite everyone thinking that Alison is some type of weather forecaster and that the women are a lesbian couple, the move brings Alison temporary respite from the fiends. But Colette, ever more controlling even as she occasionally feels unappreciated, increasingly sees her life as a dead end. No new man has entered her life in the seven years she's spent with Alison. Paying but pointless punters and kooks, Al's fellow Sensitives -- who disdain her as much as she disdains them -- surround her. Her ex, Gavin, tells her he is dating a model. Meanwhile Alison remembers more and more of her dreadful early days and the dead fiends, their fiendishness now even more enhanced, are drawing nigh and bringing death with them. There's more here, too, than a mere narrative. Mantel piles opposites on top of dualities, offers scathingly true observations on modern life, and shapes an overall metaphor for England circa 1997-2004. Surprising, unsettling, deeply subversive -- one cannot but wonder if Mantel's literary cohort will completely appreciate what a dark marvel this novel is. Readers of Peter Straub, Ramsey Campbell, Graham Joyce, and Elizabeth Hand, will, however, recognize Hilary Mantel as beyond brilliant.
John Doe · Jan. 12, 2023, 3:11 a.m.
Removing everything but numbers from String String value = string.replaceAll("[^0-9]",""); String clean1 = string1.replaceAll("[^0-9]", ""); or String clean2 = string2.replaceAll("[^\\d]", ""); Where \d is a shortcut to [0-9] character class, or String clean3 = string1.replaceAll("\\D", ""); Where \D is a negation of the \d class (which means [^0-9])   Using Match, Pattern class in java.util.regex boolean bln = Pattern.matches("^[a-zA-Z0-9]*$", this.input); ^ : 문자열의 시작 $ : 문자열의 종료 . : 임의의 한 문자(문자의 종류는 가리지 않음) | : or ? : 앞 문자가 없거나 하나있음. + : 앞 문자가 하나 이상임. * : 앞 문자가 없을 수도 무한정 많을 수도 있음을 나타냄. 만약, .* 으로 정규식이 시작한다면 시작하는 문자열과 같은 문자열이 뒤에 없거나 많을 수도 있는 경우에만 일치를 시킨다. 즉, abc 일 경우 시작문자인 a를 기준으로 a가 없을경우와 a가 무한정 많은 경우에도 true를 반환하기 때문에 abc의 경우는 true를 반환한다. [] : 문자 클래스를 지정할 때 사용. 문자의 집합이나 범위를 나타내면 두 문자 사이는 '-' 기호로 범위를 나타낸다. []내에서 ^ 가 선행하여 나타나면 not를 나타낸다. {} : 선행문자가 나타나는 횟수 또는 범위 a{3} 인 경우 a가 3번 반복된 경우 / a{3,}이면 a가 3번 이상 반복인 경우. 또한 a{3,5}인 경우 a가 3번 이상 5번 이하 반복된 경우를 나타냄 \w : 알파벳이나 숫자 \W : 알파벳이나 숫자를 제외한 문자 \d : 숫자 [0-9]와 동일 \D : 숫자를 제외한 모든 문자 ^[0-9]*$ : only number ^[a-zA-Z]*$ : only English ^[가-힣]*$ : only Korean ^[a-zA-Z0-9]*$ : English/number   e.g. 1) email : ^[a-zA-Z0-9]+@[a-zA-Z0-9]+$  or  ^[_0-9a-zA-Z-]+@[0-9a-zA-Z-]+(.[_0-9a-zA-Z-]+)*$ cellphone :  ^01(?:0|1|[6-9]) - (?:\d{3}|\d{4}) - \d{4}$ phone : ^\d{2,3} - \d{3,4} - \d{4}$ id : \d{6} \- [1-4]\d{6} IP addr : ([0-9]{1,3}) \. ([0-9]{1,3}) \. ([0-9]{1,3}) \. ([0-9]{1,3}) https://stackoverflow.com/questions/6883579/java-regular-expression-removing-everything-but-numbers-from-string   2) How to test if a String contains both letters and numbers .matches("^(?=.*[A-Z])(?=.*[0-9])[A-Z0-9]+$") The regex asserts that there is an uppercase alphabetical character (?=.*[A-Z]) somewhere in the string, and asserts that there is a digit (?=.*[0-9]) somewhere in the string, and then it checks whether everything is either alphabetical character or digit.   3) How can I de-duplicate repeated characters in a Java string? how________are_______you to how_are_you string.replaceAll("_+", "_")
John Doe · Jan. 12, 2023, 2:56 a.m.
regex
Q : Where can I download JSTL taglibs? i.e. jstl.jar and standard.jar A : If you're running a Servlet 2.5 compatible container and the web.xml is declared as at least Servlet 2.5, then you should be able to use the new JSTL 1.2 instead. Note that JSTL 1.2 does not require a standard.jar. Q : The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path A : Add a runtime first and select project properties. Then check the server name from the 'Runtimes' tab Q : Remove html tags from string using java A :  String noHTMLString = htmlString.replaceAll("\\<.*?>",""); Using Jsoup public static String html2text(String html) { return Jsoup.parse(html).text(); } https://stackoverflow.com/questions/4432560/remove-html-tags-from-string-using-java Q : JSPX A : https://jspx-bay.sourceforge.net/ Q : Apache Jakarta A : http://archive.apache.org/dist/jakarta/ Q : Prevent download attempts of videos in a video server A : Silverlight might be an idea to start with. Q : mp3 header information reader not working A : import org.farng.mp3.MP3File; you need to call mp3file.seekMP3Frame(); before attempting to retrieve bitrate, this method will read the file headers including the bitrate. or use http://www.jthink.net/jaudiotagger/examples_id3.jsp Q : How to get the message in a custom error page (Tomcat)? A : <c:out value="${requestScope['javax.servlet.error.message']}"/> javax.servlet.error.status_code java.lang.Integer javax.servlet.error.exception_type java.lang.Class javax.servlet.error.message java.lang.String javax.servlet.error.exception java.lang.Throwable javax.servlet.error.request_uri java.lang.String javax.servlet.error.servlet_name java.lang.String * <c:catch> Tag <%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %> <html> <head> <title><c:catch> Tag Example</title> </head> <body> <c:catch var ="catchException"> <% int x = 5/0;%> </c:catch> <c:if test = "${catchException != null}"> <p>The exception is : ${catchException} <br /> There is an exception: ${catchException.message}</p> </c:if> </body> </html> Q : Get current action in jsp - struts2 A :  <s:url forceAddSchemeHostAndPort="true" includeParams="all"/> Q : Oracle date to Java date A : little h for "Hour in am/pm (1-12)" and H for "Hour in day (0-23)" see here: SimpleDateFormat SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); Date date = dateFormat.parse("2011-08-19 06:11:03.0"); Q : How to get previous URL? A :  HttpServletRequest.getHeader("Referer"); Q : [JSP] 파일 다운로드창에서 한글깨짐 방지? A : response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "utf-8") + ";");
John Doe · Jan. 12, 2023, 2:03 a.m.
This is a proof of concept only Disclaimer: Before I get a bunch of hate mail about the, obviously, horrible things I've done to make this work, I stole most of the painting code straight out of the source, this is how it's actually done within the look and feel code itself :P I've also gone to the nth degree, meaning that I've literally assumed that you wanted the row headers to look like the column headers. If this isn't a requirement, it would be SO much easier to do... Okay, this is a basic proof of concept, which provides the means to generate the row header and render them the same way as they are normally, just as row headers instead. Things that need to be added/supported: Detect when the table model is changed (that is, a new table model is set to the table) Detect when the column model is changed (that is, a new column model is set to the table) Much of this functionality would probably need to be added to the TableWithRowHeader implementation... Basically, what this "tries" to do, is create a custom row header, based on a JTableHeader, remove the existing column header and add itself into the row header view position of the enclosing JScrollPane. import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridBagConstraints; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.JViewport; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.event.ChangeEvent; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TableColumnModelEvent; import javax.swing.event.TableColumnModelListener; import javax.swing.table.DefaultTableColumnModel; import javax.swing.table.JTableHeader; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; public class TableRowHeaderTest { public static void main(String[] args) { new TableRowHeaderTest(); } public TableRowHeaderTest() { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } Object rowData1[][] = { {"", "", "", ""}, {"", "", "", ""}, {"", "", "", ""}, {"", "", "", ""} }; Object columnNames1[] = {"HEADER 1", "HEADER 2", "HEADER 3", "HEADER 4"}; JTable table1 = new TableWithRowHeader(rowData1, columnNames1); table1.getColumnModel().getColumn(0).setPreferredWidth(120); JScrollPane scrollPane1 = new JScrollPane(table1); scrollPane1.setColumnHeaderView(null); JFrame frame = new JFrame("Testing"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(scrollPane1); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } }); } public class TableWithRowHeader extends JTable { private TableRowHeader rowHeader; public TableWithRowHeader(final Object[][] rowData, final Object[] columnNames) { super(rowData, columnNames); rowHeader = new TableRowHeader(this); } @Override protected void configureEnclosingScrollPane() { // This is required as it calls a private method... super.configureEnclosingScrollPane(); Container parent = SwingUtilities.getUnwrappedParent(this); if (parent instanceof JViewport) { JViewport port = (JViewport) parent; Container gp = port.getParent(); if (gp instanceof JScrollPane) { JScrollPane scrollPane = (JScrollPane) gp; JViewport viewport = scrollPane.getViewport(); if (viewport == null || SwingUtilities.getUnwrappedView(viewport) != this) { return; } scrollPane.setColumnHeaderView(null); scrollPane.setRowHeaderView(rowHeader); } } } } public class TableRowHeader extends JTableHeader { private JTable table; public TableRowHeader(JTable table) { super(table.getColumnModel()); this.table = table; table.getColumnModel().addColumnModelListener(new TableColumnModelListener() { @Override public void columnAdded(TableColumnModelEvent e) { repaint(); } @Override public void columnRemoved(TableColumnModelEvent e) { repaint(); } @Override public void columnMoved(TableColumnModelEvent e) { repaint(); } @Override public void columnMarginChanged(ChangeEvent e) { repaint(); } @Override public void columnSelectionChanged(ListSelectionEvent e) { // Don't care about this, want to highlight the row... } }); table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { repaint(); } }); } public JTable getTable() { return table; } @Override public Dimension getPreferredSize() { Dimension size = new Dimension(); JTable table = getTable(); if (table != null) { TableColumnModel model = table.getColumnModel(); if (model != null) { for (int index = 0; index < model.getColumnCount(); index++) { TableColumn column = model.getColumn(index); TableCellRenderer renderer = column.getHeaderRenderer(); if (renderer == null) { renderer = getDefaultRenderer(); } Component comp = renderer.getTableCellRendererComponent(table, column.getHeaderValue(), false, false, -1, index); size.width = Math.max(comp.getPreferredSize().width, size.width); size.height += table.getRowHeight(index); } } } return size; } /** * Overridden to avoid propagating a invalidate up the tree when the * cell renderer child is configured. */ @Override public void invalidate() { } /** * If the specified component is already a child of this then we don't bother doing anything - stacking order doesn't matter for cell renderer components * (CellRendererPane doesn't paint anyway). */ @Override protected void addImpl(Component x, Object constraints, int index) { if (x.getParent() == this) { return; } else { super.addImpl(x, constraints, index); } } @Override protected void paintComponent(Graphics g) { // super.paintComponent(g); Graphics2D g2d = (Graphics2D) g.create(); g2d.setColor(getBackground()); g2d.fillRect(0, 0, getWidth(), getHeight()); JTable table = getTable(); if (table != null) { int width = getWidth(); TableColumnModel model = table.getColumnModel(); if (model != null) { for (int index = 0; index < model.getColumnCount(); index++) { TableColumn column = model.getColumn(index); TableCellRenderer renderer = column.getHeaderRenderer(); if (renderer == null) { renderer = getDefaultRenderer(); } boolean selected = table.getSelectedRow() == index; Component comp = renderer.getTableCellRendererComponent(table, column.getHeaderValue(), selected, false, 0, index); add(comp); comp.validate(); int height = table.getRowHeight(index) - 1; comp.setBounds(0, 0, width, height); comp.paint(g2d); comp.setBounds(-width, -height, 0, 0); g2d.setColor(table.getGridColor()); g2d.drawLine(0, height, width, height); g2d.translate(0, height + 1); } } } g2d.dispose(); removeAll(); } } } Disclaimer: This is likely to blow up in your face. I make no checks for preventing the header from responding to things like changes to the column row sortering and ... in theory ... it shouldn't try and "resize" the column but I didn't test that... https://stackoverflow.com/questions/26248084/how-to-display-row-header-on-jtable-instead-of-column-header
John Doe · Jan. 12, 2023, 1:36 a.m.
JTable swing
xwidget_48_The Overnight What could be more innocuous than a bookstore? Modern chain stores are designed to exude a safe welcoming feeling for the customer. They are a safe haven for the reader--aren't they? How creepy can a modern shopping complex get anyway? The masterful Ramsey Campbell can make it quite creepy, thank you, and he also turns the cozy embrace of a clean, well-lighted book emporium into a place of terror. Perhaps, as a booklover who got her wish of receiving plenty of free books only to realize that such largesse becomes a problem in itself and thus occasionally feels threatened by stacks of tomes, I can identify more closely than most with The Overnight. And, too, like Campbell, I sojourned briefly at a Borders bookstore. But I'm sure that even if books have never been anything but your friends and bookstores only benign, you'll still be rewarded with this delightfully disturbing novel. Campbell combines wickedly insightful wit, a wise understanding of human nature, awesome prose, a rich evocation atmosphere of fear, and, well, retail experience to create yet another modern masterpiece. Right. The man seems to write masterpieces as easily and frequently as a politician lies. Adding to that achievement is his ability to write, at least lately, entirely different "sorts" of books each time. No one, with the exception of Peter Straub, evolves his horror so readily or so well. The Overnight is also an extremely accessible novel, a true "page-turner," and would serve as an excellent vehicle to attract the masses. In fact, of all Campbell's novels in the last ten years, this one could stock the mass market bins just as well as it pleases elitist horror snobs like me. Not only does The Overnight succeed as horror, it's a sublime satire of the modern workplace. The plot centers on Texts, a newly opened, Borders-like American chain store in the not-yet-completed Fenny Meadows Retail Park on a highway between Manchester and Liverpool. For Woody Blake, the store's American boss, it's a chance to prove himself in his first position as a branch manager. His staff is competent, but like any group of diverse personalities in an intense work environment, there are small irritations and minor disagreements. Woody's gung-ho, team spirit retail attitude --"Everything's good or we wouldn't sell it." -- would be annoying in a U.S. store, in England it is even more so. Campbell deftly shifts the point of view from one character to another with each chapter. As we get to know the employees we also become aware of small incidents that, in isolation, are meaningless. Together they are ominous and eerie. Only the reader, of course, gets all the data -- the odd draft, the disordered, damaged, and often grimy books, fogged videos, a constant feeling of being watched, clammy walls, an elevator (or, rather, lift) with a mind of its own, a blur here, a computer glitch there. Only the perpetual fog outside that never seems to dissipate is obvious to all. Nothing much is right, although nothing seems hugely wrong until Woody gets the first month's numbers: the Fenny Meadows Text is setting new records for nonperformance and the big guns are heading over from New York in less than two weeks. Woody decides the answer is to push even harder and to have everyone work all night before the inspection to make sure everything is in tip-top shape. One of the employees is run down in the parking lot but Woody's only real concern is the store. Wilf, a former dyslexic who is now a voracious reader, loses his beloved ability to read. A perfectly copyedited store flyer keeps turning up with an embarrassing a mistake in each batch printed. A reading group and author's signing go spectacularly awry. A local author hints that Fenny Meadows has a peculiar history. Each of the thirteen (hmmm...) employees -- Agnes, Angus, Connie, Gavin, Greg, Jake, Jill, Lorraine, Madeleine, Nigel, Ray, Ross, Wilf -- are distinct right down to their individual modes of transportation. At the same time, they realistically match the "type" of individuals who work in such stores whether it is located in Cheshire or Ohio. Campbell plays them both in ensemble and in isolation as what should be small problems grow large, relationships lose the veneer of politeness, normal conversations begin to drip venom, prejudices become more pronounced, the overnight looms like Doomsday, and everyone is expected to smile, smile, smile. Chapters overlap one another, layering viewpoints, impelling the action, and the reader becomes almost another character in The Overnight -- mute, unable to scream out a warning, brimming with dread, certain that nothing will turn out right in the end, but still hoping it will. What's behind all the nasty goings-on? Campbell makes it plain by the end, although he wastes no exposition on explanation. Whether The Overnight is an extremely well done variation on a standard supernatural trope or something else is a question I'm still debating with myself. Not that it matters. What does matter is that Ramsey Campbell, for all his previous accolades and acclaim as a master of horror, is a writer very much in his prime. The Overnight is not only another dark jewel in his uncanny crown, it is one of its most wondrous gems. (from Cemetery Dance #52) • • • Other novels by Ramsey Campbell reviewed : »» Darkest Part of the Woods by Ramsey Campbell »» Ghosts And Grisly Things by Ramsey Campbell »» Nazareth Hill by Ramsey Campbell »» Pact of the Fathers by Ramsey Campbell »» Silent Children by Ramsey Campbell
John Doe · March 29, 2022, 10:35 a.m.