Welcome to Kodok Marton's homepage

Professional work from professionals!

  • Increase font size
  • Default font size
  • Decrease font size
Home Domains-For-Sale Web Programming
International and Romanian Domains-For-Sale

Random newline and spaces inserted in emails


I isolated the process into three components: the email builder (my code), the mailer application, and the sending application (in this case, smtp through postfix). I followed the below process to troubleshoot:

Changed the mailer application to use the built in PHP mail() function, and I also tried sending using a completely different SMTP box. The problem was persistent no matter what process was used to send the mail.
I found the place in my code where the completed HTML was being handed off to the mailer application. Adding in a file_put_contents, I could then examine the exact data before it went to the mailer. Taking a look at it through a hex editor revealed that the body did not contain the offending characters Finally, I found another mailer application (I was using phpmailer). Swiftmailer is an alternative to phpmailer. I figured that if it was obscure bug with phpmailer, changing the mailing application would clear it up. This also did not solve the problem.
So if everything was working correctly, where could the problem crop up? The only place left to look was the encoding scheme for the emails. Scouring the internet, I found a few suggestions that the problem may be related to the message encoding. In this case, it appeared the problem stemmed from (possibly) a 75 character limit in quoted-printable encodings. This didn’t help me, as my emails were being sent using 8-bit encoding.

The solution

Just to see what happened, I changed the encoding settings on phpmailer to use base64 encoding using $mail->Encoding=”base64?. This solved my problem, though I don’t admit to knowing exactly why.

Note: don’t confuse this with character set issues. In the past I have seen situations where utf-8 text was being read into an email and sent as ISO-8859-1. When having weird characters showing up in your emails, this is most often the problem (or vice versa).


Speed up your beanstalkd developent by using saved job templates, supported by beanstalk-console (v1.4)

- ability to save jobs as templates/samples for later use
- manage saved templates
- add/edit/delete templates
- ability to reuse a template and kick to tubes
- added version checking to detect new releases



Delete a bucket via streaming in RIAK added to riak-admin panel written in PHP (v0.5)

Several updates to admin panel for RIAK written in PHP.

- delete a bucket via streaming
- Enhanced listing and deleting keys via streaming, to avoid costly getKeys which can lock your Riak node
- riak-data-migrator supported delete, enhanced visual feedback for streaming delete
- Favorite based bucket listing, to avoid costly getBuckets of Riak, UI enhancements
- Composer and Vagrant support



Pause tube, auto-refresh added to beanstalk console interface (v1.3.2)

  • pause tube for beanstalkd
  • Composer/Vagrant support
  • support to deactivate unserialize/json_decode/highlighter
  • edit Auto-refresh interval
  • edit tubePauseSeconds
  • added Settings modal

Check out on https://github.com/ptrofimov/beanstalk_console/releases and feedback is welcomed.


Clear filters gridview Yii extension

This extensions helps you to clear remembered filter values on GridViews. Adds an additional image in top right of the grid.

The EButtonColumnWithClearFilters extension adds up some functionality to the default possibilites of CButtonColumn implementation when you use extensions to remember filter values. This extension helps you to clear the remembered filter values.


Remember filters gridview Yii extension (updated June 3, 2011)

This extensions helps you to remembered/store filter values of GridViews between navigation, filters will stick.

The ERememberFiltersBehavior extension adds up some functionality to the default possibilites of CActiveRecord/Model implementation.

It will detect the search scenario and it will save the filters from the GridView. This comes handy when you need to remember them between navigation during page changes. For lot of navigation and heavy filtering, this functionality can be activated by just a couple of lines.


Resources for faster programming - time-honored methods

A gyorsabb programozast elosegito eroforrasok


How to count all NULL values in a table?

The other day I came across with a situation when a guy asked about how can he count all NULL values in a table, not only on a specific column.

He wanted to use the value for their contacts database report. Where all the columns for a contact is preferred but not mandatory, he just want to generate a quick report on the completion percentage of contact information in the entire table. He wanted to count from all the columns and not from one.


Getting a list of days from SQL date range (the most surreal query ever seen)

I asked a few days ago on a forum for help, to run a TSQL query like

select ... as days where `date` is between '2010-01-20' and '2010-01-24'

And return data like:

I ended up with the most surreal query ever seen in my life:

How to properly get user's birthday from database (solution for 29th February)

Today, I came across a problem, where I had to get from database all users that celebrate today. This is not as easy as it sounds, as there are leap years, and users having their birthday on 29th February will be returned only in 4 years. It's better return them on 1st March if the 29th February doesn't exists in that year. Actually, if you need to be serious about this, you have to take into account, that every 100 years, there's no leap year, but every 400 there is. 

Here is an answer that property takes into account leap-years and will always give you the users whose birthday is on the 29th of February at the same time as those on the 1st of March.

(FROM_UNIXTIME(birthDate),'%m-%d') = DATE_FORMAT(NOW(),'%m-%d')
(NOW(),'%Y') % 4 <> 0
(NOW(),'%Y') % 100 = 0
                        AND DATE_FORMAT
(NOW(),'%Y') % 400 <> 0
            AND DATE_FORMAT
(NOW(),'%m-%d') = '03-01'
            AND DATE_FORMAT
(FROM_UNIXTIME(birthDate),'%m-%d') = '02-29'



What makes each major language “special”?

It's been said that any language that doesn't change your way of thinking about programming isn't worth learning. It would be interesting to compile a list of what makes every major language "special". These would be the features that are unique to the language (at least compared to languages of similar or greater popularity and/or in terms of the level of emphasis placed on them), that one has to understand to "think in" the language, and that make the language worth learning even if you can't make any money by learning it. Here are some examples:

  • C: Pointers, manual memory management, low-level unchecked programming.
  • C++: RAII, templates.
  • D: Templates on steroids, compile time function evaluation, insanely powerful compile time introspection/reflection, the ability to program at a very high level and a very low level in the same language.
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  Next 
  •  End 
  • »

Page 1 of 2