While and IF in data reader
How I will combine the while and if in data reader? I tried this but in
while DR1.Read it does not gives me all the result
if(DR1.Read())
{
while(DR1.Read())
{
flowLayoutPanel1.Controls.Add(label);
}
}
else
MessageBox.Show("No results found")
Saturday, 17 August 2013
Thursday, 8 August 2013
Migrating large user to its own index in ElasticSearch
Migrating large user to its own index in ElasticSearch
In Shay's Berlin Buzzwords talk, in the "user data flow" portion, he
talked about "very large users can be migrated to their own respective
indices". Is this said migration a out-of-the-box supported operation with
no user-visible disruption, or is it a custom migration that we'll have to
implement ourselves?
In Shay's Berlin Buzzwords talk, in the "user data flow" portion, he
talked about "very large users can be migrated to their own respective
indices". Is this said migration a out-of-the-box supported operation with
no user-visible disruption, or is it a custom migration that we'll have to
implement ourselves?
Error in Devise Registrations controller with Rails 3.2.13
Error in Devise Registrations controller with Rails 3.2.13
I get this error when signing up a new user:
ArgumentError (wrong number of arguments (0 for 1)):
app/controllers/devise/registrations_controller.rb:15:in `create'
Is there something wrong with my code?
Code:
class Devise::RegistrationsController < DeviseController
prepend_before_filter :require_no_authentication, :only => [ :new,
:create, :cancel ] prepend_before_filter :authenticate_scope!, :only =>
[:edit, :update, :destroy]
# GET /resource/sign_up def new resource = build_resource({}) respond_with
resource end
# POST /resource def create build_resource
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_up(resource_name, resource)
respond_with resource, :location => after_sign_up_path_for(resource)
else
set_flash_message :notice,
:"signed_up_but_#{resource.inactive_message}" if
is_navigational_format?
expire_session_data_after_sign_in!
respond_with resource, :location =>
after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords resource
respond_with resource
end
end
# GET /resource/edit def edit render :edit end
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating
or # modifying a user and when used to authenticate or find a user.
Default is :email. config.strip_whitespace_keys = [ :email ]
# Tell if authentication through request.params is enabled. True by
default. # It can be set to an array that will enable params
authentication only for the # given strategies, for example,
config.params_authenticatable = [:database] will # enable it only for
database (email + password) authentication. config.params_authenticatable
= true
# Tell if authentication through HTTP Basic Auth is enabled. False by
default. # It can be set to an array that will enable http authentication
only for the # given strategies, for example, config.http_authenticatable
= [:token] will # enable it only for token authentication.
config.http_authenticatable = true
# If http headers should be returned for AJAX requests. True by default.
config.http_authenticatable_on_xhr = true
# The realm used in Http Basic Authentication. "Application" by default.
config.http_authentication_realm = "Application"
# It will change confirmation, password recovery and other workflows # to
behave the same regardless if the e-mail provided was right or wrong. #
Does not affect registerable. config.paranoid = true
Thanks, Tony
I get this error when signing up a new user:
ArgumentError (wrong number of arguments (0 for 1)):
app/controllers/devise/registrations_controller.rb:15:in `create'
Is there something wrong with my code?
Code:
class Devise::RegistrationsController < DeviseController
prepend_before_filter :require_no_authentication, :only => [ :new,
:create, :cancel ] prepend_before_filter :authenticate_scope!, :only =>
[:edit, :update, :destroy]
# GET /resource/sign_up def new resource = build_resource({}) respond_with
resource end
# POST /resource def create build_resource
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_up(resource_name, resource)
respond_with resource, :location => after_sign_up_path_for(resource)
else
set_flash_message :notice,
:"signed_up_but_#{resource.inactive_message}" if
is_navigational_format?
expire_session_data_after_sign_in!
respond_with resource, :location =>
after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords resource
respond_with resource
end
end
# GET /resource/edit def edit render :edit end
# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating
or # modifying a user and when used to authenticate or find a user.
Default is :email. config.strip_whitespace_keys = [ :email ]
# Tell if authentication through request.params is enabled. True by
default. # It can be set to an array that will enable params
authentication only for the # given strategies, for example,
config.params_authenticatable = [:database] will # enable it only for
database (email + password) authentication. config.params_authenticatable
= true
# Tell if authentication through HTTP Basic Auth is enabled. False by
default. # It can be set to an array that will enable http authentication
only for the # given strategies, for example, config.http_authenticatable
= [:token] will # enable it only for token authentication.
config.http_authenticatable = true
# If http headers should be returned for AJAX requests. True by default.
config.http_authenticatable_on_xhr = true
# The realm used in Http Basic Authentication. "Application" by default.
config.http_authentication_realm = "Application"
# It will change confirmation, password recovery and other workflows # to
behave the same regardless if the e-mail provided was right or wrong. #
Does not affect registerable. config.paranoid = true
Thanks, Tony
Calculating a work week based on weekly time-sheet in Excel
Calculating a work week based on weekly time-sheet in Excel
I am trying to calculate work week hours which I want to match it with the
company's paycheck earned amount. So far I have this:
7/12/2011 7.90 7/13/2011 8.03 7/14/2011 7.83 7/15/2011 7.97 7/18/2011 8.20
7/19/2011 8.12 7/20/2011 8.15 7/21/2011 6.07 7/22/2011 8.12 7/25/2011 8.13
7/26/2011 8.1 7/27/2011 8.4 7/29/2011 8.27 8/1/2011 8.33 8/2/2011 8.18
8/3/2011 8.22 8/4/2011 6.72 8/5/2011 7.57 8/8/2011 8.07 8/9/2011 8.28
8/10/2011 5.8 8/11/2011 8.8 8/15/2011 8.2 8/16/2011 7.95 8/17/2011 8.17
8/18/2011 8.1 8/19/2011 7.8 8/22/2011 8.18 8/23/2011 9.7 8/24/2011 8.17
8/25/2011 8.18
and want to match the total to this:
Check Date Earnings Start Earnings End Earn Type Earn Amount 8/10/2011
7/26/2011 8/10/2011 Salary 899.6 8/25/2011 8/11/2011 8/25/2011 Salary
888.28
The company's pay period varies, that's why these days don't follow. So
far I was using =sumifs functions but isn't giving the result I need. Let
me know if there's clarifications anyone needs! Thanks a lot!
I am trying to calculate work week hours which I want to match it with the
company's paycheck earned amount. So far I have this:
7/12/2011 7.90 7/13/2011 8.03 7/14/2011 7.83 7/15/2011 7.97 7/18/2011 8.20
7/19/2011 8.12 7/20/2011 8.15 7/21/2011 6.07 7/22/2011 8.12 7/25/2011 8.13
7/26/2011 8.1 7/27/2011 8.4 7/29/2011 8.27 8/1/2011 8.33 8/2/2011 8.18
8/3/2011 8.22 8/4/2011 6.72 8/5/2011 7.57 8/8/2011 8.07 8/9/2011 8.28
8/10/2011 5.8 8/11/2011 8.8 8/15/2011 8.2 8/16/2011 7.95 8/17/2011 8.17
8/18/2011 8.1 8/19/2011 7.8 8/22/2011 8.18 8/23/2011 9.7 8/24/2011 8.17
8/25/2011 8.18
and want to match the total to this:
Check Date Earnings Start Earnings End Earn Type Earn Amount 8/10/2011
7/26/2011 8/10/2011 Salary 899.6 8/25/2011 8/11/2011 8/25/2011 Salary
888.28
The company's pay period varies, that's why these days don't follow. So
far I was using =sumifs functions but isn't giving the result I need. Let
me know if there's clarifications anyone needs! Thanks a lot!
Creating a complicated new variable
Creating a complicated new variable
I have a dataset which is in longformat in which Measurements (Time) are
nested in Networkpartners (NP) which are nested in Persons (ID), here is
an example of what it looks like (the real dataset has over thousands of
rows):
ID NP Time Outcome1 Outcome2
1 11 1 4 NA
1 11 2 3 4
1 11 3 NA NA
1 12 1 2 3
1 12 2 3 1
1 12 3 3 2
2 21 1 2 4
2 21 2 NA NA
2 21 3 NA NA
2 22 1 4 NA
2 22 2 4 3
2 22 3 NA 4
Now I would like to create the following new variable "NP.T":
The Number of Networkpartners (who have no NA in outcome1 and outcome2 at
this measurement) a specific person (ID) at a specific time.
So I would like to create a dataset like this:
ID NP Time Outcome1 Outcome2 NP.T
1 11 1 4 NA 2
1 11 2 3 4 2
1 11 3 NA NA 1
1 12 1 2 3 2
1 12 2 3 1 2
1 12 3 3 2 1
2 21 1 2 4 2
2 21 2 NA NA 1
2 21 3 NA NA 1
2 22 1 4 NA 2
2 22 2 4 3 1
2 22 3 NA 4 1
I have the solution on how to create a variable that counts the number of
Networkpartners (who have no NA in ONE of the two outcomes) a specific
person (ID) at a specific time:
library(plyr)
mydata1<-ddply(mydata,.(ID,Time),transform,
NP.T=length(Outcome[which(Outcome ! ="NA")]))
Now, I'd be very thankful if somebody could help me to find an answer on
my specific problem!
I have a dataset which is in longformat in which Measurements (Time) are
nested in Networkpartners (NP) which are nested in Persons (ID), here is
an example of what it looks like (the real dataset has over thousands of
rows):
ID NP Time Outcome1 Outcome2
1 11 1 4 NA
1 11 2 3 4
1 11 3 NA NA
1 12 1 2 3
1 12 2 3 1
1 12 3 3 2
2 21 1 2 4
2 21 2 NA NA
2 21 3 NA NA
2 22 1 4 NA
2 22 2 4 3
2 22 3 NA 4
Now I would like to create the following new variable "NP.T":
The Number of Networkpartners (who have no NA in outcome1 and outcome2 at
this measurement) a specific person (ID) at a specific time.
So I would like to create a dataset like this:
ID NP Time Outcome1 Outcome2 NP.T
1 11 1 4 NA 2
1 11 2 3 4 2
1 11 3 NA NA 1
1 12 1 2 3 2
1 12 2 3 1 2
1 12 3 3 2 1
2 21 1 2 4 2
2 21 2 NA NA 1
2 21 3 NA NA 1
2 22 1 4 NA 2
2 22 2 4 3 1
2 22 3 NA 4 1
I have the solution on how to create a variable that counts the number of
Networkpartners (who have no NA in ONE of the two outcomes) a specific
person (ID) at a specific time:
library(plyr)
mydata1<-ddply(mydata,.(ID,Time),transform,
NP.T=length(Outcome[which(Outcome ! ="NA")]))
Now, I'd be very thankful if somebody could help me to find an answer on
my specific problem!
mysql union all from one table create from join and another table
mysql union all from one table create from join and another table
I have one question please
I would like to do "union all" through union to two tables but one is
created with a join of 3 tables, is it possible?
exemple
1table create by join
(SELECT numfattmiele, datafattmiele, idclifattmiele, codsfusofattmiele
,nomegiacesfusofattmiele, kgsfusofattmiele, resparzcodsfusofattmiele,
resparznomesfusofattmiele, FROM fattmiele AS FM
JOIN dettsfusofattmiele AS DS ON FM.idfatt = DS.idfatt JOIN
giacesfusofattmiele AS GS ON DS.idfatt = GS.idfatt)
and after with
UNION ALL
normal select another table
Select idconf, codconf..etc.. from confmiele...from confmiele
some can help me please thanks...
I have one question please
I would like to do "union all" through union to two tables but one is
created with a join of 3 tables, is it possible?
exemple
1table create by join
(SELECT numfattmiele, datafattmiele, idclifattmiele, codsfusofattmiele
,nomegiacesfusofattmiele, kgsfusofattmiele, resparzcodsfusofattmiele,
resparznomesfusofattmiele, FROM fattmiele AS FM
JOIN dettsfusofattmiele AS DS ON FM.idfatt = DS.idfatt JOIN
giacesfusofattmiele AS GS ON DS.idfatt = GS.idfatt)
and after with
UNION ALL
normal select another table
Select idconf, codconf..etc.. from confmiele...from confmiele
some can help me please thanks...
Better header labels than Current, Previous and Previous of Previous in a Spreadsheet?
Better header labels than Current, Previous and Previous of Previous in a
Spreadsheet?
I am trying to find better header labels than Current, Previous and
Previous of Previous in a Spreadsheet. For Example:
EmployeeID | Compensation | Previous Compensation (1) | Previous
Compensation (2)
ssmith374 | $45,983 | $43,436 | $40,176
hbrown394 | $37,736 | $36,154 | $34,643
Wgold872 | $67,734 | $64,232 | $62,433
Any suggestions?
Spreadsheet?
I am trying to find better header labels than Current, Previous and
Previous of Previous in a Spreadsheet. For Example:
EmployeeID | Compensation | Previous Compensation (1) | Previous
Compensation (2)
ssmith374 | $45,983 | $43,436 | $40,176
hbrown394 | $37,736 | $36,154 | $34,643
Wgold872 | $67,734 | $64,232 | $62,433
Any suggestions?
Subscribe to:
Posts (Atom)