-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.xml
987 lines (836 loc) · 45.7 KB
/
feed.xml
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
<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>ROHIT</title>
<link>http://jbake.org</link>
<atom:link href="http://jbake.org/feed.xml" rel="self" type="application/rss+xml" />
<description>JBake Bootstrap Template</description>
<language>en-gb</language>
<pubDate>Fri, 8 Dec 2017 00:10:42 +0530</pubDate>
<lastBuildDate>Fri, 8 Dec 2017 00:10:42 +0530</lastBuildDate>
<item>
<title>Functional Programming in JavaScript, Clojure, Kotlin, Java and Python-Part 1</title>
<link>http://jbake.org/blog/2017/FunctionalProgramming.html</link>
<pubDate>Sun, 19 Nov 2017 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2017/FunctionalProgramming.html</guid>
<description>
<div>
<p><b>Map Reduce and Filter</b> are functional Idioms you frequently encounter in functional programming.
This is first of the series of posts that shows the comparison of functional capabilities across languages.
</p>
<p>Map, Reduce and Filter are higher order functions.
In Mathematics a higher order function are function that operate on other functions either by taking them
as arguments or returning them.</p>
</div>
<!--more-->
<h2>Map</h2> <b>Map</b>
applies a function to every item of a List/Array/Iterable/Sequence. It’s behaviour is to derive a new List/Array/Iterable/sequence y from existing List/Array/Iterable/Sequence of x.
<p align="center"><b>y1=f(x1) y2=f(x2) y3=f(x3) y4=f(x4)</b></p>
<p>
I will interchangeably use the terms List/Array/Iterable/Sequence going forward. Assume relevant meaning from the context.</p>
<a href="../../images/map.png">
<p align="center">
<img src="../../images/map.png" class="img-rounded" alt="Map Higher Order Function"/>
</p>
</a>
</p>
Now that we know what a Map is lets use it in different programming languages.</br>
</br>
<p align="center"> <b>Lets increment the numbers in the list by 1</b></p>
<P>
<b>JavaScript</b>
<pre class="prettyprint">
<code>
list=[0,1,2,3,4]
function inc(num){
return ++num;
}
list.map(inc)
Output: [ 1, 2, 3, 4, 5 ]
</code>
</pre>
</P>
<P>
<b>Java</b>
<pre class="prettyprint">
<code>
IntStream.range(0,5)
.map(x->++x)
.forEach(
x->{
System.out.print(x + " ");
}
);
Output: 1 2 3 4 5
</code>
</pre>
</P>
<P>
<b>Kotlin</b>
<pre class="prettyprint">
<code>
print((0..4).map { it + 1 })
Output: 1 2 3 4 5
</code>
</pre>
</P>
<P>
<b>Clojure</b>
<pre class="prettyprint">
<code>
(map inc [0 1 2 3 4 5])
Output: (1 2 3 4 5 6)
</code>
</pre>
</P>
<P>
<b>Python</b>
<pre class="prettyprint">
<code>
def inc(x):
return x+1;
list=[0,1,2,3,4]
for num in map(inc,list):
print(num)
Output:
1
2
3
4
5
</code>
</pre>
</P>
<h2>Reduce</h2>
<b>Reduce</b> is similar to Map that it applies a function on the list.
However unlike Map it does not produce a list.
It produces a single value as a result of reduction or <a href="https://en.wikipedia.org/wiki/Fold_(higher-order_function)">folding process</a>.
<p>
The operation to be performed should be <a href="https://en.wikipedia.org/wiki/Associative_property">associative</a> to attain correct result. For instance
+,* are associative where as / and - are not.
</p>
<a href="../../images/reduce.png">
<p align="center">
<img src="../../images/reduce.png" class="img-rounded" alt="Reduce Higher Order Function"/>
</p>
</a>
Now that we know what reduction is lets solve a problem.</br>
</br>
<p align="center"><b>Lets add up all numbers in the list.</b></p>
</br>
<P>
<b>JavaScript</b>
<pre class="prettyprint">
<code>
numbers=[1,2,3,4,5]
numbers.reduce((a,b)=>a+b)
Output: 15
</code>
</pre>
</P>
<P>
<b>Java</b>
<pre class="prettyprint">
<code>
System.out.println(IntStream.range(1,6)
.reduce((a,b)->a+b)
.getAsInt());
Output: 15
</code>
</pre>
</P>
<P>
<b>Kotlin</b>
<pre class="prettyprint">
<code>
print((1..5).reduce { sum, next -> sum + next })
Output: 15
</code>
</pre>
</P>
<P>
<b>Clojure</b>
<pre class="prettyprint">
<code>
(reduce + [1,2,3,4,5])
Output: 15
</code>
</pre>
</P>
<P>
<b>Python</b>
<pre class="prettyprint">
<code>
numbers=[1,2,3,4,5]
reduce(lambda x,y:x+y,numbers)
Output: 15
</code>
</pre>
</P>
<h2>Filter</h2> <b> Filter function</b>takes a list and returns a list. The filtered list preserves the same order.
Only elements satisfying a predicate are returned. A Predicate is boolean valued function.
</br>
</br>
<a href="../../images/filter.png">
<p align="center">
<img src="../../images/filter.png" class="img-rounded" alt="Reduce Higher Order Function"/>
</p>
</a>
</br>
</br>
<p align="center"><b>Lets filter out only even numbers from a list.</b></p>
<P>
<b>JavaScript</b>
<pre class="prettyprint">
<code>
list=[0,1,2,3,4,5,6,7,8,9,10]
list.filter(x=>x%2==0)
Output:[ 0, 2, 4, 6, 8, 10 ]
</code>
</pre>
</P>
<P>
<b>Java</b>
<pre class="prettyprint">
<code>
IntStream.range(0,10)
.filter(x->x%2==0)
.forEach(x->{
System.out.println(x);
});
Output:
0
2
4
6
8
</code>
</pre>
</P>
<P>
<b>Kotlin</b>
<pre class="prettyprint">
<code>
print((0..10).filter { it % 2 == 0 })
Output:[ 0, 2, 4, 6, 8, 10 ]
</code>
</pre>
</P>
<P>
<b>Clojure</b>
<pre class="prettyprint">
<code>
(filter even? (range 0 11))
Output: (0 2 4 6 8 10)
</code>
</pre>
</P>
<P>
<b>Python</b>
<pre class="prettyprint">
<code>
filter(lambda x:x%2==0,range(0,10))
Output:[0, 2, 4, 6, 8]
</code>
</pre>
I hope you liked the post. Please share your comments.
</br>
<p>&nbsp</p>
<b>Credits:</b>Kotlin code was contributed by <b>Anton Kirvel</b>
</p>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<!-- end htmlcommentbox.com -->
</description>
</item>
<item>
<title>How I taught a computer to play Chess</title>
<link>http://jbake.org/blog/2017/Chess.html</link>
<pubDate>Sat, 18 Mar 2017 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2017/Chess.html</guid>
<description>
<div>
<p>How I taught a Computer to play Chess</br>
<iframe src="//www.slideshare.net/slideshow/embed_code/key/eAtoGgxxd2atSi" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/RohitVaidya3/how-i-taught-a-computer-to-play-chess" title="How i taught a computer to play chess" target="_blank">How i taught a computer to play chess</a> </strong> from <strong><a target="_blank" href="//www.slideshare.net/RohitVaidya3">Rohit Vaidya</a></strong> </div>
</div>
<!--more-->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<!-- end htmlcommentbox.com -->
</description>
</item>
<item>
<title>Functional Programming with Clojure</title>
<link>http://jbake.org/blog/2016/Clojure.html</link>
<pubDate>Wed, 19 Oct 2016 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2016/Clojure.html</guid>
<description>
<div>
<p>Demystifying Functional Programming with Clojure.</br>
<iframe src="//www.slideshare.net/slideshow/embed_code/key/lLg7DWRYVlWplq" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/RohitVaidya3/clojure-67414947" title="Clojure" target="_blank">Clojure</a> </strong> from <strong><a target="_blank" href="//www.slideshare.net/RohitVaidya3">Rohit Vaidya</a></strong> </div>
</div>
<!--more-->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<!-- end htmlcommentbox.com -->
</description>
</item>
<item>
<title>Syncing Emacs Org Files</title>
<link>http://jbake.org/blog/2016/Emacs-Org-Mode-Syncing.html</link>
<pubDate>Thu, 29 Sep 2016 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2016/Emacs-Org-Mode-Syncing.html</guid>
<description>
<p>
I like to use <a href="http://orgmode.org/">org mode</a> with <a href="https://www.gnu.org/software/emacs/">Emacs</a>. It helps me stay organized. The long vertical green
lines of accomplished tasks gives me immense satifaction.
I also heavily use org-agenda feature which helps me keep track of multiple org files.
However syncing org mode files across machines like work place computer and personal laptop
is a pain. I tried using <a href="http://orgmode.org/manual/MobileOrg.html">mobile-org</a> but could never set it up correctly. Here is a better alternative.
<!--more-->
<p>
<a href="../../images/todo.png">
<img src="../../images/todo.png" class="img-rounded" alt="Emacs Todo" width="304" height="236"/>
</a>
<a href="../../images/git-blame-buffer.png">
<img src="../../images/git-blame-buffer.png" class="img-rounded" alt="Git Buffer in Emacs" width="304" height="236"/>
</a>
<a href="../../images/cfw.png">
<img src="../../images/cfw.png" class="img-rounded" alt="Cfw Calendar" width="304" height="236"/>
</a>
<p>
A better option is to use a version control like git. I wanted to avoid public
repository as I don't want my org files to be publically forked :-).
Bitbuket allows you to have private repositories. Create one. Atlassian is simply cool.
<p>
Install git-blame and git from melpa repository. Edit your org mode files.
Commit them using git-blame buffer. Push. Syncing is fun.
<p>
The only pain point with git-blame is you cannot push. May be I will find a better alternative.
For now I use
<b>M-x shell-command</b> to enter my push commands "git push orgin master" and it works
like breeze.
Also, the <a href="https://github.com/kiwanami/emacs-calfw">cfw calendar</a> is simply awesome.
Synced it with google calendar and you
have everything in google calendar.
<p>
Happy Syncing. Please let me know your thoughts.
</div>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
</description>
</item>
<item>
<title>Guava</title>
<link>http://jbake.org/blog/2016/Guava-Library.html</link>
<pubDate>Thu, 16 Jun 2016 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2016/Guava-Library.html</guid>
<description>
<div>
<p>Guava. A presentation given at <a href="http://www.meetup.com/jughyderabad/events/228339958/">JUG Hyderabad</a>. The presentation covers String, Basic Utilities and caching.
<iframe src="//www.slideshare.net/slideshow/embed_code/key/Guxf3EReFESmYP" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/RohitVaidya3/gauva-62941695" title="Gauva" target="_blank">Gauva</a> </strong> from <strong><a href="//www.slideshare.net/RohitVaidya3" target="_blank">Rohit Vaidya</a></strong> </div>
</div>
<!--more-->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<!-- end htmlcommentbox.com -->
</description>
</item>
<item>
<title>Oracle JET Getting Started</title>
<link>http://jbake.org/blog/2016/Oracle-JET-GettingStarted.html</link>
<pubDate>Wed, 16 Mar 2016 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2016/Oracle-JET-GettingStarted.html</guid>
<description>
<h3>JavaScript Extension Toolkit </h3>
<div class="">
Oracle Jet Framework. This is an introductory post of Oracle JET JavaScript library.
Doing this excercise to evaluate the JS framework. I would be doing more focussed posts latter.
<h3>Oracle JET Overview: </h3>
Oracle JET is a collection of Oracle and open source JavaScript Libraries.
A quote by Issac Newton is really apt to describe what Oracle has done. "If I have seen further it is by standing
on the shoulders of giants"
<h3> What has JET consumed?</h3>
Just to illustrate a few keywords on what these libraries used for
<ol>
<LI> <b>Require JS:</b> File and Module loader. Is optimised for in browser use and can be used in Javascript environments like Rhino and Node
<li> <b> JQuery:</b> Lightweight JS Library with support for standard and contemproary UI components, event handling, animation and AJAX.
<li> <b>Knockout:</b> Data Binding, Automatic UI Refresh, Templating
<li> <b> Promise:</b> Build in object in Javacript but avaiable in Ecma Script 6. Useful for deferred and asynchronous computation.
<li> <b>Hammer JS:</b> Support for touch gestures in JS application
<li> <b>CrossRoads:</b> Routing library. A URL Route/Dispatch library. Similar to one present in frameworks like Rails, Django etc.
<li> <b>JS-Signals:</b> custom Event/Messaging System for JavaScript
</oL>
Thats a really comprehensive collection of js libraries which cater to needs of a modern client side application.
</div> <!--more-->
<div class="jumbotron"><h3>What would you use Oracle JET for? </h3>
As indicated in Jet Documentation[1]
<ol>
<li> Add interactivity to existing pages
<li> Create a new end to end client side web application with HTML5,CSS, and responsive web design
<li> Create a hybrid mobile application that feels like a native Android IOS app
</oL>
<h3> Getting started</h3>
Oracle JET has good tooling support to get started. One can use Yeoman or Grunt. However the easiest way to do
HelloWorld type project is to install Oracle Jet Support Plugin. Create a JET project selecting the Project
Category has HTML5/Javascript. Select Oracle JET QuickStart Basic.
<h3>Understanding the Project Structure of Sample application</h3>
<table>
<tr>
Site Root/css:
<tr>
<tr>
<td>
Site Root/js</td><td>The JS prerequisites for your application</td></tr>
<tr><td>Site Root/js/main.js</td><td> Require.js boostrap javascript</td>
<tr><td>Site Root/js/main-release-path.json</td><td>JSON object which points to physical location of JS libraries</td>
<tr><td>Site Root/scss:</td><td> Oracle JET uses SCSS files to preprocess the CSS files. </td></tr>
<tr><td> Site Root/scss/alta:</td><td> Files belonging the alta Theme</td>
<tr><td>Site Root/scss/common:</td><td> Contains common files shared by multiple themes</td></tr>
<tr><td> Site Root/scss/utilties:</td><td> Contains SASS Mixins. If you don't know CSS preprocessor read http://sass-lang.com/guide</td></tr>
<tr><td>Site Root/scss/3rdparty:</td><td> Oracle's port of third party files such as normalize[2]</td>
<tr><td>Site Root/index.html: </td></tr>
</table>
<h3> Understanding Require boostrap file</h3>
The boostrap file is self explanatory and indicates the modules which should be injected in the web application.
You can also add custom modules to be injected by require.js
<pre class="prettyprint">
<code>
requirejs.config({
// Path mappings for the logical module names
paths:
//injector:mainReleasePaths
{
'knockout': 'libs/knockout/knockout-3.4.0',
'jquery': 'libs/jquery/jquery-2.1.3.min',
'jqueryui-amd': 'libs/jquery/jqueryui-amd-1.11.4.min',
'promise': 'libs/es6-promise/promise-1.0.0.min',
'hammerjs': 'libs/hammer/hammer-2.0.4.min',
'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.0.min',
'ojs': 'libs/oj/v2.0.0/debug',
'ojL10n': 'libs/oj/v2.0.0/ojL10n',
'ojtranslations': 'libs/oj/v2.0.0/resources',
'signals': 'libs/js-signals/signals.min',
'text': 'libs/require/text'
}
//endinjector
);
</code></pre>
This is a top level require call executed by the application.
oj,ko,$ gives access to oj(Oracle Jet),ko(KnockOut) and $(JQuery selector) namespace
<pre class="prettyprint">
<code>
require(['ojs/ojcore', 'knockout', 'jquery', 'ojs/knockout', 'ojs/ojbutton', 'ojs/ojtoolbar', 'ojs/ojmenu'],
// add additional JET component libraries as needed
function(oj, ko, $) // this callback gets executed when all required modules are loaded
{
// add any startup code that you want here
}
);
</code></pre>
Refer following documentation in [1]
<h3> Understanding the index.html</h3>
The index.html has reference to require js script. The require script will take care of injecting libraries as defined
in the bootrap script file.
Inspecting the HTML one can easily spot the JET CSS classes referenced.
<pre class="prettyprint">
<code>
div id="globalBody" class="oj-web-applayout-offcanvas-wrapper oj-offcanvas-outer-wrapper"
</code>
</pre>
Knockout js binding can be spotted here as well
<pre class="prettyprint">
<code>
div id="offcanvas" class="oj-contrast-marker oj-web-applayout-offcanvas oj-offcanvas-start"
data-bind="ojModule: {viewName: 'navDrawer'}
</code>
</pre>
<h3>References</h3>
<ol>
<li> <a href="https://docs.oracle.com/middleware/jet200/jet/developer/GUID-C6947139-DF37-4258-8E02-2679F40535E1.htm#JETDG108">Jet Developers Guide</a>
<li> <a href="https://github.com/JohnAlbin/normalize-scss">Normalize SCSS</a>
<li> <a href="http://knockoutjs.com/">Knockout JS</a>
<li> <a href="https://jquery.com/">JQuery</a>
<li> <a href="https://millermedeiros.github.io/crossroads.js/">Crossroads</a>
<li> <a href="http://millermedeiros.github.io/js-signals/">JS Signals</a>
<li> <a href="http://hammerjs.github.io/">Hammer JS</a>
<li> <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise">ES6 JS Promise </a>
<li> <a href="http://requirejs.org/">Require JS</a>
<li> <a href="http://sass-lang.com/guide">SASS</a>
</ol>
</div>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<!-- end htmlcommentbox.com -->
</description>
</item>
<item>
<title>Creating and Destroying Objects</title>
<link>http://jbake.org/blog/2016/Creating-and-Destroying-Objects.html</link>
<pubDate>Sat, 13 Feb 2016 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2016/Creating-and-Destroying-Objects.html</guid>
<description>
<div>
<p>Creating a Destroying Object. A presentation given at JUG Hyderabad. The content is inspired by Joshua Bloch's book The effective Java.
<iframe src="//www.slideshare.net/slideshow/embed_code/key/3TPMJ6UQr9ccN0" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/RohitVaidya3/effective-java-creating-and-destroying-objects" title="Effective java - Creating and Destroying Objects" target="_blank">Effective java - Creating and Destroying Objects</a> </strong> from <strong><a href="//www.slideshare.net/RohitVaidya3" target="_blank">Rohit Vaidya</a></strong> </div>
</div>
<!--more-->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<!-- end htmlcommentbox.com -->
</description>
</item>
<item>
<title>My Emacs CheatSheet</title>
<link>http://jbake.org/blog/2015/Emacs-CheatSheet.html</link>
<pubDate>Sat, 20 Jun 2015 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2015/Emacs-CheatSheet.html</guid>
<description>
<p>This is my Emacs cheat sheet.
<!--more-->
<pre class="prettyprint">
<code>
Note: If you are new to emacs C - Ctrl M - Esc key. '-' indicates simultaneous key press
To split a window vertically C-x 3
To split a window horizontally C-x 2
To kill a buffer C-x-0
To swtich between buffers: C-x-o
To save C-x-s
To open a new file: C-x-f
To undo C-/
To switch buffers: C-x-b. This will show a list of buffers. Switch to the buffer by selecting the buffer.
To open a shell: M-x shell
To play tetris : M-x tetris
To kill a line: C-k
To Paste: C-y pastes last kill text. Kill with C-k
To Cut kill next word M-d
To Cut sentence M-k
To copy a selected region M-w
To move end of buffer M->
To move to beginning of buffer M-<
To move forward 4 lines C-u C-n
To move forward 16 lnes C-u C-u C-n
To jump to specified line M g g
To search incrementally C-s (C-s again to search)
To start org-mode M-x org-mode
To search and replace C-% enter ! to replace all the occurences. y to replace current. n to skip and q to quit
To add deadline to todo item in org mode C-c-d
To open browser in emacs M-w eww [return] Type the URL
To tweet using emacs <a href="http://emacswiki.org/emacs/TwitteringMode">Twittering Mode</a> E-w twit
To talk to a doctor M-w doctor
</code>
</pre>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
<!-- end htmlcommentbox.com -->
</description>
</item>
<item>
<title>Contributing to Open Source</title>
<link>http://jbake.org/blog/2015/Open-source-contribution.html</link>
<pubDate>Wed, 15 Apr 2015 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2015/Open-source-contribution.html</guid>
<description>
How does one contribute to open source? Contribution is an overloaded term and may
mean a code fix, documentation changes, reporting a bug/issue, code review and comments
<!--more-->
<ol>
<li>There are multiple projects online on <a href="https://github.com/">github</a> and <a href="https://bitbucket.org"> bitbucket</a></li>
<li>Choose One. Finding choosing difficult? goto 4. If you don't like any, goto 3</li>
<li>Create a new repository assuming you have a brilliant/dumb idea. Blog about it & let friends know.</li>
<li>Join a User Group. Mingle to find projects people are working on. Chances are less that you are in Hyderabad but in case if you are join us <a>http://jughyderabad.in/</a></li>
<li>Fork the repository of your liking. Liking is a overloaded term. It may signify language, interest, philosophy ...</li>
<li>Check the issue list of the project you liked/forked. If you don't understand anything goto 7 else goto 8</li>
<li>Subscribe to project mailing list or ask questions on IRC channel of the project</li>
<li>Request that the issue be assigned to you</li>
<li>Read the Readme and How to contribute section in the repository. You may need to understand Gerrit/Jira. Read!</li>
<li>Fix the issue in your forked branch </li>
<li>Run the tests for that project. See if all pass! this is important. If there no tests, create. </li>
<li>Create a pull request to sumbit your patch</li>
<li>Party if your pull request gets accepted. If not go back to 6 or 1 based on your motivation levels</li>
</ol>
Every open source project is in different stages of development. A mature project with thousands of developers will take weeks if not months for your code to be reviewed and incorporated. Be patient.
A beginner project will almost instantaneously accept your pull request. This gain may not be true for dormant projects.
You can be part of both as you can learn good coding practices in a mature project and apply them to your pet project or any open source project you would like to be associated with.
Most important have fun.Good luck.
<p>&nbsp</p>
<p>Choose <a href="https://github.com/rohitvvv/GitFx">GitFx</a> if you want to work on JavaFX</p>
<p align='right'>--Rohit Vaidya</p>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
</description>
</item>
<item>
<title>Invalid Signature file digest - Maven solution</title>
<link>http://jbake.org/blog/2015/Invalid-Singature.html</link>
<pubDate>Tue, 24 Mar 2015 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2015/Invalid-Singature.html</guid>
<description>
Are you getting this exception ?
<pre class="prettyprint">
<code>
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:273)
at java.util.jar.JarVerifier.update(JarVerifier.java:228)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
</code>
</pre>
<!--more-->
<p>If you a mere mortal like I am and have got this SecurityException after adding a maven repository read on.
The most basic cause of such a exception is some dependency define in pom.xml is pulling in jars which are singed. After building your application unzip the final jar that gets created for your application.
<p>
In my case its GitFx-1.0-SNAPSHOT.jar. Unzip GitFx-1.0-SNAPSHOT.jar or
do a jar -xvf GitFx-1.0-SNAPSHOT.jar. Inspect the META_INF folder.
You will find <b>.RSA,.SF or .DSA</b> present under META_INF. This is signed information. The best way to explain why one gets the exception at runtime is “Some of your dependencies are likely signed jarfiles. When you combine them all into one big jarfile, the corresponding signatures are no longer valid so the runtime halts.” - StackOverflow Answer[1]
</p>
Solution to fix this with <b>maven-dependency-plugin</b>. Small snippet of code in my pom.xml.
<pre class="prettyprint linenums lang-xml"><span style="color:#ee3030;"></span>
&lt;plugin&gt;
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
&lt;version&gt;2.6&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;id&gt;unpack-dependencies&lt;/id&gt;
&lt;phase&gt;package&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;unpack-dependencies&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;excludeScope&gt;system&lt;/excludeScope&gt;
&lt;excludes&gt;META-INF/*.SF&lt;/excludes&gt;
&lt;excludes&gt;META-INF/*.DSA&lt;/excludes&gt;
&lt;excludes&gt;META-INF/*.RSA&lt;/excludes&gt;
&lt;excludeGroupIds&gt;junit,org.mockito,org.hamcrest&lt;/excludeGroupIds&gt;
&lt;outputDirectory&gt;${project.build.directory}/classes&lt;/outputDirectory&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
</pre>
Line # 15,16 and 17 is where we prevent the signed information from going into our final consolidated jar file.
<P>Some more information about the plugins configuration can be found
<a href="https://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html">here[2]</a>
</P>
Hope this helps :)
<P>
<b> References:</b>
<ol>
<li><a href="http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar">Stack OverFlow</a></li>
<li><a href="https://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html">Apache Maven - Unpacking Specific Artifacts</a></li>
</ol>
<!-- begin htmlcommentbox.com -->
<div id="HCB_comment_box"><a href="http://www.htmlcommentbox.com">Comment Box</a> is loading comments...</div>
<link rel="stylesheet" type="text/css" href="//www.htmlcommentbox.com/static/skins/bootstrap/twitter-bootstrap.css?v=0" />
<script type="text/javascript" id="hcb"> /*<!--*/ if(!window.hcb_user){hcb_user={};} (function(){var s=document.createElement("script"), l=(""+window.location).replace(/'/g,"%27") || hcb_user.PAGE, h="//www.htmlcommentbox.com";s.setAttribute("type","text/javascript");s.setAttribute("src", h+"/jread?page="+encodeURIComponent(l).replace("+","%2B")+"&opts=16862&num=10");if (typeof s!="undefined") document.getElementsByTagName("head")[0].appendChild(s);})(); /*-->*/ </script>
<!-- end htmlcommentbox.com -->
</description>
</item>
<item>
<title>JavaFX Introduction</title>
<link>http://jbake.org/blog/2015/JavaFX-Introduction.html</link>
<pubDate>Sun, 15 Mar 2015 00:00:00 +0530</pubDate>
<guid isPermaLink="false">blog/2015/JavaFX-Introduction.html</guid>
<description>
<p><b>JavaFX</b> is a software platform for creating Rich Internet Applications that can run across variety of platforms[1].It
has a collection of Java Packages with ability to add fancy GUI to your Java application.
JavaFX is official standard part of Java platform. JavaFX is considered as a successor of Swing
and can be easily understood by a Swing developer. You can get the latest in JavaFX in early access preview
of JavaFX in <a href="https://jdk8.java.net/download.html">Java 8 EA 40</a></p>
<!--more--><p><b>History:</b> Formerly it was called in F3(Form Follows function) and developed by Oliver Smith at Sun
Microsystems. JavaFX was initially developed as a scripting language however it was later
discontinued by Oracle and declared dead in Java One 2010. Now JavaFX has a clean Java API.
<p>
<b>JavaFX Lingo</b>
In order to understand JavaFX well one needs to familiarize with the Jargon used
<ul>
<li>Stage - Top level container for all Java Objects</li>
<li>Scene - A scene is a hierarchical node structure that contains all scenes components</li>
<li>Group - Group is a general purpose container node</li>
</ul>
</p>
<p><b>Stage:</b> Stage is implicitly created by JavaFX. JavaFX makes you think like a designer and
stage is where you will host your scene</p>
<p><b>Scene:</b>A scene is a hierarchical node structures that contains all scene’s components</p>
<p><b>Group:</b>Group is general purpose container node. This is analogous to a layout creates</p>
<p><b>Various possibilities with JavaFX</b></p>
<ul>
<li>CSS Support</li>
<li>Visual Effects: Shadow,reflect,blur perspective</li>
<li>Animation- rotate,scale,translate etc</li>
<li>Chars</li>
<li>3D Object - cubes,cylinder,spheres etc</li>
<li>Touch Interface</li>
<li>Property bindings</li>
</ul>
<b>JavaFX Application Life Cycle</b>
<ol>
<li>init (): Default implementation of init does nothing.
One can override to perform any processing before application UI is displayed</li>
<li>start (): No default implementation and is declared abstract.
Your app must override this. Build and display the UI</li>
<li>Wait for application to End. Typically happens when user signals end of program</li>
<li>stop(): Default implementation does not do anything
One can override to to perform any necessary processing as program terminates</li>
<ul>
<pre class="prettyprint">
<code>
package sampleapplication;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
*
* @author rvvaidya
*/
public class SampleApplication extends Application {
@Override
public void start(Stage primaryStage) {
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("Hello World!");
}
});
StackPane root = new StackPane();
root.getChildren().add(btn);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}
</code>
</pre>
<P><b>Code Walk through</b>
<ul>
<li>Any JavaFX application must extend javafx.application.Application</li>
<li>The start method is overriden. The override also passes the Stage object</li>
<li>Button object is instantiated and event handler is associated</li>
<li>A stack pane is created. This is a layout and corresponds to the group</li>
<li>Create the Scene object and pass the group reference </li>
<li>The scene is hosted on the stage</li>
<li>In main (the main entry point for java application) launch is called. This launches
the JavaFX application.</li></ul>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'rohitvvvinfo';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
</P>
</description>
</item>
</channel>
</rss>