Daily Prayer List

매일의 기도 목록

Daily prayer list

세계 지도자

World leaders

경찰과 최초 대응자

Police and first responders

군대

Military

설교자와 사제

Preachers and Priests

의사들

Doctors

법률 시스템

Legal system

교사

Teachers

선교사

Missionaries

고아

Orphans

연세가 드신

Elderly

과부

Widows

잊혀진

Forgotten

모든 사람들

All people

신이 독재자와 폭군에게 평화와 사랑을 주기를

May God give peace and love to Dictators and Tyrants

하나님께서 그들의 백성에게 번영과 압제와 사랑과 희망을 주시기를

and may God give prosperity, lack of oppression, love, and hope to their people

신께서 우리 모두가 서로에게 의심의 유익을 줄 수 있도록 도우소서

May God help us all give each other the benefit of the doubt

나는 트럼프 대통령과 그의 권위에 관심을 갖고 존경합니다. 나는 확실히 그와 많은 문제에 동의하지 않습니다. 내가 모든 것에 대해 옳다는 것은 아닙니다. 정의보다 자비와 사랑을 추구하는 경향이 있습니다. 그것이 정의를 위한 장소가 없다는 것을 의미하는 것이 아니라 항상 그 정도를 확신하지 못하는 것입니다. 잔인함과 무자비함은 악이며 범죄자들이 모든 것을 파괴하도록 내버려두는 것도 악입니다.

I care about and respect President Trump and his authority. I definitely disagree on many issues with him.  Doesn’t mean I am right about everything.  I try to have a tendency towards mercy and love over justice.  That doesn’t mean there isn’t a place for justice, just not always sure the extent.  Cruelty and mercilessness is evil and so is letting criminals destroy everything.  

이것이 의미가 있기를 바랍니다. 나는 사형제도를 믿지 않는다. 내가 목숨을 끊는 것이 현명하다고 생각하기 전에 누군가가 나 또는 내가 사랑하는 누군가에게 총을 겨누고 있어야 합니다. 그래도 다른 모든 옵션을 먼저 소진하고 싶습니다. 나는 사람들이 항상 모든 옵션을 완벽하게 평가할 시간이 없다는 것을 알고 있습니다. 나는 눈에는 눈이 아니라 보호를 믿습니다.

Hope this makes sense.  I don’t believe in the death penalty.  Someone should have a gun pointed at me or someone I care about before I think it wise to take a life.  Even then I would want to exhaust all other options first.  I realize in protection people don’t always have time to weigh all options perfectly.  I believe in protection, not eye for an eye. 

 누구에게나 앞으로 나아갈 길은 필요하고, 총을 겨누는 사람들은 다양한 방식으로 활용될 수 있습니다. 총을 가지고 있는 사람들의 문제는 그것이 기본 옵션이 될 수 있다는 것입니다. 남이 대접받고 싶은 대로 남을 대접하십시오. 남자의 손, 그의 눈 또는 그의 거시기를 가져 가지 마십시오.

Everyone needs a path forward, and people that have a gun pointed at me might be leveraged in many different ways.  Problem with people having guns is it can be a default option.  Treat others as they wish to be treated.  Don’t take a guys hands, his eyes, or his dick.

공을 놓친 사람을 탓하지 마세요. 좋은 점을 확대하고 사람들에게 사랑 때문에 잘못한 부분을 말하십시오. 옆으로 차지 마십시오. 또한 나는 내 경험에 의해 형성된 한 사람이라는 것을 깨닫습니다. 나는 모든 것에 대해 누군가와 동의하지 않을 수 있으며 그것이 사랑과 존경이 필요하지 않다는 것을 의미하지는 않습니다. 간접적으로 소통할 수 있는 곳이 없다고 말하는 것이 아니라 심리적으로 고문하는 데 사용되지 않는 것이 좋습니다.

Don’t blame a guy for missing a pitch. Magnify the good and tell people where they are wrong out of love, don’t kick them sideways.  Also realize I am one man that has been shaped by my experiences, I might not agree with someone on everything and that doesn’t mean they don’t need love and respect.  I am not sayin there is not a place for indirect communication, just would prefer it not be used to psychologically torture people.

저는 금기를 판단하고 싶지 않고, 무언가에 대해 흑백논리를 하지 않는 것이 사람들을 극단적인 경우로 이끌 수 있다는 것도 알고 있습니다. 거위를 원하는 위치에 따라 다릅니다. 곁눈질을 하려면 희생이 필요할 수 있습니다. FPS 게임은 재미있게 플레이할 수 있지만 일부 사람들에게는 악의가 커질 수 있습니다.

I don’t want to judge the taboo and I also realize that not being black and white about somethings might lead people to the extreme cases.  All depends where you want the goose.  Leading the gander might require sacrifices.  FPS games can be fun to play, though I know some might scale up evil in some people.

카운터 스트라이크와 콜 오브 듀티는 제 생각에 Grand Theft Auto보다 좋습니다. 둘 다 부적절하게 확장될 수 있습니다. 내가 최근에 레이싱 게임을 즐기는 이유 중 하나는 이름이 뭔가 다른 것을 생각나게 합니다. 우리는 또한 지도자에 대한 자비와 사랑이 있어야 하며 완벽을 요구하지 않아야 합니다.

Counter Strike and Call of Duty greater than Grand Theft Auto in my opinion.  Both could be scaled inappropriately.  One of the reason I have enjoyed playing racing games more recently, though the naming kind of reminds me of something else.  We also have to have mercy and love for leaders and not require perfection. 

 불완전한 지도자들은 자신이 신이 아니며 모든 사람에게 사랑과 은혜가 필요하다는 것을 상기시켜줍니다. 어떤 사람들은 항상 저를 미워할 수 있습니다. 그들에게도 사랑과 자비와 은혜를 주십시오. 내 삶을 더 좋게 만들기 위해 다른 사람을 해치지 말고 앞으로 모두를 위해 더 나은 것을 만들기 위해 모두 함께 노력합시다.

Maybe imperfect leaders remind us they are not God and everyone needs love and grace.  Some people might always hate me, please give them love, mercy, and grace as well.  Don’t hurt anyone to make my life better and let’s all work together to make things better for everyone going forward.

우리가 의사들에게 너무 가혹하다면 그들은 시도를 멈추고 싶어할 것입니다. 항상 완벽할 것으로 기대된다면 공을 놓쳤을 때 포기할 수도 있습니다. 우리는 최선을 다해 그들을 훈련시켜야 하며 그들에게도 사랑과 자비를 베풀어야 합니다. 결국 우리는 열심히 일하다 보면 무언가를 놓치게 됩니다. 우리 모두가 완전하다면 은혜와 자비가 필요하지 않을 것입니다. 우리는 그들이 놓친 것에 대해 불을 줄 것인가 아니면 그들이 옳았던 모든 것에 대해 물을 줄 것인가? 때때로 완벽주의자는 다른 사람들보다 자신에게 더 엄격합니다. 그렇기 때문에 더 많은 사랑과 은혜가 필요한 것입니다.

If we are too harsh on Doctors they might want to stop trying.  If they are expected to always be perfect they might give up when they miss a pitch.  We should train them the best we can and we need to give them love and mercy too.  Eventually we all miss something if we are working hard.  If we were all perfect there would be no need for grace and mercy.  Do we give them fire for what they missed or water for everything they got right.  Sometimes perfectionists are harder on themselves than others.  That’s why they need more love and grace not less. 

사람들이 시도하고 싶지 않게 만들지 않으면서 지원 네트워크를 개선하는 데 어떻게 도움을 줄 수 있습니까? 너무 높은 기대는 모두가 체면을 유지하고 싶게 만듭니다. 이것은 사람들이 조정하는 것을 방지하고 지원 네트워크의 문제가 실제로 수정되는 것을 방지합니다. 완벽하게 구축된 시스템은 악을 위해 사용될 수 있기 때문에 강력한 도구에는 좋은 입력이 필요합니다.

How do we help improve support networks without making people never want to try.  Too high of expectations makes everyone want to save face.  This prevents people from reconciling and problems in support networks from actually getting fixed.  Powerful tools need good inputs, because a perfectly built system can be used for evil.

시스템에는 입력, 내부 및 출력이 있습니다. 모든 사람들과 Al Bundy 유형의 사람들에게도 좋은 결과가 나오길 원한다면 좋은 입력과 문제가 발생할 경우 내부를 수정할 수 있는 능력이 필요합니다. 좋은 입력이 없으면 강력한 도구를 사용할 수 없습니다. 강력한 도구를 사랑의 방식으로 사용하지 않으면 사람들이 보호 수단으로 잘못된 입력을 추가할 수 있습니다.

A system has inputs, internals, and outputs.  If we want the outputs to be good for all people and Al Bundy type people too, we need good inputs and the ability to correct the internal if a problem arises.  If we can’t have good inputs we can’t have powerful tools.  If we don’t use the powerful tools in loving ways people might add bad inputs as a form of protection. 

조화롭게 함께 일하는 것이 좋을 것입니다. 전쟁은 파괴의 결과를 초래할 수 있으며 새로운 시스템은 다를 수 있지만 항상 더 나은 것은 아닙니다. 가능하면 시스템을 저장하고 개선하십시오. 믿음으로 모든 것이 가능합니다.

Would be better to work together in harmony.  Wars can create a wake of destruction, and while a new system might be different it might not always be better.  Save and improve a system if possible, and with faith all things are possible.

하나님께서 잊혀진 자들의 짐을 덜어주실 수 있기를 빕니다. 그분께서 그들에게 사랑과 평화와 기쁨과 은혜를 주시기를 빕니다.

May God help lift the burdens of the forgotten.  May He give them love, peace, joy, and grace.

거리에 있는 사람들과 하늘이 솟아오르는 곳에 하나님이 함께 하시기를 빕니다. 신이 그들의 연구실에 있는 과학자와 전국을 가로지르는 자전거 타는 사람과 함께 하시기를 빕니다. 하나님이 병자들과 놀라운 에너지를 가진 사람들과 함께하시기를 바랍니다. 바늘로 고통을 무디게 하려는 사람과 함께하고 두려워하는 사람들이 앞으로 나아가지 못하게 하는 사람과 함께 하시기를 바랍니다. 그분이 모든 사람에게 사랑과 기쁨을 주시기를 빕니다. 그분이 우리 모두에게 그분을 신뢰해야 할 더 많은 이유를 주시기를 빕니다. 그분이 우리 모두가 함께 일하도록 도우시고 그분이 모든 사람을 그분의 형상대로 만드셨음을 깨달을 수 있기를 바랍니다. 그분이 우리를 함정과 지렛대에서 해방시켜 주시기를 빕니다.

May God be with the people on the street and in the sky rises.  May God be with the scientist in their lab and the biker riding across the country.  May God be with the sick and those who have amazing energy.  May He be with the one trying to dull the pain with a needle and with those who’s fear prevents them from moving forward.  May He bring love and joy to all people.  May He give us all more reasons to trust Him. May He help us all work together and realize that He made everyone in His Image.  May He free us from entrapment and leverage.

잔인하고 비정상적인 처벌을 강요하는 시스템에 자금을 지원하는 이유는 무엇입니까? 경찰이 존중받고 안전하다고 느끼려면 사람들이 사랑받고 있다고 느끼게 하는 법과 시스템이 필요합니다. 사랑으로 잘못한 부분을 알려야 하며 처벌이 치료보다 더 나빠지지 않도록 하여 사형수를 ​​감방에 남겨두는 것이 필요합니다. 내 생각에 그리스도가 원하는 것이 아니라 우리가 돌을 치워야 할 때를 위해

why fund a system that pushes cruel and unusual punishment?  if we want Police to be respected and feel safe we need laws and systems that make people feel loved, tell people where they are wrong out of love and don’t let the punishment be worse than the cure, leaving people on Death Row equals eye for an eye, not what I think Christ would want, maybe time we put our stones away

그리스도는 놀랍고, 모든 사람을 보호하고 사랑하시며, 과거를 용서하고 화해시키십니다.

Christ is amazing, protect and love everyone, and forgive and reconcile the past

강변에 머물고 있는 해병을 꿈꾸십시오. 그는 아무것도 가지고 있지 않으며 강은 계속 상승하고 얼음과 빙산으로 변합니다. 그는 강철 컵의 물만 가지고 움직이기 시작합니다. 동료 베테랑이 탈출구를 찾도록 도와주고 그들은 기차를 뛰어 넘습니다. 해병은 너무 오래 자다가 거의 기차에 치일 뻔했습니다. 그가 누구에게 사냥당했는지 알 수 없다.

Dream a marine staying at a river side.  He has nothing and the river keeps rising and then turns to ice and icebergs.  He begins moving with only a steel cup of water.  A fellow veteran helps him find a way out and they are jumping trains.  The marine sleeps a little too long and nearly gets run over by the train.  Can’t tell who he is being hunted by

슬픈 눈물, 행복한 눈물, 무관심의 눈물, 방종의 눈물이 동시에. “비를 본 적이 있나요?” – 크리던스 클리어워터 리바이벌

Sad tears, Happy tears, Apathy Tears and Overindulgence tears all at the same time.  “Have you ever seen the rain?” – Creedance Clearwater Revival

Free Image

UDP Client and Server

This will hopefully be the first post of several on different network connections.  User Datagram Protocol (UDP) is defined by a Request for Comments (RFC) RFC 768.  The purpose of this protocol is sending data across a network.  Sending data across a network is like sending a letter in the mail.  It requires an address and requires both the sender and receiver to have access to the delivery network.

Computers don’t have a physical address.  They have a set of numbers called an IP Address as well as a Port.   The IP Address tells the network which computer will receive a particular message.  There are many applications that run on a computer as well, and more than one program can be networked.  To be able to determine which application to send a message to the computer also has a Port number.  Different applications bind to different port numbers so they can receive messages from the network.

User Datagram Protocol (UDP) is built on the idea that a network in potentially unreliable.  Much like a message in the postal mail being lost, particular packets can be lost which is why we consider the networks unreliable.  Transmission Control Protocol (TCP) is a reliable method of communication but this protocol has a performance penalty and can slow things down in real time systems.  Developers can create reliable protocols on top of UDP as well.

In computing we think of servers as computers or applications that will receive messages, process messages, and send us a response.  Client generally means any application that connects to the server and sends a message, but generally doesn’t process other users requests.  So while this is not always the case, generally speaking there is a many to one relation between clients and servers.

Server

Generally we need a server first.  Someone listening to the request.  Then we can create a client to send requests to the server.  In computers there are many names for a process that stays active – process, background task, service, daemon process, thread etc.  For creating a server we need a process that will stay in an active state of listening for messages.  Much like someone watching a horizon for a smoke signal, once the server receives the message it will be able to process that message and possibly send a response to the return IP address of the client.

Below is an example of creating a UDP server in Java.  The code launches a UDP Server thread that will listen on Port 7777.  The method uses a threadpool to launch the server.   Other UDP server threads with different ports could be launched on the same threadpool.  The IP Address 127.0.0.1 is usually associated with localhost.  Both of these example applications are on the same computer for testing.  In a network scenario these IP addresses would need to be replaced with the IP addresses or the hostname would need to be resolved into an IP address so we could send the message to that computer.

Standard Disclaimer: The below code is licensed under the MIT license, so do with it as you wish and please understand this was provided as an example so there are no guarantees it is tested properly or will work 100% of the time.

Main method:

private static Logger logger = Logger.getLogger(UpdServerContainer.class.toString());
private static UdpServer server = new UdpServer(7777);
private static BlockingQueue workQueue = new ArrayBlockingQueue(10);

public static void main(String args[]) {
logger.setLevel(Level.INFO);
logger.info("System is running...");
byte[] receiveData = new byte[16384];
ThreadPoolExecutor executor = new ThreadPoolExecutor(4,4,10000,TimeUnit.MILLISECONDS,workQueue);
executor.execute(server);
}

Below creates a UDP server in Java configured to non-blocking input output (NIO).  Non blocking input allows us to not leave the current thread or process idling while waiting to receive messages.  Blocking threads can add value in situations where lots of data does not need to be processed quickly, and other ports or input can be processed as well within the same thread.

An article that discusses the difference between IO and NIO: http://tutorials.jenkov.com/java-nio/nio-vs-io.html

UpdServer class:

public class UdpServer implements Runnable {
private static Logger logger = Logger.getLogger(UdpServer.class.toString());
private static int BUFFER_SIZE = 16384;
private int port;
private DatagramChannel channel;
private DatagramSocket outgoingSocket;
private ArrayBlockingQueue receivedMessageQueue = new ArrayBlockingQueue(10000);
private ArrayBlockingQueue sendMessageQueue = new ArrayBlockingQueue(10000);

public UdpServer(int port) {
this.port = port;
}

private void createUdpServer() throws SocketException {
try {
channel = DatagramChannel.open();
channel.configureBlocking(false);
} catch (IOException e) {
e.printStackTrace();
}
outgoingSocket = new DatagramSocket();

channel.socket().bind(new InetSocketAddress(port));
logger.info("UDP Server created and bound to port "+port);
}

@Override
public void run() {
byte[] receiveData = new byte[BUFFER_SIZE];
ByteBuffer buffer = ByteBuffer.allocate(BUFFER_SIZE);

try {
createUdpServer();

while (true) {
buffer.clear();
channel.receive(buffer);
buffer.flip();

if (buffer.hasRemaining()) {
String receivedMessage = new String(buffer.array());
receivedMessage = receivedMessage.substring(0,receivedMessage.indexOf("\n"));
logger.info("Message received: "+receivedMessage);
receivedMessageQueue.put(receivedMessage);
}

if (!sendMessageQueue.isEmpty()) {
DatagramPacket sendPacket = sendMessageQueue.poll();
outgoingSocket.send(sendPacket);
}
}
} catch (Exception e) {
e.printStackTrace();
}

}

public ArrayBlockingQueue getReceivedMessageQueue() {
return receivedMessageQueue;
}

public void setReceivedMessageQueue(ArrayBlockingQueue receivedMessageQueue) {
this.receivedMessageQueue = receivedMessageQueue;
}

public ArrayBlockingQueue getSendMessageQueue() {
return sendMessageQueue;
}

public void setSendMessageQueue(ArrayBlockingQueue sendMessageQueue) {
this.sendMessageQueue = sendMessageQueue;
}

public void sendMessage(DatagramPacket packet) throws InterruptedException {
this.sendMessageQueue.put(packet);
}

public boolean hasMessagesReady() {
return !this.receivedMessageQueue.isEmpty();
}

}

Example client:

Below is an example client application that sends to the UDP Server above.  We create a DatagramPacket with data and an IP address.  Then we send it over a datagram socket to port 7777.

public class UdpClient {

public static void main(String[] args) {
System.out.println("Client is running...");
byte[] sendData = new byte[16384];
try {
InetSocketAddress IPAddress = new InetSocketAddress("127.0.0.1", 7777);
DatagramSocket socket = new DatagramSocket();
String testData = "Test 123";
sendData = testData.getBytes();
DatagramPacket sendPacket = new DatagramPacket(sendData,sendData.length,IPAddress);
socket.send(sendPacket);
System.out.println("Data sent: "+testData);

} catch (Exception e) {
e.printStackTrace();
}
}

}

Server output:
INFO: System is running…
INFO: UDP Server created and bound to port 7777
INFO: Message received: Test 123

Client output:
Client is running…
Data sent: Test 123

I hope this gives people a working starting example for UDP servers.

Best Regards

Red Tape in Programming

This is a bit of a tangent from my previous posts.  I would like to note red tape, political processes, excessive concern with details, and reinventing processes to prevent others from being tricked into wasting time.  In programming and development people can be very particular.  Like artists developers sometimes think in the abstract and find themselves concentrating on the abstraction rather than the task in front of them.

Think about someone working on a car.  They might need to do a simple task like repairing a belt.  Developers sometimes see the way the belt was built, look at the engine and decide they don’t like the way things were done.  In cars most people would understand changing an engine when a belt is broken is really not necessary.  With the level of the abstractions developers deal with at times they sometimes think they can do better.

The Good

First I will speak to the good in this mindset.  Many developers have created great frameworks for the community and have built tools that can make other developers lives easier, though at the same time introducing more layers into the equation.  With all layers and abstractions in development there can be pros and cons.  Good abstractions can let a developer focus on getting the task at hand done without adding excessive complexity.  Bad abstractions can take power away from the developers and cause reliance on buggy systems that don’t always act in expected ways.

If developers didn’t think they could make the wheel better, we wouldn’t have C++, and wouldn’t have Java. We wouldn’t have lambdas, annotations, and other syntactical sugar that makes developing simpler.  We wouldn’t have XML and wouldn’t have JSON format for sending data in descriptive and concise ways that are human readable.  We wouldn’t consider best practices and make choices in development that make more reliable systems such as DRY principles.  We might not be able to compete with other companies because they are leveraging the power of work that has already been completed in the open source community.

There are great things about the many tools available because people see a problem with the current tools, and they find a way to improve them.  The entire development community can benefit.

The Bad

Throughout my career I have seen and even been a part of working on the next new type of frameworks.  I have seen multiple technologies that are similar and follow a similar need.  If I were a building architect I would liken this to focusing so much on material science or how one room is laid out that I would not really ever design the entire building.

In development there is a lot of things that can annoy other developers.  Whether someone uses tabs or spaces like in the HBO show Silicon Valley.  While following a standard is a good thing, sometimes getting too caught up in the details can cause political strife within an organization.  As it was said to me “You can be right or happy”. This highlights the bad in overly strict processes.  Further people that think they are right can be polarized, such that small things become big things.

A while back in a cafeteria I used to go to I think the dishwasher was broken one day.  All the glasses looked like they had some soap scum on them.  While I looked for a clean glass to no avail, another guy walked up picked up a glass and looked at me and said “Nothings perfect in life”.  Development should be considered the same way and it is important to choose battles wisely.

The more open source projects a person or an organization uses the more potential they have for leveraging those projects and also being leveraged as they do not have complete visibility into the code base.  Ideally smart people would be checking these code bases consistently to make sure they are secure and not introducing any malicious code into the system.  This might not always be the case.

The amount of information, frameworks, and open source projects out there is daunting.  Understanding all of them could waste a lot of time.  Organizations are very susceptible to politics within the industry and many times things will be done because that is what is expected and not because that is necessarily the best way to do things.  Political processes shape development and which technology sets we use.

Some organizations favor reuse so they spend money building their infrastructure in a certain technology.  Projects using that technology are simpler to start because they have spent money building libraries for a technology like Java or C# or PHP etc.  So the organization becomes polarized to particular technologies and might have less or no projects of the other technologies.  Developers concerns are at times orthogonal to the organizations.  They need to keep their skillsets up and work on the latest technologies so they are ready for the next big trends.

Developers have political tools as well as business people have political tools.  From a developer standpoint I understand wanting to do things right and the argument that if things are not done right we will pay that in maintenance costs later, technical debt.   Understanding the business point of view also they know that this project might give way to something else one year down the line.  So they might care more about getting things done than making sure everything is completed perfectly.

Both sides could actually use these political arguments in negative ways to destroy projects they don’t like.  If a developer wanted to see a project fail because they have a vendetta against an organization they could make the organization get so tied up in best practices and red tape that they never get anything done.  Vice versa if a business person wanted to destroy a team they could prevent developers from taking the time they need to properly prepare the system and then use that as leverage to get them fired or divert funding to another group.

We all have to believe each other is working for the best interest of the company and the projects.  There is a lot of reasons to do so, the company is paying them to do so and their career and trustworthiness within the industry hinges on this.  Other companies incentivizing, greed, jealousy, and other motivations known and unknown can entice people to act in ways that are not in the best interest of the company.

Anyone starting their own company really should have this realization.  I wish ideally we would all work to each others best interest but that is not always the case.  We live in a world of human nature.  Important to remember that everyone telling you about the next big things or which technologies you want to work with might not be on the level.  Important for leaders to do their due diligence though a certain level of trust is necessary to ever get anything done.

Understand that every person that is added to an organization adds complexity.  Ideally each person added creates a win for the company, a win for the person, and a win for society.  This is not always the case.  Some people that are hired have health problems, are emotionally torn up, or have other problems that are out of control of the company or even the person themselves at times.  Competition is a good thing and results and profits matter to a companies well being.  It would be ideal that we can help society and not leave people hurting as well.  Finding that balance is not always easy, especially competing on an increasingly global market.  The combination of these problems creates friction and considering all the variables it is very difficult to optimize alone.  Some decisions that can be best for a group aren’t necessarily best for an individual so mercy and compassion are needed for those that can be hurt by those decisions.

Conclusion

Basics of what I am getting at here is that development has aspects outside of pure technology and whether the best product wins.  A company that does great PR work might get the business instead of a company with a better product.  Important to remember there is also ways for people to introduce concepts that work like an infinite loop wasting time and bringing a corporate engine to a standstill on efficiency.  This might be more obvious at a corporate level, but this can be done to individuals as well.  Understanding concepts and new technologies is important, just don’t let the abstractions prevent you from achieving your dreams.

If I were to judge two projects, one that uses lots of frameworks and best practices, and one that spent all the time on that building functionality for the business requirement which would I choose?  Both show hard work, both are valuable.  If a project is built out of a good set of frameworks it could be a spring board for leveraging the project in a team friendly way.  If the other project completed all the business requirements yet missed some best practices, I might lean towards that project while still having the developers go back and refine the code so there isn’t a maintenance penalty later.  There is definitely a balance, and mistakes will be made, just don’t let someone get you so caught up in the exact details that you never get anything done.

Bigger team sizes can be more difficult to manage and make sure developers are working efficiently.  Having multiple architects or leads can help enable the developers on the team.  In situations where there is only one architect or lead for a large group of developers that person’s schedule can be taxed to the point they can no longer efficiently review what is happening or properly enable the group to be efficient.

From what I have seen in the industry there should probably be one lead developer per 5 developers.  With great DevOp processes, automated testing, and continuous integration this number could possibly be increased.  Though in my experience I really haven’t been at an organization where all this is perfect yet, many organizations are moving that direction but are not there yet.  Again the pursuit of perfection is admirable, DevOps is important and can help positive change in organizations.  Don’t let the pursuit of best practices bring the primary pursuit of the company to a standstill.

The same could be likened to the US government, process and regulation is important as well as a competitive market place to help make sure those regulations are properly funded.  I like clean water and I like being able to pay rent.

 

 

Symmetric Encryption

Encryption allows us to change information from a readable form to an undecipherable form.  The reason we change the data is so that those that listen in on the information will not be able to understand or use its contents unless they have a key.  Think if it like a safe with documents inside, without a certain combination a person would not be able to open the safe.

Data encryption is a little bit trickier than having a bank vault.  Imagine if the safe was instantly accessible by highly intelligent and insanely fast lock picks all around the world.  It might be simpler for them to break into the safe.  If a safe had 1,000,000 different possible combinations it would be near impossible for a user to guess the key without winning the lottery so to speak, very unlikely.  Computers can attempt 1,000,000 different combinations against encrypted data very quickly.  This poses a problem if the encryption method only had 1,000,000 combinations.

Mathematicians build encryption that theoretically cannot be broken by current computers.  My guess is some governments have the ability to break most current encryption methods, so make sure to only use this for purposes that don’t break the law.  I discuss more about this in the State of Surveillance section below.

Symmetric Encryption

Symmetric Encryption is where both the sender and receiver have the same key.  The sender encrypts the data with the key and the receiver decrypts the data with the same key.

Below is example Java code for encryption and decryption.  Bytes don’t always convert well to Strings so I added utility methods for Base64 encoding as well.  The below output just shows the Base64 encoded as the convert bytes don’t work well with HTML.

Standard Disclaimer: The below code is licensed under the MIT license, so do with it as you wish and please understand this was provided as an example so there are no guarantees it is tested properly or will work 100% of the time.

I apologize for the formatting, need to work on that a bit and I might need an upgraded version of the blog to have more editing tools.

Main method for calling utility class:

private static Logger logger = Logger.getGlobal();

public static void main(String args[]) {
try {
String inputText = "Hello Encryption World!";
// AES Encryption using javax.crypto

SecretKey secretKey = AesEncryptUtil.generateSecretKey();
logger.info("Secret Key: "+secretKey);
logger.info("Text to encrypt: "+inputText);
byte [] encryptedBytes = AesEncryptUtil.encrypt(secretKey, inputText);
logger.info("Encrypted text: "+(new String(encryptedBytes)));
byte [] decryptedBytes = AesEncryptUtil.decrypt(secretKey, encryptedBytes);
logger.info("Decrypted text: "+(new String(decryptedBytes)));

// AES Encryption and encoded into Base 64 String
String keyText = AesEncryptUtil.generateBase64SecretKey();
logger.info("Text to encrypt: "+inputText);
logger.info("Base64 encoded encryption key: "+keyText);
String encryptedText = AesEncryptUtil.encryptAesBase64(keyText, inputText);
logger.info("Base64 encrypted text: "+encryptedText);
String decryptedText = AesEncryptUtil.decryptAesBase64(keyText, encryptedText);
logger.info("Base64 decrypted text: "+decryptedText);

} catch (Exception e) {
e.printStackTrace();
}
}

The Encryption Utility class:
public class AesEncryptUtil {

public static SecretKey generateSecretKey() throws NoSuchAlgorithmException {
return KeyGenerator.getInstance("AES").generateKey();
}

public static String generateBase64SecretKey() throws Exception {
return   Base64.getEncoder().encodeToString(generateSecretKey().getEncoded());
}

public static SecretKey getBase64KeyFromString(String keyText) {
byte [] key = Base64.getDecoder().decode(keyText);
return new SecretKeySpec(key,"AES");
}

public static String encryptAesBase64(String keyText, String inputText) throws Exception {
SecretKey secretKey = getBase64KeyFromString(keyText);
byte encryptedText[] = encrypt(secretKey, inputText);
String encryptedAndBase64Encoded = Base64.getEncoder().encodeToString(encryptedText);
return encryptedAndBase64Encoded;
}

public static String decryptAesBase64(String keyText, String encryptedBase64Text) throws Exception {
SecretKey secretKey = getBase64KeyFromString(keyText);
byte aesEncryptedBytes[] = Base64.getDecoder().decode(encryptedBase64Text);
byte aesDecryptedBytes[] = decrypt(secretKey,aesEncryptedBytes);
return new String(aesDecryptedBytes);
}

public static byte [] encrypt(SecretKey secretKey, String inputText)
throws NoSuchPaddingException, InvalidKeyException, NoSuchAlgorithmException,
BadPaddingException, IllegalBlockSizeException, ShortBufferException {
byte inputBytes[] = inputText.getBytes();

Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
byte cipherBytes[] = new byte[cipher.getOutputSize(inputText.length())];

cipher.doFinal(inputBytes,0,inputText.length(),cipherBytes,0);

return cipherBytes;
}

public static byte [] decrypt(SecretKey secretKey,byte[] cipherBytes) throws
BadPaddingException, InvalidKeyException, NoSuchPaddingException,
NoSuchAlgorithmException, IllegalBlockSizeException,
ShortBufferException {

Cipher decodeCipher = Cipher.getInstance("AES");
decodeCipher.init(Cipher.DECRYPT_MODE, secretKey);
byte decipheredBytes[] = new byte[decodeCipher.getOutputSize(cipherBytes.length)];
decodeCipher.doFinal(cipherBytes,0,cipherBytes.length,decipheredBytes,0);

return decipheredBytes;
}
}

Example output

INFO: Text to encrypt: Hello Encryption World!
INFO: Base64 encoded encryption key: 4Es490DZhfdIUmpZqLefWw==
INFO: Base64 encrypted text: auxb0UW8zxLBh3CAiLvgFZExWSzNwXnlXZuD8Npxbsw=
INFO: Base64 decrypted text: Hello Encryption World!

Browser Encryption and Beware of Public Computers

Browsers use SSL/TLS encryption and there is a good article at Apache’s website.  This encryption theoretically makes it impossible for other users to listen in on browser communication.  When making purchases online generally websites require an SSL connection which is usually signified by a lock in the browser address bar.  One thing people fail to understand at times is that if their computer has been compromised both the connection itself could be faked as through a proxy as well as the certificate authority and certificate itself. A man in the middle attack.

Obviously if the computer has been compromised others can use it as they wish, so they could make purchases in your name.  Vice versa is possible as well, if they can control the site your connecting to and the other sites you are using to verify their identity, they can make a computer look secure when it really is not.

State of Surveillance

There are many ways to listen to keyboards, or on the particular computers themselves, so even if the data is encrypted before sending over the network it does not mean another user or organization hasn’t already seen the real information.  This is something to be aware of especially when typing on a computer.

Just because you don’t hit send it doesn’t mean others haven’t already read what you typed before you hit backspace.  This is an invasion of privacy and makes people distrust computers.  Under normal circumstances listening in on a persons computer should be highly illegal but for national security purposes it can make sense.  Many advertisers and development companies write fine print in their privacy statements as well so they can legally listen to every key stroke you type on their site.  Conversations or thoughts you had and expected to be private are not always so be careful.  Just because something is legal doesn’t make it right.

Further employers will listen to your computers and I wouldn’t doubt that some employees would be listening in on their employers computers or other employees computers.  So if you have some criticism for the boss, or if you are a boss and have criticism for the employees, make sure you know what you want to say before you type it.  From my personal advice, wait a day and make sure you still want to say it or saying it will actually add value to the situation.  This advice applies to anywhere with a cell phone as well, remember there are microphones everywhere.  I wish it wasn’t like that but the higher up the ladder and the bigger the corporation, people don’t like leaving things to chance.

A Primer on Programming Languages

There are many different programming languages that are built for many different systems.  Some programming languages are low level meaning they don’t have a high level of abstraction between the hardware and the language.

Assembly Language

An example of this assembly language.  Assembly language uses basic operations that the hardware knows how to compute.  The assembly language can have different instruction sets for different processors.  Assembly allows math operations, logic operations, and transferring between hard disks, memory, various levels of cache and registers.  Registers are the part of memory that are directly used by the processor.  If the processor does not have data in a register it must fetch the data from other memory.  Ideally it fetches the information from the source that takes the least amount of time.

Computers are built in such a way that they have different levels of memory.  Similar to how a person has short term memory and long term memory.  The different levels of memory are generally more expensive the faster they are like sports cars.  Registers are the fastest, if we could build processors will only register memory they could never be penalized by having to fetch data from sources that take more time.  In reality that is not the case, at least in consumer and corporate computers as I know them now.  If the processor doesn’t have the data in memory it must fetch that data from the cache.  The cache is a small set of memory that generally holds frequently accessed information in the main system memory (RAM – or random access memory).  If the computer does not have the data it needs in the cache, it will ask for that data from RAM.  If the computer can’t find the memory in RAM it will get the information from a hard disk.

Generally each step cost much more time and greatly reduces the speed of a processor. Luckily as technology has progressed we have more room on the lines to send that data across, so we can take the penalty in shorter amount of times and ideally pull a large set of data to make sure we don’t have to keep going back to RAM or hard drive for similar sets of information.  We call that system the bus.  Initially we had smaller buses that could only transfer small amounts of data.  Now we have larger buses that can transfer more data.

Assembly allows us access to those basic functions but not much more.  Assembly closely compiles to machine code which is directly run by the processor itself.  Everything a person wants to do in assembly they really have to do with those basic computer functions.  This is why higher level languages and abstractions were created, so more complex concepts could be expressed.

High Level Languages

The basic functions of a computer are great for doing math and transferring data but converting real world concepts into this kind of code is difficult.  Imagine building a house with only a hammer, wood, and a box of nails.  This can be done, but what about plumbing, electricity, insulation, the size of rooms, and other more complex concepts?  That is why higher level languages were built.

Computer Scientist don’t like reinventing the wheel all the time, unless the wheel is broken (many times though they think they can or need to reinvent the wheel).  Sometimes though the wheel is broken, and it needs to be reinvented or can’t be trusted as currently made, though that is a bit of a tangent.

Many programmers have worked hard to create both open source and closed source projects and generate abstractions above assembly with different languages.  These higher level languages can be grouped in to categories.  Some compile directly into machine code that can run on the computer.  They basically compile into object code which is like assembly.  Another type of languages compiles code into byte code, which is a set of instructions much like a processor understands, but then the virtual machine converts those byte code into actual instructions the processor uses.  Finally there are interpreted languages, like scripting languages where the code is not compiled and just interpreted by another program running on the computer.

Compiled Languages

Examples of compiled languages: C++, C, Objective C, FORTRAN, COBOL

Before the existence of virtual machines lots of programming was done in compiled languages.  Initially virtual machines did not have just in time compilation and did not have all the features they have today.  Some have argued that virtual machine programs run as fast or faster in some cases because of optimizations than the compiled counter part.

Pros: fast, does not add another layer of abstraction between the hardware and the program which could add to security or reduce security

Cons: generally tied to one platform, no just in time compilation, possibly more rigid and less expressive – tools like reflection might not be available

Virtual Machine Languages

Examples of virtual machine languages: C# and Java

In the time Java was created there was Unix, Apple, Windows, and Wang computers as well as more.  Having to recompile code for each different machine made distributing and packaging the same application for multiple computer types difficult.  The idea of write once and run anywhere helped drive the conception of the Java virtual machine.

Initially Microsoft also had their version of Java, Microsoft J++.  After some lawsuits they gave up on using Java but made another product which runs on a virtual machine, C#.  Virtual Machines have some power that allow a great level of abstraction from the systems that they are working on, with many different hardware vendors this can be powerful and help not tie developers to a particular hardware vendor.  This can also allow for powerful debugging, profiling, and security tools to inspect what is being run on the system.  With any level of abstraction, this could reduce performance or introduce security risks.

Pros: Does not have to be recompiled on different systems. Same Java code can run on Macs, Windows, and Linux.  Just in Time (JIT) compilation can allow certain optimizations for particular systems.  Automatic garbage collection, this allows developers not to worry about complexities around allocating and de-allocation of memory.

Cons: Might have a subset of functionality available to a particular system, could potentially not be optimized for running on that system, not bare metal – there is a layer of abstraction that could introduce security risks

Interpreted Languages

Example of interpreted languages: JavaScript, Python, Perl, PHP, Ruby

Interpreted languages or scripting languages generally have the ability to interpret each line of code and call a specific set of functionality based upon this versus actually compiling the code to machine code.  This works much like the virtual machine does without byte code, though some of the newer browser engines have the ability to compile this to an intermediate representation.  Also languages like JavaScript have the ability to minimize the code into more a more machine friendly format which could increase efficiency on both file transfer and performance.

Procedural (FORTRAN or COBOL)

Most of the original languages were functional.  They did not have the concept or objects or classes.  The moved to different parts of the application via procedures (blocks of codes with inputs and outputs).

Object Oriented

Object Oriented programming helps create an abstraction of real world objects.  The idea is that objects have both data and functionality.  An example object could be a Dog object.  Dogs have a height, weight, appetite, and breed which could all be data associated with the Dog.  They also have the ability to bark, fetch, run, rollover etc which would be part of their functionality.

Passing a Dog object around programmers can call different functions such as bark or eat and this could change an appetite variable within the Dog object.  In object oriented program there is usually a conception of hierarchies as well.  There could be an animal class which could have basic functionality and variables like height.  This could be extended as a Dog, a Cat, a Snake, a Dove class etc.  The sub classes can have different functions.  Dog could have a bark function, and a Dove could have a fly function.  They both could use the eat function specified on the animal class.

Wikipedia has an article on the greater complexities of this.

Strongly Typed Languages vs Loosely Typed Languages

Loosely Typed

Some languages like JavaScript developers can assign any variable type to a variable.  This is called loosely typing, the variables don’t require a specific type so they are not as stringent.  An integer, a float, a string, an object can all be stored in a var in JavaScript.  JavaScript can be powerful because this lack of type can reduce work for programmers and can allow reuse of functions for many different types, and can make the language less restrictive on the developer.

Strongly Typed

Other languages like Java and C++ require specific types to be assigned to certain variables.  I like other developers see this as a benefit as some of the errors can be found at compile time.  I also understand that this can require extra boilerplate code which can make development less pliable.  The strict typing will throw an error if you try to assign a String to an integer for example.  This forces the developer to deal with the issues before they are in testing or production rounds.  This strict typing can be worked around by other mechanics within the language and can be useful at times.  Such as that every class in Java is an Object, so if a developer writes a function that takes Object as the input any class can be passed to that function.

Programming Language Performance

I have not done performance testing on this so I will leave that up to other articles to prove or disprove.  A lot of money can be won or lost and there are legal restrictions around published performance results.  This is understandable as vendors wish to show their technology in the best light possible.  It is also understandable that as a user of the the software you would want to know its strengths and weaknesses.  So my personal suggestion would be write your own performance test on multiple languages and run them in a disconnected isolated environment without other programs running.  Preferably on machines you know haven’t been compromised.

A Few Words On The Industry

Many developers have worked many years with certain technologies.  Their resumes and their well being is attached to whether or not a technology succeeds.  I have a personal experience with that.  I was using Apache Flex which uses the Flash run-time environment and after Steve Jobs discussed Flash being insecure and the reason Macs crashed the industry started shifting away from Flex.  Even good technologies can fail if politics change around us.  Programming work generally pays pretty well, given my own life experience I would suggest saving because you don’t know when and if the politics about a certain technology might change around you or what kind of health problems you might experience.

I believe in charity and trying to help others and this is also important to understand.  I am currently going through bankruptcy and had been extremely close to bankruptcy years previous.  People sell the tech sector as always having work.  Some bosses get very stringent on exact requirements for developers and can make matching your skillset to their needs difficult.  Further developers are competing on a world market where great developers from other countries have great skillsets as well.

Strict regulation and high wages in the US can make it more difficult for US companies to compete on the world stage.  Some executives will decide they have to outsource or find it more cost effective to outsource to other nations.  Businesses are for profit though they should also look out for the people that make them great, and finding that balance is not always easy.  Not all businesses are looking for there to be a balance and my guess is that will be the downfall of that business overtime.  Focusing only on short term profits can bankrupt organizations but so can shifting technologies, too much red tape, bad PR, or many other reasons including those that are unforeseeable.  So short term profits might be all a person gets which is why saving and being smart financially is important, as well as learning new skills and keeping off the bad PR radar.

When times get tough people might leverage any of your personal problems as a reason to keep their jobs.  I would advise being exceptionally careful in merger situations as technology companies generally only need one set of infrastructure to complete a particular task.  Ideally companies would work together to find new positions for all those in the other organization but that might not be the optimal amount of labor to compete against the competition on an increasingly worldwide market.  This mindset does not just apply to organizations at large, it can also apply to teams competing with each other for funding, or even people on a particular team trying to climb the corporate ladder.

All that said I don’t want to scare people away from the industry I would just like them to understand some of the difficulties I have faced in my life and hopefully give a fuller picture of what the computer development industry is like.  I can’t say there are perfect fixes to any of these problems though if you are struggling through or have struggled through similar things know you aren’t alone.

Introduction to Encoding and Decoding

What is a code?  A code is a way to represent information in a different way than its original presentation.  The different representation can be used to make it so only those that know how to decode the message can understand the information.  A code also can be changing the way information is presented to make it more readable to other people or systems.  Louis Braille generated a code that allowed blind people to read books.  The sight book are encoded into different bumps on paper that allow the blind to read the information.  This encoding is known as braille.

Encoding Examples

Braille is one form of encoding.  Letters and Arabic numerals are another form of encoding. Changing a text from one language to another such as French to Italian would be another example of encoding the same information in different ways so others can read it or to prevent those who don’t know how to decode the message from reading it.

Many of the examples I have given are examples of how people send encode and decode messages.  Computers are machines.  A machine like an engine are generally built for one purpose, like making the wheels on the car turn allowing us to drive down the road. Computers are built for a purpose as well, math, logic and data operations which I discussed in my previous article.

How do machines store information?  Much like a printing press stores different letters in a book.  The book would be the memory.  The printing press writes each letter and the information is transferred to the hard copy, a book.

The way computers store information is much the same. Computers have many different technologies and mechanism and different types of memory but at the basic level they store information with light switches (figuratively speaking).  If a light switch is turned on, it is represented as a 1.  If a light switch is turned off, it is represented as a 0.  This allows us to store two representations which is called binary.  Computers speak in binary and other encodings like we speak in English or other languages like Chinese or Spanish.  So how would one represent a number like 7 or 3 in binary? Binary only has two values which are 0 and 1 which makes this a bit confusing.  Much like we can add numbers in the front of 7 to say make 17, or 27, or 37 we can add values in front of binary to represent greater values.

What are some examples of binary encoding?

Normal Decimal Number Binary
0 0
1 1
2 10
3 11

From the table above we can see that 0 and 1 have the same values in decimal as they do in binary.  Binary can represent those two numbers without having to add a greater value.  Binary can’t represent 2 or 3 in just 0s and 1s so it needs to add a greater value, so to represent a 2 it adds 1 to the front.

In decimal we represent each digit progressing left as a multiple of 10. That is why decimal encoding is considered base 10.  In binary we represent each value in multiples of 2, that is why we consider it base 2.

Binary Number Decimal Number
0 0
1 1
10 2
100 4
1000 8

The way to convert a binary number to decimal is we need to look at the position of the 1.  We generally ignore 0s as they represent values we don’t have to add.  When considering position the first position is considered position 0. So at position 0 for binary 1 or 0 we just add that value.

Position 1 in binary is where we have to multiply by 2. So if the binary encoding is 10 then we multiply the 1 in Position 1 by 2.  So 10 is represented as 2.  Further 11 is represented as 2 (from the first position) + 1 = 3.

Further representations are the same way. If we look at 100 we take then its Position 2. We find the decimal number by 1 multiplied by 2 to the exponent of the position.  Generally in computer programming we represent exponent operand as ^.

100 = (1)*2^2 + (0)*2^1 + (0)*2^0 = (1)*4 + (0)*2 + (0)*1 = 4

More examples

101 = (1)*2^2 + (0)*2^1 + (1)*2^0 = (1)*4 + (0)*2 + (1)*1 = 4 + 0 + 1 = 5
110 = (1)*2^2 + (1)*2^1 + (0)*2^0 = (1)*4 + (1)*2 + (0)*1 = 4 + 2 + 0 = 6
111 = (1)*2^2 + (1)*2^1 + (1)*2^0 = (1)*4 + (1)*2 + (1)*1 = 4 + 2 + 1 = 7

These are examples of decoding binary numbers into decimal numbers.  Examples of encoding from decimal into binary is similar except we use division and look at the remainders instead of multiplication.  Below is a useful link that shows the longhand division.

Decimal number Conversion Binary
0 0/1 would give no remainder 0
1 1/2 would give a remainder of 1 1
2 2/2 = 0 remainder and 2/1 would give remainder 1, flip this to 10 10
3 3/2 = 1 remainder and 2/1 would give remainder 1, flip this to 11 11
4 4/2 = 0 remainder and 2/2 would give 0 remainder, 2/1 would give remainder 1, flip this to 100 100

Other computer encodings:

Decimal number
(Base 10)
Binary
(Base 2)
Oct
(Base 8)
Hexadecimal
(Base 16)
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
100 1100100 144 64
1000 1111101000 1750 3E8

 

This article will be a precursor to hopefully some other articles on base 64 encoding and then encryption.

Ethics of Encoding

All technology can be used for good purposes and bad purposes.  Intelligent people know they can create associations with certain things in peoples mind.  They can tie colors or numbers to different things in society.  They can use this to break down communication between families, cities, and states.  Many times those that create encodings such as these don’t understand the full ramifications of all their actions.

These encodings can be used to teach bullies a lesson or they can be the instrument of bullies themselves.  Street names or other companies names could be taken out of context.  Through this they can derail companies or societies themselves.  It is a bit of a chicken and an egg problem.  Did the company know their name would be taken out of context or did others leverage their name to bankrupt the company.  A little bit of knowledge goes a long way.  I don’t understand any different human languages and not being able to pick up on puns or other types of encoding in other languages or multiple languages might be a blessing in disguise.  The idea that we should all think better of other people doesn’t only help them, it generally helps us.  When a group of people builds mistrust in any person it can make them question who is on the level and who is not.

Important to understand that mixed with different types of drugs these encodings and associations can be leveraged to manipulate people in to acting in certain ways, both good and bad.  Also sad to say that health problems and other issues that are no fault of the person can be leveraged by others for this same purpose.  This is why we need vigilant people to be able to understand what is going on at different times.  We also need to watch closely that some master plan isn’t unfolding right between our eyes.  Disrupting this encoding can be important at times.

It is sometimes difficult to know which side of the fence a person is on, so telling this to people might let you know your onto them.  Yet not telling someone this can make them appear to be a certain way that they are not.  Others might prefer to orchestrate someone else telling them because they are too afraid to say so themselves, definitely understand both sides of the coin on that one.

People use encodings as well, through non verbal communication.  Things that might be obvious to others might not be so obvious to someone else.  Proceeding with a level of caution with all human beings is extremely wise.  We don’t know what the other person has been through, nor what health problems they have.  This can change on a daily basis which can make this even more difficult.  Add in drugs and alcohol and it can be a recipe for disaster.  All that said, many of us don’t hear this, or we don’t understand in the way it was communicate to us.  Maybe someone would try but because of other issues they weren’t able to listen, or maybe the people that should have said something didn’t have the capacity at the time.  This is why grace is important, it not only helps others but also frees ourselves down the line from paying for things we didn’t understand at the time.  That said people that understand this might be less likely to take chances going forward, the probabilities and possibilities of failure can be overwhelming to the point they choose not to act and fail to speak up when necessary.

I generally try to look at the motivations behind a persons actions, though even this can be deceptive.  Some people might want to make others take pity on you by being mean.  I consider this a bit of a failed logic.  Others might just want to spar a bit but it would be wise to make sure both are at capacity for a fair fight and people aren’t actually getting hurt.  The main point from above being that people can encode information in different ways and that others don’t always understand the information encoded which can result in miscommunication.

This is also why living in cities can be difficult.  There are more interactions and less time to deal with those interactions in a graceful way.  People in cities might have just experienced 100 problems that are out of our control, if they sound like a jerk, it might not be because of us.  We would like to be able to expect they will treat us with kindness and treat us as we would like to be treated, but at that point in time, they just might not have the capacity.  Giving a person who seams mean or unhappy the benefit of the doubt and trying to do right by them the best we can might not make things better with our interaction, but it might help ease their burden or prevent problems down the line.  Excessive pressure on any person, organization, or society can cause it to collapse.  I don’t want to clean up the mess, so hears to hoping I will have the capacity to give others the grace they need.  Remember also that others can reverse this process to try and destroy people, then use it as an excuse to go to war.

 

Links to similar articles

http://www.wikihow.com/Convert-from-Decimal-to-Binary

Introduction to Computer Programming

Many articles have been provided for me to read over the years that have helped me learn more about development.  This will be an attempt to help the community learn more about computers and how to program.  This is not an attempt to replace any other articles already written on how to program.  I have been in the industry for years and hopefully can communicate valuable information to those starting out.  This might also give some basic knowledge to those who want to understand the basics, because as technology evolves our lives will be shaped by its influences, both good and bad.

What is a variable?

A variable is like a piece of paper.  It is a place to store information.  In computers we call this memory.  For the purposes of this tutorial we will use variables like X and Y. Computers find answers and then store the information they find so they can make decisions based upon those answers in the future.

What is an instruction?

An instruction is similar to a command.  It tells a computer one thing to do.  Computers are great with Math.  At the basic level we can instruct a computer to add, subtract, multiply, divide, make logic choices, and move information from one place to another.  These are the basic building blocks of all programs.

Examples of instructions:

  • 1+2
    • If I tell a computer to add 1 and 2 then the computer will return the answer 3
  • 10/2
    • If I tell a computer to divide 10 by 2 then the computer will return the answer 5
  • X = 4
    • If I tell a computer X equals 4,  then the computer will store the number 4 in the variable X

What is a program?

A program is a set of instructions. Not much different than a chore list. A program tells the computer what to do and in what order.

A basic program:

  • X = 1+2 – The computer returns the answer 3 and stores it in the variable X
  • Y = 2+3X – The computer reads the value of the X variable.  From the previous instruction we know the variable is 3, so the equation is now 2+(3*3), which the computer reduces to 2+9, which the computer reduces to 11. Now that the computer has found that the answer to the equation is 11. The computer will store the number 11 in the Y variable.

This example program has computed the answer to an algebra equation.

How does a computer make logic choices?

Computers have several different logic operations. They have the ability to check that two variables equal.  They have the ability to check if a variable is less than or greater than the other.  Computers use this kind of logic to determine which path of instructions they should follow.  A real world example of a human making a logic decision would be if laundry is done drying then take laundry out of dryer, if laundry has not finished drying leave clothes in dryer until dry.

Example:

  • if (X equals 4) do X=X+1 otherwise do X=X-1
    • this is a true or false check, X = 4 from the line above so the computer will solve X=X+1, thus X=4+1=5, if X equaled 1,2,3,5,6,7 etc then the computer would have computed X=X-1

A more complex view:

How computers actually move information around is built upon electricity.  Electricity is like water.  Electricity and water both move. Water moves through pipes and electricity moves through metal or other conductive material.  Computers have the ability to divert electricity into different paths using transistors.  Water could be diverted to different paths based upon how much pressure flows through a pipe or which gates are opened. There are other examples in nature that could create computers as well.  Computer manufactures create transistors from the element silicon (sand is silicon). They stamp small gates that tell the electricity where it can flow and where it cannot.  Using this method they create addition, subtraction, multiplication, division, logic operations and the ability to store that information. Storing information is like a light switch, in computer programming we call this binary which is a 0 or a 1. Using 0s and 1s larger numbers can be stored, and even text, pictures, music, and videos. As well as more instructions for a computer.

Security in Computers

Why is security so important?

Many systems initially are built with the idea can we do this, rather than how do we do this best.  Building a house without locks and doors could let the wrong people into our house.  Computers are much the same.  Computers are used in healthcare, and control our basic utilities like water, electricity, and even when shipments of food are sent to markets.  They also are used to design buildings and even allow us to listen to music online and talk with our friends.  They have become a part of day to day life and if we don’t secure them correctly all of the above and more could be affected by anyone in the world.

Why is security so difficult to do right?

There are many governments in the world with various levels of understanding of computer systems and cyber warfare. There are also rogue organizations of people in our country as well as other countries that might be able to launch attacks or attempt to steal secrets or leverage individuals.  Another issue is the verification problem – one person could not add in many lifetimes even close to the numbers 1 computer could add in one second.  So we are dependent on other machines to be able to verify what we know is correct, these machines themselves could be insecure or compromised.  Further there are billions of people in the world and many services and computers all communicating at different times in different ways.

This global network is constantly evolving and the complexity is such that no one person, and no one machine (that I know of) would be able to capture and effectively analyze all this information.  That doesn’t stop some from trying though.  Humans are imperfect, and they might not always secure systems effectively or have the time or ability to do so.  Computers are also imperfect, many of us would like to believe they do everything exactly right, but that is not the case, service outages, bugs introduced into the system, and systems interacting in unexpected ways and as a part of the more complex global network can all cause problems.  Like cars or any other piece of machinery it would be unwise to believe that they will work perfectly all the time. This does not mean they are not useful and can’t help us solve many complex problems. It just underscores how important cyber security is to our lives.

Imagine a system where a dam controls water to a city.  There is a set of computers that control water flows from the gates to make sure enough water gets through to power the generator.  Now imagine that someone or some entity causes the dam to stop turning and create enough water pressure that caused the dam to bust and water to destroy a city.  It is understandable we would want to keep people with packages from walking up to the dam because they might be carrying a bomb.  It is not always as easy to understand that compromising these network systems could create the same level of problem.  Even scarier these days is that even if a system wasn’t previously connected to a network, it is possible to install satellite and cellular chips that are now more accessible to the general public.  So networks that were previously protected by a firewall can be just walked around like the wall the French built in WWII.

Securing computer systems requires physical security, network security, great programming practices, secure systems where the programs are built, and other complexities such as encryption algorithms.  Scaling factors and fault tolerance also can be an issue as botnets could bankrupt cloud based companies and overload their systems.

If securing computers is so complex why do we even try?

Computers make life more convenient in many ways and can help us analyze complex data such as detecting tumors and saving lives.  In the movie Interstellar they make this point talking about MRI machines.  Computers also allow us to generate creative content and socialize with our friends around the world.  They give us access to information and libraries that were previously not accessible to certain parts of the world.  Insuring that we get that information in a secure way and they are not controlled by bad actors is paramount to their successful use.  One of the things to remember about computers is there is no 100% secure system.  We should all be careful about what information we share outside of our brains, and I am not sure even that might not be accessible in the near future, if not already.

Security is like the medical practice, just because we know bacteria could get on sterilized equipment in a certain small percentage of cases, we should still sterilize the equipment so we are optimizing the probability that something bad does not happen. Now imagine doctors trying to make sure their equipment is sterilized when a global network of people can mess with their office, where their files are, what times appointments are etc.  We can make good security choices in isolation such as using a card reader to control access to a hospital.  Making choices with many other factors becomes much more difficult.

Security can also slow down productivity, if someone is dealing with national security, time they are taking to deal with security systems could waste time if not implemented effectively.  The benefit to securing a system has to outweigh the time it takes to follow the best practices of the system.  Even as I type this there is no guarantee this will get to other users in the current form I have created it. Others could modify the words and the information and could build mistrust, or try to get people to trust systems they should not. This is why there are digital signing algorithms, a healthy mistrust of those is important as well, we should use them, rely upon that, but realize they might have been compromised.

Yet how in society do we have bridges that are built correctly and generally get through life for years? We have others that are vigilant and fighting this battle, and possibly those that prefer to leverage us will only do so when it benefits them.  Important to remember that the potential for being leveraged is high by both good and bad actors so being careful of what information is communicated on these systems can possibly save a lot of heartache.  Further it is important to remember that even though we might not be directly sending this information, others could be recording our conversation or taking our information and misusing it.  Others can take compromising pictures or leak classified documents and share them on Facebook without our permission which can damage reputations and have much greater consequences.  Sometimes the people doing this don’t have a valid grasp of social impact and the retributive damage it can do to their own lives.  Sometimes they could just be drunk frat guys that thought something was funny at the time – not trying to excuse this behavior, just hind sight is 20/20. Not quite

Important also to remember that computers are just one tool in an arsenal of many.  So they might not make the best judges, understanding mercy and being able to look at many factors might not be best left to statistics.  It would be easy to think that just because it is 99% likely that they are guilty that their case shouldn’t be reconsidered.  If those systems were insecure or leveraged at the time then they might not have made perfect judgements.  Also important to remember judges are imperfect and might not have all the information as well.  A healthy mistrust of all technology systems is important.  Just like walking across the street there is a probability I might get hurt. Doesn’t mean I shouldn’t ever walk across the street, I just should do so in the safest way possible.

Be careful of any online addiction, it is simple to be lulled into a false sense of security.  They can also be leveraged in ways you didn’t think were possible.  I was watching a lecture by Former U.S. Secretary of the Treasury Timothy F. Geithner and Professor Andrew Metrick on the global financial crisis from Standford on Coursera.  They talked about the problem being “A failure of imagination”.  To be clear this is not from a position of judgement, just trying to save some others from experiencing pain like I have in my life.

———————–

I can’t say this is the perfect way to communicate this to every person out there, I think if I had read this and taken heed of its information I could have saved myself some problems and regrets in life.

Portfolio and Useful Information

I would like to provide a portfolio of projects to showcase my work to potential employers and help others that might be interested in working on technology learn more as well.  This will hopefully be a site where others can learn about technology without being offended. I say hopefully because like all human beings I can make typos or say the wrong things in the wrong way at the wrong time. So cheers to hopefully saying the right thing and please feel free to let me know if I have a problem – in a civil manner.

Also I apologize in advance for some of the naming conventions used by the tech industry, I have failed that test at times as well.  People like to have fun with names I get it, just annoying when your entire resume starts sounding bad.  I suppose the younger we are we don’t always see how things could sound or be read into.  Not really fair for the world to do that but it does, so trying to walk that line accordingly.  What I find humorous in a bar is far different from how I want to sound making presentations and it might push people away from wanting to learn technology or other topics for that matter.  Also people with health problems can be effected in a whole different way.  Many of us haven’t experienced certain health problems so I am going to try to error on the side of caution so that others can learn here.  This is meant to be professional and creative, going to try to combine the two without compromising either.

Best Regards