3551
Points
Questions
30
Answers
325
-
- 406 views
- 1 answers
- 0 votes
-
Asked on April 11, 2020 in Graphic Design.
I went down the design school method but in terms of advice for someone wanting to treach themselves I’d first of all say good on you and then;
- For the technical side of the software then there’s plenty of tutorials on, as has been mentioned, places like YouTube. Get yourself a creative cloud subscription and go from there.
- Somewhat conversely to my first point, don’t discard the good old pen, pencil and paper. I usually start most of my designs by at least sketching them out first. Sometimes just to quickly experiment with layout, other times to create custom elements or letterforms. Sometimes just to play around with texture and colour combinations. You can find some great ideas by accident this way. Let your creative brain loose at the start without limiting it to the rules of the software. Save Adobe for the polishing stage. So much is missed by jumping straight onto the computer and working from there. It may sound old fashioned to some but I believe the ability to visualise your ideas on paper is an essential tool to have which is lacking these days. Graph and layout paper can be your best friends, it doesn’t make you a dinosaur.
- For inspiration on what some others are doing I recommend behance as there are some great designers in all kinds of fields who exhibit their work on there. You’ll get to see the level other professionals are working at and this will give you a good way to gauge your skills against the rest of the industry.
- There’s a wealth of books out there on graphic design theory which would probably be useful too. I wouldn’t recommend trying to learn completely from books, more to use them as a way of delving deeper into areas that interest you. Most designers specialise in some specific area of graphic design over others, don’t try and decide this now but as you go along you’ll find yourself drawn to one aspect more than others, this is when it is worth really expanding your knowledge via books. To try and cover the entire scope of graphic design with literature would cost you a small fortune. Much more can be learned at this stage by actually trying your hand at creating designs.
- You could find work you like and try to emulate it. This will give you a good way of learning techniques and practises. Don’t ever try to pass it off as your own though, treat it more as a learning exercise for yourself.
- If you really want to get straight into the thick of it then have a go at producing designs for people who may want them, I’d stick to small stuff to start with. I guarantee your first attempts won’t be masterpieces by any stretch (feel free to prove me wrong on this!) but you can learn a lot from constructive, honest critique. Build a portfolio for these and take it around established design agencies. Most are happy to speak to people looking for crits and usually offer sound, focused advice that you won’t get from the Internet or a book. Always remember, people are critiquing your work, not you. Try to not take anything personally.
Hope this helps and best of luck!- 410 views
- 1 answers
- 0 votes
-
Asked on March 27, 2020 in Programming.
Use prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious SQL.
You basically have two options to achieve this:
Using PDO (for any supported database driver):
$stmt = $pdo->prepare(‘SELECT * FROM employees WHERE name = :name’);
$stmt->execute([ ‘name’ => $name ]);
foreach ($stmt as $row) {
// Do something with $row
}Using MySQLi (for MySQL):
$stmt = $dbConnection->prepare(‘SELECT * FROM employees WHERE name = ?’);
$stmt->bind_param(‘s’, $name); // ‘s’ specifies the variable type => ‘string’$stmt->execute();
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
// Do something with $row
}If you’re connecting to a database other than MySQL, there is a driver-specific second option that you can refer to (for example, pg_prepare() and pg_execute() for PostgreSQL). PDO is the universal option.
Correctly setting up the connectionNote that when using PDO to access a MySQL database real prepared statements are not used by default. To fix this you have to disable the emulation of prepared statements. An example of creating a connection using PDO is:
$dbConnection = new PDO(‘mysql:dbname=dbtest;host=127.0.0.1;charset=utf8’, ‘user’, ‘password’);
$dbConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);In the above example the error mode isn’t strictly necessary, but it is advised to add it. This way the script will not stop with a Fatal Error when something goes wrong. And it gives the developer the chance to catch any error(s) which are thrown as PDOExceptions.
What is mandatory, however, is the first setAttribute() line, which tells PDO to disable emulated prepared statements and use real prepared statements. This makes sure the statement and the values aren’t parsed by PHP before sending it to the MySQL server (giving a possible attacker no chance to inject malicious SQL).
Although you can set the charset in the options of the constructor, it’s important to note that ‘older’ versions of PHP (before 5.3.6) silently ignored the charset parameter in the DSN.
ExplanationThe SQL statement you pass to prepare is parsed and compiled by the database server. By specifying parameters (either a ? or a named parameter like :name in the example above) you tell the database engine where you want to filter on. Then when you call execute, the prepared statement is combined with the parameter values you specify.
The important thing here is that the parameter values are combined with the compiled statement, not an SQL string. SQL injection works by tricking the script into including malicious strings when it creates SQL to send to the database. So by sending the actual SQL separately from the parameters, you limit the risk of ending up with something you didn’t intend.
Any parameters you send when using a prepared statement will just be treated as strings (although the database engine may do some optimization so parameters may end up as numbers too, of course). In the example above, if the $name variable contains ‘Sarah’; DELETE FROM employees the result would simply be a search for the string “‘Sarah’; DELETE FROM employees”, and you will not end up with an empty table.
Another benefit of using prepared statements is that if you execute the same statement many times in the same session it will only be parsed and compiled once, giving you some speed gains.
Oh, and since you asked about how to do it for an insert, here’s an example (using PDO):
$preparedStatement = $db->prepare(‘INSERT INTO table (column) VALUES (:column)’);
$preparedStatement->execute([ ‘column’ => $unsafeValue ]);
Can prepared statements be used for dynamic queries?
While you can still use prepared statements for the query parameters, the structure of the dynamic query itself cannot be parametrized and certain query features cannot be parametrized.
For these specific scenarios, the best thing to do is use a whitelist filter that restricts the possible values.
// Value whitelist
// $dir can only be ‘DESC’, otherwise it will be ‘ASC’
if (empty($dir) || $dir !== ‘DESC’) {
$dir = ‘ASC’;
}- 345 views
- 1 answers
- 0 votes
-
- 884 views
- 1 answers
- 0 votes
-
Asked on March 24, 2020 in YouTube.
According to YouTube’s new policy, no ads will be displayed on your content unless you hold a total of 10,000 views , 1k subscribers and 4k hours watch time on your channel.
So in today’s post I will tell you exactly how much you get 1000 views from YouTube and this post will definitely help a lot more new you Tubers. As everyone wants to know the answer to this question.
How much does YouTube pay per 1000 views?
On that point are no any terms under the partnership agreement about how much you will be earning per 1000 views. Average you can earn $1 per 1000 views. Advertisers only pay when someone clicks an ad or watches for 5 or 30 minutes. If your video gets millions of views but nobody clicks on ads, then you don’t make any single penny. YouTube advertising is managed in the Google Adwords platform. The advertisers are choosing ads based on two different constituents is a cost per click (CPC) and cost per view (CPV).
Advertisers have two models based on which they choose the advertisement.
a) Cost per View (CPV)
b) Cost per Click (CPC)a) In CPV, the advertiser pays for the number of times the ad has been viewed. It doesn’t matter if a viewer clicks on the advertisement, they pay only for the views.
b) On the CPC, the advertiser pays for the number of clicks. So the advertiser is charged only when someone clicks on the ad.
So even if you have over a million views on your video and no one clicked on our watches the ad, you don’t make money. On the other hand, even if you receive only a couple hundred views and someone watches or clicks on an ad then you end up earning money.
Location of visitors also depends, if any, visitors come from Asian countries, like India, Nepal, Pakistan, then CPC will comparatively lower earning, if any, visitors come from the UK, the US the earning will be higher comparingly. It totally depends upon the economy of the country.
I would like to suggest, stop worrying that how much YouTube pays for 1000 views rather than focus on your content and increase your fan base and subscriber on your channel. This would automatically lift your earning for long term. The more you have subscribers on your channel, the more your videos get hits and thus eventually increase your earning.
- 480 views
- 1 answers
- 0 votes