Aleksey Gladysh

Just another dude with a weblog.

The goodness and severity of God

By Aleksey on

Behold therefore the goodness and severity of God: on them which fell, severity; but toward thee, goodness, if thou continue in his goodness: otherwise thou also shalt be cut off. - Romans 11:22 (KJV)

As I take this journey to draw nearer to God, I am bothered by the things which preoccupy my heart. Today, I vaguely remembered a verse and decided to find it. When I read it in its context, I was amazed at the goodness and severity of God that I found in the passage. I have read the chapter many times before, but I never noticed the significance of the words like today.

Ezekiel 14:1-11 (ESV):

1 Then certain of the elders of Israel came to me and sat before me. 2 And the word of the LORD came to me: 3 "Son of man, these men have taken their idols into their hearts, and set the stumbling block of their iniquity before their faces. Should I indeed let myself be consulted by them? 4 Therefore speak to them and say to them, Thus says the Lord GOD: Any one of the house of Israel who takes his idols into his heart and sets the stumbling block of his iniquity before his face, and yet comes to the prophet, I the LORD will answer him as he comes with the multitude of his idols, 5 that I may lay hold of the hearts of the house of Israel, who are all estranged from me through their idols.

6 "Therefore say to the house of Israel, Thus says the Lord GOD: Repent and turn away from your idols, and turn away your faces from all your abominations. 7 For any one of the house of Israel, or of the strangers who sojourn in Israel, who separates himself from me, taking his idols into his heart and putting the stumbling block of his iniquity before his face, and yet comes to a prophet to consult me through him, I the LORD will answer him myself. 8 And I will set my face against that man; I will make him a sign and a byword and cut him off from the midst of my people, and you shall know that I am the LORD. 9 And if the prophet is deceived and speaks a word, I, the LORD, have deceived that prophet, and I will stretch out my hand against him and will destroy him from the midst of my people Israel. 10 And they shall bear their punishment—the punishment of the prophet and the punishment of the inquirer shall be alike— 11 that the house of Israel may no more go astray from me, nor defile themselves anymore with all their transgressions, but that they may be my people and I may be their God, declares the Lord GOD."

It almost seems like somewhat of a strange and self-contradictory passage. I have read it through many times, and I still have trouble following it through all the way. It starts with some elders coming to Ezekiel to inquire of God through him. Instead of giving them what they want, God gives them what they need. They have a severe problem that needs immediate attention: they have taken their idols into their hearts. The question is not whether we have idols or not, but where are our idols? Sadly, I must admit that I take them into my heart too often. Doing so is putting a stumbling block right in your own face! Take one step forward and you will trip and find yourself flat on your face!

The Lord then asks: "should I even allow you to consult Me?" We have absolutely no right to approach God with a question, much less be answered by Him. Yet He says that if we do this and yet come to inquire of God, He will answer us. Why? To lay a hold on our hearts. So here I am, idols in my heart, falling flat on my face tripping over my iniquity. God would be fully just to ignore me, or as verse 9 says, even to let me be deceived. Yet what does He do? He answers when I consult Him, for He wants to lay a hold on my heart. While we all know this, why do we so seldom think about the significance of these words?

So when God answers, what do we do? The rest of the passage is somewhat hard to follow, but in it are mixed together goodness and severity until it seems almost one. If God lays a hold of our hearts, we repent and turn away from our idols and abominations. However if we separate ourselves from God by taking our idols into our hearts and come to inquire of Him still, He will answer us, but He will turn against us and bring us to ridicule and ultimately destruction. Now, do I see three chances here to repent, or is this the slow painful demise of one who did not have his heart gripped by God and did not repent when he inquired of God and discovered his idols in his heart? I do not know. The only thing I can see is that the purpose of such severity is so that we may not go astray from the Lord our God again, that we would not defile ourselves again, and that we would be His and He ours.

Why does such severity have such an effect? The answer, I believe is in the verses before the opening verse in this note:

17 But if some of the branches were broken off, and you, although a wild olive shoot, were grafted in among the others and now share in the nourishing root of the olive tree, 18 do not be arrogant toward the branches. If you are, remember it is not you who support the root, but the root that supports you. 19 Then you will say, "Branches were broken off so that I might be grafted in." 20 That is true. They were broken off because of their unbelief, but you stand fast through faith. So do not become proud, but fear. 21 For if God did not spare the natural branches, neither will he spare you. 22 Note then the kindness and the severity of God: severity toward those who have fallen, but God’s kindness to you, provided you continue in his kindness. Otherwise you too will be cut off. - Romans 11:17-22 (ESV)

The severity of God humbles us and puts in us the fear of the Lord. It also magnifies His greatness:

For the LORD most high is terrible; he is a great King over all the earth. - Psalm 47:2 (KJV)

Why do we see God's goodness and severity come into almost one at times? I believe it is because together, they lead us to repentance:

The LORD has disciplined me severely, but he has not given me over to death. - Psalm 118:18 (ESV)

Or despisest thou the riches of his goodness and forbearance and longsuffering; not knowing that the goodness of God leadeth thee to repentance? - Romans 2:4 (KJV)

And of course, the greatest picture of God's goodness and severity coming together in one is at the cross!

It is when I read these kinds of passages that God lays a hold on my heart and shows me His majesty in His goodness and severity! The fear of the Lord then awakens in me at His severity and I am broken over my sin and His goodness towards me and I repent and cast out my idols from my heart so that I may be His and He mine!

Forum disabled and future plans

By Aleksey on

I disabled the forum I used to have as it's been unused for about a year and has served its purpose. Also, since I don't really do much on my website anyway, in the future I plan to make it more of a gateway to places where I am more active and have it aggregate my activity there. The only exception is I will probably still host a portfolio on here.

A case for free will and God's absolute sovereignty

By Aleksey on

I've recently been told that if God sovereignly chose whom to save instead of giving people the free will to choose salvation, then they would love God like robots instead of choosing to love Him, which would make it not love, but dry, preordained praise. The problem with such a conclusion is a confusion of what salvation, love, and praise are and a misunderstanding of their source and action.

Ephesians 2:1-10
1. And you hath he quickened, who were dead in trespasses and sins; 2. Wherein in time past ye walked according to the course of this world, according to the prince of the power of the air, the spirit that now worketh in the children of disobedience: 3 Among whom also we all had our conversation in times past in the lusts of our flesh, fulfilling the desires of the flesh and of the mind; and were by nature the children of wrath, even as others. 4. But God, who is rich in mercy, for his great love wherewith he loved us, 5. Even when we were dead in sins, hath quickened us together with Christ, (by grace ye are saved;) 6. And hath raised us up together, and made us sit together in heavenly places in Christ Jesus: 7. That in the ages to come he might shew the exceeding riches of his grace in his kindness toward us through Christ Jesus. 8. For by grace are ye saved through faith; and that not of yourselves: it is the gift of God: 9. Not of works, lest any man should boast. 10. For we are his workmanship, created in Christ Jesus unto good works, which God hath before ordained that we should walk in them.

This passage is very clear: we were dead in trespasses and sins, we walked in disobedience, all our will was for the lusts of the flesh and the unregenerate mind. Please make note of this: we were DEAD! How can a dead person have free will to choose life? It's impossible: life after death requires divine intervention; a dead person is only free to rot in his grave! When we were sinners, our understanding was darkened and our will was in bondage to sin (Ephesians 4:18; Romans 6:6). Verse 5 makes the point absolutely clear: while we were yet dead in sins, God brought us to life with Christ, and raised us up in Him. Regeneration happens without any act on our part whatsoever. God brings us to life by His grace alone and for His glory (Ephesians 1:4-6) and when we are regenerated, we are now free from death and bondage to sin and can now do the good works that God has ordained for us to do.

So, if we have no will in being saved (who among the dead has the will to rise up?), how can our love for and praise to God be genuine? Are we not merely then robots? Hardly. We were robots before, enslaved to fulfill only the desires of our flesh and wicked mind. We were dead, with no free will to do any good, and any good we did was for our own benefit, so that added to our wicked desire, we falsely did a good deed, making it worse than an openly bad deed! But now we are freed by the grace of God from that bondage, how can we not worship Him for it? How can we not love Him when He loved us so at first?

What is love anyway; what is it's source? "He that loveth not knoweth not God; for God is love." - 1 John 4:8. How can one ever choose to love God before God is in him when God is love? Let me ask that again: God is love, so can you have love towards God when love Himself isn't in you? Can you choose not to love God when He is in you? "But the fruit of the Spirit is love, joy, peace, longsuffering, gentleness, goodness, faith," - Galatians 5:22. You can only love God when His Spirit is within you, and you can't not love Him when you have His Spirit! So you do not choose to love God, but when God's love is in you, you can rest assured that your love towards God is genuine, because God is the only source of genuine love that there is.

What shall we then say about praise? When God raised us up to life from dead works how can we not willfully praise Him? How can preordained praise be dry? If you were born a baby, you were meant to breath. Can your breathing be not genuine? Genuine praise comes from the joy that God gives us when we see His might power. When the apostle Paul finishes telling of God's sovereignty in Romans chapter 11, he bursts forth in praise:

29. For the gifts and calling of God are without repentance. 30. For as ye in times past have not believed God, yet have now obtained mercy through their unbelief: 31. Even so have these also now not believed, that through your mercy they also may obtain mercy. 32. For God hath concluded them all in unbelief, that he might have mercy upon all. 33. O the depth of the riches both of the wisdom and knowledge of God! how unsearchable are his judgments, and his ways past finding out! 34. For who hath known the mind of the Lord? or who hath been his counsellor? 35. Or who hath first given to him, and it shall be recompensed unto him again? 36. For of him, and through him, and to him, are all things: to whom be glory for ever. Amen.

So, do we have free will then? Of course we do. Do we have a choice of whether to breath or not? Yes, but preventing yourself from breathing will result in suffocation. But more importantly, you are only truly free when you are in the truth: "And ye shall know the truth, and the truth shall make you free." - John 8:32. You are freed from sin and death so that you may freely worship the One who freed you! True free will is not independent of God. In fact, the opposite is the same; the will that tries to be independent of God is at enmity with God and is subject to the power of darkness and therefore is not free at all. The same can be said of love and praise to God. It is not genuine and not free if chosen independently of God, because God is the only source of genuine love and praise! For of him, and through him, and to him, are all things: to whom be glory for ever. Amen!

Moved to a new domain

By Aleksey on

I will be moving have moved to a new domain soon. I know it's often not a good idea to move domains, but detyabozhye.com is not so easy for people to remember, especially those who don't speak my native language (and even then, it is slightly misspelled).

The new domain name is lyosha.me.

Edit: I have moved over to the new domain now. Anyone linking to my website, please update your links.

Merry Christmas to all

By Aleksey on

I just want to break the silence and wish everyone a merry Christmas, happy New Year, and all the other holidays you might enjoy this season. Personally, I don't celebrate any other winter holidays, but I do believe some others, such as Hanukkah, are great holidays.

I haven't blogged in a really long time. I am always busy working on many things and often neglect my own projects. I wanted to say some things that have happened and are coming up for my website (which nobody is interested in anyway) and other things I am working on.

Most of the things I have done so far on my blog is behind the scenes. I have improved spam management and fixed a bug in which spam messages, though not visible, were counted with the legitimate comments on the home page.

If anyone is interested, I will release my blog source on Github. I know that the open source world has many blogging systems already, but none of the Rails systems seemed to cut it for me when I set mine up, so I wrote my own. I think we can build a good system with this base if there is interest.

I am going to add some of my more useful content from my old blog here and delete my forums. I will also add a proper portfolio on my website where I can include my graphic design work, art, etc.

As for other projects, I plan on letting members on Bryte Youth to log into their accounts and start interacting on the website some time in January. I know it's been a long time since I started development and have estimated incorrectly many times when it will be ready for use, but don't worry, it will be ready soon ("soon" is the favorite release date for programmers).

I have also been put in charge of the technical side of Anime Angels. I have plans on greatly revamping that website too. I don't know when or if that might happen, but if it's the Lord's will, it will happen. We are also getting ready to release a new magazine issue to mark 10 years of Anime Angels: a rather long time for an online community. I pray it will continue strong as it has over the past 10 years.

Emulating HTML 5 support in current browsers

By Aleksey on

For about a year, I've slowly been migrating to HTML 5. First of course was the DOCTYPE. Next I started using new structure elements such as <section>, <article>, <header>, etc. and in some applications - Web Forms 2.0 input types.

To use these elements in Internet Explorer (all currently used versions) and Firefox 2.0 (though I believe this one isn't as important anymore), I wrote a script that looks like a hybrid of John Resig's HTML 5 Shiv and Simon Pieters' Firefox 2 HTML 5 enabling script.

I was happy with that solution and other than using the new structuring elements and a little Web Forms 2, I used HTML 4. One of the applications I was working on needed to use an expanding area for more details. So instead of just making a pure Javascript and HTML 4 solution, I decided to use (and implement for current browsers) the HTML 5 <details> element.

Boy was that fun! I ran into a lot of bugs, and in the end increased my script from about 20 lines to almost 200. Opera was the most tolerant of the new functionality. Firefox had major issues with the DOM, the WebKit browsers had rendering issues, and don't even ask about Internet Explorer. With a few semi-ugly hacks though, I believe I have come up with a forwards compatible solution which I call Fiks.html5.

I plan on adding more HTML 5 functionality as I go. One thing I won't add is support for Web Forms 2 because it has already been done and I believe it belongs in a seperate module.

Websites I have built

By Aleksey on

This is an official archive/portfolio of the work I have done. Some websites I have built are down right now and some old designs are completely gone. I will add to this list when I get some archived wesbites up and when I remember other websites I've built.

Active websites

Archived websites

  • 1000 Linens - A website for a linens business.
  • Chudosok - An informational website in Russian on mangosteen. This was built when AJAX was the latest buzzword and I built it with an experimental AJAX navigation system.
  • K ź D Scooters
  • Anime Angels Downloads - A small site that hosts the magazine issues of Anime Angels

New website and blog

By Aleksey on

I finally made my new blog to replace my old forum-dependant website. I built the blog engine from scratch in Ruby on Rails (and no, it's not just like the one in the tutorial on rubyonrails.org) in a week. If there is enough interest, I will release the source. It is dependant on one gem other than Rails: Authlogic.

There are still things missing on this website that I will put up later. One thing I'm wondering is whether or not I should add some of my old content (that might still be useful) on this blog or not.

A little PHP CRUD

By Aleksey on

I had to return to PHP for a small application I had to write for which Rails would have been too big. Being used to Rails RESTful methods and MVC, I didn't want to make another messy 200 line PHP app that I would not be able to read later, so I coded a very small and simple CRUD "router" (as in Rails' routes) and I decided to share it with the world. So far it only works with a "controller" that manages plural resources. The CRUD pattern here is modeled after the way Rails controllers work. It's really simple, but it sure makes coding tiny apps a lot cleaner. (Helpers, clean URLs, MVC, etc. are up to the reader to implement)

crud.php:

<?php
switch($_SERVER['REQUEST_METHOD']) {
  case 'GET':
    switch($_GET['action']) {
      case 'new':
        cnew();
        break;
      case 'edit':
        edit();
        break;
      default:
        if (preg_match('/^[0-9]+$/', $_GET['id']))
          show();
        else
          index();
        break;
    }
    break;
  case 'POST':
    switch($_POST['_method']) {
      case 'put':
        update();
        break;
      case 'delete':
        destroy();
        break;
      default:
        create();
    }
    break;
  case 'PUT':
    update();
    break;
  case 'DELETE':
    destroy();
    break;
}
?>

index.php (an example "controller"):

<?php
require 'crud.php';

function index() {
  // grab some data
  require 'views/index.php';
}

function cnew() {
  // new resource
}

function show() {
  // get the resource by id
  echo "You requested resource number " . $_REQUEST['id'];
}

function edit() {
  // edit resource
}

function create() {
  // create something
  header('Location: ./');
}

function destroy() {
  //delete something
  header('Location: ./');
}
?>

Ruby on Rails: Complex forms + auto_complete

By Aleksey on

I haven't written here in a long time, so as many of you might not know yet, I've been learning Ruby on Rails the past 4 or 5 months. I'll have to say I've run into some pretty big challenges, but overall Ruby on Rails is one awesome framework. My latest challenge has been getting DHH's auto_complete plugin to work with Ryan Bates' complex forms. It might not be the best way to do it, but the solution was to monkey patch ActionView::FormHelper and FormBuilder which I put in a seperate file in the /lib folder of my project. So without further ado, here's the code:

## lib/auto_complete_form_helper.rb
module ActionView
  module Helpers
    module FormHelper
      def text_field_with_auto_complete_mod(object, method, tag_options = {}, completion_options = {})
        sanitized_object = object.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")
        sanitized_method = method.to_s.sub(/\?$/,"")
        (completion_options[:skip_style] ? "" : auto_complete_stylesheet) +
        text_field(object, method, tag_options) +
        content_tag("div", "", :id => "#{sanitized_object}_#{sanitized_method}_auto_complete", :class => "auto_complete") +
        auto_complete_field("#{sanitized_object}_#{sanitized_method}", { :url => { :action => "auto_complete_for_#{sanitized_object}_#{sanitized_method}" } }.update(completion_options))
      end
    end

    class FormBuilder
      def text_field_with_auto_complete(method, tag_options = {}, completion_options = {})
        @template.text_field_with_auto_complete_mod(@object_name, method,
          objectify_options(tag_options), completion_options)
      end
    end
  end
end

Don't forget to include the file in your environment.rb. If you see any bugs or know of a better way (I couldn't find any solutions on the web), please let me know.

Auto expanding textarea in Opera and Konqueror

By Aleksey on

I recently had to make an auto expanding textarea for a web application and when it came to Opera, I couldn't find a working solution. The most common way of making the textarea to auto expand is to compare the offsetHeight or clientHeight of the textarea with the scrollHeight. This works fine in IE, Firefox, and Safari (and even allows auto shrinking in IE) but not in Opera or Konqueror. Some solutions I found divided the number of characters by the number of rows and and cols in the textarea. The problem with this is that many people don't type everything on one line, so it won't accurately measure how many lines there are.

After thinking about both of those solutions, I decided to write my own, which calculates the number of lines based on how many newline characters are in the text and whether or not each line has more characters than the number of cols. There is however one catch: for the word wrap to work when there are as many characters in a line as there are cols in the textarea, the font has to be monospace, otherwise the script will not work reliably. So, without futher ado, here's the basic code:

<textarea rows="10" cols="40" onkeyup="adjustRows(this);"></textarea>
...
function adjustRows(ta) {
    while(ta.scrollHeight > ta.offsetHeight) //I use offsetHeight rather than clientHeight because scrollHeight is always bigger than clientHeight in Opera on textareas
        ta.rows++;
    adjustRows2(ta);
}

function adjustRows2(ta) {
    if (window.opera || navigator.vendor.indexOf("KDE") > -1) { //detects Opera or Konqueror
        var lines = ta.value.split("\n");
        var linecount = lines.length;
        for (var line in lines)
            linecount += parseInt(lines[line].length / ta.cols);
        if (linecount > ta.rows)
            ta.rows = linecount + 1;
    }
}

Auto shrinking is also possible in IE, Opera, and Konqueror and horizontal expanding is possible in Firefox, Opera, and Konqueror. If anyone ever uses that, I can post it too. Note: The script is not perfect, and doesn't calculate 100% acurately, but so far it's the most reliable script for auto expanding a textarea in Opera I know of.

Water is NOT always wet

By Aleksey on

Yesterday (it's past midnight (1:30AM), so forgive me if I say something crazy) it's been one year since my group and I got baptized. Before getting baptized, one of the men who worked with us promised us that the water would be wet in the river. Thinking back to that day and discussing it with another person who got baptized the same day, we came to the conclusion that the water was exactly how the man promised us. But discussing the matter further, my friend argued that water is always wet so the promise was easy for him to keep. However, I have found proof that that is not always so; one of the largest distributors of dehydrated water, http://www.buydehydratedwater.com/ sells hundreds of gallons of dehydrated water daily. So water is NOT always wet.

Read Your Bible Christians!

By Aleksey on

Yesterday I came across a statistic that only about 5% of those who call themselves Christians have actually read the Bible from cover to cover! How can a Christian not read the work of the One he/she is supposed to love more than anything else? If you had a girlfriend/boyfriend who you haven't heard from in a while and with whom you were totally in love and got a letter in the mail from her/him what would you do? You would tear open the envelope and read and reread the letter a few times before calming down and reading it yet again, right? How can 95% of those who claim to love God not read His letter even once from beginning to end?!

Another interesting thing is that in English, there are like over 400 different translations of the Bible. Why do we need so many? The Bible is easily readable in one. The bigger question is, however: If there are so many, why aren't 95% of Christians reading any of them?

There were about 30,000 "Christian" books published last year. Yet, the number 1 truly Christian book is being ignored by most "Christians". It's like instead of opening and reading the letter from your gf/bf you go and ask all her/his friends about how she/he is doing and what she/he has been up to. Sounds silly? Yes. Put down you Billy Graham, John Hagee, Rick Warren, Thomas Williams, or whatever book you're reading, open your Bible, and start reading it. It's just the best.

Real Life

By Aleksey on

You know, lately I've been getting more into real life and all. So far, real life is pretty cool:

I get to meet actual real people,
I'm going to be in the church play (the rehearsal was fun, btw),
I actually get to breath fresh air! Sure beats sitting here. LOL.

There is however one thing about real life that I must warn you about if you guys want to try it:

Ctrl+Z doesn't work in real life! That means we have to be a lot more careful when we do things. For example, today I was cutting branches off our plum tree (# rm -rf /backyard/plumtree/branches/longyoungones/) and one about the thickness of my thumb and 5' long fell on my head. Now it's bleeding and neither Ctrl+Z nor # fsck -a /dev/head will fix the problem!

Another interesting thing about real life is when those real actual people you meet find out you're a geek trying out real life, they'll give you computer related jobs to keep you in your box!

OK, OK, this whole blog post is mostly a joke (except the fact that I did get hit on the head by that branch, and it is bleeding), but that's pretty much what I've been up to lately (you don't want to hear about all the work I've been doing, it's boring).

God Bless. ^_~
- Alyoshka