Sunday, January 15, 2017

According to this article, new-old trend for sales in 2017. is: COLD CALLING , again.

Here is an excerpt from the article:

"I read that 84% of new business is being generated by referrals.

Again, this statistic is simply not true because in the main, that's an internal referral generated off of a savvy cold caller who has leveraged social engineering to do the triangulating and targeting. If the CMO flicks your email to the CEO, bingo: internal referral.

I hope this is giving you a lot of hope and a fire in your belly. There is a light at the end of the tunnel, and it's called "back to basics."

Think about how Rocky used to train for boxing matches to become the world champion. Pulling heavy things in the snow.

"I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times." - Bruce Lee

You can do it all with a phone or amp it up leveraging a smart, blended approach. I like to call this Combination Selling. But you can't do it without challenge and hard work. If you're having a blast clicking the mouse and it all seems so easy, you'll fail.

There will never be an easy button on sales success.

Social is a piece of quality selling. Social selling is not a thing, it's a feature - a crucial component of "whatever it takes."

I hate to burst your bubble, generation Z. A+ selling should strike terror in your heart: you can only win by talking to qualified prospects as often as possible. "Pipeline cures all ills!"

Wednesday, January 11, 2017

A good article on propaganda through modern User Experience. Modern propagandist are using this clever tricks to make us buy and use their apps, sites, games and so on. However, this is not limited to software, the same techniques are applied all over the marketplace - from retail shops to online sales. If you intend to use them, make sure people benefit from your products! :)

"
When faced with a threat, people are directed to respond, depending on:

The severity of the threat.
The probability of the threat occurring if no adaptive behavior is performed.
Availability of a solution.
The individual’s ability to execute on the solution.

"

Applications can use this tactics to notify their users about potential threats or make them feel ashamed if they are not actively using the application. One way of influencing the users is through frequent reminders.
This tactic is used my vast majority of big players in app world. Obviously, for a good reason.

Appeal to authority
People have a tendency to trust people they perceive as experts. When pressed by man in lab coats, people are willing to do anything that's required from them, no matter how good or smart that is, and no matter what they see or hear.

There is a well known quote regarding our willing to listen to people we trust and like:

“All other things being equal, people buy from people they know, like, and trust.”

Bandwagon effect

People in large groups and crowds are likely to behave differently from how they ususally behave, when they are alone or in small groups. People start sharing same ideas, same views, same likes and dislikes, and this behavior becomes stronger and stronger.

Tools of trade for this effect:

-Displaying shares and likes from other users

-Displaying reviews from other users

Exaple of bandwagon-driven success:

Facebook

Other techniques covered in the article:

Beautiful People

People are attracted to good looking people.

Black and White fallacy

(making a false dillema, and limiting the number of options)

Plain folks appoach

Use pretext which implies that opinion presented by the propagandist's is a precise replica of common sense approach.

In standard Java, URLClassLoader can be used to dynamically load a class to a Java program. And also, on Android, URLClassLoader should be able to load an external class, from a folder or JAR. However, Android implementation unfortunately fails, either with a ClassNotFoundException , or with NullPointerException.

My guess is that there's a bug inside of Andorid's URLClassLoader or it's badly documented and prone to security restrictions on OS-level, since NullPointerException returns no additional error information.

Some people have suggested to use DexClassLoader:
http://stackoverflow.com/questions/22541177/urlclassloader-working-on-java-but-not-in-android

Hopefully,it's going to work properly.

SOLUTION:

There's an example of DexClassLoader in the Dalvik test suite. It accesses the classloader reflectively, but if you're building against the Android SDK you can just do this:

#1 Extract the .class file you want to dynamically load (make sure you respect exact folder strcture as in original project). Put that folder to a folder temp1
So you have a structure like this:
temp1/com/example/myapp/MyClass.class

This will generate jar1.jar inside of temp1 folder. Now we need to make Dalvik-ready JAR out of it.

#3 To make dalvik ready jar, we use dx tool:

Location of dx tool:
ANDROID-SDK/build-tools/vXX.X/dx

Command:
dx --dex --output=update1.jar jar1.jar

This will generate a Dalvik ready JAR which you can transfer to your device. There you can use the code above to successfully load it to your program at runtime!
If you have problems with /tmp directory, replace it with Context.getCacheDirectory().getAbsolutePath(). It's tested and it works!

If wewould like to replace existing class, that will probably require us to write a custom class loader. Because, all default class loaders in Java will skip loading the class if the class with same name is already loaded.

One idea:

Reserve a dynamic name for updated class ,and first look for it in your code....

Leads are valuable. B2B leads are very very valuable. I'm sure most of us will agree with it. Nevertheless, most of us don't know how many ways of generating them exist. Business to Business leads can be generated in so many ways. Here is a list of some, just to refresh your memory or give you some new creative ideas:

When you are too close to a situation you need to step back and get a little perspective. When you do you will notice there was a whole forest you couldn't see before because you were too close, and focusing on the trees. Simply that you have focused on the many details and have failed to see the overall view, impression or key point.

Does this happen to you? It's a very common thing in programming. You end up looking at single part of code, losing sight of the big picture. In my experience, a good piece of paper or a Excel spreadsheet can come handy to strip the whole process to most basic concepts and elements.

Either physical paper or a computer program can help you visualize the big picture. Yes, the program is much more complicated matter than just a few concepts interconnected with some arrows. However, if you don't have clarity at this high-level, the low-level is going to be a mess for sure.

Tuesday, January 3, 2017

I suspect that the cause might be a internal logical bug inside of the library, or maybe just a memory leak, as the script seems to be pretty memory inefficient. Anyway, this bug looks like this:

Scenario:

You update an element using innertext or outertext method. It seems all good, but when you print your DOM object, it doesn't include the newly changed/added elements.

SOLUTION / WORKAROUND:

Call method ->clear() on $html object and reload it back from the string every now and then:

$x=(string)$html;$html->clear();$html=str_get_html($x);

UPDATE:

Recreating simple_dom_html object by the method above adds significant overhead in terms of page load time (~100ms in my tests). So,I've decided to investigate the issue in more detail. The result: I've found the bug to be linked with a line that's changed innertext of body tag:

$html->find("body", 0)->innertext.=$BOX;

After this call, any other call to innertext change would fail. So, I've decided not to directly expand body tag using this approach, but I have added a dummy child element to body tag, and put $BOX content there. It worked well. So, I guess there must be a bug in simple_dom_html somewhere, which makes it silently crash upon change of body tags innertext. It seems that it doesn't have ability to recreate DOM tree if the root element is modified?

Many of us are sometimes confused with what it means that NodeJS is both single-threaded, and async. So, it's a bit more complicated than that.

NodeJS core contains an non-blocking loop for requests. The received requests is immediately sent for processing and the listening process resumes. This way, NodeJS's primary thread is almost always ready to accept new requests. Data can be processed either in other threads or on other servers (like in case of a distributed system or a distributed database).

Here is a nice explanation by slebetman about the way NodeJS operates at its core:

First, a disclaimer: I'll be talking mostly about networking code because the only widely used database I know of that use file I/O is sqlite. Since you're asking about postgres I can assume you're interested about how socket I/O (be it TCP socket or unix local sockets) can work with only one thread.

At the core of almost all async systems and libraries is a piece of code that looks like this:

As you can see, the code above uses no threading whatsoever. Yet it can handle many connections simultaneously. If you take a look at the for loop it is also obvious that it is basically a simple state machine that processes sockets one at a time if they have any packets waiting to be read (if not it is skipped by the if (FD_ISSET...) statement).

Non-I/O events can logically only come from timed events. And that's where the timeout management (details not shown for clarity) comes in. All I/O related stuff (basically almost all your async code) gets called back from the read_from_client() function (again, details omitted for clarity).

There is zero code running in parallel.

Where does the parallelization come from?

Basically the server you're connecting to. Most databases support some form of parallelism. Some support mulththreading. Some even support node.js or vert.x style parallelism by supporting asynchronous disk I/O (like postgres). Some configurations of databases allow higher level of parallelism by storing data on more than one server via partitioning and/or sharding and/or master/slave servers.

That's where the big parallelism comes from -- parallel computing. Most databases have very strong support for read parallelism but weaker support for write parallelism (master/slave setups for example allow you to write only to the master database). But this is still a big win because most apps read more data than they write.

Where does disk parallelism come from?

The hardware. Mostly this has to do with DMA which can transfer data without the CPU. DMA is not one thing. It is more like a concept. Different systems like the PCI bus, SATA, USB even the CPU RAM bus itself has various kinds of DMA to transfer data directly to RAM (and in the case of RAM, to transfer data higher up to the various levels of CPU cache) or to a faster buffer.

While waiting for the DMA to complete. The CPU is not doing anything. And while it is doing nothing and there happens to be a network packet coming in or a setTimeout() expiring the code that handles them can be executed on the CPU. All while a file is being read into RAM.

But Node.js docs keep mentioning I/O threads

Only for disk I/O. It's not impossible to do async disk I/O with a single thread. Tcl has done that for years and many other programming languages and frameworks have too. It's just very-very messy since BSD does it differently form Linux which does it differently from Windows and even OSX may be subtly different form BSD even though it is derived from it etc. etc.

For the sake of simplicity and solid reliability node developers have opted to process disk I/O in separate threads.

Note that even for socket I/O it is not as simple as the code example I gave above. Since select()has some limitations (for example, you're forced to loop over ALL sockets to check for incoming data even though most won't have incoming data), people have come up with better APIs. And obviously different OSes do it differently. That is why there are a lot of libraries created to handle cross platform event processing like libevent and libuv (the one node.js uses).

OK. But postgres still runs on my PC

Asynchronous, event-oriented systems does not automagically give you performance superpowers. What they DO give you is choice: the app server is blazing fast so where you put your database servers and what database you use us up to you.

OK. But I can do this with threads. Why async?

Benchmarks.

Since 1999, many people have run many benchmarks and in the majority of cases single threaded (or low thread count), event-oriented systems have outperformed simple multithreaded systems. It was especially true in the old days of single CPU, single core servers. It is still partly true now (since cores are still limited).

That is why Apache was re-written into Apache2 to use a thread pool of async listeners and why Nginx was written from scratch to use a thread pool of async code.

Yes, on modern servers ideally you'd still want some threads in order to use all your CPUs. The alternative is a process pool like how the cluster module works in node.js. But you'd want the number of threads/processes to be constant or as constant as possible to avoid the overhead of context switching and thread creation.