text:
Q: Why Drupal subthem is not includng base theme styles I'm creating a Commerce Kickstart subtheme. I have done each step in this reference and I could create and install my subtheme, but commercer_kickstart_styles.css is not being included.
The following is my .info:
name =  web_francia
description =  Ajustes para version francesa
core = 7.x
engine = phptemplate
screenshot = screenshot.png
base theme = commerce_kickstart_theme

; REQUIRED CORE REGIONS

regions[page_top] = Page Top
regions[page_bottom] = Page Bottom
regions[content] = Content

; ADDITIONAL REGIONS

regions[user_first] = User Bar First
regions[user_second] = User Bar Second

regions[branding] = Branding
regions[menu] = Menu
regions[breadcrumb] = Breadcrumb

regions[sidebar_first] = Sidebar First
regions[sidebar_second] = Sidebar Second

regions[header_first] = Header First
regions[header_second] = Header Second

regions[preface_first] = Preface First
regions[preface_second] = Preface Second
regions[preface_third] = Preface Third

regions[postscript_first] = Postscript First
regions[postscript_second] = Postscript Second
regions[postscript_third] = Postscript Third

regions[footer_first] = Footer First
regions[footer_second] = Footer Second
regions[footer_third] = Footer Third

regions[footer2_first] = Footer2 First
regions[footer2_second] = Footer2 Second

; ZONES

zones[user] = User
zones[branding] = Branding
zones[menu] = Menu
zones[header] = Header
zones[preface] = Preface
zones[content] = Content
zones[postscript] = Postscript
zones[footer] = Footer first
zones[footer2] = Footer second

; OPTIONAL STYLESHEETS

css[web_francia_style.css][name] = Arreglos para Francia
css[web_francia_style.css][description] = Css con cosas para Francia
css[web_francia_style.css][options][weight] = 12
settings[alpha_css][web_francia_style.css] = 'web_francia_style.css'

; THEME SETTINGS (DEFAULTS)

settings[alpha_grid] = 'alpha_default'
settings[alpha_primary_alpha_default] = 'normal'
settings[alpha_responsive] = '1'
settings[alpha_layouts_alpha_fluid_primary] = 'normal'
settings[alpha_layouts_alpha_fluid_normal_responsive] = '0'
settings[alpha_layouts_alpha_fluid_normal_media] = 'all and (min-width: 740px) and (min-device-width: 740px), (max-device-width: 800px) and (min-width: 740px) and (orientation:landscape)'
settings[alpha_layouts_alpha_default_primary] = 'normal'
settings[alpha_layouts_alpha_default_fluid_responsive] = '0'
settings[alpha_layouts_alpha_default_fluid_media] = 'all and (min-width: 740px) and (min-device-width: 740px), (max-device-width: 800px) and (min-width: 740px) and (orientation:landscape)'
settings[alpha_layouts_alpha_default_fluid_weight] = '0'
settings[alpha_layouts_alpha_default_narrow_responsive] = '1'
settings[alpha_layouts_alpha_default_narrow_media] = 'all and (min-width: 740px) and (min-device-width: 740px), (max-device-width: 800px) and (min-width: 740px) and (orientation:landscape)'
settings[alpha_layouts_alpha_default_narrow_weight] = '1'
settings[alpha_layouts_alpha_default_normal_responsive] = '1'
settings[alpha_layouts_alpha_default_normal_media] = 'all and (min-width: 980px) and (min-device-width: 980px), all and (max-device-width: 1024px) and (min-width: 1024px) and (orientation:landscape)'
settings[alpha_layouts_alpha_default_normal_weight] = '2'
settings[alpha_layouts_alpha_default_wide_responsive] = '0'
settings[alpha_layouts_alpha_default_wide_media] = 'all and (min-width: 1220px)'
settings[alpha_layouts_alpha_default_wide_weight] = '3'
settings[alpha_viewport] = '1'
settings[alpha_viewport_initial_scale] = '1'
settings[alpha_viewport_min_scale] = '1'
settings[alpha_viewport_max_scale] = '1'
settings[alpha_viewport_user_scaleable] = ''
settings[alpha_libraries][omega_formalize] = 'omega_formalize'
settings[alpha_libraries][omega_equalheights] = ''
settings[alpha_libraries][omega_mediaqueries] = 'omega_mediaqueries'
settings[alpha_css][alpha-reset.css] = 'alpha-reset.css'
settings[alpha_css][alpha-mobile.css] = 'alpha-mobile.css'
settings[alpha_css][alpha-alpha.css] = 'alpha-alpha.css'
settings[alpha_css][omega-text.css] = 'omega-text.css'
settings[alpha_css][omega-branding.css] = 'omega-branding.css'
settings[alpha_css][omega-menu.css] = 'omega-menu.css'
settings[alpha_css][omega-forms.css] = 'omega-forms.css'
settings[alpha_css][global.css] = 'global.css'
settings[alpha_debug_block_toggle] = '0'
settings[alpha_debug_block_active] = '0'
settings[alpha_debug_grid_toggle] = '0'
settings[alpha_debug_grid_active] = '0'
settings[alpha_debug_grid_roles][1] = '0'
settings[alpha_debug_grid_roles][2] = '0'
settings[alpha_debug_grid_roles][3] = '3'
settings[alpha_toggle_messages] = '1'
settings[alpha_toggle_action_links] = '1'
settings[alpha_toggle_tabs] = '1'
settings[alpha_toggle_breadcrumb] = '1'
settings[alpha_toggle_page_title] = '1'
settings[alpha_toggle_feed_icons] = '1'
settings[alpha_hidden_title] = ''
settings[alpha_hidden_site_name] = '1'
settings[alpha_hidden_site_slogan] = ''
settings[alpha_zone_user_equal_height_container] = ''
settings[alpha_zone_user_wrapper] = '1'
settings[alpha_zone_user_force] = ''
settings[alpha_zone_user_section] = 'header'
settings[alpha_zone_user_weight] = '1'
settings[alpha_zone_user_columns] = '24'
settings[alpha_zone_user_primary] = ''
settings[alpha_zone_user_css] = ''
settings[alpha_zone_user_wrapper_css] = ''
settings[alpha_zone_branding_equal_height_container] = ''
settings[alpha_zone_branding_wrapper] = '1'
settings[alpha_zone_branding_force] = ''
settings[alpha_zone_branding_section] = 'header'
settings[alpha_zone_branding_weight] = '2'
settings[alpha_zone_branding_columns] = '24'
settings[alpha_zone_branding_primary] = ''
settings[alpha_zone_branding_css] = ''
settings[alpha_zone_branding_wrapper_css] = ''
settings[alpha_zone_menu_equal_height_container] = ''
settings[alpha_zone_menu_wrapper] = '1'
settings[alpha_zone_menu_force] = ''
settings[alpha_zone_menu_section] = 'header'
settings[alpha_zone_menu_weight] = '3'
settings[alpha_zone_menu_columns] = '24'
settings[alpha_zone_menu_primary] = ''
settings[alpha_zone_menu_css] = ''
settings[alpha_zone_menu_wrapper_css] = ''
settings[alpha_zone_header_equal_height_container] = ''
settings[alpha_zone_header_wrapper] = '1'
settings[alpha_zone_header_force] = ''
settings[alpha_zone_header_section] = 'header'
settings[alpha_zone_header_weight] = '4'
settings[alpha_zone_header_columns] = '24'
settings[alpha_zone_header_primary] = ''
settings[alpha_zone_header_css] = ''
settings[alpha_zone_header_wrapper_css] = ''
settings[alpha_zone_preface_equal_height_container] = ''
settings[alpha_zone_preface_wrapper] = '1'
settings[alpha_zone_preface_force] = ''
settings[alpha_zone_preface_section] = 'content'
settings[alpha_zone_preface_weight] = '1'
settings[alpha_zone_preface_columns] = '24'
settings[alpha_zone_preface_primary] = ''
settings[alpha_zone_preface_css] = ''
settings[alpha_zone_preface_wrapper_css] = ''
settings[alpha_zone_content_equal_height_container] = ''
settings[alpha_zone_content_wrapper] = '1'
settings[alpha_zone_content_force] = '1'
settings[alpha_zone_content_section] = 'content'
settings[alpha_zone_content_weight] = '2'
settings[alpha_zone_content_columns] = '24'
settings[alpha_zone_content_primary] = 'content'
settings[alpha_zone_content_css] = ''
settings[alpha_zone_content_wrapper_css] = ''
settings[alpha_zone_postscript_equal_height_container] = ''
settings[alpha_zone_postscript_wrapper] = '1'
settings[alpha_zone_postscript_force] = ''
settings[alpha_zone_postscript_section] = 'content'
settings[alpha_zone_postscript_weight] = '3'
settings[alpha_zone_postscript_columns] = '24'
settings[alpha_zone_postscript_primary] = ''
settings[alpha_zone_postscript_css] = ''
settings[alpha_zone_postscript_wrapper_css] = ''
settings[alpha_zone_footer_equal_height_container] = ''
settings[alpha_zone_footer_wrapper] = '1'
settings[alpha_zone_footer_force] = ''
settings[alpha_zone_footer_section] = 'footer'
settings[alpha_zone_footer_weight] = '1'
settings[alpha_zone_footer_columns] = '24'
settings[alpha_zone_footer_primary] = ''
settings[alpha_zone_footer_css] = ''
settings[alpha_zone_footer_wrapper_css] = ''
settings[alpha_zone_footer2_equal_height_container] = ''
settings[alpha_zone_footer2_wrapper] = '1'
settings[alpha_zone_footer2_force] = ''
settings[alpha_zone_footer2_section] = 'footer'
settings[alpha_zone_footer2_weight] = '2'
settings[alpha_zone_footer2_columns] = '24'
settings[alpha_zone_footer2_primary] = ''
settings[alpha_zone_footer2_css] = ''
settings[alpha_zone_footer2_wrapper_css] = ''
settings[alpha_region_dashboard_sidebar_equal_height_container] = ''
settings[alpha_region_dashboard_sidebar_equal_height_element] = ''
settings[alpha_region_dashboard_sidebar_force] = ''
settings[alpha_region_dashboard_sidebar_zone] = ''
settings[alpha_region_dashboard_sidebar_prefix] = ''
settings[alpha_region_dashboard_sidebar_columns] = '1'
settings[alpha_region_dashboard_sidebar_suffix] = ''
settings[alpha_region_dashboard_sidebar_weight] = '-50'
settings[alpha_region_dashboard_sidebar_css] = ''
settings[alpha_region_dashboard_inactive_equal_height_container] = ''
settings[alpha_region_dashboard_inactive_equal_height_element] = ''
settings[alpha_region_dashboard_inactive_force] = ''
settings[alpha_region_dashboard_inactive_zone] = ''
settings[alpha_region_dashboard_inactive_prefix] = ''
settings[alpha_region_dashboard_inactive_columns] = '1'
settings[alpha_region_dashboard_inactive_suffix] = ''
settings[alpha_region_dashboard_inactive_weight] = '-50'
settings[alpha_region_dashboard_inactive_css] = ''
settings[alpha_region_dashboard_main_equal_height_container] = ''
settings[alpha_region_dashboard_main_equal_height_element] = ''
settings[alpha_region_dashboard_main_force] = ''
settings[alpha_region_dashboard_main_zone] = ''
settings[alpha_region_dashboard_main_prefix] = ''
settings[alpha_region_dashboard_main_columns] = '1'
settings[alpha_region_dashboard_main_suffix] = ''
settings[alpha_region_dashboard_main_weight] = '-50'
settings[alpha_region_dashboard_main_css] = ''
settings[alpha_region_user_first_equal_height_container] = ''
settings[alpha_region_user_first_equal_height_element] = ''
settings[alpha_region_user_first_force] = ''
settings[alpha_region_user_first_zone] = 'user'
settings[alpha_region_user_first_prefix] = ''
settings[alpha_region_user_first_columns] = '16'
settings[alpha_region_user_first_suffix] = '0'
settings[alpha_region_user_first_weight] = '1'
settings[alpha_region_user_first_css] = ''
settings[alpha_region_user_second_equal_height_container] = ''
settings[alpha_region_user_second_equal_height_element] = ''
settings[alpha_region_user_second_force] = ''
settings[alpha_region_user_second_zone] = 'user'
settings[alpha_region_user_second_prefix] = ''
settings[alpha_region_user_second_columns] = '8'
settings[alpha_region_user_second_suffix] = ''
settings[alpha_region_user_second_weight] = '2'
settings[alpha_region_user_second_css] = ''
settings[alpha_region_branding_equal_height_container] = ''
settings[alpha_region_branding_equal_height_element] = ''
settings[alpha_region_branding_force] = '1'
settings[alpha_region_branding_zone] = 'branding'
settings[alpha_region_branding_prefix] = ''
settings[alpha_region_branding_columns] = '24'
settings[alpha_region_branding_suffix] = ''
settings[alpha_region_branding_weight] = '1'
settings[alpha_region_branding_css] = ''
settings[alpha_region_menu_equal_height_container] = ''
settings[alpha_region_menu_equal_height_element] = ''
settings[alpha_region_menu_force] = '1'
settings[alpha_region_menu_zone] = 'menu'
settings[alpha_region_menu_prefix] = ''
settings[alpha_region_menu_columns] = '24'
settings[alpha_region_menu_suffix] = ''
settings[alpha_region_menu_weight] = '1'
settings[alpha_region_menu_css] = ''
settings[alpha_region_breadcrumb_equal_height_container] = ''
settings[alpha_region_breadcrumb_equal_height_element] = ''
settings[alpha_region_breadcrumb_force] = '0'
settings[alpha_region_breadcrumb_zone] = 'preface'
settings[alpha_region_breadcrumb_prefix] = ''
settings[alpha_region_breadcrumb_columns] = '24'
settings[alpha_region_breadcrumb_suffix] = ''
settings[alpha_region_breadcrumbu_weight] = '1'
settings[alpha_region_breadcrumbu_css] = ''
settings[alpha_region_header_first_equal_height_container] = ''
settings[alpha_region_header_first_equal_height_element] = ''
settings[alpha_region_header_first_force] = ''
settings[alpha_region_header_first_zone] = 'header'
settings[alpha_region_header_first_prefix] = ''
settings[alpha_region_header_first_columns] = '17'
settings[alpha_region_header_first_suffix] = ''
settings[alpha_region_header_first_weight] = '1'
settings[alpha_region_header_first_css] = ''
settings[alpha_region_header_second_equal_height_container] = ''
settings[alpha_region_header_second_equal_height_element] = ''
settings[alpha_region_header_second_force] = ''
settings[alpha_region_header_second_zone] = 'header'
settings[alpha_region_header_second_prefix] = ''
settings[alpha_region_header_second_columns] = '7'
settings[alpha_region_header_second_suffix] = ''
settings[alpha_region_header_second_weight] = '2'
settings[alpha_region_header_second_css] = ''
settings[alpha_region_preface_first_equal_height_container] = ''
settings[alpha_region_preface_first_equal_height_element] = ''
settings[alpha_region_preface_first_force] = ''
settings[alpha_region_preface_first_zone] = 'preface'
settings[alpha_region_preface_first_prefix] = ''
settings[alpha_region_preface_first_columns] = '8'
settings[alpha_region_preface_first_suffix] = ''
settings[alpha_region_preface_first_weight] = '1'
settings[alpha_region_preface_first_css] = ''
settings[alpha_region_preface_second_equal_height_container] = ''
settings[alpha_region_preface_second_equal_height_element] = ''
settings[alpha_region_preface_second_force] = ''
settings[alpha_region_preface_second_zone] = 'preface'
settings[alpha_region_preface_second_prefix] = ''
settings[alpha_region_preface_second_columns] = '8'
settings[alpha_region_preface_second_suffix] = ''
settings[alpha_region_preface_second_weight] = '2'
settings[alpha_region_preface_second_css] = ''
settings[alpha_region_preface_third_equal_height_container] = ''
settings[alpha_region_preface_third_equal_height_element] = ''
settings[alpha_region_preface_third_force] = ''
settings[alpha_region_preface_third_zone] = 'preface'
settings[alpha_region_preface_third_prefix] = ''
settings[alpha_region_preface_third_columns] = '8'
settings[alpha_region_preface_third_suffix] = ''
settings[alpha_region_preface_third_weight] = '3'
settings[alpha_region_preface_third_css] = ''
settings[alpha_region_content_equal_height_container] = ''
settings[alpha_region_content_equal_height_element] = ''
settings[alpha_region_content_force] = '1'
settings[alpha_region_content_zone] = 'content'
settings[alpha_region_content_prefix] = ''
settings[alpha_region_content_columns] = '12'
settings[alpha_region_content_suffix] = ''
settings[alpha_region_content_weight] = '2'
settings[alpha_region_content_css] = ''
settings[alpha_region_sidebar_first_equal_height_container] = ''
settings[alpha_region_sidebar_first_equal_height_element] = ''
settings[alpha_region_sidebar_first_force] = ''
settings[alpha_region_sidebar_first_zone] = 'content'
settings[alpha_region_sidebar_first_prefix] = ''
settings[alpha_region_sidebar_first_columns] = '6'
settings[alpha_region_sidebar_first_suffix] = ''
settings[alpha_region_sidebar_first_weight] = '1'
settings[alpha_region_sidebar_first_css] = ''
settings[alpha_region_sidebar_second_equal_height_container] = ''
settings[alpha_region_sidebar_second_equal_height_element] = ''
settings[alpha_region_sidebar_second_force] = ''
settings[alpha_region_sidebar_second_zone] = 'content'
settings[alpha_region_sidebar_second_prefix] = ''
settings[alpha_region_sidebar_second_columns] = '6'
settings[alpha_region_sidebar_second_suffix] = ''
settings[alpha_region_sidebar_second_weight] = '3'
settings[alpha_region_sidebar_second_css] = ''
settings[alpha_region_postscript_first_equal_height_container] = ''
settings[alpha_region_postscript_first_equal_height_element] = ''
settings[alpha_region_postscript_first_force] = ''
settings[alpha_region_postscript_first_zone] = 'postscript'
settings[alpha_region_postscript_first_prefix] = ''
settings[alpha_region_postscript_first_columns] = '8'
settings[alpha_region_postscript_first_suffix] = ''
settings[alpha_region_postscript_first_weight] = '1'
settings[alpha_region_postscript_first_css] = ''
settings[alpha_region_postscript_second_equal_height_container] = ''
settings[alpha_region_postscript_second_equal_height_element] = ''
settings[alpha_region_postscript_second_force] = ''
settings[alpha_region_postscript_second_zone] = 'postscript'
settings[alpha_region_postscript_second_prefix] = ''
settings[alpha_region_postscript_second_columns] = '8'
settings[alpha_region_postscript_second_suffix] = ''
settings[alpha_region_postscript_second_weight] = '2'
settings[alpha_region_postscript_second_css] = ''
settings[alpha_region_postscript_third_equal_height_container] = ''
settings[alpha_region_postscript_third_equal_height_element] = ''
settings[alpha_region_postscript_third_force] = ''
settings[alpha_region_postscript_third_zone] = 'postscript'
settings[alpha_region_postscript_third_prefix] = ''
settings[alpha_region_postscript_third_columns] = '8'
settings[alpha_region_postscript_third_suffix] = ''
settings[alpha_region_postscript_third_weight] = '2'
settings[alpha_region_postscript_third_css] = ''
settings[alpha_region_footer_first_equal_height_container] = ''
settings[alpha_region_footer_first_equal_height_element] = ''
settings[alpha_region_footer_first_force] = ''
settings[alpha_region_footer_first_zone] = 'footer'
settings[alpha_region_footer_first_prefix] = ''
settings[alpha_region_footer_first_columns] = '17'
settings[alpha_region_footer_first_suffix] = ''
settings[alpha_region_footer_first_weight] = '1'
settings[alpha_region_footer_first_css] = ''
settings[alpha_region_footer_second_equal_height_container] = ''
settings[alpha_region_footer_second_equal_height_element] = ''
settings[alpha_region_footer_second_force] = ''
settings[alpha_region_footer_second_zone] = 'footer'
settings[alpha_region_footer_second_prefix] = ''
settings[alpha_region_footer_second_columns] = '7'
settings[alpha_region_footer_second_suffix] = ''
settings[alpha_region_footer_second_weight] = '2'
settings[alpha_region_footer_second_css] = ''
settings[alpha_region_footer_third_equal_height_container] = ''
settings[alpha_region_footer_third_equal_height_element] = ''
settings[alpha_region_footer_third_force] = ''
settings[alpha_region_footer_third_zone] = 'footer'
settings[alpha_region_footer_third_prefix] = '1'
settings[alpha_region_footer_third_columns] = '5'
settings[alpha_region_footer_third_suffix] = ''
settings[alpha_region_footer_third_weight] = '2'
settings[alpha_region_footer_third_css] = ''
settings[alpha_region_footer2_first_equal_height_container] = ''
settings[alpha_region_footer2_first_equal_height_element] = ''
settings[alpha_region_footer2_first_force] = ''
settings[alpha_region_footer2_first_zone] = 'footer2'
settings[alpha_region_footer2_first_prefix] = '0'
settings[alpha_region_footer2_first_columns] = '7'
settings[alpha_region_footer2_first_suffix] = ''
settings[alpha_region_footer2_first_weight] = '1'
settings[alpha_region_footer2_first_css] = ''
settings[alpha_region_footer2_second_equal_height_container] = ''
settings[alpha_region_footer2_second_equal_height_element] = ''
settings[alpha_region_footer2_second_force] = ''
settings[alpha_region_footer2_second_zone] = 'footer2'
settings[alpha_region_footer2_second_prefix] = '8'
settings[alpha_region_footer2_second_columns] = '9'
settings[alpha_region_footer2_second_suffix] = ''
settings[alpha_region_footer2_second_weight] = '2'
settings[alpha_region_footer2_second_css] = ''

What am I doing wrong?

A: One reason can be that you have overidden base css here:
settings[alpha_css][commerce_kickstart_style.css] = 'commerce_kickstart_style.css

Try removing this line and check.


text:
Q: Ejecutar .bat desde programador de Tareas como administrador tengo un .bat que se levantar el servicio de SQL SERVER, he creado un acceso directo y lo configure para que se ejecute como administrador, s ejecuto directamente dicho acceso directo el servicio se levanta correctamente, pero ahora necesito que ese .bat se ejecute en una tarea programada.
AL crear la tarea programada, direcciono para que ejecute el acceso directo, pero no logra levantar el servicio, no se pueda ser, la primera idea que tengo es que me faltaria indicarle a la tarea programada que se ejecute como administrador pero no se donde se configura eso.
Alguna idea?

A: Cuando creas la tarea en la opciones de seguridad defines que se ejecute con los privilegios mas altos y cambia el usuario al usuario que precisas (también puede ser SYSTEM) y en acciones tu script.

redpajama_set_name: RedPajamaStackExchange


text:
Q: R - Function to make a binary variable I have some variables which take value between 1 and 5. I would like to code them 0 if they take the value between 1 and 3 (included) and 1 if they take the value 4 or 5.
My dataset looks like this
var1    var2        var3
1       1            NA
4       3            4
3       4            5
2       5            3

So I would like it to be like this:
var1    var2        var3
0       0            NA
1       0            1
0       1            1
0       1            0

I tried to do a function and to call it
making_binary <- function (var){
  var <- factor(var >= 4, labels = c(0, 1))
  return(var)
}

df <- lapply(df, making_binary)

But I had an error : incorrect labels : length 2 must be 1 or 1
Where did I go wrong?
Thank you very much for your answers!

A: You can use :
df[] <- +(df == 4 | df == 5)
df
#  var1 var2 var3
#1    0    0   NA
#2    1    0    1
#3    0    1    1
#4    0    1    0

Comparison of df == 4 | df == 5 returns logical values (TRUE/FALSE), + here turns those logical values to integer values (1/0) respectively.
If you want to apply this for selected columns you can subset the columns by position or by name.
cols <- 1:3 #Position
#cols <- grep('var', names(df)) #Name
df[cols] <- +(df[cols] == 4 | df[cols] == 5)

As far as your function is concerned you can do :
making_binary <- function (var){
  var <- as.integer(var >= 4)
  #which is faster version of
  #var <- ifelse(var >= 4, 1, 0)
  return(var)
}

df[] <- lapply(df, making_binary)

data
df <- structure(list(var1 = c(1L, 4L, 3L, 2L), var2 = c(1L, 3L, 4L,
5L), var3 = c(NA, 4L, 5L, 3L)), class = "data.frame", row.names = c(NA, -4L))

A: I think ifelse would fit the problem well:
df[] <- lapply(df, function(x) ifelse(x >=1 & x <=3, 0, x))
df
  var1 var2 var3
1    0    0   NA
2    4    0    4
3    0    4    5
4    0    5    0
df[] <- lapply(df, function(x) ifelse(x >=4 & x <=5, 1, x))

df
  var1 var2 var3
1    0    0   NA
2    1    0    1
3    0    1    1
4    0    1    0

If you need to do the two steps at once, you can look at dplyr::case_when() or data.table::fcase().

A: You can simply test if the value is larger than 3, which will return TRUE and FALSE and cast this to a number:
+(x>3)
#     var1 var2 var3
#[1,]    0    0   NA
#[2,]    1    0    1
#[3,]    0    1    1
#[4,]    0    1    0

In case you want this only for some columns, you have to subset them. E.g. for column 1 and 2:
+(x[1:2]>3)
#+(x[c("var1","var2")]>3)  #Alternative
#     var1 var2
#[1,]    0    0
#[2,]    1    0
#[3,]    0    1
#[4,]    0    1

Data:
x <- data.frame(var1 = c(1L, 4L, 3L, 2L), var2 = c(1L, 3L, 4L, 5L)
              , var3 = c(NA, 4L, 5L, 3L))


text:
Q: How to write php unit test to test the stack functionality? I want to write a unit test for a class handling a stack of positive integers.
There are 4 methods in such class: push($x), pop(), getSize(), purge().
Please help me.
Class looks like :-
class Stack {

    private $stack = array();

    public function __construct() {
    }

    public function push($data) {
        array_push($this->stack, $data);
    }

    public function pop() {
        return array_pop($this->stack);
    }

    public function getSize() {
        return count($this->stack);
    }

    public function purge($element) {
        unset $this->stack[$element];
    }

}

$s = new Stack();

A: One test would be
$s = new Stack();
$s->push(1);
assertEquals($s->getSize(), 1);
$s->push(2);
assertEquals($s->getSize(), 2);
assertEquals($s->pop(), 2);
assertEquals($s->getSize(), 1);
assertEquals($s->pop(), 1);
assertEquals($s->getSize(), 0);


text:
Q: Import error with Python Django (Note: I have found a workaround, as stated at the bottom, but it seems like the wrong way to go about this.)
views.py and forms.py are both in
R:\\jeffy\\programming\\sandbox\\python\\django_files\\tutorial\\django_test\\django_test\\
and
R:\\jeffy\\programming\\sandbox\\python\\django_files\\tutorial\\django_test\\
is in Django's "Python Path"
But when attempting
from forms import MyRegistrationForm

in views.py, it results in an ImportError ... No module named 'forms'.
I changed it to
from django_test.forms import MyRegistrationForm

but that results in SyntaxError ... invalid syntax.
Since
R:\jeffy\programming\sandbox\python\django_files\tutorial\django_test\django_test
is a package (it has the empty __init__.py file in it), I thought I could refer to django_test in this way. (It's also the Django project name.)
I can manually add
R:\\jeffy\\programming\\sandbox\\python\\django_files\\tutorial\\django_test\\django_test\\
to the PYTHONPATH environment variable (Windows 7, 32 bit, Django 1.7c2), and get it to work. But since this implies that every Django project must be added to the PYTHONPATH, it seems like it should be able to work without having to do this.
Am I correct? Is there a way to import forms.py from views.py (which is in the same directory) without having to manually add its directory to the PYTHONPATH?
Thanks.

A: If it's in the same directory, try a relative import:
from .forms import MyRegistrationForm

EDIT: Someone posted this same suggestion as a comment already. I didn't see the comment.


text:
Q: Start NodeJS through pm2 with sudo privileges to access SSL keys I have a digital ocean droplet running Ubuntu 16.04. I followed this guide to use HTTPS with my NodeJS server.
In short
I used certbot to create an SSL certificate, which meant that at this directory /etc/letsencrypt/live/yourdomain.com/, 3 files were created:

*

*privkey.pem

*cert.pem

*chain.pem

So in my server code, I have to fetch these files, which I do:
// Certificate
const privateKey = fs.readFileSync('/etc/letsencrypt/live/yourdomain.com/privkey.pem', 'utf8');
const certificate = fs.readFileSync('/etc/letsencrypt/live/yourdomain.com/cert.pem', 'utf8');
const ca = fs.readFileSync('/etc/letsencrypt/live/yourdomain.com/chain.pem', 'utf8');

The Problem
When I tried to run my server using the command node server, or using pm2 start server I got this error message:
  { Error: EACCES: permission denied, open '/etc/letsencrypt/live/yourdomain.com/privkey.pem'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.<anonymous> (/home/myuser/mywebsite/lib/server-configurations.js:13:21)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/etc/letsencrypt/live/yourdomain.com/privkey.pem' }

BUT
When I tried launching it using sudo node server it did work without any problems.
Small Notice
I know I can change the permissions on the files but I would rather not do that as I have read multiple times that it is better not to change the permissions on these files.
And most importantly...
Thank you for your help :)

A: I did change permissions according to Let's encrypt SSL couldn't start by "Error: EACCES: permission denied, open '/etc/letsencrypt/live/domain.net/privkey.pem'"
That worked for running
node file.js
Still now pm2's process somehow can't access the certs even though it should be running as the same user as node... perplexing.

A: You can use this certbot script.
More info on certbot renewals might be helpful, as well as other solutions for this issue on the Let's Encrypt forums.


text:
Q: Segmentation fault caused after iterating through a queue. Possibly caused by unique_ptr? I keep getting a seg fault when I run an autocomplete function.
gdb gives the following seg fault error:
Program received signal SIGSEGV, Segmentation fault.
std::__uniq_ptr_impl<cs19::CompactStringSet::Node, std::default_delete<cs19::CompactStringSet::Node> >::_M_ptr (this=0x8) at /usr/include/c++/11/bits/unique_ptr.h:173
173           pointer    _M_ptr() const { return std::get<0>(_M_t); }

This is kind of a lot to post, the main part of the code to look at is right after the comment that says // step 3 to the end. I'm including the rest mostly for context.
In my function std::get<0> is a pointer. The seg fault might be because of the pop(), though in gdb it performed a pop() on one element prior to getting the seg fault. I'm using unique_ptrs which I'm not super familiar with, I know they're supposed to auto delete but I may be making errors in the implementation. The error is at while(sibling->sibling).
The function is expected to go through a dataset of chars which are linked in child/sibling fashion and return a std::vector of the fastest matches, but no more than n.
I know seg faults aren't cut-and-dry so I don't expect an exact answer, anything helps!
std::vector<std::string> CompactStringSet::autocomplete(const std::string& base, std::size_t n) const {
    // check children, if no match -> check siblings, if no match -> return empty vector; after
    // all matches to base, check all base->child->sibling then check each ->child
    // each option, add any which evaluate to terminal. Exit after n have been found,
    // or no options remain
    std::vector<std::string> results;
    std::queue<std::pair<const Node*, std::string>> matches;
    const Node* cur = &this->root_;
    std::size_t numResults = 0;
    // step 1 : READ IN BASE, MAKE SURE IT'S VALID
    for (auto let : base) {
        if (cur->child) {
            if (cur->child->letter == let) {
                cur = cur->child.get();
                continue;
            }
        }
        Node* sibling = cur->child.get();
        while (sibling->sibling) {
            sibling = sibling->sibling.get();
            if (sibling->letter == let) {
                cur = sibling;
                continue;
            }
        }
        return results;
    }
    // step 2 : start from after base and check options  make sure if terminal
    //          and initialize queue
    if (cur->child) {
        std::string toAdd = base + cur->child->letter;
        auto newElem = std::make_pair(cur->child.get(), toAdd);
        matches.push(newElem);
    }
    Node* newSibling = cur->child.get();
    while (newSibling->sibling) {
        newSibling = newSibling->sibling.get();
        std::string toAdd = base + newSibling->letter;
        auto newElem = std::make_pair(newSibling, toAdd);
        matches.push(newElem);
    }
    // step 3 : check each node*, if terminal add to results
    do {
        // check first in queue
        auto elem = matches.front();
        auto curNode = std::get<0>(elem);
        auto curStr = std::get<1>(elem);
        if (std::get<0>(elem)->terminal) {
            results.push_back(std::get<1>(elem));
            ++numResults;
        }
        if (curNode->child) {
            std::string updated = curStr + curNode->child->letter;
            auto newElem = std::make_pair(curNode->child.get(), updated);
            matches.push(newElem);
        }
        Node* sibling = curNode->child.get();
        while (sibling->sibling) {                // where error message occured
            sibling = sibling->sibling.get();
            std::string updated = curStr + sibling->letter;
            auto newElem = std::make_pair(sibling, updated);
            matches.push(newElem);
        }
        matches.pop();
    } while (numResults < n && matches.size() > 0);
    return results;
}

A: I suspect the error is here:
    if (cur->child) {
        if (cur->child->letter == let) {
            cur = cur->child.get();
            continue;
        }
    }

    Node* sibling = cur->child.get();
    while (sibling->sibling) {

In particular, the if (cur->child) test in the first line quoted above indicates that the code's author knows that cur->child might be a null unique_ptr, and is guarding against that possibility.  Fair enough.  But then just below that we have this code that sets sibling equal to (whatever cur->child points to, taken as a raw-pointer) and tries to dereference sibling in the next line.  In this case, if cur->child was NULL, then sibling will also be NULL, and therefore trying to evaluate sibling->sibling will cause a segfault.


text:
Q: How can I split up a long f-string in Python? I am getting a line too long PEP 8 E501 issue.
f'Leave Request created successfully. Approvers sent the request for approval: {leave_approver_list}'

I tried using a multi-line string, but that brings in a \n, which breaks my test:
f'''Leave Request created successfully.
Approvers sent the request for approval: {leave_approver_list}'''

How can I keep it single line and pass PEP 8 linting?

A: You will need a line break unless you wrap your string within parentheses. In this case, f will need to be prepended to the second line:
'Leave Request created successfully.'\
f'Approvers sent the request for approval: {leave_approver_list}'

Here's a little demo:
In [97]: a = 123

In [98]: 'foo_'\
    ...: f'bar_{a}'
Out[98]: 'foo_bar_123'

I recommend juanpa's answer since it is cleaner, but this is one way to do this.

A: Use parentheses and string literal concatenation:
msg = (
    f'Leave Request created successfully. '
    f'Approvers sent the request for approval: {leave_approver_list}'
)

Note, the first literal doesn't need an f, but I include it for consistency/readability.


text:
Q: How do I turn off wget proxy? I had been using a proxy for a long time. Now I need to remove it. I have forgotten how I have added the proxy to wget. Can someone please help me get back to the normal wget where it doesn't use any proxy. As of now, I'm using
wget <link> --proxy=none

But I'm facing a problem when I'm installing using a pre-written script. It's painstaking to search all through the scripts and change each command.
Any simpler solution will be very much appreciated.
Thanks

A: In case your OS is alpine/busybox then the wget might vary from the one used by @Logu.
There the correct command is
wget --proxy off http://server:port/

Running wget --help outputs:
/ # wget --help
BusyBox v1.31.1 () multi-call binary.

Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
        [-o|--output-file FILE] [--header 'header: value'] [-Y|--proxy on/off]
        [-P DIR] [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

        --spider        Only check URL existence: $? is 0 if exists
        -c              Continue retrieval of aborted transfer
        -q              Quiet
        -P DIR          Save to DIR (default .)
        -S              Show server response
        -T SEC          Network read timeout is SEC seconds
        -O FILE         Save to FILE ('-' for stdout)
        -o FILE         Log messages to FILE
        -U STR          Use STR for User-Agent header
        -Y on/off       Use proxy

A: Check your

*

*~/.wgetrc

*/etc/wgetrc
and remove proxy settings.
Or use wget --no-proxy command line option to override them.


text:
Q: Amazon Echo Account Linking - how to identify echo device when generating and saving token? I have a pre-existing web app with user accounts. I want to extend functionality with Amazon's echo.
When the user enables the skill in their Echo/Alexa dashboard, it will redirect them to the login page of my app with Authorization URL https://foo.com/auth.
I checked the incoming request that comes from Authorization URL https://foo.com/auth and there is no client id, user id, or user email on the request. It doesn't do me any good to generate a token and send it back to Amazon if I can't save that token on my webserver along with some kind of echo client device id.
From Account linking implicit granting

3 The user logs in using their normal credentials for your site.
4 Your service authenticates the user and then generates an access token
       that uniquely identifies the user in your system.

When amazon redirects users to my app to enter login credentials, how do I link their token I give back to them to their echo device for future requests?

A: You don't do that when the user enter his credentials, but after the linking is completed.
When the user launches your skill, you can identify him with the context.System.user.userId, the access token will be in  context.System.user.accessToken and the device in context.System.device. deviceId. The same accessToken can be used for multiple devices, and the userId will change if the user disables and re-enables your skill.
More info here: Request and Response JSON Reference


text:
Q: Extract number from string with jquery I need to extract number from string like

etc etc(5)

etc etc(-5)

I'm using this code
alert($("#example").text().match(/\((\d+)\)/)[1]);

It's work fine if the number is positive but in the case of a negative number
get error
Uncaught TypeError: Cannot read property '1' of null

please help me about that
thank's

A: Try this:
.match(/\((-?\d+)\)/)[1]

-? says "optional minus".

A: Try this instead:
alert($("#example").text().match(/\((-?\d+)\)/)[1]);

That will capture negative numbers as well.


text:
Q: How can I install different icons?
Possible Duplicate:
How do I get and install more themes, icons, and pointers?

I often find myself seeing new icons but I am unable to install them.
How do you install icons on Ubuntu? Can someone break down the process for me?

A: Drag and drop the theme package in the Appearance Preferences window
 (System->Preferences->Appearance) Theme tab.

A: To add a new icon theme, copy them into the hidden directory (control+h in nautilus to show hidden files) .icons in your home directory.
You should then be able to select them from Appearance Preferences.
If you don't have a ~/.icons directory, just create one.

A: If you just want to change an individual icon you should do the following:

*

*Download a .png image

*Right click the icon you want to change

*Go to Preferences and then click on the little image window on the upper left.
It will open a dialog where you can select the icon you wish to substitute for the old one.


text:
Q: Finding solutions of $x^{201}+x^{21}+x+1 \equiv 0 \mod 5$?
Find integral solutions of:
$x^{201}+x^{21}+x+1 \equiv 0 \mod 5$.

I know the solution is $3+5n, n \in \mathbb Z $ but I'm trying to work out how to get there.
The big exponents are throwing me off, what is the easiest method? I thought about plugging in the values of $\mod 5$ manually...

A: HINT
Note that by FLT
$$x^4\equiv 1 \mod 5$$
then
$$x^{201}+x^{21}+x+1\equiv x+x+x+1 \equiv 3x+1 \mod 5$$


text:
Q: Is the following function considered type-stable in Julia? I want to have a curried version of a function. So, I write the code as follows:
f(x::Int64, y::Int64) = x + y
f(x::Int64) = (y::Int64) -> f(x, y)

But I am not sure if Julia considers this an example of a type-unstable definition. On the face of it, one of the methods returns an anonymous function, while another returns an Int64. Yet, when the curried version is applied, the final result is also an Int64.
So, my questions are:

*

*Is this code type-stable?

*If not, is there a way to have a curried version of a function without writing type-unstable code?

Thanks in advance.

A: Yes, it is.
According to the official doc, you can investigate it by using the @code_warntype macro:
julia> @code_warntype f(1, 5)
MethodInstance for f(::Int64, ::Int64)
  from f(x::Int64, y::Int64) in Main at REPL[2]:1
Arguments
  #self#::Core.Const(f)
  x::Int64
  y::Int64
Body::Int64
1 ─ %1 = (x + y)::Int64
└──      return %1

The arguments of this function have the exact type Int64, and as we can see in the Body::Int64, the inferred return type function is Int64.
Furthermore, we have f(x) which is based on the type-stable function f(x, y):
julia> @code_warntype f(1)
MethodInstance for f(::Int64)
  from f(x::Int64) in Main at REPL[15]:1
Arguments
  #self#::Core.Const(f)
  x::Int64
Locals
  #3::var"#3#4"{Int64}
Body::var"#3#4"{Int64}
1 ─ %1 = Main.:(var"#3#4")::Core.Const(var"#3#4")
│   %2 = Core.typeof(x)::Core.Const(Int64)
│   %3 = Core.apply_type(%1, %2)::Core.Const(var"#3#4"{Int64})
│        (#3 = %new(%3, x))
└──      return #3

Here as well, there's not any unstable defined parameter type.
Look at the following as an example of an unstable-typed function:
julia> unstF(X) = x*5
unstF (generic function with 1 method)

julia> @code_warntype unstF(1)
MethodInstance for unstF(::Int64)
  from unstF(X) in Main at REPL[17]:1
Arguments
  #self#::Core.Const(unstF)
  X::Int64
Body::Any
1 ─ %1 = (Main.x * 5)::Any
└──      return %1

If you try this in the REPL, you'll see the Any appears with a red color. Since we have the Body::Any (Any with the red color), we can conclude that the returned object by this function is a non-concrete type object. Because the compiler doesn't know what is the x (Note that the input is X). So the result can be Anything! So this function is type-unstable for (here, for integer inputs. Note that you should investigate the type-stability of your function by your desired input(s). E.g., @code_warntype f(5) and @code_warntype f(5.) should be observed if I can pass it Float64 or Int64 either).


text:
Q: Daily chain sensors with HIGH/LOW signal output I'm working with 8 - 16 MTCH101 capacitive proximity sensors connected to one master MCU. Each sensor has a single output pin that is either HIGH or LOW.
Is there a general-purpose IC that I can use to daisy chain these sensors together to generate a serial value based on the output of each sensor? I could use a parallel-to-serial multiplexer, however, the sensors will each be on their own board and that would require each board to have a hardline to the multiplexer.
Ideally, there's just one bus that goes to each sensor and has a serial output at the end.
I could add a small microcontroller to each sensor board with custom firmware that does this. However, the 8-16 sensors are part of one module, and I'll be building 20+ modules, so a purpose-built IC would add one less thing to program and manage.


text:
Q: Ripple rings are in backside of map not infront I'm trying to work with Globe but Ripple rings always going on the backside of the map, not in front of it
I'm using https://github.com/vasturiano/globe.gl/blob/master/example/random-rings/index.html as source
and already I tried BackSide for ripple rings
Also is there anyway to disable rotate with mouse or disable mouseclick or drag
    const N = 2;
    const gData = [...Array(N).keys()].map(() => ({
        lat: 35.6892,
        lng: 51.3890,
        maxR: Math.random() * 20 + 10,
        propagationSpeed: 2,
        repeatPeriod:1000
    }));

    const colorInterpolator = t => `rgba(255,100,50,${Math.sqrt(1-t)})`;

    const world = Globe()
        (document.getElementById('globeViz'))
        .ringsData(gData)
        .ringColor(() => colorInterpolator)
        .ringMaxRadius('maxR')
        .ringPropagationSpeed('propagationSpeed')
        .ringRepeatPeriod('repeatPeriod')
        // .backgroundColor('rgba(0,0,0,0)')
        .showGlobe(false)
        .showAtmosphere(false);

    fetch('https://unpkg.com/world-atlas/land-110m.json').then(res => res.json())
    .then(landTopo => {
        world
            .polygonsData(topojson.feature(landTopo, landTopo.objects.land).features)
            .polygonCapMaterial(new THREE.MeshLambertMaterial({
                color: '#282828',
                side: THREE.DoubleSide
            }))
            .polygonSideColor(() => 'rgba(0,0,0,0)');
    });

    // Add auto-rotation
    world.controls().autoRotate = true;
    world.controls().autoRotateSpeed = 0.9;

Preview : https://i.ibb.co/JyjwPL7/s.png

A: According to the documentation, the default ringAltitude is 0.0015, whereas the default polygonAltitude is 0.01. If you set the ringAltitude to be greater than polygonAltitude, the rings will appear over the land shapes. Run the snippet below to see it in action.

const N = 2
const gData = [...Array(N).keys()].map(() => ({
  lat: 35.6892,
  lng: 51.389,
  maxR: Math.random() * 20 + 10,
  propagationSpeed: 2,
  repeatPeriod: 1000,
}))

const colorInterpolator = t => `rgba(255,100,50,${Math.sqrt(1 - t)})`

const world = Globe()(document.getElementById('globeViz'))
  .ringsData(gData)
  .ringColor(() => colorInterpolator)
  .ringMaxRadius('maxR')
  .ringPropagationSpeed('propagationSpeed')
  .ringRepeatPeriod('repeatPeriod')
  .ringAltitude(0.015) // <--- change of interest.

fetch('https://unpkg.com/world-atlas/land-110m.json')
  .then(res => res.json())
  .then(landTopo => {
    world
      .polygonsData(topojson.feature(landTopo, landTopo.objects.land).features)
      .polygonCapMaterial(
        new THREE.MeshLambertMaterial({
          color: '#282828',
          side: THREE.DoubleSide,
        }),
      )
      .polygonSideColor(() => 'rgba(0,0,0,0)')
  })

// Add auto-rotation
world.controls().autoRotate = true
world.controls().autoRotateSpeed = -0.9


text:
Q: How deploy with maven-glassfish-plugin on my Linux server? I try to deploy my web application on Linux Server.
When I deploy on local Server GlassFish : It's ok.
But, when I try to deploy on Linux Server Glassfish : maven try to call "asadmin.bat" in my  local computer (OS : Windows). So Build is failed. I want Maven call "asadmin shell script" on the Linux Server.
How can I declare to maven-glassfish-plugin the server Linux ?

A: You have to use a local asadmin.bat to delpoy on the remote Linux-Server.
Configure the maven-glassfish-plugin so that the glassfish-dir points on a local glassfish(windows) e.g.:
<plugin>
                <groupId>org.glassfish.maven.plugin</groupId>
                <artifactId>maven-glassfish-plugin</artifactId>
                <configuration>
                    <glassfishDirectory>C:\glassfish3\glassfish</glassfishDirectory>
                    <user>remote_admin</user>
                    <adminPassword>remote_adminPassword</adminPassword>
                    <domain>
                        <name>remote_domain</name>
                        <host>remote_host</host>
                        <adminPort>remote_adminPort(4848)</adminPort>
                    </domain>
                    <components>
                        <component>
                            <name>${project.artifactId}</name>
                        <artifact>${project.build.directory}/${project.build.finalName}.war</artifact>
                        </component>
                    </components>
                </configuration>
....
<plugin>


text:
Q: How to get battery temperature updated in every 10 seconds in android
Possible Duplicate:
Get temperature of battery on android

I am new to android, making an app which shows the battery temperature of the android updated in every 10 seconds...please help me out
      public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
       // setContentView(R.layout.activity_blue_tooth);

        LinearLayout big = new LinearLayout(this);
        big.setOrientation(LinearLayout.VERTICAL);

    LinearLayout small[]= new LinearLayout[5];

    for(int i=0; i<5; i++)
    {
        small[i]= new LinearLayout(this);
    small[i].setOrientation(LinearLayout.HORIZONTAL);
    LinearLayout.LayoutParams linearparams1 = new LinearLayout.LayoutParams(
            LinearLayout.LayoutParams.MATCH_PARENT,
            LinearLayout.LayoutParams.MATCH_PARENT);

     temp = new TextView(this);
     small[i].addView(temp);

       volt= new TextView(this);
      small[i].addView(volt);

        big.addView(small[i]);
    }
        setContentView(big);

        this.registerReceiver(this.mBatInfoReceiver,
        new IntentFilter(Intent.ACTION_BATTERY_CHANGED));

      }

      private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver(){

        @Override
        public void onReceive(Context arg0, Intent intent) {
          // TODO Auto-generated method stub
            int temperature = intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, 0);
            int voltage= intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE,0);
            temp.setText("Temperature="+String.valueOf(temperature) + "%");
          volt.setText("   " +"Voltage="+String.valueOf(voltage) + "%");
        }
      };

I am getting battery temperature and voltage but I'm unable to update this for every 10 seconds


text:
Q: Does Office 365 have a preferred way of sending attachments when using MailKit? I've written a console application which sends out emails, I'm attaching the emails using the BodyBuilder() class like so...
builder.Attachments.Add(path + id + ".docx");
If I send these emails using an on prem exchange server, they're attached and viewable fine, if I send them using Office 365, they're sent and received fine, the attachments are attached fine, however the files appear to be corrupt and can not be viewed.
Do I need to do something extra in order to attach them properly when using Office 365 to send the emails?
Thanks,


text:
Q: How to connect EVB- ADC7606BSTZ to MCU (STM32)? I try to connect the EVAL-7606BSTZ to my application, my MCU -
user guide for EVAL:https://www.analog.com/media/en/technical-documentation/user-guides/EVAL-AD7605-4SDZ_7606SDZ_7606-6SDZ_7606-4SDZ_7607SDZ_7608SDZ.pdf
I have in my MCU, SPI block, but I'm not sure how to connect the ADC to STM32 , it's not a standard SPI protocol(in the side of the ADC), there are signals like ~CS and SCLK, and that's all, but how to interface with the ADC? this is just reading ?
this is the schematic of the EVAL

and this is the datasheet of the IC:https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606_7606-6_7606-4.pdf
you can see from the datasheet this connection :

I will ask again, this is just reading? how to configure the relevant register to it?


text:
Q: Parse.com pushnotification shedule error I am trying to set a push notification background job. - I am getting  following error while running the background job-
E2015-02-15T21:45:23.581Z] v20: Ran job push_job with:
  Input: {}
  Failed with: success/error was not called
This is  my code- Kindly help me to figure this out
 Parse.Cloud.job("push_job", function(request, response) {

Parse.Cloud.define('httpRequest', function(request, response) {

 Parse.Cloud.httpRequest({

  method: "POST",
  headers: {
  "X-Parse-Application-Id": "xxxxxxxcxxxxxxxxxxxxx",
  "X-Parse-REST-API-Key": "xxxxxxxxxxxxxxxxxxxxxx",
  "Content-Type": "application/json"
  },
body: {
   "data": {
    "alert": "Local push notification"
  }
 },
 url: "https://api.parse.com/1/push"
 }).then(function() {
response.success();
console.log("Successful push");
 }, function(error) {
response.error(error);
console.log(error);
});
});
});

A:    Parse.Cloud.job("PushNtfct_job_TimeEnable", function(request, status) {

   function dateFormat(date, format) {
// Calculate date parts and replace instances in format string    accordingly
   format = format.replace("DD", (date.getDate() < 10 ? '0' : '') +   date.getDate());
 // Pad with 0 if needed
format = format.replace("MM", (date.getMonth() < 9 ? '0' : '') + (date.getMonth() + 1));
// Months are zero-based
  format = format.replace("YYYY", date.getFullYear());
 return format;
}

   var Today = dateFormat(new Date(), "YYYY-MM-DD")+ "T01:25:00";
   // this will sent push notification at 1:25 am daily
 Parse.Push.send({
channels: [ "" ],
 push_time: new Date(Today),
 data: {
 alert: "Today's Push"
  }
 }, { success: function() {
  console.log("Succuss with Time, Local Push notification time was sent    at : " + Today);
 }, error: function(err) {
  console.log(err);
 }
}).then(function() {
  // Set the job's success status
  status.success("Successfully Ran");
}, function(error) {
  // Set the job's error status
   status.error("damn error");
 });
 });


text:
Q: How to duplicate a block of form using jQuery I am very new to jQuery, so please bear with me!
I need to duplilicate a chunk of a form where the user can create multiple/indefinite job roles.  I found an approxination of what I was looking for here: Repeating div with form fields, but it doesn't quite finish the job.
What was wrong:
It didn't add a new number to each form field of the new blocks to make them complete.
What I still need:
To add a new heading to the top of each block with an increment of 1 each time (Job 2, Job 3, etc)
Form fields whos IDs and "for"s increment by one each time (primaryJobRole2, primaryJobRole etc)
I managed to get the increasing numbers on to the elements, but the issue is the first time it will be primaryJobRole2, then next time it will be primaryJobRole23 etc.
I'm sure the answer is right in front of me, but I have developed tunnel vision!  Thanks in advance.
My HTML is:

Current Role

  Job Role:
  <input id="primaryJobRole" name="primaryJobRole" type="text">

  Current Organisation Name:
  <input id="currentOrganisation" name="currentOrganisation" type="text">

  Current Title:
  <input id="currentTitle" name="currentTitle" type="text">

jQuery is:
$('.add-role').click(function(){
    var currentCount =  $('.repeat-role').length;
    var newCount = currentCount + 1;
    var newHeading = $('.repeat-role h3').append(' ' + newCount);
    var lastRepeatingGroup = $('.repeat-role').last();
    var newSection = lastRepeatingGroup.clone();

    lastRepeatingGroup.removeClass('current-role');
    newSection.insertAfter(lastRepeatingGroup).hide().addClass('current-role new-role').slideDown(1000);
// this is what I did that adds a number each time instead of incrementing
    newSection.find("input").each(function (index, input) {
        var i = $(this).attr('id');
        $(this).attr('id', i + newCount);
    });
// this is what was with the original script which doesn't seem to work at all
    newSection.find("label").each(function (index, label) {
        var l = $('label');
        l.attr('for', l.attr('for').replace("_" + currentCount, "_" + newCount));
    });
    return false;
});

JSFiddle here: http://jsfiddle.net/vmail/hdw4gyyv/

A: Instead of trying to modify the last section, I edited your logic to use the original section as a template for each new section.  This way you only need to append the new count instead of trying to replace them.
$('.add-role').click(function () {
    var currentCount = $('.repeat-role').length;
    var newCount = currentCount + 1;
    var lastRepeatingGroup = $('.repeat-role').last();
    var template = $('.repeat-role').first();
    var newSection = template.clone();
    var newHeading = $('h3', newSection).append(' ' + newCount);

    lastRepeatingGroup.removeClass('current-role');
    newSection.insertAfter(lastRepeatingGroup).hide().addClass('current-role new-role').slideDown(1000);
    newSection.find("input").each(function (index, input) {
        var i = $(this).attr('id');
        $(this).attr('id', i + newCount);
    });
    newSection.find("label").each(function (index, label) {
        var l = $(this);
        l.attr('for', l.attr('for') + newCount);
    });
    return false;
});

http://jsfiddle.net/hdw4gyyv/1/
UPDATE:
I've updated the answer and fiddle to use .on() instead of .click().  Only the first line is affected:
$(document).on('click', '.add-role', function () {
  ...
});

Fiddle: http://jsfiddle.net/sb8fyehv/


text:
Q: Liferay 6: Can the Liferay Friendly URL can be modified in my case I am using liferay 6.1
I have added this inside the liferay-portet.xml file
<friendly-url-mapper-class>com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper</friendly-url-mapper-class>
<friendly-url-mapping>Gasd</friendly-url-mapping>
<friendly-url-routes>com/test/friendlier-friendly-url-routes.xml</friendly-url-routes>

And as per the COntext root (Or the Portlet name ) this is my friendlier-friendly-url-routes.xml
<routes>
<route>
    <pattern>/satportlet</pattern>
</route>
</routes>

But still the URL of that Portlet looks this way when i did a Submit Operation
http://localhost:8086/web/guest/home/-/Gasd/satportlet?p_auth=EFAy7VSA&p_p_lifecycle=1&_satportlet_WAR_SatPractportlet_javax.portlet.action=addBook

Is there anyway that this can be improved .
I am very much new to Liferay , please suggest me , i am ready to do chnages as you mention .

A: Yes it can be improved.
For Example for a render URL in JSP, to view a User in the portlet:
<portlet:renderURL windowState="maximized" var="myURL">
    <portlet:param name="resourcePrimKey" value="<%=user.getUserId() %>" />
    <portlet:param name="jspPage" value="/html/viewMyUser.jsp" />
</portlet:renderURL>

You can have the friendly URL route in your friendlier-friendly-url-routes.xml like this:
<route>
    <pattern>/satportlet/{resourcePrimKey:\d+}/view</pattern>
    <!-- \d+ is the place-holder for the userID, i.e. 5 in the friendly URL below -->
    <implicit-parameter name="p_p_lifecycle">0</implicit-parameter>
    <!-- Implicit parameters are not shown in the route pattern, here 0,1 etc are the phases of the portlet 0=render, 1=action etc -->
    <implicit-parameter name="p_p_state">maximized</implicit-parameter>
    <implicit-parameter name="jspPage">/html/viewMyUser.jsp</implicit-parameter>
</route>

So the generated friendly URL would be:
http://localhost:8086/web/guest/home/-/Gasd/satportlet/5/view

In your case looking at your generated URL you can have the <route> element something like this (if the <portlet:actionURL> or <portlet:renderURL> you are using in the JSP was given I think it would be a little helpful to build the <route> element). I am not sure if this would be perfectly correct but it would be something like this:
<route>
    <pattern>/satportlet/{p_auth}/{[p_p_id]_javax.portlet.action:\d+}</pattern>
    <implicit-parameter name="p_p_lifecycle">1</implicit-parameter>
</route>

So I guess (again I am not sure enough) with the above configuration it should generate the friendly URL as:
http://localhost:8086/web/guest/home/-/Gasd/satportlet/EFAy7VSA/addBook

You can also check liferay's source code and the *-friendly-url-routes.xml files for a much better understanding.
Hope this atleast gives you a clue as to how the friendly URLs work in liferay.


text:
Q: What is the most appropriate way to wrap and vertically align checkboxes and radio buttons in Bootstrap? This is my first major attempt at building a form with Bootstrap after 2 days of reading and researching about Bootstrap.  I was instructed to build a form that closely matches an old Access form.  I've included a portion of the form below.  It's a combination of inline and horizontal, and you're seeing the inline portion.
Am I syntactically correct?  Am I doing this right?
What is the Bootstrap-recommended way of wrapping checkboxes and radio buttons for an inline form?  Did I do it correctly in the examples below?
How do I vertically align checkboxes/radios inside a row?
Any love or advice or recommendations are always appreciated.

.custom-margins {
  margin-top: 7px;
  margin-bottom: 7px;
}

.strong-border {
  border-top: 2px solid black;
}

.intro-row {
  margin-top: 15px;
  margin-bottom: 15px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />

        Name:
        <input id="Name" name="Name" class="form-control" type="text" size="50" value="" readonly>

        Emp No:
        <input id="EmployeeNbr" name="EmployeeNbr" type="text" size="6" class="form-control" value="" readonly>

        SSN:
        <input id="SSN" name="SSN" type="text" value="" class="form-control" size="11" readonly>

        Verification Date:
        <input id="DateStamp" name="DateStamp" class="form-control" type="text" size="10" value="" readonly>

        Last Pay Date:
        <input id="LastPayDate" name="LastPayDate" class="form-control" type="text" size="10" value="" readonly>

        Notary Required?

          <input type="checkbox" id="NotaryReq" name="NotaryReq" value="1">

          Status:
          <input id="Status" name="Status" class="form-control" type="text" size="2" value="" readonly>

          Hire Date:
          <input id="HireDate" name="HireDate" class="form-control" type="text" size="10" value="" readonly>

          Term Date:
          <input id="TermDate" name="TermDate" class="form-control" type="text" size="10" value="" readonly>

        Currently Employed?

          Yes:  <input type="radio" id="EmpY" name="currentEmployee" value="true">

          No:  <input type="radio" id="EmpN" name="currentEmployee" value="false">

A: Yes you are, except for the radio buttons, if you want to make the label clickable then you should use the same way as the other inputs

      Yes:
      <input type="radio" id="EmpY" name="currentEmployee" value="true">

      No:
       <input type="radio" id="EmpN" name="currentEmployee" value="false">


text:
Q: Thinkpad T470 touchpad buttons not working after upgrading to Windows 10 Pro The machine is freshly bought and I upgraded its system from the pre-installed Windows 10 Home Single Language Edition to Windows 10 Pro via the windows store and after that the touchpad buttons don't respond to clicking or pressing or whatsoever at all. I couldn't find anywhere this problem has been addressed. What are the possible causes and solutions?

A: This was solved by updating its mouse and keyboard driver: Drivers & Software

A: Probably you do not need this information now but maybe it will help someone.
I bought t470 and had the same problem with stock win 10 pro. I thought about sending it back but I uninstalled touch driver and probably now windows uses some default one. I have almost fully working touchpad with buttons (of course there is no fancy functionalities like shrinking touch area).

A: Download the latest Ultranav driver from lenovo. The trick is to find the C:\DRIVERS\UltraNav\SynPD.inf file in the directory the driver extracts to. right click and choose "install" it will prompt restart computer. It should work afterwards.


text:
Q: USB stick is automatically getting disconnected When i plug in my usb stick it doesn't get mounted. So i check dmesg. There i could see that stick is getting connected initially but in a second its getting disconnected.
dmesg output:
[  734.488450] usb 3-7: new high-speed USB device number 6 using xhci_hcd
[  734.505175] usb 3-7: New USB device found, idVendor=0781, idProduct=5406
[  734.505182] usb 3-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  734.505185] usb 3-7: Product: U3 Cruzer Micro
[  734.505188] usb 3-7: Manufacturer: SanDisk
[  734.505190] usb 3-7: SerialNumber: 173971115603386C
[  734.505645] usb-storage 3-7:1.0: USB Mass Storage device detected
[  734.505718] scsi7 : usb-storage 3-7:1.0
[  735.053026] usb 3-7: USB disconnect, device number 6

fdisk -l shows only this:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1   976773167   488386583+  ee  GPT

lsusb doesn't list my stick.
What could be the problem ?
On windows 7 it gives the error "Device driver is not properly installed".

A: Your USB stick is busted!
Sorry to be the harbinger of bad news and I hope you've got a back-up of the data it contains, but this is typical behaviour of a USB stick whose control circuit is broken...
If you have no backup: It looks like the control circuit is broken as it gets connected/disconnected/connected/disconnected/...  Probably the memory chip itself is still OK, so if you have an identical disk, you repair the USB stick ;-) or take it to an electronics shop and have it repaired for you.
Warning: Repairing a USB stick will be much more expensive then just throwing it away and buying a new one!  This is only to be attempted if it contains critical data.
It's always good to have a back-up of everything!


text:
Q: Adding text to D3js shape created (rectangle & triangle symbol)
I'm not sure why i cannot use both code for adding text to triangle and rectangle together.
If i'm using both, only text for triangle will be displayed. Text for rectangle should displayed at yellow.
If i remove code for adding text to triangle, then only text for rectangle will be displayed.
Below is my code for creating the shape and adding text.
    let axes_width2: any = 900;
    let axes_height2: number = 150;
    let axes_svg2: any = d3select
            .selectAll('tr')
            .append("svg")
            .attr("width", axes_width2)
            .attr("height", axes_height2);
    // Create scale
    let scale: any = d3select.scaleTime()
            //.domain([d3select.min(data), d3select.max(data)])
            .domain([new Date(2020, 0, 1), new Date(2021, 0, 1)])
            .range([40, axes_width - 30]);
//golive date
    var myData = [new Date(2020, 3, 1), new Date(2020, 6, 1)];
          var testdata = [{ start: new Date(2020, 2, 0), close: new Date(2020, 9, 0) }];
//draw rect2
        axes_svg2
            .selectAll('rect')
            .data(testdata)
            .enter()
            .append("rect")
            .style("fill", "#00a19c")
            .attr("x", function (d) {
                return scale(d.start);
            })
            .attr("y", 80) //distance from axis
            .attr("width", function (d) {
                return (scale(d.close) - scale(d.start));
            })
            .attr("height", 20); //height

    //create symbol
        var symbol = d3select.symbol().size(150).type(d3select.symbolTriangle);

        //create triangle
        axes_svg2
            .selectAll('path')
            .data(myData)
            .enter()
            .append('path')
            .attr('width', 50)
            .attr('height', 50)
            .style("fill", "#232496")

            //.attr('transform', 'translate(50, 50)')
            .attr('d', function () { return symbol(); })
            .attr('transform', function (d, i) { return "translate(" + (scale(d)) + "," + (60) + ")"; });

        //add text to triangle
        axes_svg2
            .selectAll('text')
            .data(myData)
            .enter()
            .append("text")
            .attr("x", function (d) {
                return scale(d) + 10;
            })
            .attr("y", 60)
            .attr("stroke", "black")
            .attr("font-size", "12px")
            //.attr("font-family","Museo Sans 300")
            .text("Go-Live");

        //add text to rectangle
        axes_svg2
            .selectAll('text')
            .data(testdata)
            .enter()
            .append("text")
            .attr("x", function (d) {
                return scale(d.start);
            })
            .attr("y", 120)
            .attr("stroke", "black")
            .attr("font-size", "12px")
            //.attr("font-family","Museo Sans 300")
            .text("Start Date");

A: I make changes as below :
//add text to rectangle
        axes_svg2
            .selectAll('null')
            .data(testdata)
            .enter()
            .append("text")
            .attr("x", function (d) {
                return scale(d.start);
            })
            .attr("y", 120)
            .attr("stroke", "black")
            .attr("font-size", "12px")
            //.attr("font-family","Museo Sans 300")
            .text("Start Date");


text:
Q: Where store computed values in redux What do you advice to where to store computed values? Example: API serves to me product property as union of 1 | 2 | 3. In app this is interpreted as normal | premium | platinum. When user changes this, to API goes as 1 | 2 | 3. What is the most reliable way to store? As original API values (and use selectors or similar and compute) or values which I use on front?

A: You are displaying normal | premium | platinum as a visual representation of the actual numeric API values. Since you will need the numeric values again, translating them back and forth bears the risk of values of introducing errors, e.g. when a new state is added by another developer.
My recommendation is: Internally work with the numeric values. If it comes to showing them to the user, use a selector like selectNameForProduct that will give you the strings. Then you have only one place where you need to deal with an maintain the strings.


text:
Q: Merge two columns in MySQL and ignore the NULL MySQL data table are as follows:
Column1   Column2
A         NULL
B         NULL
NULL      C
NULL      D
NULL      NULL

Need output as follows:
Column3
A
B
C
D
NULL

How can i get this merging?
MySQL query would be preferable.
If no options available in the end then i can look for python code.

A: select COALESCE(Column1, Column2) as Column3 from tablename

This is working.

A: You need to join tables on common columns and use case in mysql.
You can do something as below..
CREATE TABLE new_tbl [AS] SELECT CASE
    WHEN orig_tbl1.col1 IS NOT NULL THEN orig_tbl1.col1
    WHEN orig_tbl1.col2 IS NOT NULL THEN orig_tbl1.col2
    ELSE NULL
    END , orig_tbl1.col2,orig_tbl1.col3,
 FROM orig_tbl1,orig_tbl2 where orig_tbl1.id = orig_tbl2.id ;

You can try this link.  https://stackoverflow.com/a/8600850/1069633


text:
Q: Submit data to PHP, and get the result I would like to submit some data. Weather this be using a form, or onClick execute some AJAX, I'm not sure.
For example, I have this input
<input id='inpamount' type="text" name="amount" value="2.00" onkeyup="pad();validatemin();product()">

Now say if I wanted to send this data to a PHP file, using post ( i could just add a form). But then, without reloading the page (I can do this), how could I fetch a response (using AJAX).
Essentially I would like a user to be able to press a button, then to submit the inputs to a php file, and then get the output and assign it to a variable (I know how to do this, I just want to be able to get the data.
The php execute takes a few centiseconds because it comunicates with SQL. (If this matters).
I have considered using invisible forms but it didn't seem to work
If anyone could point me in the right direction, that would be great.

A: Something like this?
$(document).ready(function(e) {

       $('#inpamount').click(function() {

            var data = 'myValue=' + $(this).val();

            $.ajax({
                url: "yourscript.php",
                type: "POST",
                data: data,
                cache: false,
                success: function(scriptOutput) {
                   //handle the result
                    }
                }
            });
            return false;
        });
    });


text:
Q: Get versions from item I am trying to get all versions from an list item and tried following:
$listName = "VersionHistoryStatistics"
Connect-PnPOnline -Url "xxx"

$ctx= Get-PnPContext
$list = $ctx.Web.Lists.GetByTitle($listName)
$item = $list.GetItemById(1);
$versions = $item.Versions
$ctx.Load($list)
$ctx.Load($item)
$ctx.Load($versions)

Error: Cannot find an overload for "Load" and the argument count: "1". Any idea on whats causing this? Its the last line throwing the error.

A: Figured out it was a mismatch between two PnP versions. After uninstalling all PnP versions and reinstalling it worked.


text:
Q: How to backup /proc folder with >2000 subfolders and 140TB kcore file? I found the /proc folder with >2000 subfolders and a kcore data with 140TB. All created at the same time. What is this? All the folders are named from 1 to 2634 and have all 44 subentries...
Using ubuntu 12.04
Thanks

The problem appears when i try to back up my entire system... but when i back up, it seems try to backup the kcore file (which is 130TB, so impossible to do)
any suggestions?
Thanks

A: The /proc filesystem is a virtual filesystem that contains file representations of information about the running system.  In other words, they do not really exist on any disk, so you should generally ignore it unless you have a reason to tweak some of the settings it provides access to.
The numbered directories contain information about running processes.  The kcore file allows access to the entire kernel virtual address space, which is 128 TB on amd64.
Other virtual filesystems include /dev and /sys.


text:
Q: Unable to access codeigniter controller in Live Server but accessible in localhost (xampp on windows) My project working fine on local system (XAMPP) , however when uploaded to hosting server its not working. Im Using Codeigniter framework. accesible in localhost via "localhost/myproject/controller" , but in host server unable to access via myproject.com/controller or even myproject.com/index.php/controller !!
On server, main domain is (lets suppose D.COM and add on domain is AD.COM). My application is installed under addon domain. hence my folder structure is
public html/
            AD.COM/
                  application/
                              Config
                              Controllers
                              Modules
                              Views
                  System/
                 User_guide/
                .htaccess

.htaccess contains this code
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

Also maintained these variables
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

how to fix this. I tried googling but didnt get any help. Thanks in advance.

A: Please be concern about Codeigniter naming conversion and Keep mind Linux host is Case-Sensitive.
You are not providing any resources related to your question.  So have to tell is check about Spellings of your url and controller names and methods which you will call further.


text:
Q: Get Path of my toolboxes ESRI addins Python 2.7 I need my toolboxes path. These are in the installation folder (toolboxes) but when using the function:
dir_tools = os.path.join(os.path.dirname(__file__),r'toolboxs\parametros.tbx')

result:
  C:\Users\xxx\AppData\Local\ESRI\Desktop10.4\AssemblyCache{8F89910B-C991-4EAA-B2A5-294D1F72C1A4}\toolboxs\parametros.tbx

Return path of system, not path installation folder.
How do I get the path of the installation folder?

A: This is not quite what you want, but you may be able to adapt it for your purposes.
import os
import arcpy
from os.path import expanduser

home = expanduser("~")
arcGISver = arcpy.GetInstallInfo()['Version']
path = r"{}\AppData\Roaming\ESRI\Desktop{}\ArcToolbox\My Toolboxes".format(home,arcGISver)

The basic idea is that these paths tend to be mostly static and we can rely on Python and arcpy functionality to fill in for parts that do change.
Not the best solution - I'd prefer some built-in function call in arcpy, but that doesn't appear to exist.


text:
Q: How to call a stored procedure of oracle using C#? Hi I have a stored procedure in oracle for insert in my table employee
Here it is my stored procedure it works fine
CREATE OR REPLACE PROCEDURE insert_Emp(idEmp in NUMBER, nameEmp in VARCHAR2,
addressEmp in VARCHAR2, emailEmp in VARCHAR2,
phoneEmp in CHAR, sexoEmp in CHAR, duiEmp in CHAR, nitEmp in CHAR, salaryEmp in NUMBER, userEmp in VARCHAR2,
contraEmp in VARCHAR2, cargoEmp in VARCHAR2, activoEmp in CHAR)
IS
BEGIN
    INSERT INTO EMPLEADO(IdEmpleado, Nombre, Direccion, Email, Telefono, Sexo, Dui, Nit, Sueldo, Usuario, Contraseña, Cargo, Activo)
    VALUES (idEmp, nameEmp, addressEmp, emailEmp, phoneEmp, sexoEmp, duiEmp, nitEmp, salaryEmp, userEmp, contraEmp, cargoEmp, activoEmp);
    COMMIT;
END;
/

But the problem is when I call it in my program from C#, I can't use my sequence EMP_SEQ.nextvalue
OracleCommand cmd = new OracleCommand("INSERT_EMP", DataBase.Conexion());
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add("idEmp", OracleDbType.Decimal).Value = EMP_SEQ.nextval;
                    cmd.Parameters.Add("nameEmp", OracleDbType.Varchar2).Value = txtNombre.Text;
                    cmd.Parameters.Add("addressEmp", OracleDbType.Varchar2).Value = txtDireccion.Text;
                    cmd.Parameters.Add("emailEmp", OracleDbType.Varchar2).Value = txtEmail.Text;
                    cmd.Parameters.Add("phoneEmp", OracleDbType.Char).Value = txtTelefono.Text;
                    cmd.Parameters.Add("sexoEmp", OracleDbType.Char).Value = cb_sexo.Text;
                    cmd.Parameters.Add("duiEmp", OracleDbType.Char).Value = txtDUI.Text;
                    cmd.Parameters.Add("nitEmp", OracleDbType.Char).Value = txtNIT.Text;
                    cmd.Parameters.Add("salaryEmp", OracleDbType.Decimal).Value = txtSueldo.Text;
                    cmd.Parameters.Add("userEmp", OracleDbType.Varchar2).Value = txtUser.Text;
                    cmd.Parameters.Add("contraEmp", OracleDbType.Varchar2).Value = tb_contraseña.Text;
                    cmd.Parameters.Add("cargoEmp", OracleDbType.Varchar2).Value = cb_cargo.Text;
                    cmd.Parameters.Add("activoEmp", OracleDbType.Char).Value = obtenerEstado();
                    OracleDataAdapter da = new OracleDataAdapter(cmd);
                    cmd.ExecuteNonQuery();

So how can I put my sequence without any problem?

A: Shouldn't EMP_SEQ.nextvalue be used in the stored procedure, not sent to it?  Something like:
INSERT INTO EMPLEADO(IdEmpleado, Nombre, Direccion, Email, Telefono, Sexo, Dui, Nit, Sueldo, Usuario, Contraseña, Cargo, Activo)
VALUES (EMP_SEQ.nextvalue, nameEmp, addressEmp, emailEmp, phoneEmp, sexoEmp, duiEmp, nitEmp, salaryEmp, userEmp, contraEmp, cargoEmp, activoEmp);

(Or perhaps placed into a variable on a previous line and then use the variable in the query, whichever you prefer.)
Then your stored procedure wouldn't need to expect an identifier, it would be internally generating one.  So the idEmp parameter can be removed entirely.


text:
Q: retrieve SSH unique session ID I wonder if there is any way to retrieve, for both a server and a client connected through ssh (OpenSSH), some unique session identifier (let this be USID).
This would be used to restrict the execution of a specific (custom) software (let it be a.exe), so it can only be executed through a specific ssh session, even if other users (potentially root) have access to that executable:

*

*after a ssh session is opened from machine C (client) to machine S (server), machine C (which knows the USID) will update a record on machine X (a third-party server), letting it know that this USID is "safe".

*a.exe on machine S will check, when invoked, if the USID of the current session is "safe" (this information will be provided by X) and will halt execution if negative answer received.

The communication channels between X and C, X and S are secure, so the only issue here is retrieving that USID without having to write my own ssh client and/or server.
Any ideas?

A: seems to me in a round about way, you are trying to re-implement kerberos. Seems to me that you want to GSSAPI secure the transport between client and server; so your client needs to authenticate to the server.
Typical way of doing this would be to 'kinit' to a prinicpal using a keytab, and then passing this credential to the server. Kerberos ensures that it's reasonably hard to fake.
that's probably going to be a little less brittle than the method that you describe above.
-Ace


text:
Q: Which is the fastest and easiest way to install 10 indentical computers? In a few days I'll have to install 10 brand new pc that identical on the hardware side.
Starting from windows 7 professional and ending to applications, settings and users.
I thought about preparing a "perfect pc" and then clone it with clonezilla...
But then I should change, at least, computer name I think...
Any better hints?
Thanks for helping :)

A: Whatever imager you use, you should definitely use Microsoft's Sysprep to prepare your original image for deployment. This goes especially if the target computers are on the same network, because Windows uses unique identifiers for users and computers to manage access rights - Sysprep deletes all these IDs for regeneration.
There's other tools to do that, too - but Sysprep is by far the simplest for a small number of target PCs, especially with identical hardware: You just make a fresh install of Windows, make all your preparations, and when you're done, you run Sysprep and shut down.
The next time you run this sysprepped Windows, it will perform a Mini-Setup, so be sure you take the image right after shutting down.

A: You could use Acronis True Image, set up one computer with all applications, settings, etc. and then create an image of the hard drive. As long as the computers use the same hardware, you can then copy the image over to the other machines.
You will then also have an image that you can use as a rescue backup in case something goes wrong or one system has a major hiccup.
(Everything else has some overhead in setting up, I think. Like using deployment techniques for server domains, etc.)

A: If this is something you think you will be doing often you might look into Windows Deployment Services, but if this is going to be a one time thing I would make one drive exactly how I wanted it then use your backup/restore software of choice (Acronis, Ghost, Paragon, etc.) to perform a drive to drive copy.  Hirens Boot CD has lots of different backup software on it... and I think the current version of Hirens Boot CD is actually legal (no pirated program like the older versions).


text:
Q: Flutter package 'epub_parser 3.0.1' fails due to dependency conflicts Package errors:

*

*Because epub_parser 3.0.1 depends on image ^3.1.3 and no versions of epub_parser match >=3.0.0 <3.0.1-∞ or >3.0.1 <4.0.0, epub_parser ^3.0.0 requires image ^3.1.3,

*And because flutter_native_splash >=2.2.18 depends on image ^4.0.15, flutter_native_splash >=2.2.18 is incompatible with epub_parser ^3.0.0.

*And because epub_view_enhanced 1.6.0 depends on epub_parser ^3.0.0 and no versions of epub_view_enhanced match >1.6.0 <2.0.0, flutter_native_splash >=2.2.18 is incompatible with epub_view_enhanced ^1.6.0.

*So, because dyubooks depends on both epub_view_enhanced ^1.6.0 and flutter_native_splash ^2.2.18, version solving failed.

pub get failed
command: "/Users/shakib/flutter/bin/cache/dart-sdk/bin/dart __deprecated_pub --directory . get --example"
pub env: {
  "FLUTTER_ROOT": "/Users/shakib/flutter",
  "PUB_ENVIRONMENT": "vscode.dart-code:flutter_cli:get",
  "PUB_CACHE": "/Users/shakib/.pub-cache",
}
exit code: 1

This is my pubspec.yaml:
environment:
  sdk: '>=2.19.1 <3.0.0'

dependencies:
  advance_pdf_viewer:
    git:
      url: https://github.com/lohanidamodar/pdf_viewer.git
      ref: 4e5d96be29de515f1081c0b6897741b8dca84722
  audio_session: ^0.1.13
  bottom_bar: ^2.0.3
  carousel_slider: ^4.2.0
  country_pickers: ^2.0.0
  cupertino_icons: ^1.0.2
  epub_view_enhanced: ^1.6.0
  expandable: ^5.0.1
  firebase_auth: ^4.2.5
  firebase_core: ^2.4.1
  flutter:
    sdk: flutter
  flutter_native_splash: ^2.2.18
  flutter_rating_stars: ^1.0.3+4
  flutter_screenshot_switcher: ^2.1.0
  flutter_secure_storage: ^7.0.1
  get: ^4.6.5
  google_sign_in: ^5.4.3
  http: ^0.13.5
  internet_file: ^1.2.0
  just_audio: ^0.9.31
  share_plus: ^6.3.0
  shared_preferences: ^2.0.15
  sqflite: ^2.2.4+1


text:
Q: Can't display selected property from NGRX state I'm trying to display error from state, it's Observable<String> type so I'm using async pipe.
In component
this.error = store.select(state => state.error); // in constructor
error: Observable<String>;

In template:

{{ err }}

I have almost the same code at another component, it works, here it doesn't. I see the error on devtools, it's there.

A: The code snippet seems alright, make sure you:

*

*mutate state in a pure way, no direct assignments (do not do state.error = errorMessage)

*verify there's an error property that exists on the state

A:

{{ err }}

this should be working (if you don't have any errors befuor this.error = store.select(state => state.error); // in constructor
error: Observable;


text:
Q: Updating node version using nvm I want to upgrade my node version to 16.15.1 I am using nvm for this but getting error please help me resolving it. Here is image showing error attached

A: I recommend you first do a clean reinstall of the package manager, a python dependency is missing. Then you can run nvm install --lts which would be the v16 you would like.


text:
Q: Integrating between two function with simpson rule I have a numerical problem. I need to calculate the integral between two functions f1 and f2. I already have the simpson rule for one function. I need help how to find the intercepts between the two function and calculate the integral.
        F0 = f(a)
        F1 = 0
        F2 = f(b)
        for i in range(n):
            x = a + i * h
            if x % 2 == 0:
                F2 += f(x)
                F0 += f(x)
            else:
                F1 += f(x)
        inter = (h / 3) * (F0 + 4 * F1 + F2)```


text:
Q: Find the store type which sells the maximum products in terms of sales amount & by quantity sold ?  For this question, I have a table named as 'Transactions' and the variables of this table are as follows :

*

*total_amt : It contains amount paid by customer when a transaction took place.

*Qty : It contains quantities ordered by customer of a particular product.

*prod_subcat_id : It contains products' subcategories ID

*prod_cat_id : It contains the products' category ID.

*store_type : It contains store type. It has 4 values - Flagship Stores,
           Online, e-store, debcred

Since the question demands that store type should sell maximum products by value of sales amount & by value of quantities sold. So it might be a case where sales amount is max for a store type (lets say Store_A) but value of quantities sold is max for some other store type (lets say Store_B)
But this is not the case with the given data. so whichever store_type holds the max Value of sales_Amt also holds the max value of quantities sold.
Below is the query I have written so far. But it surely has some problem with alias names or something in the inline view or in the subquery. Also I have to achieve the output using subqueries in having clause.
select
    store_type,
    sum(cast(total_amt as float)),
    sum(cast(Qty as int))
from Transactions
group by Store_type
having
    sum(cast(total_amt as float)) =
    (
        select MAX(cast(total_amt as float))
        from(
            select SUM(cast(total_amt as float)) as col1
            from Transactions
            group by Store_type
        )
    ) as T1 AND
    sum(cast(Qty as int)) =
    (
        select MAX(cast(Qty as int))
        from(
            select SUM(cast(Qty as int)) as col2
            from Transactions
            group by Store_type
        ) as T2

A: I think you can use query below, of course if i am not mistaken
;WITH a AS(
SELECT t.store_type,SUM(cast(t.total_amt as float)) amountSum,SUM(cast(t.Qty as Int)) totalCount
FROM Transactions AS t
GROUP BY t.store_type
)
SELECT TOP 1 * FROM a AS a
ORDER BY a.amountSum desc,a.totalCount desc

A: You can just use an order by clause and pick the top 1
select top 1 store_type,
sum(cast(total_amt as float)) as sales_amt,
sum(cast(Qty as int)) as qty_sold
from Transactions
group by Store_type
order by sales_amt desc,qty_sold desc


text:
Q: unable to get the passed data from servlet I'm writing a program that is working fine with the regular jsp-servlet interaction. But when I submit the same with ajasx, it is not working fine. Below is my code.
JSP-Servlet (w/o Ajax)
index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
    <form name="f1" id="f1" method="post" action="Controller">
        <input type="text" name="name1" id="name1" /> <input type="submit" />
    </form>
</body>
</html>

Controller
protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String nsme = request.getParameter("name1");
        request.setAttribute("name", nsme);
        request.getRequestDispatcher("index1.jsp").forward(request, response);
    }

index1.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
    <input type="text" value="${name}" />
</body>
</html>

With Ajax
index.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript"
    src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
</head>
<body>
    <form name="f1" id="f1">
        <input type="text" name="name1" id="name1" /> <input type="submit"
            name="x" id="x" />
    </form>
    <script type="text/javascript" src="SampleJS.js"></script>
</body>
</html>

SampleJS.js
$('#x').click(function() {
    $.ajax({
        type : 'POST',
        url : 'Controller',
        success : function(data) {
            console.log(data)
        },
    });
});

Controller
protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String nsme = request.getParameter("name1");
        request.setAttribute("name", nsme);
        request.getRequestDispatcher("index1.jsp").forward(request, response);
    }

index1.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
    <input type="text" value="${name}" />
</body>
</html>

Here when I use the first method, The name is printed correctly. When I use it with AJAX, to my surprise nothing gets printed in the textbox.
Basically, We use request.getRequestDispatcher("GetCaseData.jsp").forward(request, response); to go to another page. What would be the alternative of it in my case?
please let me know where am I going wrong and how can I fix this.

A: In the Ajax case you don't send any form data. Use $.serialize to serialize the form data and send it to the server:
$('#x').click(function() {
    var formData = $("#f1").serialize();
    $.ajax({
        type : 'POST',
        url  : 'Controller',
        data : formData,
        success : function(data) {
            console.log(data)
        },
    });
});

A: After adding formData in your js file

Check your browser console
You can find your whole index1.jsp html content printed in console
with ${name} replaced with name you entered.

AJAX calls are advised to be used to stay in same page and update page content without page refresh after call.

In above code with AJAX, you are in index.jsp only even after AJAX call completion.

You can switch to other page (index1.jsp in your case) after AJAX call by using javascript window.location.href=<your file name >. However in your case, the page switches to index1.jsp but as new request. You can observe the same in your URL bar of browser. As you are storing the name attibute in request scope. You wont see the value you entered in name field of index1.jsp.


text:
Q: haproxy doesn't start on startup I am using haproxy for load balancing mysql.Haproxy is running on Ubuntu 14.04 .I have set ENABLED=1 in /etc/defaults/haproxy file. But when restarted, haproxy doesn't start as daemon. The configuration file looks like this:
global
    daemon

defaults
    log global
    retries 2
    timeout connect 3000
    timeout server 5000
    timeout client 5000

frontend mysql_read
    mode tcp
    bind *.*.*.*:3308
    default_backend cluster_db_read

backend cluster_db_read
    mode tcp
    option tcpka
    option mysql-check user haproxy_check
    balance roundrobin
     server s1 *.*.*.*:3306 check
    server s2 *.*.*.*:3306 check backup

listen stats
    bind 0.0.0.0:8080
    mode http
    stats enable
    stats uri /
    stats realm Strictly\ Private
    stats auth user:password
#stats auth Another_User:passwd
#stats auth Another_User:passwd

The output of sudo netstat -tulpn is as follows
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1078/mysqld
tcp        0      0 192.168.1.102:3308      0.0.0.0:*               LISTEN      1834/haproxy
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      1834/haproxy
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      1557/dnsmasq
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      913/sshd
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      2145/cupsd
tcp6       0      0 :::22                   :::*                    LISTEN      913/sshd
tcp6       0      0 ::1:631                 :::*                    LISTEN      2145/cupsd
udp        0      0 0.0.0.0:56175           0.0.0.0:*                           803/avahi-daemon: r
udp        0      0 0.0.0.0:39839           0.0.0.0:*                           1292/dhclient
udp        0      0 127.0.1.1:53            0.0.0.0:*                           1557/dnsmasq
udp        0      0 0.0.0.0:68              0.0.0.0:*                           1292/dhclient
udp        0      0 0.0.0.0:631             0.0.0.0:*                           958/cups-browsed
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           803/avahi-daemon: r
udp6       0      0 :::53961                :::*                                803/avahi-daemon: r
udp6       0      0 :::5353                 :::*                                803/avahi-daemon: r
udp6       0      0 :::22178                :::*                                1292/dhclient
What changes should be made to make haproxy as a daemon service?

A: Not sure which version of ubuntu since this is a old post,
but for anyone else who wants to accomplish this on ubuntu 18.04 or Ubuntu 18.10
To make the HAProxy service persist through reboots, enter the following command:
systemctl enable haproxy.service

Reboot your machine
Login & Check if HAProxy is running on boot.
To check the status of HAProxy
Type:
service haproxy status

Check your output for active / running status: (Active: active (running))
If its active & running, then your HAProxy is Working on System Boot.
Output will also point out any errors you can fix in your config even if its active.
You can also check if HAProxy is running via netstat:
netstat -tulpn


text:
Q: How do I gift a book from the iBookstore? On the iTunes Store, you can gift people music, apps, etc. by clicking on the down arrow next to the buy button and choosing Gift This ....
That option, however, is not available on books in the iBookstore:

How can I give someone a book from the iBookstore?

A: Updated 17 Dec 2013.
As reported by Macworld, the iBookstore now allows you to gift books:

Gifting in the iBookstore works identically to Apple's iTunes and App Store counterparts: Just choose the book you'd like to gift, then tap either the dropdown arrow next to the price (on a Mac) or the Share button (on an iOS device).

More details are in their article, but by-and-large it seems to behave exactly as you would expect.

My original answer:
You can't; iBook gifting isn't supported yet.
From Apple's iBooks FAQs page:

Can I gift a book?
No, you cannot gift a book in the iBookstore at this time.

The phrase "at this time" suggests that it's coming in the future, but Apple haven't announced anything yet.


text:
Q: Layer Symbology Based on both Category and Quantity? I am running ArcGIS 10.2.2 Version 10.2.2.3552, using ArcMap.
Here's my situation/what I would like to do:
I have a layer that has sewer lines. Some are main lines, some are laterals. I would like to display the pipe using a color ramp based on a Diameter column, but ONLY if it is a sewer main (there is a column that says if it is a lateral or main)
i.e.
If object is Sewer Main -> Use color Ramp depending on Diameter
If object is Sewer Lateral -> Use grayed out / Other symbology.
Is there any way to do this that avoids duplicating the objects of the layer that I want to display?

A: I would suggest using a couple of definition queries. these will allow you to have different layers in your table of contents that all draw from the same data. so if you had an attribute called type with values lateral and main you could set one query to "type" = 'main' and set the color ramp (or ranges) while the other would be "type" = 'lateral'  and would be set to the grey value.