utility

List content of one or more files with a header showing the file name

不羁岁月 提交于 2019-12-04 05:35:44
问题 Sometime ago I read a blog that showed a misuse of a commandline command that when given a list of files serially showed the content of each file and each file had header line showing the filename of the file below it. Could someone refresh my memory? 回答1: You can use either tail or head for this: when given multiple files, both tools precede each file's contents with a header containing the file name. $ for i in {1..3}; do echo line$i > file$i; done $ tail file* ==> file1 <== line1 ==> file2

Utility Classes in Java Programming

这一生的挚爱 提交于 2019-12-03 21:52:00
I am new to Java and I referred regarding my question on the Net but not quite Satisfied. I want to know what the "Utility Class" in Java is? Can anybody please tell me with an Example. Thanks, david It's usually a class which only has static methods (possibly with a private constructor and marked abstract/final to prevent instantiation/subclassing). It only exists to make other classes easier to use - for example, providing a bunch of static methods to work with String values, performing extra actions which String itself doesn't support. Utility classes generally don't operate on classes you

List content of one or more files with a header showing the file name

丶灬走出姿态 提交于 2019-12-02 10:54:22
Sometime ago I read a blog that showed a misuse of a commandline command that when given a list of files serially showed the content of each file and each file had header line showing the filename of the file below it. Could someone refresh my memory? You can use either tail or head for this: when given multiple files, both tools precede each file's contents with a header containing the file name. $ for i in {1..3}; do echo line$i > file$i; done $ tail file* ==> file1 <== line1 ==> file2 <== line2 ==> file3 <== line3 To output the entire files instead of just the last/first 10 lines of each,

Are there any good ant visualization programs out there?

只谈情不闲聊 提交于 2019-12-01 06:47:31
问题 I am looking for a utility that will suck in an ant build file and present a graphical display of the targets and properties available to that target. Please don't respond with 'VisualAnt' I own it and it sucks. 回答1: I use yWorks Ant Explorer. It runs as a stand alone app. It's pretty good. Apparently there is an Eclipse plugin as well but I haven't been able to locate that. It's free. Not sure if yWorks still develops it. You can download the jar here and here. After download, just create a

Get index of array of objects via jquery

二次信任 提交于 2019-12-01 00:43:31
I have the following array: var = array[ {"id" : "aa", "description" : "some description"}, {"id" : "bb", "description" : "some more description"}, {"id" : "cc", "description" : "a lot of description"}] and I try to find the index of the array that contains the id === "bb" . The solution I came up with is the following: var i = 0; while(array[i].id != "bb"){ i++; } alert(i) //returns 1 Is there an easier way that has cross-browser functionality? I tried $.inArray(id,array) but it doesn't work. I don't see any problem with the complexity of your code, but I would recommend a couple of changes

Using utility classes in the android programming

房东的猫 提交于 2019-12-01 00:38:39
问题 I have a little idea of the Utility Classes with a slight doubt on demand. If I use a Utility class in my Application than to use that class in my main Activity do I have to create the object of that class or I can directly Import that class in my main activity? I am Sorry if I am not making a clear sense. In the nutshell, all I want to be clear about is that basically how can I use the utility class in my Main Activity? Thanks, david 回答1: It heavily depends on what kind of utility you're

Find usage of id not working in Android Studio on Windows

放肆的年华 提交于 2019-11-30 11:06:33
I selected an id in XML, mouse right click, find Usage shows no occurrence of id even Id exist in java file. And if i do the same in Mac its finding it. So is there any cache issue or something else ? To fix the autocomplete go to: File -> Invalidate Caches -> Restart -> Click at Invalidate and Restart I was having the same problem and unfortunately @josedlujan's answer does not solve the problem. Alternatively, you my try the Ctrl + Shift + F to certainly find what you want, also double clicking Shift will open a quick dialog to find certain keyword in the whole project. In my case I was not

C/C++ call-graph utility for Windows platform [closed]

半城伤御伤魂 提交于 2019-11-30 04:42:05
I have a large 95% C, 5% C++ Win32 code base that I am trying to grok. What modern tools are available for generating call-graph diagrams for C or C++ projects? Have you tried SourceInsight's call graph feature? http://www.sourceinsight.com/docs35/ae1144092.htm nagul Have you tried doxygen and codeviz ? Doxygen is normally used as a documentation tool, but it can generate call graphs for you with the CALL_GRAPH/CALLER_GRAPH options turned on. Wikipedia lists a bunch of other options that you can try. Good old cflow works fine for C. See here for an implementation. Any decent static analysis

Utility classes.. Good or Bad?

你。 提交于 2019-11-30 02:12:49
I have been reading that creating dependencies by using static classes/singletons in code, is bad form, and creates problems ie. tight coupling, and unit testing. I have a situation where I have a group of url parsing methods that have no state associated with them, and perform operations using only the input arguments of the method. I am sure you are familiar with this kind of method. In the past I would have proceeded to create a class and add these methods and call them directly from my code eg. UrlParser.ParseUrl(url); But wait a minute, that is introducing a dependency to another class. I

Find usage of id not working in Android Studio on Windows

痞子三分冷 提交于 2019-11-29 16:29:26
问题 I selected an id in XML, mouse right click, find Usage shows no occurrence of id even Id exist in java file. And if i do the same in Mac its finding it. So is there any cache issue or something else ? 回答1: To fix the autocomplete go to: File -> Invalidate Caches -> Restart -> Click at Invalidate and Restart 回答2: I was having the same problem and unfortunately @josedlujan's answer does not solve the problem. Alternatively, you my try the Ctrl + Shift + F to certainly find what you want, also