utility

Good tool for testing socket connections? [closed]

六眼飞鱼酱① 提交于 2019-11-27 09:32:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm writing a tcp/ip client and I would need a "test server" to be able to test easily. It should listen on a configurable port, show me when a client connects and what the client sent, allow me to manually enter text to send to the client. It should work on Windows. Normally I would have use the simple but

Minimizing jar dependency sizes

怎甘沉沦 提交于 2019-11-27 03:20:09
问题 an application I have written uses several third party jars. Sometimes only a small portion of the entire 50kB to 1.7mB jar is used - one or two function calls or classes. What is the best way to reduce the jar sizes. Should I download the sources and build a jar with just the classes I need? What existing tools can help automate this (ex I briefly looked at http://code.google.com/p/jarjar/)? Thank you Edit 1: I would like to lower the size of my third party 'official' jars like swingx-1.6

Zip using Oracle Stored Procedure

三世轮回 提交于 2019-11-27 02:54:08
问题 Right now I am using Oracle utility procedure, UTL_COMPRESS.LZ_COMPRESS() , to compress some data. But the problem is it compresses the thing using GZIP compatible format, which is not also ZIP compatible unfortunately. Therefore, the Windows XP native decompression utility can not open it (you know that compressed folder thingie). And user have to use some other utility, like 7Zip , Winzip , or Filzip etc., in order to decompress that. So, we end up having a plan of retrieving GZIP data from

Getting a device UDID from .mobileconfig

荒凉一梦 提交于 2019-11-27 00:46:57
I'm trying to write function similar to http://whatismyudid.com/ that, then approved, will return the users UDID and store it to a database for future reference with that user. I have written a .mobileconfig xml doc that opens in the Profile Installer just fine but when I tell it to install the profile it responds with [alert] Invalid Profile but no alert body. No description, no code, no help. I'm new to the mobile configuration game so any help would thrill me. Here is my configuration file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http:/

Iphone SDK Utility Application template has leak

99封情书 提交于 2019-11-26 21:32:34
问题 i'm only create an project with a Utility Application template. This template has a native memory leak when i push "info button" to flip the view. Anyone know how can i fix this leak ??? I just make an new project from this template, i don't add new objects. 回答1: That might be a leak or it might not be a leak. If you were to add the backtrace of the allocation, that would be helpful. More likely than not, it isn't a leak, but some bookkeeping information that is being stashed away by dyld

How can I programmatically manipulate Windows desktop icon locations?

流过昼夜 提交于 2019-11-26 20:25:35
问题 Several years back, I innocently tried to write a little app to save my tactically placed desktop icons because I was sick of dragging them back to their locations when some event reset them. I gave up after buring WAY too much time having failed to find a way to query, much less save and reset, my icons' desktop position. Anyone know where Windows persists this info and if there's an API to set them? Thanks, Richard 回答1: If I'm not mistaken the desktop is just a ListView, and you'll have to

How to ensure thread safety of utility static method?

好久不见. 提交于 2019-11-26 18:55:28
问题 Is there any general way or rules exits by which we can ensure the thread safety of static methods specifically used in various Utility classes of any applications. Here I want to specifically point out the thread safety of Web Applications. It is well know that static methods with Immutable Objects as parameters are thread safe and Mutable Objects are not. If I have a utility method for some manipulation of java.util.Date and that method accepts an instance of java.util.Date , then this

Java: Static Class?

我与影子孤独终老i 提交于 2019-11-26 18:29:30
I have a class full of utility functions. Instantiating an instance of it makes no semantic sense, but I still want to call its methods. What is the best way to deal with this? Static class? Abstract? David Robles Private constructor and static methods on a class marked as final. According to the great book "Effective Java" : Item 4: Enforce noninstantiability with a private constructor - Attempting to enforce noninstantiability by making a class abstract does not work. - A default constructor is generated only if a class contains no explicit constructors, so a class can be made

Is it possible to have a transparent utility stage in javafx? [duplicate]

这一生的挚爱 提交于 2019-11-26 17:11:54
问题 This question already has answers here : A javaFX Stage could be both StageStyle.UTILITY and StageStyle.TRANSPARENT? (5 answers) Closed 2 years ago . I know that you can set a stage to have a utility style "Stage.InitStyle(StageStyle.UTILITY);" and you can set it to have a transparent style "Stage.InitStyle(StageStyle.TRANSPARENT);" but can you have both in the same stage? I am tiring to make it so that the stage does not show as a window down in the start menu and I would like the stage to

Implement touch using Python?

微笑、不失礼 提交于 2019-11-26 17:03:53
touch is a Unix utility that sets the modification and access times of files to the current time of day. If the file doesn't exist, it is created with default permissions. How would you implement it as a Python function? Try to be cross platform and complete. (Current Google results for "python touch file" are not that great, but point to os.utime .) voidnologo Looks like this is new as of Python 3.4 - pathlib . from pathlib import Path Path('path/to/file.txt').touch() This will create a file.txt at the path. -- Path.touch(mode=0o777, exist_ok=True) Create a file at this given path. If mode is