-
Notifications
You must be signed in to change notification settings - Fork 7
/
api-test.txt
1358 lines (1358 loc) · 130 KB
/
api-test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
sent
Logging by default blocks hard (if you need to log for real).
2.
:EOF .
(Not that I'd claim it's perfect some surprising things are still very awkward but it definitely makes things a lot easier.
"The reason is to minimize mental baggage: you can change projects or jobs, and not have to learn a new framework (provided the new job/project also uses CL, and/or you can convince them to move to it)."
Very similar to the one use by Ritche_W .
A document database has a very simple storage model and basic query abilities.
"Secondly, imho the most simple, setup & go library for JAAS is Jboss URL_http://www.jboss.org/picketbox [PicketBox] ."
"But SAF has been forked since that time and still exists under the name ""BSAF""."
"Any help, advise and pointers much appreciated."
We're using JBoss (4.0.4 I think) to serve SOAP calls.
"This may not be a satisfactory answer to your question, still: You might want to evaluate existing service providers for the task and either include their product or integrate one via web services."
"URL_http://www.restlet.org/documentation/1.1/screencast/ [ URL_http://www.restlet.org/documentation/1.1/screencast/ ] Otherwise, there is a Restlet tutorial in the O'Reilly book that we wrote in their Chapter 12."
I personally like Jetty HttpClient a lot.
"If your class sticks to the JavaBeans specification for its getters and setters, this method is straightforward to use and you don't need a schema."
"You really,should be using IOUtils.copy(inputStream, writer, encoding); unless you really,know what you're doing, which people never do with character encoding related programming."
"It has been analyzed extensively and is now used worldwide, as was the case with its predecessor, the Data Encryption Standard (DES)..."
"Having recently worked on a project which required some more IO interaction than I'm used to, I felt like I wanted to look past the regular libraries (Commons IO, in particular) and tackle some more in depth IO issues."
But this question doesn't make any sense.
"It will not work the same on every system, although it tries."
Usually it's the StringBuilder.
It will be good if you go for latest version release.
"Oracle has produced a standard JSON API (JSR 353) for Java EE 6 which is available in Maven, and the reference implementation used in Glassfish is also available in Maven."
I am planning to write a singleton Spring bean for basic level cryptography support in my app.
"Sometimes you want to create a new string with a specified length, and with a default character filling the entire string."
"s.next() : """"; }."
"The thing is, you're first splitting into lines, and then undoing that."
"@Tovi7 It probably doesn't because most OOTB Collections already provide readable toString()s, whereas arrays don't."
Ranks: ApproachApproach- 2.6% slower thanApproach- 4.3% slower thanAny of these approaches is an appropriate solution for grabbing a response and creating a String from it.
"On the other hand, determining your own buffer size(s) you can tune your memory/processor usage balance."
"The ID is the ""primary key,"" and enforcing unique triplets after that is going to be on _your_ end more than the NoSQL engine's end; this is one area where NoSQL ""suffers"" compared to SQL, but it's also where you find the greatest speed and storage improvements."
"I was seriously thinking i should go spring security despite it said complication, with that i'm sure i can have people to point me to the right direction."
"One of the shortcomings of the json.org library is that it accepts unquoted strings, breaking the JSON specification."
":URL_http://mac.softpedia.com/get/Math-Scientific/JIRRM.shtml [ URL_http://mac.softpedia.com/get/Math-Scientific/JIRRM.shtml ] (Java based)URL_http://projectiris.co.uk/ [ URL_http://projectiris.co.uk/ ] (QT based -but there are more QT <-> Java bridges) but personally I haven't used in production (just for testing) these 2 libraries since the documentation is not very good/detailed, and since this kind of problem is quite ""cutting edge"" so the documentation and an explanation paper is much more important than any source code."
HTML/XML Parser for Java.
You could have a look at URL_http://www.restlet.org [Restlet] 's client capabilities.
Bring your javascript and java code.
by Oscar Reyes** This is the (simplified) underlying code on the cited library: CODESNIPPET_JAVA2 .
"""Desktop"" applications, in Java."
"This is a drop-in replacement that mimics JCL's classes, but calls SLF4J internally."
BTW the Java Almanac link from above now goes to Adult Friend Finder (surprise!
"You'll probably share the salt (for key derivation) one time, at the same time you set up the password itself."
Bar** The CODETERM1 in Swing is easy enough to use.
In that case you mustuse the applet.
Maybe you should try the URL_http://www.bouncycastle.org/ [BouncyCastle] crypto provider.
I would like to be able to run a test application from a Windows box although the final deployment is on a Linux box.
"JSON does not have a Date type (just strings, numbers, booleans), and each lib therefore has to define its own convention."
"Ciphers) are simplified to a level that is not just bearable, but often a joy to use."
"URL_http://en.wikipedia.org/wiki/Standard_Widget_Toolkit [SWT]Created by IBM for Eclipse, they seemed to think that Swing was not suited for Eclipse at the time."
No way.
"That last point is really important, because if you want to build a decent swing application, you'll have to extend the base components or use some third-party libraries and itbe easy** to integrate those in the visual editor."
"This is it and if I didn't scroll down and down and down, I would have missed it."
Are there other ideas or frameworks which offer lets say JMS over HTTP.
"In order to make your code work, I had to use this.getClass().getClassLoader().getResourceAsStream() (using Eclipse with a maven project)."
"The more normal case is that you need to specify what the encoding is, so specifying the encoding is correct."
"Actually I've recently done some work in a system that was still running under jdk 1.3 :-(, and it was less than two years ago I was last maintaining a1.2** system."
All you're doing really is allocating 1/3 of the network bandwidth to each downloader.
As far as I can tell the idea behind commons logging is that it should be used in libraries.
"Also, CODETERM1 is thread-safe, which CODETERM2 is not."
Neither are as simple and intuitive as Shiro's solution: CODESNIPPET_JAVA1 .
"In order to make your code work, I had to use this.getClass().getClassLoader().getResourceAsStream() (using Eclipse with a maven project)."
Planning on posting my fixes for feedback when I get to that point.
"If you want the file read by 3rd party as well, how about using some popular existing exchange format such as CSV or XML?"
URL_http://natty.joestelmach.com/ [Natty] is a really good replacement for JChronic.
Answering my own question since this got resurrected for some reason.
"When we reinvent the wheel, we work twice as hard yet get to the finish line much later."
"@a_horse_with_no_name that right with same progress in SWT, SwingX, new owner, new maniers."
I think this should be publicString convertStreamToString .
In the end I Found a ORM framework called Canyon which mapping Files to Objects.
"Simple, clean."
"Another alternative, is to create a CODETERM25 implemenation by sub- classing CODETERM26 , and adding counters to track the number of characters on every CODETERM27 and other mutation operations of the list, then override CODETERM28 to create a CODETERM29 of the exact size you need and loop through the list and build the output, you can even make that CODETERM30 an instance variable and 'cache' the results of CODETERM31 and only have to re-generate it when something changes."
We used it in one of our project to replace the plain old java-serialization and it worked almost out of the box.
"For instance, System.console().readLine() (new in Java 6) is pretty easy."
You can do it in a very simple way with resteasy (by Jboss).
See the commet by ChristofferHammarstrm in the answer by HarryLime.
The alternative approach to those already discussed (i.e.
Are there any examples as to how it can be used?
"Methods that use the platform default encoding are almost never correct to use, like every other method that gives different results depending on which machine/operating system/platform or version thereof it is run on."
I swear Natty handles pretty much everything.
"However, if I am decrypting using a different instance of the AESEncrypter, the decrypted file tends to have some issues in the first few bytes (9 bytes)."
AWT is outdated.
The Java implementation of this standard is covered by the JAXP standard ( URL_http://jcp.org/en/jsr/detail?id=206) .
"Also, if you are developing Eclipse plugins, you will typically use SWT."
Swing itself handles your widgets' layout and stacking.
"This API is backed by the Restlet Engine and both are now shipped in a single JAR (""_org.restlet.jar_"")."
"String, StringBuffer, and StringBuilder."
Does anyone know where the sql grammar is located?
"You would probably also want to send control headers prior to the actual file being sent, containing the size of the file, filename, etc."
I agree with the above comments about overriding CODETERM1 on your own classes (and about automating that process as much as possible).
CODESNIPPET_JAVA1 .
"If your string can change, and will be accessed from multiple threads, use a CODETERM12 because CODETERM13 is synchronous so you have thread-safety."
"After reading the answers here and on some other places on the web, I got the impression that Shiro would be easier to understand and customize to my needs."
I tried the project iris tool.
Async request like AJAX: URL_http://hc.apache.org/httpcomponents-asyncclient- dev/ [ URL_http://hc.apache.org/httpcomponents-asyncclient-dev/ ] Sync request: URL_http://hc.apache.org/httpcomponents-client-4.0.1/index.html [ URL_http://hc.apache.org/httpcomponents-client-4.0.1/index.html ] Cookies is A kind of Header.
"Wow, didn't ever try that because it seemed too easy."
This can be incredibly useful if you put stuff like the username and the URL of the request (in case of a webapp) into it.
It's fully written in Java and can be accessed via Java using URL_http://incubator.apache.org/thrift/ [Thrift] or URL_http://avro.apache.org/ [Avro] .
I will have to go with Glassfish on this.
A better example would to be to create it with a initial size that will hold the entire contents of the final String.
It is now located at: org.hibernate.engine.jdbc.internal.BasicFormatterImpl.
"However there are many chances that we need a small, fast one."
Personally i don't like SWT.
and Customizable**You can choose whether the GUI code should be generated with fully qualified or simple class names.
Gson is very slow.
"I can manually change it, but I'd rather not have to remember to update it every time the jaxb files are regenerated."
I am think of cases where such an applet is only used for authentication and transaction-signing purpose and not otherwise in the web application.
2. why should you CODETERM2 / CODETERM3 ( CODETERM4 / CODETERM5 ) to the very same data structure?
The following is some code I am using now that I have some more experience with this.
"Nowadays, this threshold might be many gigabytes of RAM."
"Java 7 introduces byte[] Files.readAllBytes(file); To those, who suggest the 'one-line' Scanner solution: Don't yo need to close it?"
Now I saw there is a dedicated javax.crypto package inside the SDK.
"Especially, CODESNIPPET_JAVA1 ."
"Jersey does seem to mach the requirements quite adequately, although I have not given other frameworks enough investigation yet."
I need this for two things:providing an SQL interface to a non-SQL database (mapping to internal API calls)rewriting SQL before it goes to the actual database (e.g.
"You could fairly easily use this to serve your file, using URLConnection to obtain it."
"Cassandra, Neo4j, MongoDB, etc."
YES!
"A parser is just that, a parser, it won't interpret your page."
"Alternatively, you could use CODETERM3 if you don't want to mix your Streams and Writers ."
@S.Lott - There is nothing wrong with flat files for a simple app.
"I just use AWT and Swing and I can do almost everythig, so thumbs up for them :)."
Note: I work for the company behind Querydsl.
the iv or the salt?
Thanks for your help.Please suggest good link to know more difference b/w DVM and JVM.
"Luckily I am already using this jar, so i could use this straight away."
GlassFish is friendlier for developers.
"Yes, it is hard to build a tool, which find tags with high precision, because it requires a lot of testing and tuning."
Thanks!
"To be honest Collections needs a toString method too, but this works also."
I use it in an android app.
There is more support and information available for Swing components (not to mention a large community of 3rd party components and developers) You could also take a look at URL_http://dn.embarcadero.com/article/26970 [AWT-vs-Swing] and URL_http://stackoverflow.com/questions/408820/what-is-the- difference-between-swing-and-awt [What-is-the-difference-between-swing-and- awt?]
Works well on Android in comparison with other answers which work only in enterprise java.
2) Please use code formatting.
I don't understand why it's done the way it's done in Jackson.
"If your aim is professional desktop application, make sure it delivers what you need."
"Nope, no useful tutorials at all."
I was wondering if any of you have any experience with any of these or even better have tried both of them in the same environment.
"For URL_http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework- reference/html/ch18s02.html [Restful] I'd use URL_http://blog.springsource.org/2009/03/08/rest-in-spring-3-mvc/ [spring] , or URL_http://www.restlet.org/ [restlet] ."
The below code worked for me.
I generally do not chain getters like this where there is more than one nullable getter.
It also integrates nicely with Spring if you need that.
Anyone knows some good SQL builder library for Java like URL_http://code.google.com/p/squiggle-sql/ [Squiggle] (not maintained anymore it seems).
What I've done in these cases is to go for JIDE.
Could you comment on 1.
Gson can serialize private fields and automatically ignores transient fields.
For those who are not able to wrap their head around HttpClient API there is fluent facade API: URL_http://hc.apache.org/httpcomponents-client-dev/fluent-hc/index.html .
The javabean getters/setters have other purposes in other layers and does not slowdown so I would just keep them there.
"I talked about Swing :-), only about Swing Framework or Framework based on JSR296."
"I am omiting repetitions, but the 3 CODETERM1 s are part of the primary key, of the @Id."
CODESNIPPET_JAVA1 .
":) Here are a couple: AWT is a cross-platform interface, so even though it uses the underlying OS or native GUI toolkit for its functionality, it doesn't provide access to everything that those toolkits can do."
It should be able to show the growth of memory.
"And two thousand reasons, why itTake a simple select 1, which also comes in at least these flavours: select 1 from dual, select 1 from sysibm.dual, select 1 from sysibm.sysdummy1, select 1 from information_schema.system_users... Oh don't get me started :-)."
"Check out log4j's URL_http://logging.apache.org/log4j/1.2/apidocs/org/apache/l og4j/AsyncAppender.html [asynchronous-appender] , it buffers log messages ad passes them on to appenders using a separate thread."
How can I create my own key?
"Another impressive Jackson feature is the ability to _map classes that you don't own_ (in other words, map a third-party Java class when you can't change the source code)."
If you find yourself often writing: CODESNIPPET_JAVA1 .
CODESNIPPET_JAVA1 .
) [groovy's-safe-navigation-operator] .
Write document: CODESNIPPET_JAVA4 .
Why use a framework for RESTful services in Java instead of vanilla servlets.
Note that the example above uses a simplified way to issue calls via the _ClientResource_ class.
"JPA modelling is ok, but I don't know how to do the same in NOSQL ."
IOUtils.toString is deprecated.
make sure to close the streams at end if you use Stream Readers CODESNIPPET_JAVA1 .
Early failure is also an option.
I had the impression that netbrain was asking about desktop apps.
Even loading the whole document and using XPath is marginally slower than SAX and nothing compared to getting the XML (network speed).
The answers to this question only work if you want to read the stream's contents _fully_ (until it is closed).
which features do they have?
Also there are some issues that your facade would have to handle that commons logging already does.
Converting JSON to Java.
So inside of the Handler you get the username and password from user and it is passed to the LoginModule.
"part of them on AWT Components, part on Swing JCompoentns, but between AWT and Swing is difference with implemented, accesible and inherits methods, for example Swing JComponents directly (API) implements lots of inherit or nested methods directly from AWT :-)."
"At the end of the day, I have worked with different similar UI tools, Flash Builder, Delphi etc., but unless you do some relatively trivial UI design, not including much business logic and communication with other layers, you'll have to accept that what you are capable of creating in code once you learn to do it properly is much more powerful than what any editor is capable of providing you with."
Simplifies the caller code considerably.
I've used it on a couple of projects and found it to be trivial to setup.
CODETERM7 / CODETERM8 should always involve CODETERM9 s (at least for XML) 3. i really don' see a good reason to arbitrarily remove a piece of a date representation.
Thanks for the comments.
"These APIs are easier to use, but require additional jars on your class path."
"The array is owned by a org.jboss.axis.message.SAX2EventRecorder which is in turn held by these guys: org.jboss.axis.message.SOAPEnvelopeAxisImpl@0x19c31fd8 (141 bytes) : field recorderorg.jboss.axis.message.RPCParamElementImpl@0x19c32260 (123 bytes) : field recorderorg.jboss.axis.message.SOAPBodyAxisImpl@0x19c32160 (121 bytes) : field recorderorg.jboss.axis.message.RPCElement@0x19c321e0 (124 bytes) : field recorderorg.jboss.axis.encoding.DeserializationContextImpl@0x19c332f0 (67 bytes) : field recorderorg.jboss.axis.message.SAX2EventRecorder$objArrayVector@0x19c33398 (24 bytes) : field this$0 The data structures of our own app are quete bloated, but not to this degree."
!.
- Means you could extend the tool to create a Iris Search database - I could take another iris image and try to match with existing image Image acquisition is not available.
This saved me recently when we ported our framework to the Compact Framework (in .Net).
Only the version that takes a byte[] parameter is.
"The message we just received contained the data we want, doesn't it?"
"I think this solves quite well the issue you're having, and its is quite straightforward in Java EE 5 with EJB 3."
"Apache has a FTP URL_http://commons.apach e.org/net/apidocs/org/apache/commons/net/ftp/FTPClient.html [client] and a URL_http://mina.apache.org/ftpserver/ [server] Edit: spdenne's suggestion of HTTP is also good, especially if everyone has Java 6."
It doesn't really much matter.
"Sorry for the crappy answer, but it might be a good starting point if ALL ELSE fails."
Have a look at Kundera.
This will change the newlines to the default newline choise.
I still get unexpected errors when consuming entity content when using CODETERM1 .
You can read up about it (and one possible solution) on URL_http://download.oracle.com/javase/tutorial/uiswing/concurrency/worker.html [Swing-Worker-Threads] .
I want to note one thing: old doesn't mean bad.
and mixins allow great flexibility!.
"It ends up being not fitting well into this Q&A format, and it's code that you probably don't need to write yourself."
Now my question is in terms of what I should code against is SLF4J the right choice for the future given log4j 2.0.
CODESNIPPET_JAVA1 .
"I've implemented @erickson's answer as a class: URL_https://github.com/mrclay/jSecureEdit/tree/master/src/org/mrclay/crypto (PBE does the work, PBEStorage is a value object for storing the IV/ciphertext together."
"We're still not quite there, but we have tried a few things now and see things more clearly."
The entire setup is two additional jars on the classpath.
"This is a very good article: URL_http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/ [ URL_http://java.sun.com/developer/technicalArticles/Programming/PerfTuning/ ] In summary, for great performance, you should: 1."
and then I need to things like search/validate/create/read.
"The W3C Document hierarchy is verbose and hard to use, so both DOM4J and JDOM try to make it easier."
A nice way to do this is using URL_http://commons.apache.org/ [Apache-commons] URL_http://commons.apache.org/proper/commons- io/apidocs/org/apache/commons/io/IOUtils.html [IOUtils] to copy the CODETERM1 into a CODETERM2 ... something like CODESNIPPET_JAVA1 .
"For GigaSpaces, you can use JPA to talk to the data grid with very few changes, for example, although then you're still stuck with JPA."
"logj4 might not be your best bet, if you need highly concurrent logging you should go w/ just something like a concurrent linked queue (or blocking) and a dedicated polling thread."
The latest version includes URL_https://visualvm.dev.java.net/ [VisualVM] for profiling.
).
It's highly recommended to ignore this method so much so that you could treat this to be a restricted API.
You may want to try starting with a file containing 100 lines and write it to 100 different files one line in each and make the triggering mechanism work on the number of lines written to the current file.
The first rule of using a commercial tool is to assume the bug is in your code; not the commercial tool.
"maybe i'm wrong, but i think marshall/unmarshall pursuit a different goal, what you are trying to do is conceptually incorrect."
+1 I thought the selimeter should be \\\Z.
"I don't see how any early checking can be done without breaking the single statement into multiple, essentially following the style rule you disapprove of."
"You can index into a string in C# like an array, and you get the character at that index."
"For desktop programs, yes, Swing is heavily in use."
"I can't speak for Spring, but it is straightforward to move your business logic in to the EJB tier using Session Beans."
"It's a ground-up redesign, and is probably a better option for you."
"I agree too, and I wrote the original comment."
"Anywhere in your code that a null value can be returned, consider introducing a check for a null return value."
"In fact, the last major update of Java we had approximately at the same time."
"You can refactor, for example, into CODETERM1 which calls CODETERM2 which calls CODETERM3 which calls CODETERM4 ."
Difference between Swing and AWTSeveral consequences result from this difference between AWT and Swing.
"I have some questions about logging, more specifically about setting it up and making sure it works."
This is how its used: 1.
"Sure, but that's not necessarily the most scalable way to architect an application."
"Also, since jul is contained in the java."
Works with existing code and doesn't lock you in (as opposed to Netbeans)Works with MiGLayoutIt does have some conventions that your view classes have to follow though Installing in Eclipse (Juno): 1.
JavaFX is for web apps is it not?
You will need pull it apart to use it for something other than Derby.
You have full syntax autocomplete which speeds up your query-writing and makes it more error-prone.
I think the schema there explain the situation very well.
"This solution does not provide authenticated encryption, does it?"
Redeployment of the web application on GF 3lasts more or less one second - in oreder to achieve this kind of speedof redeployment for JBoss I need JRebel.
I have always coded my UIs by hand.
or if you want raw speed I'd propose a variation on what Paul de Vrieze suggested (which avoids using a StringWriter (which uses a StringBuffer internally) : CODESNIPPET_JAVA2 .
Getters and setters should be dumb if possible.
Not that I know of.
"In other words, no vendor lock-in."
Does anyone have a better/different way to read a file into a string in Java?
Here's a short update: The solution which appears to be the most viable is EJB.
But the weakness of DES is definitely a problem.
Can anyone recommend a good CODETERM1 (better than the one from URL_http://json.org/ [ URL_http://json.org/ ] )?
It had a decent IDE for making Swing forms and such.
"If you want to actually do something with the resulting parsed grammar, I might suggest looking at URL_http://db.apache.org/derby/ [Derby] , an open source SQL database written in Java."
"And are you willing to use any libraries at all, such as machine learning?"
"I now know the answer to this question: No, the SQL parser for Derby isn't a separate project."
There is a URL_http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm [webkit-based-component-to-display-HTML] .
@fooMonster I've edited the answer.
"Also, if you have an array of Objects, and you deserialize some json into that array of Objects, the true types are LOST!"
"@wufoo The problem with a more developed example is that doing things the ""right way"" would require some encoded structures for transmitting the message and IV, and the PBE parameters."
"For all these negatives, I have edited the question....."
"Open questions that shouldn't be open obviously cause so much more harm than closed questions that shouldn't be closed, so let's be thankful that people err on the side of closing questions.</sarcasm>."
"Please note, according to Java docs, the available() method might not work with InputStream but always works with BufferedInputStream.In case you don't want to use available() method we can always use the below code CODESNIPPET_JAVA2 ."
One example being that there isn't a full featured TreeTable component which can do sorting and filtering/searching.
I seems to me that the finally block does not know variables defined in the try block.
Sun also provides patch releases of GlassFish (akin to RedHat's support for JBoss); see URL_https://blogs.oracle.com/glassfishforbusiness [ URL_https://blogs.oracle.com/glassfishforbusiness ] and sun.com/glassfish.
You can use it for managing both webapps and standalone applications.
SLF4j FTW!Also thanks to Ken G for pointing out that SLF4j is written by the same guy as log4j.
IDEA stores the information in a separate file which means you have to use IDEA to edit the layout visually later.
Can you define good?
To implement a progress bar correctly you will need to create your own implementation of a URL_http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html [CODETERM4] .
I will look it up.
it returns to me boxes instead of actual text characters.
"For some projects we put together, logging framework was more driven by the open source frameworks we were using."
I got confused between facade and impl.
It tries to make Swing more pleasant to use.
"Maybe it is a matter of definition, but RIA frameworks are basically designed to run in browsers."
eg.
"It's not free, but not that pricey either and it gives you a whole lot more tools under your belt."
NLTK is an open-source project.
Avoid processing bytes and characters individually.
@Per Wiklander I disagree with you.
@Pacerier I believe it should be the same port you specify on your socket.
CODESNIPPET_JAVA1 .
What was hard to understand in the security world is just that much easier to understand.
"Details:** Also note that CODETERM7 aren't magic, they just use an Array as a backing object and that Array has to be re-allocated when ever it gets full."
"First ,you have to know the encoding of string that you want to convert.Because the java.io.InputStream operates an underlying array of bytes,however,a string is composed by a array of character that needs an encoding, e,g."
"Actually, if you want a lightweight solution and don't need transactions or clustering just use Spring support for RMI."
"As of today, there are a lot of themes around."
Natural Language date and time parser for java.
Setup of the NoSQL DB should be minimal.
"There are 2 bug reports filed with Axis URL_https://issues.apache.org/jira/browse/AXIS-2698 [AXIS-2698] URL_https://issues.apache.org/jira/browse/AXIS-2749 [AXIS-2749] See also URL_https://issues.apache.org/jira/browse/AXIS-1771 [AXIS-1771] , it has some interesting information regarding deserialization and ways to mediate its impact."
"Kundera is a object-datastore mapping tool for Cassandra, Hbase and MongoDB."
"It includes URL_http://www.instantiations.com/windowbuilder/swingdesigner/index.html [Swing-Designer] , which is a Swing UI builder."
It also has the fastest JSON to JavaBean mode too.
"Worth mentioning that since version 1.4, Java had the classes java.beans.XMLEncoder and java.beans.XMLDecoder."
"You might want to list some of the nice features, since there are so many alternatives -- project page lists many, although most exist in other libs as well."
"Similar to the goal of Commons Logging, but more intuitive from my experience."
"Look at vtd-XML, DOM and SAX are somewhat ancient APIs that has not been updated/improved for a while."
"Is there a method where we can mention REST service server list in ClientResource, in case the server is down try the next server?"
URL_http://xmlbeans.apache.org/ [XMLBeans] works great if you have a schema for your XML.
URL_https://github.com/Atmosphere/atmosphere [Atmosphere] and URL_http://directwebremoting.org/dwr/index.html [DWR] are both open source frameworks that can make Comet easy in Java.
"An exception that the property is null is a side-effect of invoking the getter, because it is something that occurred within the getter method invocation that forces the caller to adapt to its effects directly, instead of indirectly via a null check."
Unfortunately this solution seems to go and lose the exceptions thrown in my underlying stream implementation.
The best known are URL_http://nekohtml.sourceforge.net/ [NekoHTML] and URL_http://jtidy.sourceforge.net/ [JTidy] .
If one existed I'd prefer a HTTP framework that worked with Gson instead of Jersey as I'm more comfortable with it.
"How to convert it to, and use it in, Android?"
""" Google cached the site at URL_http://webcac he.googleusercontent.com/search?q=cache:bugs.sun.com/bugdatabase/view_bug.do%3 Fbug_id%3D4715154."
You have to read input-values from widgets and store them in normal variables before a dialog is disposed.
That's probably not a good idea.
"If a message is put for all subscribes, 300 of those threads queue for CPU."
Basically AWT came first and is a set of heavyweight UI components (meaning they are wrappers for operating system objects) whereas Swing built on top of AWT with a richer set of lightweight components.
It works.
Ideally with try/finally...
"Alternatively, you can use the _jconsole_ tool (which also comes with your JDK) to request a heap dump at any time using the memory management MBeans."
Thanks.
This is due to problems with invalidation of Hibernate's 2nd level cache when running several client applications working with the same datasource.
"Although, .NET implementation of Bouncy Castle is not well documented, it is essentially the same as Java."
What on earth do you copy...???
The increased CPU usage was due to a CODETERM1 loop that was waiting for the threads to finish.
Which is best for you depends on your project requirements and your personal taste.
2) MySql on MyISAM engine without any foreign keys (i.e.
"Each WAR is effectively independent -- their own sessions, there own context paths, etc."
Where as in swing components its the responsibility ofto generate the view for the components.
"later,Dean ."
Features: AWT components do not support features like icons and tool-tips.
What I really like about Spring Security is once it is set up the security is integrated into the project seamlessly.
"While GSON has reasonable feature set, I thought performance was sort of weak spot (as per [ URL_http://www.cowtowncoder.com/blog/archives/2009/09/entry_326.html])As to example: I thought GSON did not really need setters, and was based on fields."
"How did you get that done so fast?!""."
"So far, I had a great experience with the community wiki and documentation of Jboss, and it pretty much covers everything."
I'm sorry.
Some of the salient features are: JPA 2.0 compliant.
"Like most code generation tools, it might get you started, but eventually you will have to maintain the generated code yourself."
"And a fix: In our product, I even replaced should be 'we even replaced'."
"If you really need AES-256 and can't get it through the JCA, you can use a non-standard API, like BouncyCastle's ""lightweight"" crypto API directly to bypass the restrictions."
It's how many threads per socket.
"This shows how to iterate over the lines in a stream, not how to read the entire stream into a string."
C# equivalent to Java's charAt()?
"But whatever you do, try and minimize the cases where null is a valid response for this amongst other reasons."
@Arkadiy: Don't assume there's a bug in JBoss; assume the bug is in your code.
Is it non-null?Then highlight someObject.getSomething() (including the parenthesis) and inspect it.Is it null?
See URL_https://hc.apache.org /httpcomponents-client-ga/tutorial/html/fluent.html [tutorials] .
I think I vaguely remember seeing that in the logback project but I need one for the XML format.
"Thanks Jay, this looks promising, I'll check it out."
Related: URL_http://stackoverflow.com/questions/2994304/is-java-swing-still-in - use/2994324#2994324.
"I am not sure if you are upset with the question, but since I did not find the same question already answered and the community here is friendly enough with such questions, I figured I would go ahead and ask for opinions."
"Please provide the xsd, without it its difficult to guess the issue, or recreate it."
"The WindowBuilder items are under ""General Purpose Tools"" (or use the filter) Older versions and zips are available at URL_http://www.eclipse.org/windowbuilder/download.php [ URL_http://www.eclipse.org/windowbuilder/download.php ] ."
I second this.
"FWIW, almost all Java JSON libraries support this conversion mode, including GSON, Jackson and Genson."
"Requring, as Doug put it, Frankensteining something."
(disclaimer: I work at Sun and I am in the GF team) I agree that Seam works fine on GlassFish; see URL_https://blogs.oracle.com/theaquarium/tags/seam [ URL_https://blogs.oracle.com/theaquarium/tags/seam ] GFv3 is quite different than JBoss 5; in particular:GFv3 is based on OSGi while JBoss 5's kernel is based on JMX.
"If you do, gist it and I'll append your results to the answer."
Iris Image database: Text file db to store Iris Images.
"Assuming some single-byte encoding, it will (temporarily) require 5 bytes of memory for each character in the file."
"And in addition, you can put CODETERM1 into other frames without creating another frame class for this."
"The simplest solution for many, many reasons is to use a Comet based approach (like you mention)."
JavaFX 8 (for Java 8 and above) has a TreeTableView widget.
"The most complicated part is using, for example, the layouts (If you can not handle complicated parts), but everything is almost plug & play."
) ;-).
Since the deadline is looming I thought I'd better ask if it is even possible?
\- then you just call lc.login(); and authenticate the credentials.
FYI - I answered this three years ago.
It will stream in the data so it doesn't need to preload the whole file first.
"URL_http://alias-i.com/lingpipe/ [LingPipe] , URL_http://opennlp.sourceforge.net/projects.html [OpenNLP] , etc."
Copy this code into all your projects.
I question how often we put effort into optimizing something that no one notices.
"Lastly, all these logging frameworks are WAY TOO COMPLICATED."
I should enhance the translator to deal with log4j.xml as well.
"You can also have a look at the ""firstResource"" tutorial ( URL_http://www.restlet.org/documentation/1.1/firstResource [ URL_http://www.restlet.org/documentation/1.1/firstResource ] ) which describes how to develop a simple resource and which introduces some concepts of the REST architecture style."
@erickson so the lack of support is the only criteria not to use 'PBEWithMD5AndDES'?
Stability?
For details on why Ceki Glc did create SLF4J+Logback see the following Devoxx talk: URL_http://www.parleys.com /#st=5&id=1701.
You'll then have to pray that you got it right without significant unexpected avenues for exploits or denial-of-service attacks.
The Java tutorials have a good example of this in their URL_http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html [lesson-in-concurrency] .
"While Matisse (now known as "" URL_http://netbeans.org/features/java/swing.html [Swing-GUI-Builder] "") makes it pleasant to layout components, it is similar to all other code generation tools because when you use Matisse you must live in constant fear that someone else edited the ""you cannot edit this in NetBeans"" GUI sections outside of NetBeans."
"For some NoSQL engines, then, you'll build a document, consisting of the three data items, and you'd just query for that document before writing it into the database."
URL_http://tika.apache.org/ [Apache-Tika] is the best choice.
"Hmm, I'm not sure, it looks like it expects to be deployed in a war file, and I would rather avoid a heavyweight servlet container and all of that infrastructure, the API is just a small part of my project, I don't want to stuff the entire thing in a war just so I can support the API :-/."
CODESNIPPET_JAVA1 .
I've implemented the erickson's answer in a really simple class: URL_http://pastebin.com/YiwbCAW8 [Java-AES-256-bit-Encryption/Decryption- class] If you get the CODETERM1 you have to install the Java Cryptography Extension (JCE) unlimited strength jurisdiction policy files:URL_http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html [Java-6-link]URL_http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html [Java-7-link] Just place the jars in your CODETERM2 .
"Having to call InputStream#close() to release allocated resources is massively over-complex, isn't it?"
Can you please clarify what null checks you would use in this case before the changed getters of someObject?
It's old but should help with the JAAS basics.
"I assume it has improved in the past year - they seem to add features in gobs and heaps, quite often."
I am looking through the code and implementing my simple service in parallel.
"The json.org library does pretty well with serializing basic beans with reflection, but doesn't have these advanced features."
"@jmort253 Many libraries are large, slow but powerful."
So code could be simplified slightly.
"For instance, you may want to look at JavaFX if you need a rich UI; or using SWT in your application."
"Plus, it encourages mistakes like yours where you are breaking up two literals that could otherwise be compiled as one."
How to trace a NullPointerException in a chain of getters.
"Great, stylish."
E.g.
How to send HTTP request in java?
My vote is for Netbeans' visual editor.
And JXTA supports it too but the configuration is complicated.
Argh.
What does the channel means.
I attempted to get the response into a String 3 different ways.
I'm using Rhino 1.7R4 and env.js 1.2 to run Javascript code inside Java I want to print from my Javascript code a string to the Java console.
Here we will get the representation of an existing resource and output it in the JVM console: CODESNIPPET_JAVA1 .
It is safest to apply to files that you know to be small relative to the available memory.
"It's not a rewrite, really, it shares nothing in common with JBossMQ at all, other than being a JMS implementation with ""JBoss"" in the title."
That is what commons logging does so why reinvent the wheel?
"For Java 7 you can close in a try-with: try(java.util.Scanner snew java.util.Scanner(is)) { return s.useDelimiter(""\\\A"").hasNext() ?"
]( URL_http://stackoverflow.com/questions/892411/breaking-out-of-the-google-app - engine-python-lock-in).
;) .
Avoid accessing the underlying operating system.
I would use Commons Logging if I was enhancing something that already used it.
I think the best editor that can exist is Visual editor for eclipse.The only drawback is the fact that we can't re-edit the visual part when we modified the source code.
I think the below answer (IOUtils.toString()) is simpler since there is no need for a StringWriter.
"For example, if you're getting the body of an HTTP request viait's justrequest.getReader() )**."
"You can attach to a Java 5 VM, but it doesn't show as much."
You've not posted any specific reasons for not using Java's native implementations.
"things like: create new file by a defined structure(header,data,trail)."
Yes that looks like a more suitable way to use it.
URL_http://download.oracle.com/javase/6/docs/api/javax/xml/parsers/DocumentBui lderFactory.html [ URL_http://download.oracle.com/javase/6/docs/api/javax/xml/parse rs/DocumentBuilderFactory.html] Example: URL_http://www.mkyong.com/java/how-to-read-xml-file-in-java-dom- parser/ [ URL_http://www.mkyong.com/java/how-to-read-xml-file-in-java-dom-parser/ ] .
Thanks in advance.
The best sql parser for Java +1.
I have been asking this same type of question now over and over again and I keep getting little to nothing back.
I've added the encoding.
use of annotations)it is not convoluted to get to the values of parameters (e.g.
"@harschware: Given the question was: ""If you have java.io.InputStream object how should you process that object and produce a String?"
"As noted in the question, this also requires the _Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy_ (else you'll encounter URL_http://stackoverflow.com/questions/3862800/invalidkeyexception-illegal- key-size/3864325 [CODETERM1] )."
"First, note that I work for a NoSQL vendor, URL_http://gigaspaces.com/ [ URL_http://gigaspaces.com/ ] - I'm not unbiased."
Has extra spaces and where do you close the inputstream?
"In the diagram below, ports represent the connector that enables the communication between components which are represented by the larger boxes."
The only hard part is when you don't know how many characters you need to read.
"I am working on a Natural Language parser which examines a sentence in english and extracts some information like name, date etc."
I am planning on making a Java Swing application and was wondering if Swing is still used or if it has been replaced with something else.
And did you have the gall to downvote this?
@Mark Got it.
Why one would use one of the following packages instead of the other?
[UniREST]( URL_http://unirest.io /#java) is also pretty good nowadays.
"If there's a mismatch, then you'll care about encoding."
I've added the encoding.
Memory leak in JBoss.
URL_https://www.eclipse.org/jetty/documentation/current/http-client.html .
Other users have provide some very useful links above so I am not going to bother with links.
Eclipse Visual Editor is pretty dull in my experience.
DOM is a W3C standard ( URL_http://www.w3.org/DOM/) .
Code above has a bug of adding extra new line char at the last line.It should be something like followingif(linereader.readLine() ) != null){ stringBuilder.append( line );}while (linereader.readLine() ) != null) { stringBuilder.append( ls ); stringBuilder.append( line );}.
etc.
Isn't this a little perverse?
"In short, it's not a very fluid API in the style of, say, JSoup, it appears to be a tool that comes from the era where everything was XML, and then it was retrofitted for JSON."
You appear to be sharing the same fixed salt value between all key instances.
If you visit URL_http://json.org/java/ [this-page] you will find several Java classes that can help with this.
The big annoyance in switching is actually the configuration and supported appenders.
""" twice to stdout."
However on the client side there seems to be something missing that is comparable to Apache Axis for SOAP - something that hides the web service and marshals the data transparently back to Java objects.
DarkSquid's method is vulnerable to password attacks and also doesn't work unless your plaintext's size is a multiple of AES's block size (128 bits) because he left out padding.
this is probably a code smell and should be avoided.
What kind of conversions are possible there?
"The new try-with-resources will auto-close the Scanner, which will auto-close the InputStream."
Also the ControlsFX widget library is available for Java 8 only: URL_http://fxexperience.com/controlsfx/ .
"Samiksha, make that another question instead of trying to have a discussion thread in these comments."
This bug has made me sad: URL_http://sourceforge.net/tracker/?func=detail&aid=2062 744&group_id=171425&atid=857928.
Why not?
Can you elaborate further?
:EOF .
( URL_http://tldp.org/HOWTO/IPCHAINS-HOWTO.html) .
Getting Access to HttpServletRequest object in restful web service.
As soon as either happens the client opens a new connection.
"Gson is great, and has high quality documentation too."
I would suggest you look at DataInputStream and DataOutputStream.
There's no need for ALL CAPS.
Your situation is what JMX is designed for (the M stands for Management).
SimMetrics is probably what you need: URL_http://sourceforge.net/projects/simmetrics/ [ URL_http://sourceforge.net/projects/simmetrics/ ] It has several algorithms for calculating various flavours of edit-distance.
"You should avoid mixing AWT and Swing components within the same UI, they tend not to play well together."
web.xml)the parameters are nicely mapped to strongly typed variables (e.g.
"This is just my point, why use a sledgehammer to hammer in a nail."
It says: 'The swing application framework (JSR 296) is no longer developed and will not become part of the official java development kit as was originally planned.
"That said, there are probably a hundred better ways to do it (just, this method has less code)."
"If you do not know this ahead of time, it is utterly bewildering."
Each time I read about itI get lost in the nth mention of channel :(.
"It's not like we debug regularly, but we do want the ability to catch a JVM in a misbehaving state."
This enables you to access spring beans from EJBs.
Sometimes speed is of the utmost importance and is a hard requirement.
URL_http://www.dcs.shef.ac.uk/~sam/simmetrics.html [SimMetrics] URL_http://ngramj.sourceforge.net/ [NGramJ] .
"The only question is whether you're writing that code yourself, or using existing libraries."
2.
They are designed to read in a JSON String and provide access to their properties via a get() method.
"So as a conclusion, on the ease of use and learning curve aspects, Shiro is really quite likeable, and I think I will probably go with it in the future, unless I encounter some features lacking or some other problem (which I haven't so far)."
Would this work - URL_http://www.wangz.net/cgi- bin/pp/gsqlparser/sqlpp/sqlformat.tpl [SQL-Formatter] .
"The whole point of using InputStream is, that a) you don't know the length of the _complete_ stream (which bails out anything depending on available) and b) the stream can be anything - a file, a socket, something internal (which bails out anything based on File.size())."
The problems started when Sun actually added java.util.logging to Java 1.4.
URL_http://www.seas.upenn.edu/~bensapp/opencvdocs/ref/opencvref_cv.htm [This- page] mentions them .
"in the database, why not just use 'PBEWithMD5AndDES' and append the salt to the encrypted text, after loading u can strip the salt and use it for decryption."
"Boy, I'm absolutely in love with Java, but this question comes up so often you'd think they'd just figure out that the chaining of streams is somewhat difficult and either make helpers to create various combinations or rethink the whole thing."
"Very important for the various Apache projects, which will be linked into outside applications."
If you want a serialization like DOT NET then you could use URL_http://java.sun.com/products/jfc/tsc/articles/persistence3/ [Long-Term- Persistence-of-JavaBeans-Components] The choice depends on use of serialization.
"But that JSON library could still stink for other reasons (never used them personally, but I know we're using them at work)."
"I've used Jersey's client, which is conceptually pretty similar."
This takes 10-60 minutes on a mobilephone/hand held computer.
Quite interesting.
The byte length depends on the character encoding used.
Otherwise you may only capture part of the file.
"Lines numbered 5 - 27 are for the String named ""literal"" Lines numbered 31-53 are for the String named ""builder"" Ther's no difference, exactly thecode is executed for both strings."
"You should delete the file in the folder first , then the folder.This way you will recursively call the method."
It's not completely thread safe (atleast AES engine).
If you are using Google-Collections/Guava you could do the following: CODESNIPPET_JAVA1 .
If your CODETERM15 is going to be less than 10k then initialize it with the constructor to 10k to be safe.
Try URL_http://zql.sourceforge.net/ [Zql] .
For me that is a HashMap/ArrayList Object.
"Even if you are not interested in reading XML/HTML/MS DOC formats you can just specify ""text/plain""."
@msw - It is rhetorical :).
Looks like logback is the best choice.
Does JBoss Seam work well on Glassfish?
Shiro defaults almost everything to sane defaults and you can override or configure only what you need.
JBoss Messaging replaces JBoss MQ.
"For me, the best visual swing editor is URL_http://www.jformdesigner.com [JFormDesigner] , which you can run standalone or as a plugin for Intellij and Eclipse."
It certainly helps to know about 1.4.
"It's clunky and hard to read, and overly verbose."
erickson said how to do this above.
It does however require mapping annotations for each field.
"It's not difficult, but you have to URL_http://java.sun.com/javase/6/docs/tech notes/guides/security/crypto/HowToImplAProvider.html [read-through-the- documentation-on-how-to-do-that] ."
"The ""suggested steps"" guide has moved here: URL_http://static.springsource.org /spring-security/site/start-here.html."
Thank you.
The password used to generate the SecretKey should be kept in a secure place and not be shared.
"IVs serve a similar purpose, and are prepended to the ciphertext by most (all?"
"The different approaches all have their issues, and we are looking for a lightweight method."
"Performance and ease of use (yes, Quality of API)."
"Now the question, which actually are two questions: A) CODETERM2 gives me error on Eclipse, and advises me to add a cast, but this doesn't solve the error."
There are times however where an applet may serve a valid purpose.
"I've used URL_http://json-lib.sourceforge.net/ [JSONLib] , URL_http://flexjson.sourceforge.net/ [FlexJSON] and URL_http://code.google.com/p/google-gson/ [Gson] all with great success."
And yet another example is here: URL_http://stackoverflow.com/questions/2496494 /library-to-encode-decode-from-json-to-java-util-map/2496528#2496528.
But this is also for transforming into well XMLs.
"It looks like it uses reflection on bean-style properties and uses similar rules as Hibernate/JPA lazy-loading for serialization, so if you give it an object to serialize it will leave out collections (unless you tell it to include them) so you don't end up serializing the entire object graph."
:).
"JAXP is then implemented by different providers such as: Oracle, Apache, etc."
"The SPI (service provider interface) defines them, and you can extend the API to define your own."
I am trying to authenticate users with a REST service I built using drop wizard.
It seems that there is no documentation on the web site at all.
"Ohh because I am looking at the Tomcat logs, and not log4j."
"java.nio is much more efficient, but can be hairy to code around."
"It seems to fit when looking at URL_http://www.slf4j.org/news.html [their-earlier-news-posts] )SLF4j because they also publish a log4j adapter so you don't have to ""switch out"" log4j in older code - just make log4j.properties use SLF4j and it's configuration ."
What is the easiest way to take the CODETERM5 and convert it to a CODETERM6 ?
awt componentsare heavy weight.
You should always indicate the mode and padding algorithm.
Just focus on using Acegi or plain old Java EE security which solves a lot of common web application security problems.
Are you pushing or pulling the file?
Their API is however somewhat clunky and not intuitive.
Etc.
What about spring parentContext?Check out this article: URL_http://springtips.blogspot.com/2007/06/using-shared-parent-application- context.html [ URL_http://springtips.blogspot.com/2007/06/using-shared-parent - application-context.html] .
But creating a 256-bit key isn't enough.
"I mean, if i was looking to create URL_http://stackoverflow.com/questions/6774904/nested-rest-routing [the-url- structure-described-by-Wim]URL_www.example.com/imagesURL_www.example.com/images/id/numURL_www.example.com/images/tag/numURL_www.example.com/images/tag/num/num/num Would it not be easier (for future developers) and faster (to implement and learn) to map the url pattern /images to a servlet and have a line or two that parses the url for the parameters instead of learning, implementing and configuring one of these libraries to do it for you."
It is based on Eclipse.
"This can be a daemon app (or Windows system process), or it can be a Unix-style ""superserver"" that's configured to load and run the actual file-copy app when someone contacts the listening port."
See more focussed question here: URL_http://stackoverflow.com/questions/7782720/when-to-move-from - container-managed-security-to-alternatives-like-apache-shiro.
[enter image description here]( URL_http://i.stack.imgur.com/uBnha.png ) .
"Its based on a grammar and JavaCC, so probably a better option than reinventing this wheel with antlr in any event."
"Now, I can see that URL_http://xstream.codehaus.org/ [XStream] might be very useful as it's nonintrusive and has really simple api."
I discovered this through experimentation after digging through the URL_https: //github.com/mozilla/rhino/blob/master/toolsrc/org/mozilla/javascript/tools/sh ell/Main.java [Rhino-shell-executable] .
"Just to clarify, I'm talking about Java's built-in collection so I can't override its CODETERM4 ."
@coolcfan - I do agree with you on that point.
@Malax Thanks for the heads up.
"It's been pre-tuned to scale up to 16 nodes, 20k concurrent users."
"Now, highlight ""someObject"" and press CTRL+SHIFT+I (or right click and say ""inspect"")."
+1.
You can change default behaviour and it will use only present fields.
At what point is it better to switch from java.net to java.nio?
Sun's Java 6 includes a light-weight URL_http://java.sun.com/javase/6/docs/jre /api/net/httpserver/spec/com/sun/net/httpserver/package-summary.html [HTTP- server-API] and implementation.
"This facilitates a nice, clean DSL but it faces a problem when trying to create queries for databases that are only known at runtime, like in the OP's example above."
A better alternative to Jersey/Jackson for building JSON REST APIs?
"The Logic goes in to Session Beans, and these Session Beans are bundled within a single jar as an Java EE artifact with a ejb-jar.xml file (in EJB3, this will likely be practically empty)."
any ideas about performance of Scanner vs reading the stream in a more verbose way?
You can create your own: CODESNIPPET_JAVA1 .
"please, rephrase the question as comparing between EITHER: Glassfish 2 vs JBoss 5, ....or.... Glassfish 3 vs JBoss 6."
Doesn't it offer DOM manipulation?
Trying to implement this with Doug's code below.
"When building a house, don't build the hammer too."
"As an alternative to the Commons libraries, Google's excellent URL_http://code.google.com/p/guava-libraries/ [guava-libraries] let you do this fairly concisely; given an _InputStream_ named _inputStream_: CODESNIPPET_JAVA1 ."
"JBoss Messaging is now in bug fix mode only, since JBoss / Red Hat has a new Java messaging project called HornetQ."
Java is high level compared with C but low compared with Python or Ruby.
JAXB 2.0 also has support for JSON serialization using Jettison.
Sure.
Implementing the new String(...) with encoding is the responsibility of the on that uses the API!.
"Otherwise, you are encoding and decoding needlessly."
"With the following caveats:As with normal Java serializationcoding and decoding run over a InputStream and OutputStreamthe process uses the familar writeObject and readObject methodsIn contrast to normal Java serializationthe encoding but also decoding causes constructors and initializers to be invokedencoding and decoding work regardless if your class implements Serializable or nottransient modifiers are not taken into accountworks only for public classes, that have public constructors For example, take the following declaration: CODESNIPPET_JAVA1 ."
"I never used String.format() mainly because I never remembered what JDK it was introduced - I see it's JDK1.5, I'd use it in favour of the other options."
CODESNIPPET_JAVA2 .
""" Regarding side effects, I'm using the term in a CS sense, which is different from API conventions, which we probably won't agree on here (and don't have to."
"But as you said, either will integrate seamlessly with Swing."
"As you said, the problem of more than one client web app using an L2 cache is keeping those caches in synch."
That means Shiro's Spring integration is superb and it all works exceptionally well.
"The process of entering the rules and logic can be annoying and time consuming, and fixing bugs can be nontrivial."
Problem is jaxb and xmlbeans require a mapping schema and arent auto ...
No need for commons-codec or anything else.
4.
"And no, that's not a side effect."
"However, it will only take you a few minutes to throw it together yourself."
"URL_http://stackoverflow.com/a/1943667/831203 [RESTlet] )the overhead for running the library is low (I have had bad experiences with reflection solutions in other libraries)it is well documentedit is well adopted In such a scenario, I find that using a library would add value to my project for the effort required to use it."
"By the way, the same rationale applies to setters, but I'd use an IllegalArgumentException there."
Rolled back the edit to this answer because the point was to narrow the scope of the line variable.
The answers to this question only work if you want to read the stream's contents _fully_ (until it is closed).
Unfortunately this solution seems to go and lose the exceptions thrown in my underlying stream implementation.
Features: Swing supports a wider range of features like icons and pop-up tool-tips for components.
A lot has changed since this question was asked 2 years ago.
"Will they co-exist happily?I thought I would use URL_http://logging.apache.org/log4j/1.2/index.html [log4j] together with both SL4J and the logging component from Apache commons, do you think that's a good idea?"
If you use SSH you can allow tunneling and tunnel a port to your local host.
CODESNIPPET_JAVA1 .
"Hint: I'm using eclipse and I know what a debugger is, but I can't figuere out how to apply it to the problem."
What strategy should I follow after I get the users' password in the CODETERM3 as plain text?
My experience is that for certain well-defined and very domain-specific tasks (for example: recognizing names of medicaments within Wikipedia web pages) you _can_ manually build NER solutions.
"google, github, etc."
GSon uses the same design protocol JSON.org went with when developing JSONObject and JSONArray.
What is the best solution for messaging?
excellent trick!
"@Alex B: HttpComponents are being used in all sorts of different applications randing from simple URL fetchers to complex transports and web crawlers with different, often conflicting requirements."
"So, any extra fields available in the JSON stream are ignored."
If you are using Google-Collections/Guava you could do the following: CODESNIPPET_JAVA1 .
Any suggestions on how to solve this?
In chronological order of api apperance (as far as I know):Log4j because most everybody uses it (in my experience)Commons Logging because open source projects use it (so they can integrate with whatever logging framework is used in the integrated solution); especially valid if you're an API/Framework/OSS and you rely on other packages that use Commons Logging.
For Sing-in I'm thinking about using CODETERM2 in Dropwizard.
Run a proxy client on the debugging workstation that also encrypts/decrypts the input.
Just found URL_http://wiki.apache.org/incubator/WinkProposal [Apache-Wink] in the Apache Incubator.
"I ran some timing tests because time matters, always."
"Since that is not always intended (http requests with a keep-alive connection won't be closed), these method calls block (not giving you the contents)."
"@PavelRepin @Patrick in my case, an empty inputStream caused a NPE during Scanner construction."
"So far, we have mostly showed you the highest level of abstraction in the Restlet API, with the ClientResource and ServerResource classes."
My immediate thought for best performance on Windows would be to use URL_http://msdn.microsoft.com/en-us/library/aa365198%28VS.85%29.aspx [IO- completions-ports] .
+1000 for Keyczar.
"One extra note: it seems that all public ways of creating a new CODETERM1 instance involves necessarily the copy of whatever buffer you are working with, be it a CODETERM2 , a CODETERM3 or a CODETERM4 ."
"If you're talking about automatic XML serialization of objects, check out URL_http://www.castor.org/ [Castor] :Castor is an Open Source data binding framework for Java[tm]."
The block size is parameterized for run-time performance optimization.
Changed to use StringBuilder.
But this just encourages programming that spots the bug in the wrong place.
CODESNIPPET_JAVA1 .
Using HTTPConnection and manual parsing of the result?
"I can recommend a few Java implementation of Lex/Yacc ( URL_http://byaccj.sourceforge.net/ [BYACC/J] , URL_http://www2.cs.tum.edu/projects/cup/ [Java-Cup] ) that you can use an existing SQL grammar with."
"I only had to extend 2 or 3 classes, and the whole thing took only about 25 lines of XML config in my spring context."
"The context has to be initialized with the used classes, but you just have to specify the root classes and don't have to worry about static referenced classes.You use annotations to specify which classes should be elements (@XmlRootElement) and which fields are elements(@XmlElement) or attributes (@XmlAttribute, what a surprise!"
"One would think that an API like RESTlet would ""help"" you."
} And these are ivBytes and a random key; CODESNIPPET_JAVA2 .
Java logging because you don't want to add in an extra jar.
Read/convert an InputStream to a String.
It could also be the languages and media types you prefer to receive as a response: CODESNIPPET_JAVA2 .
Thx.
The article describes various approaches.
basically I want to map the files to objects and vise versa.
Java LoggingCommons LoggingLog4jSLF4jLogback .
"Since you're using buffer variable locally with no chance of being shared across multiple threads you should consider changing its type to StringBuilder, to avoid the overhead of (useless) synchronization."
@S.Lott - Agreed.
"Suppose I have an CODETERM3 that contains text data, and I want to convert this to a CODETERM4 (for example, so I can write the contents of the stream to a log file)."
"Not specifically Java-related, but I thought these InfoQ articles were quite good:URL_http://www.infoq.com/articles/rest-introduction [A-Brief-Introduction-to-REST]URL_http://www.infoq.com/articles/tilkov-rest-doubts [Addressing-Doubts-about-REST]URL_http://www.infoq.com/articles/rest-anti-patterns [REST-Anti-Patterns] ."
"To sum up what we're trying to achieve: One JBoss instance, several web apps utilizing one stack of business objects on top of DAO layer and Hibernate."
"Connect SLF4J to your favorite backend (Log4J, Logback...) by putting CODETERM3 in the classpath."
"What I don't know is (a) whether there are similar concepts in other OSes, and (b) whether there are any suitable Java wrappers?"
"The above code reads from a file, but you can easily read from a URL as in the following example that reads stock info from google."
"If you can, run the application under Java 6."
"It provides a lot of great features, also a intuitive DSL for SQL and a extremly customable reverse- engineering approach."
It really doesn't matter whether you're using CODETERM1 or not.
"As others have mentioned, my best experience with Java SWING applications is with NetBeans."
"And, the way it's held (see update), it may be allocated for each request in progress-that explains why we fail only when certain number of requests are in progress."
"But as the webapp gets larger, the benefit of having a tested library to handle all the low-level stuff really does win out."
I too agree that Spring Security feels too complicated (to me).
Because internally CODETERM2 method of each Collection internally calls CODETERM3 over the Collection.
"Apache Commons Lang (probably useful enough to be on the classpath of any non- trivial project) has URL_http://commons.apache.org/lang//api-2.4/org/apache/co mmons/lang/StringUtils.html#repeat%28java.lang.String,%20int%29 [StringUtils.repeat()] : CODESNIPPET_JAVA1 ."
You should give -1 only if it is giving faulty info.
"Finally, you might also want to check out SWT (the GUI toolkit used for Eclipse, and an alternative to both AWT and Swing), which is somewhat of a return to the AWT idea of accessing native Widgets through Java."
From URL_http://java.sun.com/docs/books/tutorial/networking/urls/readingWritin g.html [Sun's-java-tutorial] CODESNIPPET_JAVA1 .
I like the URL_http://www.netbeans.org/features/java/swing.html [Swing-GUI- Builder] from the URL_http://www.netbeans.org/ [NetBeans-IDE] .
"If there is active messaging ongoing, it adds up to 10 other threads for such subscriber."
"I knew exactly what I wanted to achieve in terms of HTTP logic, cookies, session id's and stuff, and what should happen in what order, but I spent the better part of a day struggling with the Spring Security APIs, and still could not figure out exactly what class or interface I shoud implement or override, and how to plug them in the context."
Reads the contents of a file into a String using the default encoding for the VM.
It works though I still feel there is probably a better/cleaner solution.
I will have a try on it...
"I just commented on reference to expected good performance.Feature-set wise Jackson handles all the same nesting, layering, generics, so that's not where speed difference comes from.Having getters and setters does not impact performance in any measurable way (for packages I am aware of), so definitely can have them there."
It is also more robust against temporary network troubles as the server by default queues messages and wont get upset if the client isn't available on its schedule.
"But in 20 years, you can make something almost useful (for yourself)."
"That code will normalize line breaks, which may or may not be what you really want to do."
I love this game.
"In our product, I even replaced many JDK classes with our own implement."
"By looking at the Pivot docs, a lot of effort must have went into the code."
plz update it...
e.g.
The cost of XML parsing is typically orders of magnitude higher than more optimised wire formats (e.g.
I want to compose a HTTP request message in java and then want to send it to a HTTP WebServer.I also want the document content of the page recieved which I would have recieved if I had sent the same HTTP request from a webpage.
Why the hell has Ceki created 3 logging frameworks!!!
"It does not work for me to count the lines.The thing is: I have a file and I need to split it in 200 (this can change, it will come from the database) files for example.How do I do that?"
"But this led to several new problems: 1) Security manager denies access to RMI classloader, so the client failed once we tried to invoke methods on the JNDI resource."
I can use the following code to navigate through the JSON document and then map the object I want: CODESNIPPET_JAVA3 .
ToStringBuilder uses threadlocal!?!
"@M-T-A: The streamclosed, note the use of Closer in [CharSource]( URL_http://code.google.com/p/guava - libraries/source/browse/guava/src/com/google/common/io/CharSource.java)."
"The connection is long lived, server squirts up data periodically, browser thread sucks that data and displays it."
"Replace your ""main"" class with DebuggerMainWrapper in your start-up scripts 2."
is no more part of preview SDK and it is available for Production use.
"This feels like a lot of hassle, considering that everything is on the same server anyway."
"If you do, gist it and I'll append your results to the answer."
For low volume control applications the simplicity of XML-RPC should outweigh the performance costs.
@erickson - thanks for the reply.
I would go with Swing.
You should throw an IllegalArgumentException if (length < 0).
Commons URL_http://commons.apache.org/proper/commons-io/apidocs/org/apache/com mons/io/FileUtils.html#readFileToString%28java.io.File%29 [CODETERM1] :CODESNIPPET_JAVA1 .
JavaFX 2.0 works well for desktop apps as well.
StringBuilder CODESNIPPET_JAVA2 .
"@Astron Sorry, I don't really understand your question."
"URL_http://lucene.apache.org/ [Apache-Lucene] is the only way, I think."
CODESNIPPET_JAVA1 .
+1 for neo4j.
[enter image description here]( URL_http://i.stack.imgur.com/f6bUp.jpg ) .
The sending piece of code will be ran on the computer that is sending the code when they want to send a file.
@User1 - I like using libraries in my code so I can get my job done faster.
"I'm wondering if there are other libraries, perhaps more recent, that I should consider for this that might be easier to use than Jersey?"
"Not as easy to find as you might think, as there are a fair few defunct projects out there."
"JavaFX haven't long time any progress, lots of Swing's Based Frameworks are stoped, if not then without newest version just my view - best of them is SwingX, but required deepest knowledge about Swing, URL_http://stackoverflow.com/questions/3954616/look-and-feel-in-java [Look- and-Feel] for Swing's Based Frameworks ."
Are there any cases where awt is more useful/ advised to use then swing or vice-versa?
"Now, when you start up your JVM everything is the same except that a background poller thread is started."
"Code with SLF4J, and choose backend at runtime."
"It's easy to use, completely hides the network stuff from you, and works over good ol' HTTP."
You dowant to use Cassandra for this.
It's a URL_https://github.com/Netflix/astyanax/wikihttp:// [very-well-documented] Cassandra API with many examples and support very high level features such as locking and all versions of cql.
It's good to be able to consolidate the output via those APIs into a single output route.
"Today a Swing application can run fast enough to be serviceable or even zippy, and almost indistinguishable from an application using native widgets."
He want's text (see comment in answer from Lawrey).
Therefore I don't need any private-public key pairs.
While jOOQ supports a String based approached there are some quirks.
Perhaps you should be more specific next time.
URL_http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html .
Any good implementation will use a StringBuilder behind the scenes as you say.
The -- easiest to implement -- algorithm for finding tags will consists of two steps:Extract candidates for tagsFind most significant tags - most disti.
URL_http://www.eclipse.org/swt/ [The-Standard-Widget-Toolkit] .
"Unfortunately we are building a product that is available on many JVMs, databases and app servers on many operation systems so we have to think for the users using poor machines... And a string operation optimizing can improve the perf by 30~40%."
"Does String x""A"" + ""B""; really compile to be a StringBuilder?"
"While taking a heap dump can help to gather state information, it's often easier to use a remote debugger."
"Sun provides some, and BouncyCastle is another good one."
I am going to choose a JMS message broker for a project.
"I was thinking more in thechunk of code like a template""* and not really in every regular string literal."
Doesn't answer the question.
"The former is for funneling to your desired logging framework (log4j, logback, etc), the latter is to replace the used logging framework."
URL_http://www.ietf.org/rfc/rfc2898.txt .
You can find a complete overview on methods in URL_http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.164.2388&rep=rep1&type=pdf [this-survey] .
"""You use String when you are dealing with immutable strings"" - doesn't make sense."
"Yes, it still is in use."
I use Apache HTTPClient to handle all the HTTP side of things.
"From my understanding, NIO is meant for one server, many clients, but what I'm thinking of is one client, many servers."
Vendor Support: Swing development is more active.
JBoss 5.1 GA is listed as 130MB; GFv3Preview is 50MB.
CODESNIPPET_JAVA2 .
XML generators are trivially simple.
"If this is your own collection class rather than a built in one, you need to override its toString method."
") We haven't looked too much into EJB yet, but after the first two tries I'm wondering if what we're trying to achieve is at all possible."
"Here's the most elegant, pure-Java (no library) solution I came up with after some experimentation: CODESNIPPET_JAVA1 ."
I have tried a few and the closest I have found that comes close to Visual Studio is Netbeans.
Are there any further criterias not to use this algo for enryption of data stored in a db?
"which java http client library is easy to use for programmatically doing posts, setting cookies and maybe ajax?"
I recently needed an encryption algorithm that worked across multiple platforms (Java & C#).
Karl .
A best practice is to initialize the CODETERM17 a little bit larger than you think you are going to need if you don't know right off hand how big the CODETERM18 will be but you can guess.
"GSON is a good library, we have been using it in our project from past 2years, and it works fine."
"Finally, don't miss URL_http://www.cowtowncoder.com/blog/archives/2010/11/entry_434.html [7 -Killer-Features-that-set-Jackson-apart-from-competition] ."
"Resulting term should look like this: node=""//xs:element[@name='bar-date']""."
"If you want a pure web form type approach, take a look at another of my projects URL_https://github.com/gary-rowe/MultiBitMerchant [MultiBit-Merchant] which provides multiple authentication methods (web form, HMAC, cookie)."
This can be parsed with Gson the following way: CODESNIPPET_JAVA1 .
Logging in Java has been a disorganized mess leaving developers like me frustrated and confused.
"To improve performance you could have a single predefined sting if you know the max length like: String template ""####################################""; And then simply perform a substring once you know the length."
"It's pretty quick to do, and it would be in Java."
"If you have a choice here, you should prefer Qt over SWT."
"You can't turn it back off, and the machine is not terribly secure when its on."
"Once we're at the finish line, there is no one there to congratulate us."
This can result in large amounts of RAM getting allocated and not used when CODETERM10 classes start to grow large.
Some future version of Gson will reportedly support using getters/setters instead of fields.
I know many developers would like to have this.
"OAuth2 is going to be the most secure and RESTful approach; as for sending creds in plaintext, are you building a web front-end?"
I could give you an example for many NoSQL engines (and certainly can for GigaSpaces) but I don't know which one you're targeting or why.
You can use either one.
;) You could use XML or JSon with XStream.
"This approach is used by HttpClient's fluent facade, for isntance: URL_http://hc.apache.org/httpcomponents-client-dev /fluent-hc/index.html."
":) Joking, of course."
"It supports Key lengths of 128, 192, or 256 bits."
"Yes, it's still in use."
So it's an O(1) operation (no loop) and it saves memory (if that is a real issue).
"On the other hand, determining your own buffer size(s) you can tune your memory/processor usage balance."
Whats the better choice of the two APIs?
slf4j is the _API_ and logback the implementation of the API.
"Once the server uses the connection to send a message, a new connection needs to be opened up for the next message."
URL_http://northconcepts.com/data-pipeline/examples/read-a-json-stream/ [ URL_http://northconcepts.com/data-pipeline/examples/read-a-json-stream/ ] Good hunting.
I would suggest using URL_http://uima.apache.org/ [UIMA] with URL_http://opennlp.sourceforge.net/projects.html [OpenNLP] connectors and same hand made regexp rules.
You are right - reading is not included - thus I only mentioned generation of his files.
You're likely to be using a number of components which may all use different logging APIs.
A quick but not clean solution.
"@plasma147 Instead of downvoting, consider editing the example (I just submitted that, adding Closeables.closeQuietly(stream);)."
@ShYzDaSE : see my edit answer.
See URL_http://commons.apache.org/proper/commons-io///apidocs/org/apache/commo ns/io/FileUtils.html#deleteDirectory%28java.io.File%29 [FileUtils.deleteDirectory()]<s>Also with URL_http://code.google.com/p/guava-libraries [Guava] :</s> <s> CODETERM1 </s> This has been removed from Guava several releases ago.
You'll often find people a hesitance or even reluctance from people to help with outdated software.
Comet etc.
We'd actually be taking the badly behaving instance out of our load-balanced cluster before debugging.
Using the URL_http://commons.apache.org/io/api-1.4/org/apache/commons/io/FileU tils.html#deleteDirectory%28java.io.File%29 [FileUtils.deleteDirectory()] method can help to simplify the process of deleting directory and everything below it recursively.
"I have yet to figureout how to setup permissions, that I can assign to roles/groups/users in spring security- (I think ACL may be the solution)."
"This is the reason I'm chunking in the first place, splitting the file in 3 chunks allows me to download the same file 3 times faster, presuming a single chunk is too slow to saturate the connection."
SLF4J has a URL_http://www.slf4j.org/legacy.html [commons-logging-bridge] that you can use to replace the commons logging library.
"So components like JButton,JTextArea, etc., are lightweight because they do not have an OS peer."
"Swing is built on top of AWT and includes light-weight components that look and behave the same on all platforms, so you never should use AWT components directly."
7.
See an example URL_http://java.sun.com/docs/books/tutorial/java/data/buffers.html [here] .
"We currently have a web application loading a Spring application context which instantiates a stack of business objects, DAO objects and Hibernate."
3.
Maybe we can get some votes to reopen this question?
Same?
"Initializing the StringBuilder with "" Dear "" means the first .append() will cause a reallocation and copy."
"Important Update: The app is developed in Javaso ideally the Data Abstraction Layer or any alternatives must be ""Java friendly""."
"This isn't a full-blown implementation, but just a starter."
(but i don't think they support sorting and filtering out of the box).
"Also, depending on database platform, details needed and authorization levels used the results yielded might differ."
Is it really more simple?
"@jmort253 If you would already use apache commons I would say, go for it."
"ObjectInputStream is about deserialization, and the stream have to respect the serialization protocol to work, which may not always true in the context of this question."
"As an academic test, I decided to implement a basic, multi-threaded HTTP downloader."
"@PauldeVrieze how many lines, and how quickly do you need to process them!?"
"Without JFace, you're missing many major UI components or very important features of UI components (like filtering on tables)."
Also the user list is very responsive and extremely helpful.
"simmetrics looks to be GPL v2, however, so not compatible with commercially developed software."
Can be implemented using ACEGI.
I'm almost surprised that we haven't been able to find some Spring feature to help us out here.
"In order to get authentication, I'd recommend a different mode, like CCM, if your provider supports it (the SunJCE provider doesn't implement any authenticating cipher modes, at least not up through Java 7)."
I don't know why this was downvoted.
"But when we have to spend time reinventing the wheel just because we have misplaced ideas about including a common, reusable, tried and tested utility, we're giving up time we could be spending furthering our project's goals."
"First, that would be DES encryption, not AES."
Could you confirm that this fixes your issue?
"so if you're parsing oracle pl/sql, ANTLR is recommended."
Swing is outdated (maybe less so but not much work has been done on Swing for the past 10 years).
"That doesn't help if you want to monkey with request headers, something that's particularly useful when dealing with sites that will only respond a certain way to popular browsers."
Would you like to say something about when it is good to move from container based security to alternatives like shiro or others?
@coolcfan - I do agree with you on that point.
AES-128 is good.
Some snippets of code to give you an idea: The thread start-up: CODESNIPPET_JAVA1 .
The documentation isn't easy to read either because I'm only partially familiar with the some of the terms Spring Security used.
Java multithreaded file downloading performance.
"@netbrain: I have done that numerous times, it's fairly straightforward with JFace."
Maybe I'm not following correctly.
Secure Debugging for Production JVMs.
"In the auto re-size case, at the 17th character the backing Array gets re- allocated and copied to 32 characters, at the 33th character this happens again and you get to re-allocated and copy the Array into 64 characters."
Ranks: ApproachApproach- 2.6% slower thanApproach- 4.3% slower thanAny of these approaches is an appropriate solution for grabbing a response and creating a String from it.
"The answer, in short, is it is deeply broken."
) .
"I'm glad I got good answers to both questions, but it makes it rather hard to chose which answer to accept."
"There's plenty of CSV libraries out there, including URL_http://commons.apache.org/sandbox/csv/ [Apache- Commons-CSV] ."
"This is a very simple, probably a most asked question and frequently developed as part of any web application."
Does anybody else think that logging has become far too complex?
I'm not able to explain why the hibernate-validator from CODETERM5 still gets picked.
"You say you have the unlimited jurisdiction patch installed, so the AES-256 cipher should be supported (but then 256-bit keys should be too, so this might be a configuration problem)."
I used this library in a project and it stinks.
I hate it when I write a UI and users complain that something doesn't work for them because they selected an odd theme.
I've also tried: CODESNIPPET_JAVA2 .
You can download the JDK source code and find out yourself.
"If I were in your shoes, I'd go with this option just because I know that it would show great performance, there are mature tools for working with MySql, many people have experience with it and at any time you can easily use all its relational potential if you eventually decide to go back to RDBMS solutions."
"So, I've come to the conclusion that Apache HttpComponents 4 is one of the most overwrought APIs I've ever come across."
"First you are destroying the content of the file by decoding it as text, then you are destroying the structure by appending text to it."
"what do you mean by ""support HTML4, javascript and CSS"" ?"
You can write one by using Socket programming in Java.
"I just think it's important to have a good reason to avoid libraries and that the reason is a valid one, which there very well could be :)."
Rapa has a really nice interface and few dependencies.
Still under development.
CODESNIPPET_JAVA1 .
"A CODETERM9 with the message ""Illegal key size or default parameters"" means that the cryptography strength _is_ limited; the unlimited strength jurisdiction policy files are not in the correct location."
"Yes, just pipe it from the FileInputStream to the FilOutputStream using only a suitably sized byte buffer array."
I'm basically saying that Apache has good java-based products for NoSQL databases.
It's owned by VMWare.
This EAR is deployed wholesale to the app server.
The 'thin' wrapper eliminates the need for another jar being packaged and is not as much as reinventing.
I usually use a bunch of high-level classes built from more basic widgets and wire my UI from that.
I just did it !.
I think CR/LF consistency is entirely unrelated issue.
From JPA to NOSQL.
Then initialize the cipher with the key _and_ the initialization vector.
I would not start a large desktop application (or one that is going to be large) without a good platform that is build upon the underlying UI framework.
"Maybe, but 1) it's likely to be faster and 2) that's code you don't need to write."
CODESNIPPET_JAVA1 .
I've been using it for a few years and love it.
Hector is mavenized.
"JFormDesigner also works with JBuilder and Eclipse, so you are not locking your projects to one particular IDE."
Be sure and create your CODETERM8 objects large enough originally where they don't have to be constantly re-sized every time CODETERM9 gets called.
I don't know why we haven't got web services in java tied down yet.
It's async but not highly concurrent.
Those breakpoints fire whenever a specified exception is thrown (you can scope this to a package or a class).
Where is the difference?
NIST recommends it for applications through 2030.
"I have used Jackson a lot, and it blows the competition away."
A full answer to your question would try to explore all of those.
Printing Java collections nicely (toString doesn't return pretty output).
So it is CODETERM1 and no extra libraries to download and manage.A simple example can be found URL_ht tp://www.java2s.com/Code/Java/JDK-6/MarshalJavaobjecttoxmlandoutputtoconsole.h tm [here] XStream seems to be dead.
"In my experience, more effort goes into code than into documentation."
"Please note, according to Java docs, the available() method might not work with InputStream but always works with BufferedInputStream.In case you don't want to use available() method we can always use the below code CODESNIPPET_JAVA2 ."
Possible typo?
Each writer only needs to seek once; after that it is just sequential I/O.
You may try using GSON.It's downloadable at URL_http://google- gson.googlecode.com/files/google-gson-1.4-release.zip [ URL_http://google - gson.googlecode.com/files/google-gson-1.4-release.zip] Quite simple to use actually.I used it to parse JSON results from Yelp and there is a simple example here: CODESNIPPET_JAVA1 .
SCP and one of the rsync modes do require that there be some sort of remote login capability.
The JSR296 is dead.
How do you create Java RESTful clients?
You also might be interested in: URL_http://static.springsource.org/spring- security/site/ [ URL_http://static.springsource.org/spring-security/site/ ] As a side note: In addition to security there are probably a bunch of other technologies that you will need in a typical web project.
_**I never heard such thing and still developing swing apps.
This function is corrupting my input stream.
I've been using this idiom for some time now.
If it's a text file why not use apache commons-io?
@David: Good catch.
CODESNIPPET_JAVA1 .
I found configuring and using JBoss to be about as pleasing as trying to shave with a jagged spoon while riding a unicycle with no seat.
"Since simple flat files require no setup and don't use SQL, what are you asking?"
"URL_http://code.google.com/p/json-simple/ [json-simple] was excellent: tiny, with a simple API that generates HashMap/ArrayList with a single call."
GraphXML files exported from yFiles (and yFiles based windows in DBVisualizer) can be edited / (re)formatted in the (free) yEd Graph editor.
I believe there is some work being done to help integrate functions that will help enable these types of authentication into the framework.
Best not to leave this kind of thing to chance :).
"By itself is pretty low-level, and it uses the platform's native widgets through JNI."
Check out the URL_http://web-harvest.sourceforge.net/samples.php [project's -samples-page] to see if it's a good fit for what you are trying to do.
"Also, at least in my scenario, HUC is noticeably faster (mostly single-threaded, haven't done any testing under heavy load)."
"JAX-RS is a very well designed API that makes mapping HTTP requests to methods, extracting parameters from various parts of a HTTP request, handling content negotiating, and many other low level tasks very easy."
How do you find it?
The learning curve is a bit steep for the NetBeans platform (although I guess that's true for Eclipse as well) but there are some good books around which I would highly recommend.
Swing components are lightweight components because swing sits on the top of awt.
It's in the class org.apache.commons.io.FileUtils.
"""A"" + ""B"" is a contrived example for sure."
InputStream in_/* your InputStreamisnew InputStreamReader(in);StringBuilder sb=new StringBuilder();BufferedReader brnew BufferedReader(is);String readbr.readLine();while(read != null) { //System.out.println(read); sb.append(read); readsb.toString(); .
i want to create a Json like this CODESNIPPET_JAVA1 .
"Not as elegant solution as I'd want it to be, but it works."
URL_http://commons.apache.org/io/apidocs/org/apache/commons/io/FileUtils.html [ URL_http://commons.apache.org/io/apidocs/org/apache/commons/io/FileUtils.html ] It has the following method CODESNIPPET_JAVA1 .
I am looking to make native Desktop apps.
CODESNIPPET_JAVA1 .
"It's likely to be about Xdisk allocation unit, where X is quite small."
I have added a hyperlink to my parser in my answer ( URL_http://www.softwaremonkey.org/Code/JsonParser) .
URL_http://code.google.com/p/guava-libraries/ [Guava] has a method similar to the one from Commons IOUtils that Willi aus Rohr mentioned: CODESNIPPET_JAVA1 .
Then you can use the objectMapper from the library to go from an array that you have in memory to a json String like so CODESNIPPET_JAVA2 .
"It enables you to whip up a working UI quite quickly, as long as it is IDE- like (with tables, trees, native controls, etc)."
In eclipse (and most IDEs) you can also use watch expressions to evaluate code running in the debugger.
"Also, the business/DAO/Hibernate stack is growing rather large, so not duplicating it just makes more sense."
"The other option is SWT together with the Eclipse RCP, but it's harder (though not impossible) to integrate ""pure"" Swing components into such an application."
What are the advantages and disadvantages of using a Java applet for authentication as part of a web application?
"Well, you haven't said _which_ NoSQL engine you're going to, which is pretty important."
"So I'd call it the pioneer, not Restlet."
"If so, that's because they aren't doing password-based encryption there; the key is a random sequence of bytes, not derived from a password."
WindowBuilderPro is really the viable (free) alternative for Eclipse.
I've read all this before start using shiro.
"In this case, generate the salt with a cryptographic random number generator each time the password is changed."
"In practice, you will almost never use this from multiple threads at the same time, so the synchronization that CODETERM5 does is almost always unnecessary overhead."
Fortunately I am too busy with a new job to look at this now and hopefully I'll get an answer before I have to roll up my sleeves.
Note that the second parameter (i.e.
FYI the Java Almanac link is dead (or at least there are no code snippets).
about SQL99: I could tell you one thousand reasons why thatbe true.
3.
Take a look at this.
use a StringBuilder.
Place each getter on its own line and debug.
"As mentioned above, available() is not the way to go."
Any recommendations?
Java Cryptography Extensions (The Practical Guide Series) by Jason Weiss.
"@erickson I'm new here, not sure how this works but would you be interested in bounty points to fix up Dougs code?"
DOM also allows you to write to the document with Xslt transformations.Example: CODESNIPPET_JAVA1 .
Theusage** of this code is through the roof.
"concise, but incomplete, it misses the fundamental reason to use StringBuilder/Buffer and that is to reduce or eliminate the re-allocation and array copy of the regular String concatenation behavior."
But a socket is much more resource intensive than a thread...
"It's also possible to derive an AES key from a password; if that's what you are after, please let me know, and I'll show you the correct way to to do it; simply hashing a password isn't the best practice."
""
"Click into JLabels, JButtons, ButtonGroups, JTrees, JTextFields, ComboBoxes and edit their properties directly in place."
"Thanks to a suggestion from URL_http://stackoverflow.com/users/101272/patrick [Patrick] , made the function more robust when handling an empty input stream."
"Aggree that the docs are lacking somewhat, but, IDE support is pretty good, and, googling usually gets you some decent usage examples."
"This shows how to iterate over the lines in a stream, not how to read the entire stream into a string."
The CODETERM1 in JSON represents an array and should map to a Java collection such as URL_http://docs.oracle.com/javase/6/docs/api/java/util/List.html [CODETERM2] or just a plain Java array.
shouldn't it be \r\n instead of \n?
I don't see why we need to keep opening more connections.
URL_https://github.com/AsyncHttpClient/async-http-client [Ning-Async-http-client] .
Configure the debugger on the command line with the onthrow=com.whatever.TurnOnDebuggerException part added 4.
I Especially like that it's an apache project.
) Swing became the framework of choice for building new applications.
Swing components are platform-independent.
"Restlet API** First, there is the ""Restlet API"", a neutral API supporting the concepts of REST and facilitating the handling of calls for both client-side and server- side applications."
"as a developer it ""felt"" like the browser was subscribing to JMS."
"If so, DarkSquid's approach using SecretKeySpec should work."
I want my own structure in the file since some1 else need to read it by a specific structure.
"For most NoSQL engines you'll probably want an id there, too, just for efficiency's sake."
Perhaps the old grammars don't run on the new version.
"user268098: I think most Java JSON handling libraries have issues with cyclic dependencies, and most have some ways to either exclude just references, or handle them with annotations (I added an answer in the other question to point out one way to do that with Jackson)."
"This was probably the worst Sun idea ever... and it ultimately led to the wrong assumption that a ""good Java citizen"" should use jul."
Now for my over engineered solution.
"Since that is not always intended (http requests with a keep-alive connection won't be closed), these method calls block (not giving you the contents)."
SWT uses some native bindings (through JNI?
I have no idea why this happens but will be great if someone can explain why?
"Here's an option from my URL_http://northconcepts.com/data-pipeline/ [data- migration-library] that uses xpath plus the built-in, generic record class instead of creating a new bean class."
What Java implemenations exists?
CODESNIPPET_JAVA1 .
This is a very good article URL_http://kaioa.com/node/59 [ URL_http://kaioa.com/node/59 ] .
It is not related to Swing and AWT at all.
We are using JBoss 4.2.3 which in turn comes with version 3.2.1.ga of Hibernate.
Just forget about both.
I had one more question - URL_http://stackoverflow.com/questions/20662871/how-to-do-basic-authentication - of-a-resource-in-dropwizard.
SAX Parser: Solely to read a XML document.
You don't need the dot since // searches in the entire document.
And one more thing we are taking only a one scenario (matching patterns) but when our requirements will grow the same code written by our own servlets will become more complicated and complex.
One already exists - take a look at slf4j.
"Once again, these are my findings and your findings may not be exactly the same, but I wrote this to give some indication to others of the efficiency differences of these approaches."
It's a crime that code generation is the default way to layout code in Java because better ways of doing GUIs have been around for decades.
"Same is actually true for JAXB reference implementation, not much activity for past couple of years."
"You may get better scalability once you are dealing with tens of thousands of connections, but at lower numbers you'll probably get better throughput with blocking IO."
"Querydsl and jOOQ seem to be the most popular and mature choices however there's one thing to be aware of: Both rely on the concept of code generation, where meta classes are generated for database tables and fields."
Gson is great.
"My choice is Glassfish: it is faster to start-up, to deploy web applications.the Admin console is very accurate, moreover it is both graphical and command-line.Now it is fully-supported by Oracle, its future is not uncertain any more.It is based upon OSGi: it is really modular.You can install Spring-osgi applications easly.You can freely choice between Eclipse Link , Apache Open JPA and Hibernate without pain.It is greatly integrated in NetBeans (and, of course, Eclipse)."
Props to Alex for bringing it up.
You'll see that you can configure and/or replace just about anything because of Shiro's POJO /injection-friendly architecture.
To wit: URL_http://jackson.codehaus.org/ .
"@Hello71: It is ok in Java, since the instanceof operator is spelled differently."
"I find it rather hard to find out wich call actually returend null, often finding myself refactoring the code to something like this: CODESNIPPET_JAVA3 ."
"Memory utilization This method can temporarily require memory several times the size of the file, because for a short time the raw file contents (a byte array), the decoded characters (a character buffer), and a copy of the character data (in the new CODETERM1 instance) all reside in memory at once."
should be: CODESNIPPET_JAVA2 .
) and the rant on the internet is that this framework should not be used in today's projects.
I started developing a Seam application on JBoss and after a few months tried to get it working on Glassfish.
Why ask?
"Alternatives:** Just as a note, if you are doing reallyCODETERM24 building and manipulation, there is a much more performance oriented alternative called URL_http://ahmadsoft.org/ropes/ [Ropes] ."