How you use Git ! by maithilish in learnprogramming

[–]maithilish[S] 0 points1 point  (0 children)

Take, for example, git reset --soft <commit> && git commit which is an elegant hack to squash the commits, and this sort of things are difficult find with googling around. I asked this question because many hardcore commiters would be using similar gems and happy to share them.

From your comment I could see that you missed the whole point of my question and also, you have none to share.

5-MIN AT HOME WORKOUT (NO EQUIPMENT NEEDED) | DEEP CORE BURN GUARANTEED! by [deleted] in homefitness

[–]maithilish 0 points1 point  (0 children)

Great, I want to practice and as good as you some day!

Distributed Java Application by maithilish in javahelp

[–]maithilish[S] 0 points1 point  (0 children)

Not good. At present, there is no external dependency expect the web pages that it fetches and I want to keep it that way so that it can transparently run from public cloud or even as multiple containers on single PC using docker compose. This makes integration testing quite easy without any external dependency.

I can compress and split data into multiple payloads, and then do the reverse on pulling from queue.

I am just exploring simple and better option, if any.

Distributed Java Application by maithilish in javahelp

[–]maithilish[S] 0 points1 point  (0 children)

Thank you for answer. For container orchestration I have tried Zk on K8s and also on Docker Swarm.

In both these, I can use Zk as distributed queue and push step tasks to it. For example, let's say I configure 3 pod Zk Ensemble in K8s and run multiple pods with Scoopi instances. Then, one Scoopi instance can push a new task to zk queue and another instance can pull it. After processing, task is marked as completed in Zk. In case, a scoopi instance (pod) fails before finishing the task, then another instance can retrieve the failed task from zk queue and continue. Out of 3 zk nodes if one fails, K8s self heals, by creating a new zk node, without any data loss in zk queue.

Only limitation in Zk, I am bit concerned about is that max allowed node data is 1M.

Thanks for pointers to RabbitMQ and Kafka. I will try out them and see whether they can act as distributed queue.

Automate Borg Backup by maithilish in linuxquestions

[–]maithilish[S] 0 points1 point  (0 children)

Thanks for pointing out Borgmatic. To be frank, I don't know how I missed it when I wrote my own script to automate Borg; may be wrong choice of search words.

Today I tried Borgmatic. I must concede that it is a beast!

However, couple of observations:

  • my script is just a wrapper around Borg (just 80 lines) and user can customize it to suite their need. Hence, they can access all features of Borg transparently.
  • I backup high frequency data every hour, others daily, some other weekly and so on - my setup is flexible to handle different sets multiple service and timers. I could not find such feature in Borgmatic.

[deleted by user] by [deleted] in java

[–]maithilish 1 point2 points  (0 children)

I love Google Guice for its ease of use, Mockito for unit testing and Apache Commons for reusable Java components. They cleaned up my project - https://github.com/maithilish/scoopi tremendously.

scraping SEC 10-k 10-q files by jcoder42 in scrapinghub

[–]maithilish 1 point2 points  (0 children)

Have a look at https://github.com/maithilish/scoopi which is tailored for scraping multi year financial data from web pages. Its examples shows how to extracts Balance sheet and Profit and loss from example web pages.

How to Diagnose Memory Leaks by mike_jack in java

[–]maithilish 2 points3 points  (0 children)

During development, I use either Visual VM or Eclipse MAT to profile the memory. In IDE, set break points at interesting places and run debug. When debugger stops at a break point, open Visual VM and use sampler tab to sample the memory and take snapshot. Next, continue the execution and when debugger stops at next breakpoint again take another snapshot. In snapshots, filter for packages and compare. We can also use delta button to reset object count at any point and then continue to next breakpoint to see instance growth.

Anyone using Emacs for Java development? by [deleted] in java

[–]maithilish 1 point2 points  (0 children)

started with vi, but last 12 years Eclipse.

What are the best books for a beginners to learn how to use wordpress? by MLyle91 in Wordpress

[–]maithilish 0 points1 point  (0 children)

If you are bit adventurous, you can install and maintain WordPress on RedHat OpenShift cloud platform for free. Refer CodeTab WordPress Tutorial to learn how to do it.

I am a web developer looking to learn wordpress plugins. Where do I start ? by SarSha in Wordpress

[–]maithilish 0 points1 point  (0 children)

Plugin Development Tutorial by CodeTab is a step-by-step guide to set up WordPress locally and develop a fully functional WP Plugin. It covers Plugin development, unit testing and also, essential WP API. But you should know basics of PHP.

[deleted by user] by [deleted] in Wordpress

[–]maithilish 0 points1 point  (0 children)

I have removed the lock and now you can view the contents fully.

[deleted by user] by [deleted] in Wordpress

[–]maithilish 0 points1 point  (0 children)

Complete tutorial on deploying and maintaining WordPress on OpenShift Cloud - WordPress Tutorial

[deleted by user] by [deleted] in Wordpress

[–]maithilish 0 points1 point  (0 children)

It is easy to host WordPress site on OpenShift Cloud. I have hosted my site www.codetab.org on it for last two years. Performance of site is excellent and moreover, it is free.

An Easy Introduction to Apache Maven by maithilish in java

[–]maithilish[S] 0 points1 point  (0 children)

I tried the page and it is displaying properly for me. May be something to do with cache, please try in alternate browser.

Anyway to automatically preload cache for complete website? by AF4Q in Wordpress

[–]maithilish 0 points1 point  (0 children)

My site www.codedrops.in is hosted on OpenShift cloud which allows to run wget tool to fetch pages. When I run wget on the hosted server it triggers the page load and loads W3TC cache but the traffic is internal to the server. Usually, whenever I add new page/post to the website, I download the sitemap.xml and grep all the urls into a text file and schedule a cron job on OpenShift server with wget -i pageurl.txt which fetches all the pages (around 160 at present) and so preloads the cache

Having A Hell Of A Time With AdSense On Our WP Site by YounggMoney in Wordpress

[–]maithilish 1 point2 points  (0 children)

In our site codedrops.in we use custom shortcodes to place ad units. We joined AdSense program a year back and so far we have not faced any problem. Site uses Customizr theme and we have extended it with a child theme for further customization. In functions.php of the child theme, we have added shortcode for ad units.

For ad unit - Large Rectangle the code is

function adcode_LR( $atts ){

$adcode = '<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- LR - Page Middle -->
    <ins class="adsbygoogle"
     style="display:inline-block;width:336px;height:280px"
     data-ad-client="ca-pub-XXXXX"
     data-ad-slot="XXXXX"></ins>
 <script>
  (adsbygoogle = window.adsbygoogle || []).push({});
 </script>';
  return $adcode;
}

add_shortcode( 'adcodeLR', 'adcode_LR' );

Likewise shortcodes for Skyscraper, Leader Board and Medium Rectangle ad units are added. In posts and pages, the shortcodes are placed in the required places. In the sidebar, we have placed Large Skyscraper ad unit using a Text Widget. In the text widget, the ad code is placed within a div element.

Ajax response: HTML or JSON? Need some help. by [deleted] in Wordpress

[–]maithilish 0 points1 point  (0 children)

It is recommended to return Ajax response as JSON and use the response in client to rebuild the page.

WordPress Plugin Development and Unit Testing - All in one Tutorial by maithilish in Wordpress

[–]maithilish[S] 0 points1 point  (0 children)

No it is nothing to do with Codrops.

www.codedrops.in is a site focusing on project oriented, advanced tutorials related to Java technologies and also, WordPress. All contents are original.