Facebook like Before Download
I want to make people to like the facebook page first before download
songs from my site. I am new to facebook application and i have no clue
how to start and what resource and tool i need to do this.
Friday, 13 September 2013
Filter syntax in Microsoft Access 2010 form macro
Filter syntax in Microsoft Access 2010 form macro
I am new to access programming, so please cut me a little slack on the
newbie question.
I have a form that I created with Create --> More Forms --> Multiple
Items. The form is based on a query that returns values from three fields,
two of which are hidden. The three fields are FullName, ID, and LastName.
FullName is visible, while ID and LastName are not visible.
I added a text box above the form called txtFilter, and I added a macro to
the After Update event of txtFilter, with the intent of filtering out
results so that only the FullNames of records whose LastName value is like
the value entered in txtFilter.
In the "WHERE=" section of the macro builder, I added the following:
='LastName Like '' & [txtFilter] & '*''
Note the double ==. When I type a value into txtFilter and press return, I
get a dialog box that says "Type mismatch."
Can anyone show me how to fix this syntax so that it does what it is
supposed to? Also, explanation of the syntax would be much appreciated.
I am new to access programming, so please cut me a little slack on the
newbie question.
I have a form that I created with Create --> More Forms --> Multiple
Items. The form is based on a query that returns values from three fields,
two of which are hidden. The three fields are FullName, ID, and LastName.
FullName is visible, while ID and LastName are not visible.
I added a text box above the form called txtFilter, and I added a macro to
the After Update event of txtFilter, with the intent of filtering out
results so that only the FullNames of records whose LastName value is like
the value entered in txtFilter.
In the "WHERE=" section of the macro builder, I added the following:
='LastName Like '' & [txtFilter] & '*''
Note the double ==. When I type a value into txtFilter and press return, I
get a dialog box that says "Type mismatch."
Can anyone show me how to fix this syntax so that it does what it is
supposed to? Also, explanation of the syntax would be much appreciated.
Polymorphic Association in Active Admin Not Passing All Parameters
Polymorphic Association in Active Admin Not Passing All Parameters
I created a Polymorphic Association in Active Admin for the creation of
Keyword associated with Industry. I can display the association fine in
Active Admin (the association was created in the console) but when I
Update and create New, only the keyword parameters gets passed. If I go
back to the console and update, the updated data is properly displayed in
Active Admin.
I never get an error.
I have:
class Industry < ActiveRecord::Base
attr_accessible :name, :keywords, :keywords_attributes
# Associations
has_many :profiles
has_many :companies
has_many :users
has_many :keywords, as: :keyable
accepts_nested_attributes_for :keywords
end
class Keyword < ActiveRecord::Base
attr_accessible :name, :profile_id, :active,
:keyable_attributes, :rating,
:keyable_id, :keyable_industry
# Associations
belongs_to :profile # FK
belongs_to :keyable, polymorphic: true
accepts_nested_attributes_for :keyable
attr_accessor :keyable_industry
def keyable_industry
self.keyable.id if self.keyable.is_a? Industry
end
end
ActiveAdmin.register Keyword do
index do
column :name
column :active
column :rating
column "Keyword Group", :keyable
column :keyable_type
default_actions
end
form do |f|
f.inputs "Conference Detail" do
f.input :name
f.input :active
f.input :rating
f.input :keyable_industry
end
f.inputs "Industry" do
f.input :keyable_industry, label: "Industry",
:as => :select,
:collection => Industry.all.map {|i| [i.name]},
:include_blank => false
end
f.actions
end
end
Development Log Output
Started PUT "/admin/keywords/2" for 127.0.0.1 at 2013-09-13 11:41:32 -0400
Processing by Admin::KeywordsController#update as HTML
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"nnbMIHy1YndWNOKyF+LSABYyeQMpKQAiTyqGbL2sq3g=",
"keyword"=> {"name"=>"test", "active"=>"1", "rating"=>"1",
"keyable_industry"=>"Agriculture & Forestry"}, "commit"=>"Update
Keyword", "id"=>"2"}
User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1
LIMIT 1
Keyword Load (0.7ms) SELECT "keywords".* FROM "keywords" WHERE
"keywords"."id" = $1 LIMIT 1 [["id", "2"]]
(0.7ms) BEGIN
(1.1ms) UPDATE "keywords" SET "name" = 'test', "updated_at" =
'2013-09-13 15:41:32.287147' WHERE "keywords"."id" = 2
(2.9ms) COMMIT
Redirected to http://blog.dev/admin/keywords/2
Completed 302 Found in 14ms (ActiveRecord: 0.0ms)
I created a Polymorphic Association in Active Admin for the creation of
Keyword associated with Industry. I can display the association fine in
Active Admin (the association was created in the console) but when I
Update and create New, only the keyword parameters gets passed. If I go
back to the console and update, the updated data is properly displayed in
Active Admin.
I never get an error.
I have:
class Industry < ActiveRecord::Base
attr_accessible :name, :keywords, :keywords_attributes
# Associations
has_many :profiles
has_many :companies
has_many :users
has_many :keywords, as: :keyable
accepts_nested_attributes_for :keywords
end
class Keyword < ActiveRecord::Base
attr_accessible :name, :profile_id, :active,
:keyable_attributes, :rating,
:keyable_id, :keyable_industry
# Associations
belongs_to :profile # FK
belongs_to :keyable, polymorphic: true
accepts_nested_attributes_for :keyable
attr_accessor :keyable_industry
def keyable_industry
self.keyable.id if self.keyable.is_a? Industry
end
end
ActiveAdmin.register Keyword do
index do
column :name
column :active
column :rating
column "Keyword Group", :keyable
column :keyable_type
default_actions
end
form do |f|
f.inputs "Conference Detail" do
f.input :name
f.input :active
f.input :rating
f.input :keyable_industry
end
f.inputs "Industry" do
f.input :keyable_industry, label: "Industry",
:as => :select,
:collection => Industry.all.map {|i| [i.name]},
:include_blank => false
end
f.actions
end
end
Development Log Output
Started PUT "/admin/keywords/2" for 127.0.0.1 at 2013-09-13 11:41:32 -0400
Processing by Admin::KeywordsController#update as HTML
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"nnbMIHy1YndWNOKyF+LSABYyeQMpKQAiTyqGbL2sq3g=",
"keyword"=> {"name"=>"test", "active"=>"1", "rating"=>"1",
"keyable_industry"=>"Agriculture & Forestry"}, "commit"=>"Update
Keyword", "id"=>"2"}
User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1
LIMIT 1
Keyword Load (0.7ms) SELECT "keywords".* FROM "keywords" WHERE
"keywords"."id" = $1 LIMIT 1 [["id", "2"]]
(0.7ms) BEGIN
(1.1ms) UPDATE "keywords" SET "name" = 'test', "updated_at" =
'2013-09-13 15:41:32.287147' WHERE "keywords"."id" = 2
(2.9ms) COMMIT
Redirected to http://blog.dev/admin/keywords/2
Completed 302 Found in 14ms (ActiveRecord: 0.0ms)
Changing child's coordinates when zooming uiscrollview
Changing child's coordinates when zooming uiscrollview
Well, I have a scrollview in which I put the image principal MainIMG.
I also put 2 secondary images IMG1 and IMG2.
On the scrollview, i can zoom the principal Image (MainIMG), but not the
secondary images (IMG1 and IMG2).
My problem is : i don't know how to make the secondary images retain their
positions relative to the MainIMG when i zooms.
for example if IMG1 at the center of MainIMG when zoomScale = 1, it shall
be as when zoomScale = 2.
thanks a lot for help
Well, I have a scrollview in which I put the image principal MainIMG.
I also put 2 secondary images IMG1 and IMG2.
On the scrollview, i can zoom the principal Image (MainIMG), but not the
secondary images (IMG1 and IMG2).
My problem is : i don't know how to make the secondary images retain their
positions relative to the MainIMG when i zooms.
for example if IMG1 at the center of MainIMG when zoomScale = 1, it shall
be as when zoomScale = 2.
thanks a lot for help
Thursday, 12 September 2013
Using radio buttons and check boxes for similar task (Android)
Using radio buttons and check boxes for similar task (Android)
I have a EditText view and a checkBox (hide), and two radioButtons (hide
and show). The function of the buttons and checkbox is to hide or show the
hinto the EditView. I guess the first question is why I'd want to do this
in the first place. Well, I'm totally new to android and I'm just trying
different things out.
When I run the code though, the Activity fails to launch. I tested the
program before I even placed any radio buttons, and it was working just
fine with only the check box in the program. So I'm assuming the problem
lies somewhere with the radio buttons, or a combination of both used for
the same task.
here's my code:
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
public class EmPubLiteActivity extends Activity implements
CompoundButton.OnCheckedChangeListener {
CheckBox cb;
EditText et;
RadioButton rbHide;
RadioButton rbShow;
RadioGroup rg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
cb = (CheckBox)findViewById(R.id.cbHideHint);
cb.setOnCheckedChangeListener(this);
et = (EditText)findViewById(R.id.editText1);
rbHide = (RadioButton)findViewById(R.id.rbHide);
rbShow = (RadioButton)findViewById(R.id.rbShow);
RadioGroup rg = new RadioGroup(this);
rg.addView(rbHide);
rg.addView(rbShow);
rbHide.setOnCheckedChangeListener(this);
rbShow.setOnCheckedChangeListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.em_pub_lite, menu);
return true;
}
@Override
public void onCheckedChanged(CompoundButton view, boolean isChecked) {
switch (view.getId()) {
case R.id.cbHideHint:
if (isChecked) {
et.setHint(R.string.nothing);
rbHide.setChecked(true);
}
else {
et.setHint(R.string.text_here);
rbShow.setChecked(true);
}
break;
case R.id.rbHide:
et.setHint(R.string.nothing);
cb.setChecked(false);
break;
case R.id.rbShow:
et.setHint(R.string.text_here);
cb.setChecked(true);
}
}
}
I'm getting the following error, along with a bunch of others, but I have
a feeling this is where the problem is:
java.lang.IllegalStateException: the specified child already has a parent.
You must call removeView() on the child's parent first.
What does this error mean, and how can I fix it?
I have a EditText view and a checkBox (hide), and two radioButtons (hide
and show). The function of the buttons and checkbox is to hide or show the
hinto the EditView. I guess the first question is why I'd want to do this
in the first place. Well, I'm totally new to android and I'm just trying
different things out.
When I run the code though, the Activity fails to launch. I tested the
program before I even placed any radio buttons, and it was working just
fine with only the check box in the program. So I'm assuming the problem
lies somewhere with the radio buttons, or a combination of both used for
the same task.
here's my code:
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
public class EmPubLiteActivity extends Activity implements
CompoundButton.OnCheckedChangeListener {
CheckBox cb;
EditText et;
RadioButton rbHide;
RadioButton rbShow;
RadioGroup rg;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
cb = (CheckBox)findViewById(R.id.cbHideHint);
cb.setOnCheckedChangeListener(this);
et = (EditText)findViewById(R.id.editText1);
rbHide = (RadioButton)findViewById(R.id.rbHide);
rbShow = (RadioButton)findViewById(R.id.rbShow);
RadioGroup rg = new RadioGroup(this);
rg.addView(rbHide);
rg.addView(rbShow);
rbHide.setOnCheckedChangeListener(this);
rbShow.setOnCheckedChangeListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.em_pub_lite, menu);
return true;
}
@Override
public void onCheckedChanged(CompoundButton view, boolean isChecked) {
switch (view.getId()) {
case R.id.cbHideHint:
if (isChecked) {
et.setHint(R.string.nothing);
rbHide.setChecked(true);
}
else {
et.setHint(R.string.text_here);
rbShow.setChecked(true);
}
break;
case R.id.rbHide:
et.setHint(R.string.nothing);
cb.setChecked(false);
break;
case R.id.rbShow:
et.setHint(R.string.text_here);
cb.setChecked(true);
}
}
}
I'm getting the following error, along with a bunch of others, but I have
a feeling this is where the problem is:
java.lang.IllegalStateException: the specified child already has a parent.
You must call removeView() on the child's parent first.
What does this error mean, and how can I fix it?
How can I make paintEvent triggered only when update is called?
How can I make paintEvent triggered only when update is called?
It is known that QWidget::paintEvent is triggered automatically the moment
widget becomes visible or any event from the basic window happens. What
should I do if I only want the paintEvent to be issued in response to
update()?
It is known that QWidget::paintEvent is triggered automatically the moment
widget becomes visible or any event from the basic window happens. What
should I do if I only want the paintEvent to be issued in response to
update()?
Keeping png transperancy using a jQuery Lights Out effect
Keeping png transperancy using a jQuery Lights Out effect
On my page I have implemented a basic lights out effect from this source
here: http://www.emanueleferonato.com/stuff/lightsoff/
I would like a PNG image to be the button that 'switches the lights on'
however the image has a persistent white box from the div it's in. Is it
possible for just the PNG image to sit above the black layer in the lights
out effect?
My test is at this url:
http://www.voyagedesign.net/illuminatetests/logolightsout.html
Thank you for your response.
On my page I have implemented a basic lights out effect from this source
here: http://www.emanueleferonato.com/stuff/lightsoff/
I would like a PNG image to be the button that 'switches the lights on'
however the image has a persistent white box from the div it's in. Is it
possible for just the PNG image to sit above the black layer in the lights
out effect?
My test is at this url:
http://www.voyagedesign.net/illuminatetests/logolightsout.html
Thank you for your response.
Subscribe to:
Posts (Atom)