Digital Tranformation

Advertisements
Image | Posted on by | Leave a comment

好久没有完整地看一部电影了,但是张艺谋的新片《影》我看了两遍,因为这的确是一部值得你看好几遍的好片。

说句老实话,第一遍看的时候,的确有些懵,但看第二遍的时候,随着很多细节的发掘,和前后情节的贯穿,明白了张艺谋想要表达的令你扑朔迷离的影子替身的故事,明白了表面的棋子和背后的棋局之间的道理。后来又花时间看了纪录片《张艺谋和他的影》,更加理解了张艺谋对电影的执着,追求完美严谨的呈现,所有道具,布景都一丝不苟。而且张艺谋的每一部电影都不重复,都在追求新的尝试,既然是有新的尝试,就一定会有失败和成功。在《影》这部电影中,我看到了成功,色彩运用的成功,演员表演的成功, 专业团队合作的成功。也许你看到只是两个小时的电影,但是这个屏幕背后所有人的付出,精益求精的态度,让你非常感动。我们看到的《影》是一部视觉和情节都超越了好莱坞的优秀电影作品。

也只有多看几遍,你才能正在理解张艺谋导演的匠心,这个电影是黑白两个主色调,就像影片中多次展现的阴阳太极的图案,将一正一反,一明一暗,一真一假,一阴一阳,一刚一柔都融合在了这黑白的水墨画中。结尾嘎然而止的镜头,却又给了观众以无限的悬念和猜想。

据说剧本原取自于三国关羽大意失荆州的故事,我们也的确可以将电影中的人物与故事一一对应起来:沛王是孙权,青萍是孙尚香,子虞是周瑜,杨苍是关云长,小艾是小乔,境州是荆州等等。

能够成为好电影,好作品,除了导演的用心,剧本的编排,演员精湛的表演对于人物的塑造和入木三分的刻画也至关重要。值得一提的是邓超一人分饰真身和影子两个角色,孙俪在影片中的抚琴和武戏都亲自完成,胡军耍大刀,郑凯写大字也都是演员本身的修炼,可见好演员戏内戏外都花足了的功夫。

 

Posted in Movies, Uncategorized, 兴趣 | Leave a comment

6 Habits Putting You at Risk for Identity Theft

6 Habits Putting You at Risk for Identity Theft (From Frontier.com home)
Editor’s Note: The article below was published by NBC News Digital on its website.
By Emily Long
Data breaches and hacks are often unavoidable, but security
experts say there are some everyday habits that put
consumers even more at risk.
According to a report by Javelin Strategies, U.S. residents
lost $16.8 billion to fraudsters in 2017, and the number of
victims increased 8 percent over the previous year.
Unfortunately, identity thieves are getting smarter, which
means consumers have to be even more vigilant when it comes to protecting their personal
information and their financial well-being. Thieves are launching more complex schemes, but
consumers also don’t think twice about many common practices that put their data — and their money
— at risk.
SIX COMMON HABITS TO BREAK
passwords for each account, change your passwords often, and keep track of your logins with a
password manager app.
2. You avoid checking banking and credit card statements on a regular basis
Checking your account balances isn’t always fun, but not doing so
means you could miss fraudulent transactions that indicate your
identity has been stolen. You should scan your account statements
and your credit report frequently for purchases you didn’t make and
lines of credit you didn’t request.
“Reviewing your bank accounts, credit card statements and credit reports regularly won’t
necessarily prevent identity theft, but it will help you catch it early before you incur too much
damage,” says Brianna Jensen, an identity theft expert with consumer security site ASecureLife.
Credit card fraud is one of the most common types of identity theft. You are eligible for a free
report from each of the three major credit bureaus once a year, so request one every few
months in addition to reviewing other financial statements at least weekly.
3. You overshare on social media and don’t check your privacy settings
Social media is rife with scammers who take advantage of weak
privacy settings to lure you in. Even if you don’t fall victim to a phony
Facebook lottery, thieves can still glean personal information from
your supposedly private profiles. Geotagged photos, birthday posts,
and childhood throwbacks give savvy criminals answers to those
oversimplified security questions and help them impersonate you.
“Don’t share any information with sites unless you are comfortable with that information being
posted on a postcard and sent to your own house,” says Ron Schlecht, managing partner at
cybersecurity firm BTB Security.
Cut thieves off by tightening your privacy settings and limiting what you post.
4. You send sensitive information via email or unsecure messaging services
Nigerian princes aren’t the only ones scamming consumers through
email. If you include account numbers, attach sensitive documents or
simply write things you’d never share publicly, you open yourself up to
identity theft. Even if you have a strong password or use two-factor
authentication to protect your own account, your messages are only
as secure as those you send your information to.Plus, when you delete
messages from Facebook, Slack or email, that data still lives in a place that’s accessible to
thieves who can intercept or hack into accounts or servers.
“Our inbox, sent and deleted folders are treasure troves of sensitive information about
ourselves and our family,” says Mike Fleck, vice president of security at Covata, which provides
data security solutions for businesses. Avoid sending account numbers and sensitive documents
via unencrypted messages.
5. You rarely update your apps and device software
Frequent app updates aren’t just there to annoy you. They actually
patch critical security holes that would otherwise leave your data
vulnerable to hackers and viruses.
“What might have been secure enough yesterday is no longer secure
enough today — sometimes because bugs have been discovered and
sometimes because technologies have evolved,” says Gary McGraw, vice president of security
technology at software security company Synopsys.
If your devices have an automatic update setting, enable it. And if you get a notification that a
new software version is available, address it immediately.
6. You give away too much information — especially when you are in public
There are very few situations that actually require you to provide any
kind of personally identifiable information in public or to someone you
don’t know, so be wary of anyone who requests this.
For example, a telemarketer calls and asks you to confirm your name
and address. You have no way to verify that person’s credentials,
which means you just gave your name and location to a stranger, which they can then use to
piece together your personal profile. Other situations are less sinister but just as risky: You
don’t think twice about providing your credit card number to confirm an appointment or
stating your social security number for your doctor’s office over the phone, but you never know
who is listening nearby.
Before you give away any information, whether in person, over the phone or online, make sure
that it’s absolutely necessary to do so and that your data will be communicated or transmitted
securely.
Experts say that data breaches, hack and identity theft are an all-too-common — and often
unavoidable — reality, so consumers should take steps to avoid becoming victims whenever possible.“
The most dangerous habit a person can have is to be too trusting,” says Mark Gazit, CEO of data
analytics provider ThetaRay. Whenever you’re dealing with your financial information and personal
data, “you must assume that you will be hacked.”!

Posted in Uncategorized | Leave a comment

jQuery .closest(), .parent() or .parents()

In your page, you may have DOM trees, like <ul><li>…</li>…</ul>,  <tr><td>…</td>…</tr>, and so on.

Sometimes, we want to find out who is the parent of current DOM elements. .closest(), .parent() and .parents() methods are similar in that they both traverse up the DOM tree.

  1. .closest(): will return the first matched element in the DOM tree
  2. .parent(): travels a single level up the DOM tree
  3. .parents(): will search through the ancestors of current elements in the DOM tree, and return the closest parent to the outer ones.

For example, in blow DOM tree

<ul class="level-1">
  <li class="item-i">I</li>
  <li class="item-ii">II
    <ul class="level-2">
      <li class="item-a">A</li>
      <li class="item-b">B
        <ul class="level-3">
          <li class="item-1">1</li>
          <li class="item-2">2</li>
          <li class="item-3">3</li>
        </ul>
      </li>
      <li class="item-c">C</li>
    </ul>
  </li>
  <li class="item-iii">III</li>
</ul>
$( “li.item-1” ).closest(“ul”) will be “ul.level-3”
$( “li.item-1” ).closest(“li”) will be “li.item-1”, itself 🙂
$( “li.item-1” ).parent() will be “ul.level-3”
$( “li.item-1” ).parents() will be “ul.level-3”, “li.item-b”, …
In most case, closest() will return result in the fastest way.
Posted in Computers and Internet, jQuery | Leave a comment

How to create Double click event on Multi-Selection Options

doubleclick

We have a small project need to add user into group, which is many to many relationship. So we designed two multi-selections to hold available users and existed group users. Each user is one option in the multi-selections, we want to double click user to make it move from all_users to group_users, and vice versa.

Our original code is working on each options, like below

$('#group_users option').dblclick(function() {
$("#all_users").append(new Option($(this).text(), $(this).val()));
$(this).remove();
});

But the issue is new appended user will not accept double click event, only page loaded user option can response to double click event.

We tried many ways to figure out how to do that, and finally, we found we can apply dbclick event on <select> itself. And then try to check each selected options to handle that. Now the issue fixed.

The new code like below, now you can move the user option between two multi-selections by double click.


$('#all_users').dblclick(function() {
$("#group_users option[value='']").remove();
$('#all_users :selected').each(function(i, selected){
$("#group_users").append(new Option($(selected).text(), $(selected).val()));
$(selected).remove();
});
});


$('#group_users').dblclick(function() {
$('#group_users :selected').each(function(i, selected){
$("#all_users").append(new Option($(selected).text(), $(selected).val()));
$(selected).remove();
});
if($("#group_users option").length == 0)
{
$("#group_users").append(new Option("N/A", ""));
}
});

Posted in Computers and Internet, jQuery | Leave a comment

Laravel Oracle DB issue on User Authentication

[Laravel 5.2++] Oracle User Provider
When using oracle, we may encounter a problem on authentication because oracle queries are case sensitive by default. By using this oracle user provider, we will now be able to avoid user issues when logging in and doing a forgot password failure because of case sensitive search.

To use, just update auth.php config and set the driver to oracle

'providers' => [
    'users' => [
        'driver' => 'oracle',
        'model' => App\User::class,
    ],
]
Posted in Laravel | Leave a comment

jQuery .each() which better than for loop

Want to introduce jQuery .each() method, which is very useful method when you handle array of objects.

For example, we have 4 dispatch fields in the form, and we don’t want dispatch time is in the future, so we have to create validation check on these fields. In the old way, we have use check each fields, but then I found we can use jQuery .each() which much easier to get the work done.

var initial_dispatch_request = $("#entry_initial_dispatch_request");
var first_tech_on_site = $('#entry_first_tech_on_site');
var second_dispatch_request = $("#entry_second_dispatch_request");
var second_tech_on_site = $('#entry_second_tech_on_site');
var items = [initial_dispatch_request, first_tech_on_site, second_dispatch_request, second_tech_on_site];
$.each(items,function(index,item){
	if(compareDate(item.val(), 'now') == 1)
	{
		alert('Dispatch datetime fields cannot be in the future!');
		item.addClass("invalidDataSelection");
		return false;
	} else {
		item.removeClass("invalidDataSelection");
	}
});

Please note: above compareDate is the function which compare two given date. like below.

/**
* compare two datetime string
*/
function compareDate(date1,date2)
{
	var date_1 = new Date(date1);
	if(date2=='now')
	{
		var date_2 = new Date();
	} else {
		var date_2 = new Date(date2);
	}
	if(date_1 > date_2)
	{
		return 1; //date1 > date2
	} else {
		return 2; //date1 <= date2
	}
}
Posted in Computers and Internet | Leave a comment