Saturday, 31 August 2013

change background image of wordpress site

change background image of wordpress site

I am trying to change the body background image for a wordpress site but
it is not working.
The HTML class is this:
<body class="home blog" style>
And my CSS is this:
body.home.blog{
background-image:url('http://distilleryimage10.s3.amazonaws.com/0d443332b7bc11e2a7d622000a9e298f_6.jpg');
background-position:right top;
}
Does anyone know what CSS to write?
Also this is a wordpress site so keep that in mind. I don't use wordpress
or php very often.

GetAsyncKeyState : how to map to a local keyboard?

GetAsyncKeyState : how to map to a local keyboard?

I am using delphi (but could be done in any other langage) to develop a
simple keylogger using GetAsyncKeyState
I can capture the key code, but this is not related to my local keyboard
mapping
ex: when I press the "2" key (which on a french keyboard should write the
"é", it shows me "2" (VK_2)
My quetsion is : how do I map the GetAsyncKeyState keypressed to the local
keyboard ?

Friday, 30 August 2013

Data Binding WPF

Data Binding WPF

I am new to WPF. can any one please let me know how data binding works?
and please help me for the following code I want to assign this Name
property to text box or text block can anybody help?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.ComponentModel;
namespace MyFirstExample.ViewModel
{
class ViewModelAdd: INotifyPropertyChanged
{
private String m_Name = "Hello";
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new
PropertyChangedEventArgs(propertyName));
}
}

Wednesday, 28 August 2013

How to access the php.ini from my CPanel?

How to access the php.ini from my CPanel?

I want to change the limit of the php POST array from 1000 to 6000 . Is
there any way to do that ? i search about that and i found that i should
change some variables in php.ini but the problem is that i did not find
the directory of the file in my cpanel :
Your server's php.ini file is located at /usr/local/lib/php.ini.
This line is from the CPanel documentation but i could not find this
directory in my cpanel even after i show the hidden files???? can anybody
help me locating this file?

Create lead and lag variables in R

Create lead and lag variables in R

I have to create lead and lag variables like below in R
Suppose i have a dataframe which has details about a customer's visit to
any store...
CustomerID Dateofvisit
1 1/2/2013
1 1/3/2013
1 1/7/2013
2 1/9/2013
2 1/14/2013
2 2/14/2013
3 1/4/2013
3 1/5/2013
As we can see, there are 3 customers with different visit dates.. When i
apply a lag function on the above...(i created my own function,)..it
becomes like below:
CustomerID Dateofvisit Laggeddate
1 1/2/2013 -
1 1/3/2013 1/2/2013
1 1/7/2013 1/3/2013
2 1/9/2013 1/7/2013
2 1/14/2013 1/9/2013
2 2/14/2013 1/14/2013
3 1/4/2013 2/14/2013
3 1/5/2013 1/4/2013
But, i want to lag by customer as well. So for the 4th row, the lagged
date should be nothing..similarly for the 3rd cstomer, first row/entry
should be notihng and on last row, i should see 1/4/2013.. How do i do
this?
The following is code i use for lag/lead
shift<-function(x,shift_by){
stopifnot(is.numeric(shift_by))
stopifnot(is.numeric(x))
if (length(shift_by)>1)
return(sapply(shift_by,shift, x=x))
out<-NULL
abs_shift_by=abs(shift_by)
if (shift_by > 0 )
out<-c(tail(x,-abs_shift_by),rep(NA,abs_shift_by))
else if (shift_by < 0 )
out<-c(rep(NA,abs_shift_by), head(x,-abs_shift_by))
else
out<-x
out
}
and how i lead/lag them:
#generate lead by 1 variable
test$df_lead2<-shift(test$x,1)
#generate lag by 1 variable
test$df_lag2<-shift(test$x,-1)

Tuesday, 27 August 2013

combining open-graph description and description meta property into one statement

combining open-graph description and description meta property into one
statement

On my website pages, I currently define both the Description Meta
Property, and for facebook shares I define the og:description tag. I use
the same description for both.
<meta name="description" content="my description" />
<meta property="og:description" content="my description" />
Is there a way to combine both statements into one statement, so I don't
have to make changes twice on the same page when I update my text
description?

Loop don't work within single.php page

Loop don't work within single.php page

I have this code below within the loop
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="new-posts-form">
<div class="new-posts-img"><a href="<?php the_permalink(); ?>"></a><a
href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php
the_post_thumbnail(array(100,80)); ?></a></div>
<div class="new-posts-title"><a href="<?php the_permalink(); ?>"><?php
the_title(); ?></a></div>
<div class="new-post-description"><?php content('11'); ?></div>
<div class="new-post-add-date-time"><img src="<?php
bloginfo('template_url'); ?>/images/tb_clock.png" /><?php the_time('F j,
Y'); ?> at <?php the_time('g:i a'); ?> : <?php the_category(', ') ?></div>
</div> <!--end new posts form-->
<?php endwhile; ?>
<?php endif; ?>
I have 5 posts in my blog the loop is work perfectly in home page and show
all five posts without any problem
but when I use same code within same loop in single.php page only show one
post and don't show other four posts