八月读书计划

一年一度的上海书展又要开了,今年因为疫情的原因应该不会去了。

在书架上找了两年前去上海书展买的几本书,一直放在那里没看,不如趁这个机会看了吧。


八月读书计划:

1.既见君子, 张定浩, 华东师范大学出版社, 2014

2.取瑟而歌, 张定浩, 华东师范大学出版社, 2018

 72 total views

七月读书计划

七月读书计划:

1.美妙的瞬间:普希金诗选, 普希金, 广西师范大学出版社, 2014

 48 total views,  1 views today

六月读书计划

六月读书计划:

1.契诃夫短篇小说精选,契诃夫,浙江文艺出版社,2019

 271 total views,  1 views today

五月读书计划

五月读书计划:

1.GraphQL 学习指南,Eve Porcello and Alex Banks,机械工业出版社,2019

 5,581 total views,  2 views today

四月读书计划

四月读书计划:

1.前夜,屠格涅夫,生活·读书·新知三联书店,2019

 327 total views,  1 views today

PHP Interview Questions(18)

面试时间:2020-02-20,星期四,上午 10:30。


1. 怎么获取字符串倒数第二个字符。

function getSecondLastChar($string) {
    $length = strlen($string);

    if ($length >= 2) {
        return $string[$length - 2];
    } else {
        return '';
    }
}
function getSecondLastChar($string) {
    return $string[-2];
}

2.常用的框架 区别

 1,120 total views

PHP Interview Questions(17)

面试时间:2020年1月7号,星期一,上午十点。


1.What does “&” mean in ‘&$var’?

Passing by Reference

https://www.php.net/manual/en/language.references.pass.php

2.What is MVC?

MVC is a design pattern used to decouple user-interface (view), data (model), and application logic (controller). This pattern helps to achieve separation of concerns.

https://dotnet.microsoft.com/apps/aspnet/mvc

3.What is the difference between $_GET and $_POST?

$_GET — HTTP GET variables
$_POST — HTTP POST variables

https://www.php.net/manual/en/reserved.variables.php

4.What will be the output of each statements below and why?

var_dump(0123 == 123);

var_dump(‘0123’ == 123);

var_dump(‘0123’ === 123);

False
True
False

https://www.php.net/manual/en/language.types.integer.php

5.After the code below is exexuted, what will be the value of $text and what will be strlen($text) return? Explain your answer.

$text = ‘John ‘;

$text[10] = ‘Doe’;

$text = 'John      D';
strlen($text) = 11;

Javascript

1.What is the potential pitfall with using typeof bar == “object” to determine if bar is an object? How can this pitfall be avoided?

typeof null == "object"
bar != null && typeof bar == "object"

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof

2.What is NaN? What is its type? How can you reliably test if a value is equal to NaN?

Not a number
Number
isNaN()

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN

3.What is the difference between jQuery.get() and jQuery.ajax()?

$.get(url, data, success, dataType) is a shorthand Ajax function, which is equivalent to:

$.ajax({
  url: url,
  data: data,
  success: success,
  dataType: dataType
});

https://api.jquery.com/jQuery.get/

4.Write a simple function(less than 80 characters) returns a boolean indicating whether or not a string is palindrome.

A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. Allowances may be made for adjustments to capital letters, punctuation, and word dividers.

console.log(isPalindrome("level"));                    // logs 'true'
console.log(isPalindrome("levels"));                   // logs 'false'
console.log(isPalindrome("A car, a man, a maraca"));   // logs 'true'

function isPalindrome(str) {
    str = str.replace(/\W/g, "").toLowerCase();
    return str.split("").reverse().join("") == str;
}

 5,791 total views