Wednesday, February 29, 2012

Mind Controlled Skateboard


Mind Controlled Skateboard of the Day: Chaos Moon Labs broke new ground earlier this year with their Kinect-powered skateboard, the Board of Awesomeness, but now they’ve moved on to something even more awesome: a mind-controlled board that they call The Board of Imagination.

Quote
The Board of Imagination is powered by an on-board Samsung tablet running Windows 8, which is connected to an Emotiv headset.
Once the headset has been trained, the rider can focus on a point in the distance and think about how fast he wants to get there, and the board will do the rest.
The vehicle tops out at around 32 mph, and it has enough battery power to go around 10 miles at that speed.
Distractions are still a problem, though. The creators say the board was tougher to pilot in downtown Austin, TX, where the company is based, than it would be on an empty street. The mind-controlled board is much simpler to steer than the earlier Kinect version, though.
Video


Source: http://geeks.thedailywh.at

Tuesday, February 28, 2012

Facebook Identity Card


The FB Bureau is handing-out personal identification cards for a limited number of Facebook citizens, interested in alpha testing.
Next time someone needs to “see your ID” – How about showing a Facebook ID card instead of the documents your government gave you? On the web this is common practice for millions of people already. Therefore – Forget privacy.
Can I See your Facebook ID?
With more than 800 million users Facebook is the dominant identity system on the web. When signing-up for new services around the open web it's quite common to use Facebook Connect instead of creating a new user account. People stop ranting on blog comments because they only allow comments connected to your "real name" aka "Facebook Identity" (till the end of time). For the good or bad we are losing anonymity and Facebook Inc. is establishing order in this "world wild web" (for profit, not necessarily for the good of society).
Governments like Germany have released new passports that offer online identity checks as well, but they will likely never succeed with their technologies given the already existing structure of Facebook, powered by lazieness (or convience). The other way around though - A future where a Facebook Identity becomes more important than any governments' doesn't seem unrealistic. This possible future is already half-way there. What is exciting about this, what can be our role as artists and why should one even bother? Let's find out!
Next time someone needs to "see your ID" - How about showing a Facebook ID card instead of the documents your government gave you? On the web this is common practice for millions of people already. Therefore - Forget privacy. The user's next battle is about nothing less but who controls your identity, and we still might have something to say about it.
Source: http://fbbureau.com/

Friday, February 24, 2012

Blizzard Downplaying Diablo III


Manager tells such thing. Its incredible! They say "don't take candy", but as we know the more you tell "don't", it becomes more desirable.
Blizzard Downplaying Diablo III of the Day: Blizzard’s Diablo III is one of the most-anticipated games of the year, and repeated delays have only made fans hungrier to get their hands on it.
One Blizzard community manager, Bashiok, is worried that there’s no way a game could live up to all that hype, so he’s taken to the Battle.net forums to manage gamers expectations by telling them that Diablo III isn’t that awesome.
“Stop thinking about how awesome this game could be. Just imagine it’s a new M. Night Shyamalan movie. SureSixth Sense was amazing and Unbreakable had it’s moments, but this right here is the sequel to The Village,” Bashiok wrote.
Although he’s got a point — the hype for D3 may have created an impossible bar for the game to clear — it’s unusual to see a game company’s public relations team telling fans to be less excited about a new release.
Maybe the M. Night Shyamalan twist to this story is that Diablo III will be the most amazing thing Blizzard has ever created. Either that, or Deckard Cain was dead all along.
Barring any further delays, we’ll find out sometime in the second quarter of 2012







Source: http://geeks.thedailywh.at/2012/02/23/blizzard-downplaying-diablo-iii-of-the-day

Thursday, February 23, 2012

Faster Than Light Neutrino Error


The faster-than-light neutrino result measured by the OPERA experiment at CERN last September now appears to have been the result of a bad fiber optic connection between a GPS receiver and a computer.

The neutrinos appeared to make the 454 mile journey from CERN in Geneva to the Gran Sasso Laboratory 60 nanoseconds faster than the speed of light — a finding that contradicted Einstein’s special theory of relativity.
After tightening the connection and re-running the experiment, researchers found that the 60 second discrepancy was eliminated. Further tests are being run to confirm the source of the error.
Source: http://geeks.thedailywh.at/2012/02/22/faster-than-light-neutrino-error-of-the-day 

Tuesday, February 21, 2012

Saulės elektrinės

At the moment working with company which wants to increase their visitors count and so on... to their page. So all i did at the moment created blog, facebook account, wrote many articles on the blog about sun energy.
Articles about sun energy or Saulės elektrinės can be fount here - http://sauleselektrines.blogspot.com.
Articles i created supposed to be matched for these keywords:

saules baterijos, saules energija, saules elementai, saules baterijos, Saules baterija, saules elektrines, saules energetika, saulės energija, saules jegaines, saules elektrine, alternatyvi energija, saulės jėgainės, saulės elektrinės, saulės energijos sistemos, saulės elektrinė, saules energija uab, saules jegaines kaina, saules vejo energija, saules jegaine, sun energy, saules energijos supirkimo kaina, saules enerģija, saulės energija lietuvoje, grid tie saules elektrines, Fotomoduliai, Saules fomotomoduliai.

And finally facebook page - http://www.facebook.com/pages/Saul%C4%97s-Elektrin%C4%97s/345288302172587?sk=wall



Thursday, January 26, 2012

Change prestashop stores google maps zoom


Good day visitor.

In prestashop there is "Stores" section.

To change zoom of the default map which loads up after navigating there, go to:


  • /js/ folder
  • open stores.js
Go to line 196.

You will see code like this:

map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(defaultLat, defaultLong),
zoom: 15,
mapTypeId: 'roadmap',
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}
});

Change Zoom to whatever you like.

Good luck!

Wednesday, January 18, 2012

Days in months of year


Are you lazy to count how many there are days in months of certain year?

I have created small php counter for my self.

Its pretty useful so i want to share it.

http://www.drunksick.com/index.php?p=daysinmonth

Main part of code:

for($year_s;$year_s<$year_f;$year_s++)
{
  for($month=1;$month<=12;$month++)
  {
    echo $month."'th month of ".$year_s." has: ".cal_days_in_month(CAL_GREGORIAN, $month, $year_s)." days
";
  }
}

Sunday, January 15, 2012

Bitch please 9gag T-Shirt




By request of many people tshirt design was made for mass production:

http://www.streetshirts.co.uk/igloro

Original: http://9gag.com/gag/1786826

Thursday, January 5, 2012

JQuery email check

To check if user typed his email right you can use jquery.

Atribute of reg:
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;


And IF code:

if(!emailReg.test(email))
{
     error = true;
 }


Full code will could look like

$(document).ready(function()
{
  $("input.button[name=komentuoti]").click(function()
  {
    var email = $("input[name=email]").val();
    var error;
    var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
 
    if(!emailReg.test(comment_email))
    {
      error = true;
      return false;
    }
 
    if(error == true)
    {
      alert("Bad email!");
    }    
  }
});


IE image spacing issue [Solved]



Today / yesterday i faced with IE image spacing issue, which was like pain in my ass.

In Chrome, Firefox and other good browsers everything was perfect, but in IE navigation bar with background images and just images which can be clicked was not perfect. 

Solution for this is just to add CSS for the images with attribute display block.

Example:

.tablewithbadimages img
{
    display:block;
}

Update ( 2012.01.30 ):

Another solution for this is check if user's browser is IE and do something for all other browsers and other values for IE.

Example:

.footer{
  height: 40px;
}               

 
 

Tuesday, January 3, 2012

Google web preview bot check PHP

I was faced with problem of google web preview "bot".
Its really not a bot, but a chrome tool which makes preview of site which you hover in google search.

The problem was that google web preview "bot" sees page without cookies in users PC. that means google bot will see all advertises which should popup for new coming user.

So solution for this is to check who is looks at page and don't show anything if its an google bot preview.

PHP code:

$bot_v = false;  
$uAgent=$_SERVER['HTTP_USER_AGENT']; 
if(strpos($uAgent,"Google Web Preview") > 0) 
{ $bot_v=true; }

Friday, December 30, 2011

Count emails on gmail.com

As the app says they will generate report in which you will see various information about your year using of gmail.com.

I disappointed a bit after i couldn't login into the site on chrome.
And finally it will take up to 72 hours to generate report. So i still didn't got mine yet :)

We’ll scan your emails, and email you a private link when it is ready. Due to the overwhelming demand for these reports, we're advising everyone that it may take up to 72 hours as we get through everyones Emails.

Anyway i think that its cool tool too found out how effective was your gmail account.

Source: https://yearinreview.toutapp.com

Thursday, December 15, 2011

htaccess redirect from www to non-www

Code for htaccess to create redirect from site's url with www to site's url without www:
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Source: http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www

Friday, December 9, 2011

HTML crossed text

Easiest thing, but i have never used it before.

Today is my first time so i was searching for html tag code which crosses text.

I found it easily. It calls - "line-through". Its an value for text decoration tag.

tag code looks in html like:

text-decoration: line-through;

Example:

Crossed text here

Friday, November 18, 2011

Explode mysql select value



Today i have faced again with same problem - I was forced to explode value while selecting in MySQL.

Value of the field looks like - Kaina: 60000 LT (17376 EUR)
And i need this - 60000

So i made the select query:


SELECT
SUBSTRING( SUBSTRING_INDEX(`field`,' LT',1), -7) as `field_sub`
FROM `table`


As you can notice, first i have exploded the field value so it be like - Kaina: 60000
After i removed first 7 symbols.

Done... i got 60000

GL

Tuesday, September 27, 2011

Joomla K2 watermark image

We need to edit file - item.php which exists in our administrator folder, full path:
\administrator\components\com_k2\models\item.php

first we need to define the variable:
$img_url_watermark = "../images/watermark.png"; //(line 202)

near the comment line
//Original image

Then we need to paste the lines after each image comment to which we want to add watermark (i recommand not to add to small and xsmall... images )
$handle->image_watermark = $img_url_watermark;
$handle->image_watermark_position = "TL";

Than we need to add the code:
//gallery watermark
if($dir = opendir($savepath.DS.$row->id)) {
while (false !== ($file = readdir($dir))) {
$handle = new Upload ($savepath.DS.$row->id.'/'.$file);
$handle->allowed = array('image/*');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->image_resize = ture;
$handle->image_x = 1024;
$handle->image_ratio_y = true;
$handle->image_watermark = $img_url_watermark;
$handle->image_watermark_position = "TL";
$handle->image_convert = "jpg";
$handle->jpeg_quality = 85;
$handle->Process($savepath.DS.$row->id);
$handle->Clean();
}
closedir($dir);
}
//end

After the code:

if (!JArchive::extract($savepath.DS.$handle->file_dst_name, $savepath.DS.$row->id)) {
$mainframe->redirect('index.php?option=com_k2&view=items', JText::_('Gallery upload error: Cannot extract archive!'), 'error');
} else {
$row->gallery = '{gallery}'.$row->id.'{/gallery}';
}
JFile::delete($savepath.DS.$handle->file_dst_name);
$handle->Clean();

Its about 430~ line

That is all.... done :)

p.s. some sources where the solution was fount

http://api.ning.com/files/HXT6DGp5WSJFHL5RzYp-Jb*WUL4Ep5eAy*opKr8s8KN4pt-DDD92wDPKlmNCmWeQd8msVcosqVIjDLKY3jJ-pZ*6PcJz56pR/diff1.gif
http://api.ning.com/files/*txNFL3oxugapDshDybYqwZ6pM1HRBera8DL7uZp5keDIc40jfg8UZf-SEvT3aVakQ35-yRj-RYTlZXBcGxHOa0R2gQPSkPN/diff2and3.gif
http://api.ning.com/files/2ryzVIrGkDjAz*ZMCXk1aYFdbHTiKTrxNSCfUK97YXCGDhmGv7azhnkMQ1cnJp7EdCivLSbtwdV1HmnwnnjnleMveePM*1LS/diff4.gif
http://community.getk2.org/forum/topics/im-just-trying-to-add-a-png

Thursday, September 15, 2011

Mysql Table rows

Easiest way for me to check how many rows in tables of database is to use the query:
SHOW TABLE STATUS FROM `database_name`
easy.. good luck

Wednesday, September 14, 2011

Skype smiles newest 5.5 icons

0191-wfh-30px.png (wfh)
Thumbnail image for 0186-facepalm-30px.png(facepalm)
Thumbnail image for fingerscrossed_80.png (fingers)
Thumbnail image for tumbleweed_80.png(tumbleweed)
lalala_80.png (lalala)
0188-waiting-30px.png (waiting)
0193-highfive-30px.png (h5) or (highfive)


Also


(devil) - devil
(wtf) - what the fuck

Thursday, September 8, 2011

Prestashop CMS block location header



Several days ago i faced with prestashop problem. I tried to hook right column cms block to header. But as prestashop developers says, that it was developed to hook only left or right side.

So here is my solution for this:

in global.css i changed right_column class position to relative and moved it up.

CSS looks like this after my changes:

position: relative;
left: 0px;
top: -200px;
width: 191px;
margin-left: 21px;
overflow: hidden

After this my center_column looked weird ( not full width ) and chaing it's width changes everything ( right_column drops down and starts to move... ). So i figured out this solution for the place: I changed center_column position to absolute, added padding-left so it dont overlay on left_column and added width which i was required from the beggining.

CSS looks like this after my changes:

position: absolute;
padding-left: 290px;
width: 810px;
margin: 0 0 30px 0;
overflow: hidden


Good luck with you prestashop hacking!

Wednesday, August 24, 2011

Posting code on blogger

I faced again with problem of posting PHP code on blogger. So here is very simple and nice Code converter for posting code on Blogger.
http://francois.schnell.free.fr/tools/BloggerPaste/BloggerPaste.html