Jump to content

Prodjex

Site Sponsor
  • Content Count

    88
  • Joined

  • Last visited

  • Feedback

    0%

About Prodjex

  • Rank
    Kilobyte Member

Profile Information

  • Gender
    Not Telling
  • Expertise
    Jack of All Trades
  1. Prodjex

    Selecting Data From XML Tags in PHP

    I need to grab the data from the “enclosure” tag from the following feed: https://queryfeed.net/twitter?q=%40CabosNews&title-type=user-name-both&geocode= In the example, you can modify the “enclosure” field to any of the fields you need help grabbing. This is using the simplexml_load_string command. $url = 'https://queryfeed.net/twitter?q=%40CabosNews&title-type=user-name-both&geocode='; $xml = file_get_contents($url); $obj = simplexml_load_string($xml); foreach ($obj->channel->item as $item) { echo PHP_EOL . (string)$item->enclosure['url']; } This will give you an output on your page of: https://pbs.twimg.com/media/CLfaPSgWwAExQjM.jpg https://pbs.twimg.com/media/CLfaO8oWUAAhJ3N.jpg https://pbs.twimg.com/media/CLfaOiWWwAAWkGI.jpg https://pbs.twimg.com/media/CLfaOIkWoAA7Ur3.jpg https://pbs.twimg.com/media/CLfaNu7WUAAWV-4.jpg https://pbs.twimg.com/media/CLfaNWVWUAItN_4.jpg https://pbs.twimg.com/media/CLfaNFlWgAA9dA3.jpg https://pbs.twimg.com/media/CLfaMqjWoAAVNUy.jpg https://pbs.twimg.com/media/CLfaML6WcAACoj-.jpg https://pbs.twimg.com/media/CLfMg89W8AEr7lj.jpg You can see the demo output here. The post Selecting Data From XML Tags in PHP appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  2. Prodjex

    MYSQL MySQL Trim

    I have a column within my MySQL table that holds city and states for records. The dataset looks like the following: Clay County, AL Cleburne County, AL Coffee County, AL Colbert County, AL Conecuh County, AL Coosa County, AL Covington County, AL I need to just select the state name for all of the records. Since I know this is not user input and the data is all clean/structured as above I can trim off what I don’t need with the following command: select right(trim(cityStateField), 2); This then returns the needed results with just the state abbreviation: AL AL AL AL AL AL AL The post MySQL Trim appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  3. Sometimes you may have form elements that you need to changed based on other input. For example I have two selects on my page. The first one if the primary goal. The second is a multiselect box of secondary goals. Based on the users input on the first select I don’t want them to be able to select the same item in their secondary goals. This is how you can manipulate the second select by using onChange jQuery commands. The library used for the multiselect is Bootstrap Multiselect. Here is the HTML of my current form: <div class="container"> <div class="row"> <div class="col-md-12 text-center"> <h1 id="setPageName"></h1> <div class="col-md-6 col-md-offset-3"> <div class="form-group"> <label>Select a Primary Goal</label> <select id="primaryGoal" class="form-control" name="companyGoal" required=""> <option value="">Select a Primary Goal</option> <option value="1">Build a website</option> <option value="2">Update a website</option> <option value="3">Fix a website</option> <option value="11">Build a custom web application</option> </select> </div> <div class="form-group"> <label>Select Any Additional Goals</label> <select id="stGoal" class="form-control" name="companyGoalST[]" required multiple="multiple"> <option value="1">Build a website</option> <option value="2">Update a website</option> <option value="3">Fix a website</option> <option value="11">Build a custom web application</option> </select> </div> </div> </div> </div> </div> Here’s the jQuery needed to modify the second select based on the input of the first select: $(document).ready(function() { $('#primaryGoal').change(function() { // Remove the selected option from the child $("option[value='" + $(this).val() + "']",$('#stGoal')).remove(); // Now loop through all primary to add previous removed option var prevValue = ""; $("option",$(this)).each(function() { // Only add not selected options if ($(this).is(":selected") == false) { // Check if the current primary option is not in the child list and it is not the empty select goal option if ($("option[value='" + $(this).val() + "']",$('#stGoal')).length == 0 && $(this).val().length > 0) { if (prevValue == "") { $("option[value='2']",$('#stGoal')).before($('<option>', { value: $(this).val(), text: $(this).text() })); } else { $("option[value='" + prevValue + "']",$('#stGoal')).after($('<option>', { value: $(this).val(), text: $(this).text() })); } } } prevValue = $(this).val(); }); // Rebuild the multi select $('#stGoal').multiselect('rebuild'); }); $('#stGoal').multiselect({ nonSelectedText: 'Select Goal', buttonWidth: '100%', onChange: function(option, checked) { // Get selected options. var selectedOptions = $('#stGoal option:selected'); if (selectedOptions.length >= 2) { // Disable all other checkboxes. var nonSelectedOptions = $('#stGoal option').filter(function() { return !$(this).is(':selected'); }); var dropdown = $('#stGoal').siblings('.multiselect-container'); nonSelectedOptions.each(function() { var input = $('input[value="' + $(this).val() + '"]'); input.prop('disabled', true); input.parent('li').addClass('disabled'); }); } else { // Enable all checkboxes. var dropdown = $('#stGoal').siblings('.multiselect-container'); $('#stGoal option').each(function() { var input = $('input[value="' + $(this).val() + '"]'); input.prop('disabled', false); input.parent('li').addClass('disabled'); }); } } }); }); Check out the working demo here. The post Select Options Determined by Another Select’s Selection appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  4. This is a basic example of how to dynamically add new options to your select drop down without reloading the page. I’m not saving these in the database, but it’s pretty easy to add in functionality to do so. I may provide a tutorial on that in the future, but this should get you started. HTML: <div class="container"> <div class="row"> <div class="col-md-12 text-center"> <h1 id="setPageName"></h1> <div class="col-md-6 col-md-offset-3"> <div class="form-group col-md-4"> <select name="list" id="category" class="form-control"> <option value="">Select an option</option> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="4">Option 4</option> </select> </div> <div class="form-group col-md-4"> <input type="text" name="message" required id="message" class="form-control"/> </div> <div class="form-group col-md-4"> <button class="btn btn-default" id="add_category">Add select option</button> </div> </div> </div> </div> </div> jQuery: <script> //On page load set the next ID to be used in the option value var catID = 5; //Look for the click on the Add select option $("#add_category").on("click", function() { //Grab the new category name from the message input box var newCat = $('#message').val(); //Add the new option to the select, both the value and name $( "#category" ).append("<option value='" + catID + "'>" + newCat + "</option>"); //Clear out your input box after submission so you can then add more if desired $('#message').val(''); //Increase by 1 the catID variable so if you add more categories to the select you won't have conflicting IDs catID++; }); </script> I’ve commented on the jQuery script above so you know what each piece is doing. You can view a working demo of this here. Keep in mind we are not storing these in the database so if you reload the page your new categories will be gone. The post Append Select Option with jQuery appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  5. Prodjex

    PHP DateTime Class and Functions

    With PHP 5 they introduced the DateTime class. Prior to that everyone used strtotime, date, etc…commands to achieve the same results. I was a late adopter and continued to use the old commands. Recently I decided it’s been long enough and it’s time to take a look at this new class and apply it. This example is a simple how to on showing the difference between two dates in day format. So my start date here is 2016-05-04 10:20:42 as it’s stored in the MySQL timestamp field of my database. The end date is another date in the same format of YYYY-MM-DD HH:MM:SS. My first attempt mixed some of the old and new functions together to get my result. $reg_temp = strtotime('2016-05-04 10:20:42'); $registration_date = date("Y-m-d", $reg_temp); $exp_temp = strtotime('2017-05-04 10:20:42'); $expiration_date = date("Y-m-d", $exp_temp); $registration_date = date_create($registration_date); $expiration_date = date_create($expiration_date); $diff=date_diff($registration_date,$expiration_date); echo $diff->format("%R%a days"); While it did get me the end result, that’s a lot of code to accomplish what I want. And I also want to force myself to only use the new DateTime class. After a few more iterations I came up with this that does the same job in 4 nice and clean lines of code: $registration_date = date_create('2016-05-04 10:20:42'); //Replace static date with your database field $expiration_date = date_create('2017-05-04 10:20:42'); //Replace static date with your database field $diff=date_diff($registration_date,$expiration_date); echo $diff->format("%R%a days"); Much better. You can see the demo output here. The post PHP DateTime Class and Functions appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  6. Prodjex

    PHP strtok

    The PHP function strtok splits a string one by one. In the example below I’m trying to split off everything after the ? in the URL. https://www.facebook.com/LiquidWebInc?fref=ts https://www.facebook.com/CocaColaUnitedStates?brand_redir=1 In PHP I was able to do this with the following: $facebookURL = 'https://www.facebook.com/LiquidWebInc?fref=ts'; $cocacolaURL = 'https://www.facebook.com/CocaColaUnitedStates?brand_redir=1'; $facebookURL = strtok($facebookURL, '?'); $cocacolaURL = strtok($cocacolaURL, '?'); Check out the demo here. The post PHP strtok appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  7. Prodjex

    Username Availability Check

    This will be a walk-through on how to create a submit form that checks the database to make sure the username is not taken. If it is taken it will not allow the submit button to be activated. HTML on index.php page: <!DOCTYPE html> <html> <head> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet"/> </head> <body> <div class="container"> <div class="row"> <div class="col-md-12 text-center"> Test out functionality by using the username: test@test.com <form class="col-md-12" action="submit.php" method="post"> <div class="form-group"> <label>Username</label><span id="userResult"></span> <input id="username" class="form-control" type="text" name="username" placeholder="Username" required/> </div> <div class="form-group"> <label>First Name</label> <input class="form-control" type="text" name="firstName" placeholder="First Name" required/> </div> <div class="form-group"> <label>Last Name</label> <input class="form-control" type="text" name="lastName" placeholder="Last Name" required/> </div> <div class="form-group"> <label>Email</label> <input class="form-control" type="email" name="email" placeholder="Email" required/> </div> <button class="btn loginBTN" id="submitBTN" disabled>INVITE</button> </form> </div> </div> </div> <script> $("#username").keyup(function (e) { //user types username on inputfiled var username = $(this).val(); //get the string typed by user $.post('checkUsername.php', {'username':username}, function(data) { //make ajax call to check_username.php $("#userResult").html(data); //dump the data received from PHP page }); }); </script> <style> .container{ margin-top:50px; } #go{ margin-top:20px; } </style> </body> </html> PHP Script to check database to see if username is taken: <?php //Set Vars $host = 'localhost'; $username = 'database username'; $password = 'users password'; $dbName = 'database name'; //Database connection $db = new mysqli($host, $username, $password, $dbName); if(isset($_POST["username"])) { //trim and lowercase username $username = strtolower(trim($_POST["username"])); //sanitize username $username = filter_var($username, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW|FILTER_FLAG_STRIP_HIGH); //check username in db $sql = "select id from users where username='$username'"; $results = $db->query($sql); //return total count $username_exist = $results->num_rows; //total records //if value is more than 0, username is not available if($username_exist) { echo '<i class="fa fa-times" style="color:red;margin-left:15px;margin-right:5px;"></i>Username Unavailable'; echo " <script> $('#submitBTN').prop('disabled', true); //TO DISABLED </script>"; }else{ echo '<i class="fa fa-check" style="color:green;margin-left:15px;margin-right:5px;"></i>Username Available'; echo " <script> $('#submitBTN').prop('disabled', false); //TO DISABLED </script>"; } } You can see this demo here. You will notice on page load the submit “Invite” button is disabled, as you start to type in a username it checks each keystroke to see if that username exists in the database. If it does not then the submit button will become enabled. You get a response back as well letting you know in real-time if the name is available. On the demo a user that does exist is test@test.com. Check out the demo. The post Username Availability Check appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  8. Prodjex

    PHP parse_str

    Quick example of how to use PHP’s parse_str command. Here is an example of my data: $source = "access_token=CAAWhyYsjaWsBAOCwjZCs&expires=5180531"; What I’m trying to do is just grab the string of the access_token variable from the URL. So above I’ve dropped it into the $source PHP variable. Now using parse_str I can get that into an array like so: $source = "access_token=CAAWhyYsjaWsBAOCwjZCs&expires=5180531"; parse_str($source, $output); Next I just need to select the section I want, for this example I need the access_token, so my final code is: <?php $source = "access_token=CAAWhyYsjaWsBAOCwjZCs&expires=5180531"; parse_str($source, $output); echo $output['access_token'];?> If I wanted the expires field I’d modify to this: <?php $source = "access_token=CAAWhyYsjaWsBAOCwjZCs&expires=5180531"; parse_str($source, $output); echo $output['expires'];?> Output demo The post PHP parse_str appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  9. These are two different commands with different outputs when added to a SQL query. MySQL “in” command for example: select * from assets a left outer join assetInterests ai on a.id = ai.assetID where orgID = 2011 and deviceID in (11) and interestID IS NULL In the table I have the following deviceID’s: 11 11 11 11,9 The result set will only return the top 3. The 11,9 result will be missing. Why is that? 11 is in that column. The issue is that “in” I could say and deviceID in (1,3,11) and any column that had just the 1 or 3 or 11 will return, but any multiples will not. For that I need to use the MySQL command find in set like this: select * from assets a left outer join assetInterests ai on a.id = ai.assetID where orgID = 2011 and find_in_set (11,deviceID) and interestID IS NULL The post MySQL – find in set vs in appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article
  10. Prodjex

    Simple Twitter Auto Poster

    This is the first in what will end up being a several part tutorial on creating a Twitter posting program. These tutorials will show how to create the bot using the PHP library that interacts with Twitter’s API, called TwitterOAuth. It’s by far the most used PHP based Twitter API library. You can use this example anywhere, but the queries you will see are specific to the WordPress database schema. In the examples I’m demonstrating how to auto Tweet your WordPress posts. Alright, lets get started. First login to your server using SSH and navigate to the directory you want this project to reside. Then run this command: composer require abraham/twitteroauth If you are not using composer, learn it now. It will save you a ton of time over the long run. Once that command finishes running open up your project either on FTP, or an IDE, I prefer PHPStorm. Inside the folder where you ran the composer command you will see a folder called “vendor” and a few other files. You don’t need to modify any of these. Go ahead and create a new file, called whatever you like, mine for example is post.php. Once you have that file open it up and paste in the following code: <?php //Show any errors for debugging. error_reporting(E_ALL); ini_set('display_errors', 1); //Load TwitterOAuth Library require "vendor/autoload.php"; use Abraham\TwitterOAuth\TwitterOAuth; //Enter in your app keys and secrets $consumerKey = 'your consumer key'; $consumerSecret = 'your consumer secret'; $accessToken = 'your access token'; $accessTokenSecret = 'your access token secret'; //Connect to Twitter API $connection = new TwitterOAuth($consumerKey,$consumerSecret,$accessToken,$accessTokenSecret); $content = $connection->get("account/verify_credentials"); //Connect to WordPress Database $db = new mysqli('hostname','database user name','database user password','database name'); //Query the needed data $sql = "select p.ID as id, post_title as postTitle, guid as url from wp_posts p where p.post_type = 'post' and p.post_status = 'publish' and p.ID not in (select postID from twitterPublished) limit 1"; $result = $db->query($sql); while($row = $result->fetch_assoc()) { $postID = $row['id']; $postTitle = $row['postTitle']; //Replace any special characters with the correct web formatted characters $postTitle = str_replace( array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"), array("'", "'", '"', '"', '-', '--', '...'), $postTitle); $postTitle = str_replace( array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)), array("'", "'", '"', '"', '-', '--', '...'), $postTitle); //Add the post title and the URL to share together $statusText = $postTitle.' '.$row['url']; //Send Tweet to Twitter $statues = $connection->post("statuses/update", ["status" => $statusText]); //Insert postID so we don't try to Tweet the same thing again $sqlInsert = "insert into twitterPublished(postID) values('$postID')"; $db->query($sqlInsert); //Output Response var_dump($statues); } There are few variables in there that you will need to update with your own. Lines 11-14 you will need to update with your consumerKey, consumerSecret, accessToken, and accessTokenSecret. You can get these by setting up your application on Twitters website. You can go here to join: https://dev.twitter.com/. If you already have an account you can go here to login: https://apps.twitter.com/. Once logged in, select “Create New App”. You need to fill out the name, description, website, and agree to the developer agreement. You do not need to enter a Callback URL for this application. Once you click to create the application under those fields you will see your new app. Click the tab for Keys and Access Tokens. From here you can get all of your keys and secrets as needed. If you can’t find your Access Token and Access Token Secret just click the button to generate them. Now, once you’ve updated all of the keys in your post.php file from above, next you need to figure out your database name, database user, password, and host name. We’ll update these on line 21 of the file. Now you’re almost all finished up, but on line 51 you will notice a comment about what that insert does. It keeps a record of what you have already Tweeted so you don’t have to worry about duplication in the future. It uses a table I called twitterPublished. So you will need to create that table in your database. Log in to phpMyAdmin and run this query on the SQL tab in your selected database to create that table: -- phpMyAdmin SQL Dump -- version 4.6.6 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Aug 06, 2017 at 03:37 PM -- Server version: 10.1.25-MariaDB -- PHP Version: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `thenet_wordpress` -- -- -------------------------------------------------------- -- -- Table structure for table `twitterPublished` -- CREATE TABLE `twitterPublished` ( `id` int(11) NOT NULL, `postID` int(11) NOT NULL, `twitterID` int(11) NOT NULL, `createDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `twitterPublished` -- ALTER TABLE `twitterPublished` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `twitterPublished` -- ALTER TABLE `twitterPublished` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; Now you’re all set to test this out. Open up a broswer window and type in the url that will lead you to your new post.php file. You will either get an error printed on the screen or receive a response of code showing that the post successfully posted. Go to your Twitter page and take a look, you should see your newly create Tweet. If you receive an error, feel free to comment and I can help you resolve it, but if you followed the tutorial and have the correct credentials it should work just fine. Now one other note, I already had about 1200 posts in my WordPress database, I didn’t want to start Tweeting old stuff. If you’re in the same boat, here is a query to add all of the existing postID’s to the twitterPublished table so that they will not be Tweeted. Of course always make backups of your database before running commands like this, better yet do it in a development environment insert into twitter_published(postID) select ID from wp_posts where post_type = 'post' and post_status = 'publish' Lastly, you will see on line 29 we are limiting the query to only return one result. I scheduled this to run every 5 minutes, so if there are new posts that have not been Tweeted it will send them out every 5 minutes until there are no new posts. I limit it to 1 per every 5 minutes as I don’t want to send for example 10 new Tweets all at the same time. You can tweak the limit here if you want to do more and also modify your cron schedule to however many minutes/hours to get the desired results. That’s all for now. Next week I’ll continue working on this more by building out a GUI interface for setting all of this up for those of you that don’t know how to or don’t want to do this via code. Questions welcomed in the comments. View the full article
  11. Springleap says it can help marketers improve their ad campaigns by tapping into a global community of 180,000 creative professionals. To pursue that vision, the company is announcing that it has raised an additional $650,000 in seed funding, bringing its total backing to around $1.1 million. I got on the phone with founder Eran Eyal partly to discuss the funding, but more to discuss the bigger vision here. When we wrote about Springleap back in November, we focused on its tools for holding crowdsourced design contests. Eyal said Springleap will still support those contests, but they aren’t what he’s focused on moving forward. “If you’re just doing design competitions, it’s not good for creatives, it’s not changing the game,” he said. The company’s new push into research on the other hand, is “giving creatives money in their pocket on a regular basis for their insights.” Basically, Springleap is offering an alternative to “consumer panels,” where marketers gather data about consumer behaviors and attitudes by asking those consumers directly. Eyal argued that those panels are deeply flawed, because they don’t give the marketer “actionable insights.” Put another way, knowing how someone feels about a product doesn’t always help you craft the right message to sell that product to them. Instead, Springleap connects customers with what Eyal calls “creative panels,” namely small group of creative professionals chosen from its network to help brands understand local trends (it sounds like a lot of this is about helping marketers understand new markets and geographies), and improve their ads and social media strategy. Consumers panels aren’t something I’m particularly familiar with, but even so, when Eyal described Springleap’s approach to research, I was a bit puzzled — isn’t that basically just asking people for advice? And with just a handful of people in a given panel, isn’t there a risk that personal taste and bias will play a role? Eyal countered that what the company is really doing is tapping into the collective knowledge and expertise of these professionals: “The first thing you’ve got to remember is that we aren’t just working from sentiment alone. We’re talking about brand strategists — they’re looking every single day at what is and what’s not working for other clients, and they go beyond sentiment because that’s their job on an everyday basis.” He also described the product as a “TaskRabbit for research” that connects marketers with “the right people in the right location.” As for the creative pros, they can make between $40 and $350 an hour, based on experience and market. You can visit Springleap’s website toread more about some of the company’s research success stories for brands like Adidas. The company started in South Africa, but Eyal is now based in New York City and looking to expand in the United States. As for the funding, it was led by Cross Border Angels, the investment arm of Scaale Group. Manager Mandar Gadkari explained that CBA functions largely as an investment network, with the funding coming from its members, but CBA occasionally raises its own small funds to make an investment itself — as it did here. Gadkari suggested that Springleap was worth backing because beyond the US, there’s a big opportunity in emerging markets. “We’re bringing Springleap to Singapore; we’re bringing Springleap to India,” he said. Source View the full article
  12. Do you run a Facebook Page? Heads up: your page’s “Like” count is probably going to drop a bit soon, and it’s totally not your fault. The short version: Facebook is changing the way it’s counting likes, subtracting any accounts that have been either manually deactivated or “memorialized” after its owner passed. It’s something that probably should have been done since the beginning — but since it wasn’t, it’d be easy to think your Likes had dropped because of something you’d done. One thing that’s important to note: it seems that this only accounts for profiles that have been manually deactivated. Likes from profiles that could be considered “inactive” because the user just hasn’t logged in for a while will continue to count. The shift won’t happen immediately; Facebook says it’ll roll out in “the coming weeks.” So how many Likes might you lose? It’s tough to say. While Facebook says to expect a “slight dip,” it’s all relative to how many Likes you have to begin with. If your page only has a few dozen likes, you might not even lose one; if it has a few million, that slight dip will feel a bit bigger. If you run your company’s Facebook page and your boss gauges your performance based on whether that “like” counter keeps climbing, it’s probably a good idea to let them know what’s coming. Source View the full article
  13. Here’s a partnership that may come as a surprise to many: Microsoft and Google are working together to help make Angular 2 — the next (and somewhat controversial) version of Google’s JavaScript web app framework — better. Angular has been using its own AtScript superset of Microsoft’s TypeScript for a while now. TypeScript is Microsoft’s attempt at extending JavaScript with features like type annotations, generics and modules. Going forward, the two languages will converge. Angular 2 will be written in TypeScript and developers will be able to write their Angular 2 applications in this language,too. The AtScript language made its debut last October, but it looks like the AtScript name will be retired in favor of TypeScript. Angular, at various times in its development, was written in plain JavaScript, Google’s own Dart language and AtScript (there are still separate Dart and JavaScript versions of Angular 1.x today). AtScript added features like introspection, as well as field and metadata annotations to TypeScript. TypeScript will now adopt these features, too, starting with the upcoming 1.5 release of the language, which will launch in beta within the next few weeks. “Working closely with a rich library like Angular has helped TypeScript to evolve additional language features that simplify end-to-end application development, including annotations, a way to add metadata to class declarations for use by dependency injection or compilation directives,” Microsoft’s corporate vice president of its Developer Division S. “Soma” Somasegar writes in today’s announcement. “Both teams are looking forward to continuing to move TypeScript and JavaScript forward together in the future, including working with the ECMAScript standards body on the future of types in JavaScript.” Angular 2 has been widely criticized in the developer community because it breaks compatibility with the previous version. Adopting a Microsoft-led language may make it even harder for some to stomach the move to the new version. It’s definitely a win for TypeScript, though, which has seen growing adoption over the last year since its 1.0 release. The announcement was made at the ng-conf Angular conference in Salt Lake City, Utah, today. We’ve embedded the video from the presentation today (the discussion of TypeScript starts about 20 minutes into the video): Source View the full article
  14. If you’ve ever searched for the name a capital city or a celebrity’s place of birth, then you’ll probably be familiar Google’s Knowledge Graph. It’s a cool little feature that picks out and displays the answers to questions, saving you from clicking through all of the links in your search results. After recently equipping it with the ability to dispense health advice, Google now reckons you might need a little help refining your bartending skills. Yep, you’re going to cocktail-making school. A simple “How do I make a …” search now will list the main ingredients and recommended garnishes for your chosen cocktail, as well as the correct glass to serve it in. While it can’t (yet) teach you all of the cocktail-making flicks and tricks that you might see in a Las Vegas bar, it’ll certainly help improve the quality of those homemade Happy Hour refreshments. Source View the full article
  15. Bulging fenders? Check. Nubuck leather-wrapped everything? Check. V12 rumble? Ch– oh snap. For the first time an Aston Martin, car, albeit a concept, has an all-electric powertrain instead of pistons. The Brit carmaker says the all-wheel-drive DBX Concept is “a thought starter… that envisages a world where luxury GT travel is not only stylish and luxurious, but also more environmentally responsible.” Marketing buzz aside, the DBX is definitely packed with interesting tech. It has drive-by-wire electric steering, toughened, “auto-dimming” windows, heads-up displays, Tesla-like in-wheel motors and the piece de resistance, lithium-sulfur batteries. Lithium-sulfur batteries have theoretically higher energy density then lithium-ion, but suffer from stability issues — in fact, as far as we know, they haven’t even been commercialized yet. But Aston Martin said the point of the car is to “challenge conventional thinking and explore the art of the possible.” It’s testing the public’s reaction to the DBX Concept at the 2015 Geneva Motor Show, and says it intends to enter the AWD crossover category at some point in time, albeit not necessarily with an EV model. In any case, with a machined billet aluminum body, “black pearl chromium” paint that’s supposed to mimic actual black pearls and full Nubuck leather interior, we think it might be a smidge outside our price range. For more shots, check out Autoblog‘s gallery. Source View the full article
×