Author Archives: Shadow_of__soul
Hi,
recently, visiting one of the most popular Anonymous site’s to check some of their news, got my attraction at the donate section, a logo that say’s “Bitcoin Accepted”, in my infinite curiosity, i made a click and i learned what bitcoin was and what i want to share with you.
What is bitcoin?
Bitcoin basically is a virtual currency, like mochimedia have the mochicoins, like facebook have their own etc.. but the difference remains in there is no issuer or centralized institution that control how much it worth, how much of this coins are on the market or if there are available or not. like the P2P systems, users run the program and handle the transactions, yours and others one, where you can send and receive bitcoins.
Who or how is the bitcoin value decided ?
As a decentralized currency, the value is made by the goods that can be exchanged with. there are several people and company that will accept bitcoins for services, products, licenses and there are even exchangers that will give you USD,EUR or others virtual currency’s for it. basically the value of the bitcoins is made by their own users.
How i can get the bitcoins?
there are several methods, the most effective is selling something (as a product or service) for bitcoins and with that, buy any other thing or exchange it for USD or other virtual currency in some exchanger. the other method, the hard one, is running the program and check the option “generate coins”, this will use the remaining process in your machine and generate the coins in some period of time. depending the difficulty level and the number of hashes per second that your machine can make, it will take from months to years to generate the first 50 BC. anyway, is free money, and you are contributing to the system.
Where you can exchange bitcoins for real, virtual goods or money?
you will find all the necessary info in their site you will find a large list of services and exchanger that could fit your needs. by the way, i’m also accepting donations in this currency too
there are some advantages and problems in the system that i will detail:
advantages:
*like is a p2p currency, if there are users that run the program and give to the coin a “value” it will live forever.
*like there is no central authority, cannot be taken down by anyone, and no one can screw you up (didn’t even the creator of the app) why the other clients will correct the problem or the variation.
*if there any trustful virtual currency, i think this is the best in the market.
problems:
*the “wallet” where you have the money, is stored in your computer, so you need to have a persistent backup solution, why if not you will lost your money
*like is in your computer, others can steal it
*like is a p2p network, the payments are not instantaneous, if you are not running the app, could take more than 10 minutes to get credited the transaction, and even then, is better to wait for some confirmations from the others node networks to be sure that is legit.
i think is a project to follow and support, using it, donating real or bitcoin money, and a good opportunity to those service providers to offer another payment method in their websites.
Regards,
Shadow.
Related Post
Hi,
weeks ago i posted this function that basically let you serialize object and arrays in javascript and is compatible with the unserialize funcion in php. recently i discovered a problem in this function related with the management of the weird, other language characters. the problem is that when you save a word with, let say, russian characters, the count of the chars is different as how php do it, so when you try to unserialize the string you get a offset errors. to solve this, you need to convert the string into unicode, serialize it and then send it to the php.
the function to convert any string into unicode with javascript is the following:
function convertToEntities(tstr) {
var bstr = '';
for(i=0; i127)
{
bstr += '&#' + tstr.charCodeAt(i) + ';';
}
else
{
bstr += tstr.charAt(i);
}
}
return bstr;
}
and in the php, you process the string like this:
$unserliazed= html_entityt_decode(unserialize($string),ENT_NOQUOTES, "UTF-8");
is very important that you set the UTF-8 charset to the decode function, so you get the original string.
also, remember that the database need to be support unicode-utf8, here you will find a quick guide for it
Regards,
Shadow.
Related Post
Hi,
recently, i have a problem with the flash content in a page that is customized by the user. the problem was that i popup a div with a higher z-index to show some info, this popup was not showing it in front of flash or youtube embed videos. and to make it more difficult, this content was load using ajax and even that i could filter the information or the html code, i prefered to make it using javascript.
here i will share with you the function that process all the objects, embed and youtube iframe tags and set the wmode that you want to them.
function setWmode(mode,reinsert,youtube){
if(youtube==true){
var allIframes=$(document.body).getElements('iframe');
allIframes.each( function (item, index){
if(item.get('src').test('http:\/\/www.youtube.com\/embed\/')){
item.set('wmode',mode);
item.set('src',item.get('src')+"?wmode="+mode);
if(reinsert==true){
var newElem= item.clone(true,true);
var parentElem= item.getParent();
item.destroy();
parentElem.grab(newElem);
}
}
});
}
var allObjects=$(document.body).getElements('object');
allObjects.each(function (item, index){
var allParams=item.getChildren('param');
var WmodeExist=false;
allParams.each(function (item2, index2){
if(item2.get('name')=='wmode'){
item2.set('value',mode);
WmodeExist=true;
}
});
if(WmodeExist==false){
item.grab(new Element('param', {name: 'wmode',value: mode}));
}
if(reinsert==true){
var newElem= item.clone(true,true);
var parentElem= item.getParent();
item.destroy();
parentElem.grab(newElem);
}
});
var allEmbed=$(document.body).getElements('embed');
allEmbed.each(function (item, index){
item.set('wmode',mode);
if(reinsert==true){
var newElem= item.clone(true,true);
var parentElem= item.getParent();
item.destroy();
parentElem.grab(newElem);
}
});
}
this function requires of 3 paramenters:
mode: the value of wmode to set
reinsert: what this make is, clone the iframe/object/embed, erase the original and insert it again on the same location. this is made when you load the content before you set the wmode, so you can restart the load of the flash object and the wmode will have effect.
youtube: process or not youtube videos
i hope it help you in some way and save you maybe some time
Regards,
Shadow.
Related Post
Hi,
a few days ago i started to make a paypal express checkout integration at the project i’m working on. i started to look at the developer documents to know how it works. all the most valuable info is here, here here and the samples of code for several languages are here.
How express checkout works?
EC works in this way: in your website you have a shopping cart or a buy now button. with the api signature or certificate that grant you access to the paypal API, you make a call to the NVP service SetExpressCheckout. this service will register the order at the paypal server. to this service you send all the order data, as the price of each item, the taxes, if need to be shipped or not etc.. paypal will return to you a access token, that you will use to redirect the user to the paypal website to authorize the payment. when the user authorize the payment, ger redirected to the returnurl you defined at the SetExpressCheckout call. in that moment you will ask the user any necessary data that you may need (as the shipping address or any other personal data) and put a button to confirm the order. when the user press the button, you call to the DoExpressCheckout service at paypal, sending the same parameters like the last call adding the toke and payerid that paypal give to you. and that’s it, the order has been processed, paypal with return to you if the order has been processed or not and the transaction id that you should keep in a safe place
now i will give you some tips that could help you at the moment of the integration:
Get test account from the sandbox environments
one of the docs i linked here, give you some api username, password and signature ready to use, but i tested it with them and i just got the general error of the timeout, so basically they are not valid. so go to developer site and sign up for a account. remember to put a email and user names for the test account that will not have numbers, if not you will get a error at creating the test accounts.
3dr party billing
one of the best features of EC is the 3dr party billing. with this you can use your own account api access to make the order but will be credited to someone else. this is useful when you have a project that offers the users a way to charge for the service or something like that. the money charges goes directly to the specified account. to make this you need to add a SUBJECT parameter to the call, with the client paypal email and also the client need to add your API username in the list of their api access. there is no fees and don’t have any cost for your account to do this.
Timeout error
this is a general error that you can get trying to make the calls at paypal, most of the errors are descriptive in their problem, just print the return of paypal to figure it out. if you get this error could be for several reasons, like a really timeout why the paypal server are down or your connection have some problem. or the api credentials are wrong, or you miss or have some parameter wrong in the call. unfortunately is a try and error task to solve this.
i hope it help you in some way to get working your EC integration easy and fast
Regards,
Shadow.
Related Post
Hi,
2 reflexive post in a row
. sorry about this, are the result of what happened to me on the last days
i bring a complicated subject today. there are people who lead and people who follow, has been like this from the beginning of the time, when our ancestors lived in the jungle or whatever, there has been always someone that have marked the path to follow and those who followed that path.
how this is related to development? well, it can help you to figure out how to reach a position on a company or even help you to decide what to do with your career, or just help you to be a better person, ergo, a better dev. also could help to managers to determine the potential and role of the employees, to optimize their work.
first of all, let define the roles:
Leader
the leader is the one who have defined a direction, a path to follow, that can or not know how to transit that path, but is determined to figure out how to do it. have the enough self determination and self confident that what he thinks is right, but at the same time, should be able to listen their surrounding and take decide accordingly.also a leader is able to recognize their errors and take the decision to fix them.the leader can be nice with their subordinates and transmit to them security and trust but at the same time, have respected with them and draw line that separated both classes whiteout needing of fear and in a polite way. the most important skill of the leader is that they can keep a cold head and take objective decisions and do not regret them even if they are incorrect.
Follower
The good follower will follow, but also will high his voice in case see something wrong or can say something useful. the follower need to realize that is part of a engine, that is the fuel of that engine and should be responsible of his acts and attitudes, why is what the leader expect from him. the follower should have initiative, trying to be a perfect his skills and always be useful, be the fuel for the engine that the leader will use to transit the path. this should not sound like the follower need to be something like a slave, need to be the opposite, need to be a constructive asset to the organization.
all of this could sound too philosophic but i’m getting to a point here that is the following:
Nor the leader or the follower are more important between them, one could not exist whiteout the other, and complemented to build something bigger, a organization.
my personal opinion is that you need to born as a leader, you cannot convert into one, and vice-versa. and you need to know that you are not more or less important if you are a leader or a follower (is what i tried to say earlier), but is important that you know what you are, to focus on that and don’t waste yours and other resource in something that you will never be.is possible that you are a leader or a follower and do not know it, it’s a matter of look in yourself, be sincere, review your past, present and future, try to review your way of thinking the stuff and evaluate your decision on stress situations that you could have on the past, when you needed to take decisions (and if you didn’t have one, create it). to determine who you are, is just a journey of self honesty.
no matter what you are, if you know who you are and what is your place in the world, you will find the answer at your questions.
so, you are a follower or a leader?
Regards,
Shadow.
Related Post
Hi,
today i have a reflexive post for all of you
those who know me, can say that my design skills are in a level of a developer. i’m not a designer, i do not pretend to be one really, i like coding more than doing anything else but when you are not only a developer, but also in charge of make improvements or decide about a product in their general aspect (functionality, aspect, usability etc..) you need to have basic/advanced knowledge about the design process. when you try to develop a product, you are talking about a whole thing that involves all this things, not only the code. the people who will use will not care about how you code it (except if the product is a code itself that will be used by devs or a product that can be extended by the client). is something seamless when you see a game developer talk about a incredible piece of code or algorithm that make something awesome, but still the game is shit
i have learned based in experience how to “look” at a product. is something that can be taught and studied but is really useful just doing it. the process is simple, but hard to take it in action. is simply ask you several questions and look in a objective at the product.
Did this really meet the purpose of the product?
Is easy for the user to use and accomplish what is trying to do with it?
The secondary functions are not bothering the use of the product?
I like it when i see it?
How i feel when i see it?
How i feel using it?
Can be more simple?
there are several process to answer this questions. first of all, you, the person on charge of the product need to be objectively answer this questions. after this, you need to put someone that never used it and target the audience that will use it and observe how they react. just in silence, do not give them any help, just observe and see the user reactions. is a iteration process and hard to do, but is the only way to make it. also, there are some gold rules that you should follow to make it in less iteration possible.
Simple is better
my boss always say that you need to make it idiot proof, and he is right. you need to simplify the process of do something in less steps as possible first, even if it require to delete some secondary feature. after that, you need to make it visually easy and obvious to fin the steps necessaries to make the action. again, is a iteration process that could take several revisions to optimize it accordingly.
The call-to-action elements are essential
call-to-action is something used always on the sales sites and marketing stuff, but is something that can be applied to almost anything. if you intent that the user to buy a product, you need to push that user that is already interested to make the deal with you. in case of sales, this is used explaining the features of the product, showing demos, etc.. but if you look in detail, the most important part is that the user have always a button close to buy the product, and the process to buy it is easy, fast and obvious. the page make the user experience less painful as possible, to avoid the regret feelings or the buying feeling. you should apply this for anything that have contact with the user. the experience need to bring joy and make it easy, put the action itself easy to find and use (of course with moderation in the qty, you don’t want to flood the user either), this will push the user to make the action, together with all the other elements.
The emotions are importants
The humans are emotional things, we do things drive by the emotions. we want to be better, so for that reason we study, we want to be stronger, for that reason we train our body etc.. be sure that the functionality, design and usability can transmit the correct emotions to your user. if you want the user enjoy the app, transmit joy, reward him, be sure that is not too frustrated (i think the frustration is always there on the human self) to leave or stop using your app. the use of your app should be not painful in any aspect. this can be achieved choosing a good selection of colors (light colors transmit peace etc..) and a flowing usability, where the user is guided to the options and not forced or need to think too much to do something that wants.
Support the users
This is maybe more on a advanced phase of the product, but design a easy and friendly support is also essential. there is no worse thing that a angry user for bad support, or even one that can’t even find it. sometimes the user get lost, for bad design or sometimes for no reason, they should be able to contact you fast, easy and you need to answer them fast too.
Flexible code is the best
When you develop a product, the code need to be flexible, is possible that in terms of usability or aspect, you need to change radically the aspect, positions and process that your product does, and it can be really painful if you don’t plan accordingly. the MVC pattern is a good option here, even you can morph to something that will suit you better in some aspects, but try to maintain the base of it separating the process from the views. by the way, the same questions i say earlier, should be applied to the code design, always remember, simple is better.
and here we finish folks, this is something that cost me to express in words, i have tried to be plain and straight as possible on my explanations, i hope you get what i mean and help you in your tasks
Regards,
Shadow.
Related Post
Hi,
today i wanted to give some common and not so common ideas of how to improve the performance of your web app. as you know, when you have a busy website, the performance (and along with the stability) is a key factor to have your project up and running, in this cases, you need to try to improve every aspect of your app, that is the idea, to help you to identify what can be or not be done in your case.
Database Optimization
Build a efficient database schema is not something easy, it cost time, study and testing to do it. at the time to build a efficient DB schema you need to take in consideration the following:
*Use the minimum columns as possible, and choose wisely the type of data that the database will store (if you will store number of 3 digit max, set a int(3) and not a varchar, text or a int(20))
*use the relational model, for dynamic or multiple values, use a index pattern where you have the definition of the data in 1 table and the data itself inserted by the user in other. do not create tons of columns as value_1, value_2 etc..
*add indexes to your tables
*use the primary key and unique key for columns that should have unique values to avoid data corruption or misbehavior.
in cases of the query, try to group the query’s in the less quantity of calls, use JOIN’s, select only the columns that you will really going to use, don’t make generals select’s. in case you need to return the number of something, use functions as SUM() and not mysql_num_rows().
Clean and re-usable code
you need to be careful at coding too, even that php bring a big liberty whiteout having to worry about types and variable types, you need to be responsible for what you write. the php code get messy when you do messy stuff. organize variables, functions and classes as much as you can. i’ll recommend to use a MVC model if is possible (even that before i rejected it) and a framework will also make you life easier when you learn how to use it.
there is always a good practice separate the logic from the view (i mean the main php code from the design), for this you can grab any framework, most of them already support this or get a template engine. i have always used smarty, and is very flexible and you can extend it with custom functions and modifiers, also it support time cache and others types too. even that i’m happy with it, and i’ll recommend to you, i have realized with the time that is a waste if time. it will never be faster than the normal php code, so if you want to go really well, i’ll recommend you to get a or build a class that will just load the php script as templates and that’s it. you will save time from learning a template script and save process in the meantime
cache everything
this is one of the most important thing of all. the cache is the base of any optimization. let say true, most of the pages of any app doesn’t change and if they change dynamically, is usually for a user action. if this happen you can use a selective caching, where you cache at the event if a action. make this type of cache is not a easy task, takes time and testing, but really it make great results on the practice and worth the time invested on it. the cache of css and js files is also a good technique, as well the compress of them.
use the power of javascript
i learning caching a lot of stuff to use the power of javascript. i have cached pages that needed to be refreshed each 20 seconds. surely you are asking how i made it, so basically i just cached them once and filtered the results with javascript after the ajax load of the filter using JSON and the html code from other call. if you are wondering if this is really a performance advantage, well yes, you will see a 50% of difference from a normal php processing. anyway, be careful with this type of technique, remember that javascript run on the client side, so the information passed there can be manipulated in evil ways. is a powerful tool that need to be used very careful. also, i will recommend you to use a javascript framework, they are cross browser compatible for almost all their functions, with a big community and plugins available, and heavily optimized.
i hope this help you in some way at the moment to optimize your web app’s
Regards,
Shadow.
Related Post
Hi,
in any web app (or desktop app) the security and store of password is a critical subject. there is a lot of solution out there for desktop and if you are around in the web development you will know the usual solutions as well. the hashing of the password is *usually* the most popular option (is discarded any attempt to store the password in plain text of course) and even that mysql have in-built functions as AES_ENCRYPT and AES_DECRYPT, i still think is insecure have any option to get the encrypted password in some way.
for the hash of the password, there are lot of popular functions, as md5(), sha1() etc.. and the big problem with all this functions is the advance of the processing units of our computers have made easier for the cracker to figure out the real password behind the hash.
recently, with the attacks that pletyoffish.com and other important webs have suffered i started looking for the strongest hash encryption i could find (in the past i used a combination of sha2 with a unique salt and a second pass of sha2). in this search, i realized that bcrypt was the best option here. knowing that, i looked for a class that could wrap that process and make it easier. then is when i found phpass.
phpass is a wrapper, that will use the strongest hash function available (in this case bcrypt) and if not, will go down with a combination of functions. is really easy to use, as you will see in the following examples:
Encrypt password:
$hasher = new PasswordHash(8, FALSE); $hash = $hasher->HashPassword($pass);
Check password at login
if ($hasher->CheckPassword($pass, $hash))
in this example, you need to provide the plain password and the hashed password that is keep on the DB.
if you have already a hashed password system for login, the transition should be painless, if not, i recommend you do it as soon as possible. this is better to any system you could make, really will make you sleep better at night and don’t wake up at night with the notice that your site has been hacked.
you will find more info in their tutorials and in their home page
i hope it help you in some way
Regards,
Shadow.
Related Post
Hi,
for the past days i have been playing with selenium, coding test’s for the application we are developing. in my journey with this great tool i have found some interesting tips that could be handy to you in my own situation.
Handle ajax calls
there are 2 ways to handle ajax calls, one is making the actions that will trigger the ajax call (like a click or something) and set a pause for XXXX quantity of miliseconds and then check that the actions has been made. the other is the waitForCondition command, that will execute the script till the condition is true. the second is the best,you can check a condition by setting up a variable or checking for some stat on the page after the ajax call is made. be sure to measure how much time the ajax call take action on a normal environment so you can set up a correct timeout.
Access to content in the page for a conditional or a script
there are commands that require you write some conditional sentence or minimal script to verify an action. in some of this cases is probably you need to get some value for a element in the page. in this case you can use this function:
this.page().findElement('locator');
this will return you the object like a getElementById will, and support the use of locators.
Store the result of a script
maybe you need to save the result of a script for later, so, you can use storeEval for that purpose. will store the result of the last line of the script on a variable you define.
later you can access to it like this:
storedVars['foo'];
i hope it help you in some way
Regards,
Shadow.
Related Post
Hi,
i made other post’s about big blue button in the past, explaining you that was a great peace of open source software focused on delivering a e-learning platform. some days ago i was needed to install it on my job server as it will be integrated to a app we are working on.
so i followed the instructions here and i found some problem in the process that i will detail here, so you can save some time in the task:
bbb-conf don’t start the process:
i need to say that most of the process of installation have gone smoothly but the most biggest problem was that the script that should start everything never finished and get stuck at the start of the asterisk. the solution is to kill all the process that could maybe be working (tomcat,red5,openffice-headless,nginx,asterisk,activemq) and then start them manually in this order:
asterisk activemq bbb-openoffice-headless red5 tomcat6 nginx
bbb-openoffice-headless say that can’t open display X or don’t start
if this is happening to you, try with the commands described here. if that didn’t work, you need to install the package openoffice-headless, and then run:
bbb-openoffice-headless stop bbb-openoffice-headless start
BigBlueButton with apache and not nginx
if you have the same requirement like me, to run big blue button over apache and not nginx, you can follow this guide that is proved that works
if you find other problems, just follow the logic and check the logs of each one of the app’s involved on this (usually are on /var/log) when you found a specific problem there and don’t know how to solve it, you can post on the bbb-setup group for help. also, you can download the VM image their provide ready to use to compare that and your installation and find where is the problem.
i hope you find this useful
Regards,
Shadow.





