I'm looking for help with website coding

Advertising

Dont do it?

Advertise pretty much anything here, with CPM banner ads, CPM email ads, and CPC contextual links. You can segment relevant areas of the site and display ads based on the user's geographic location if you want.

It starts at just $ 1 per CPM or $ 0.10 per CPC.

Books on good coding practices and idioms in today's world?

From my college years, I remember some classic examples from books that teach good practice in code writing and software engineering. Examples that come to mind are:

  1. Clean code
  2. Complete code
  3. Design patterns: elements
    Reusable Object Oriented Software

However, they all come from an era that seems to be fading: POO architectures and programming languages.

What are the new kids on the block? Are there any such books on this new era of highly parallel and functionally influenced software by programming?

gui layout – Alternative to color coding in table cell

I'm not entirely sure that their problem is the colors themselves. When a table starts to look messy, it usually means you had a messy base to start with. Tufte coined the term "junk graph" to refer to these kinds of weird visuals that, while on the surface seem to make sense, ultimately just get in the way to see the actual data:

http://en.wikipedia.org/wiki/Chartjunk

The easiest example of chart garbage in the table is the vertical dividing lines between the cells in the table. In most cases, the data itself creates a line of sight for you. You don't need to add another line to mess things up.

Therefore, I suggest going back and ordering the table layout as much as possible. At that point, you may be able to see much simpler solutions to the highlighting problem.

coding theory – ternary error correction codes

Let's define Trianry ECC as a code that your code words can be defined by $ {xyz f (y, z) f (x, z) f (x, y) | x, y, z in mathbb {F} _2 ^ m } $ for some function $ f $.

Is there a good known bug fix code that is trinary?

Such a family of LDPC codes would be best.

Is there any reason why it won't be good (in terms of distance, rate)?

It can be useful in a construction that I have. I just wanted to make sure it's not known before I dive in.

Thank you

coding style: Python scripts: to use the class or not, what is the best practice?

I'm seeking feedback from the community (Python) on style and maintainability. Note the sample script below that declaratively solve a certain problem:

Script v1

def take_path_a(param_1, param_2):

    # the full implementation is irrelevant
    pass


def take_path_b(param_1, param_2):

    # the full implementation is irrelevant
    pass


def start(path_decision_factor_1, path_decision_factor_2):

    path_a_is_optimal = path_decision_factor_1 is "whatever"

    take_path_a(path_decision_factor_1, path_decision_factor_2) if path_a_is_optimal else take_path_b(path_decision_factor_1, path_decision_factor_2)


if __name__ == "__main__":

    start("param_1", "param_2")

The actual script modeled by the previous example will finally deploy cloud resources with variable characteristics depending on the path you take during the script runtime.

Questions:

  1. Is the above script readable?

  2. Where in fact there is no agreed style or paradigm, and considering that taxpayers have mentioned that there is no need to adhere to a particular style, I do sensation that the script would improve significantly if included in a class. Honestly, I generally feel comfortable working with classes, but I also see that designing param_1 Y param_2 since the object states that can be shared through potentially more methods of the prospective class make more sense or feel good, aren't these perceptions a valid ground to block public relations?

  3. Python is an object-oriented language, is it a good practice to accept scripts that are out of the norms like above?

This is how I would prefer to accept the script:

Script v2

class ActionTaker:

    def __init__(self, param_1, param_2):

        self.param_1 = param_1
        self.param_2 = param_2

    def _take_path_a(self):

        # the full implementation is irrelevant
        pass


    def _take_path_b(self):

        # the full implementation is irrelevant
        pass


    def start(self):

        if self.param_1 is "whatever":
            self._take_path_a()
        else:
            self._take_path_b()

if __name__ == "__main__":

    action_taker = new ActionTaker("param_1", "param_2")
    action_taker.start()

How can I convince a developer to stop writing with style in Script v1 since it doesn't seem standard?

information theory: coding system that assigns the same number of bits for each character

I am trying to get a binary string that has been converted from the text of a text file, I can get that, but the problem is that I need each character to be represented by the same number of bits, but that is not what I get (please see the following Python code and corresponding output)
For example, character i is represented by 1101001, which is 7 bits long, but the character ! is represented by 100001, which is 6 bits long.

Is there an encoding / decoding system where each character takes the same number of bits?

content = open('a.txt', 'r').read()
test_str = content
# using join() + ord() + format()  ... Converting String to binary 

Binary = ' '.join(format(ord(i), 'b') for i in test_str)

#Decimal=int(Binary, 2)



# printing original string  
print("The original string is : " + str(test_str)) 
# printing result  
print("The string after Binary conversion : n" + str(Binary))

Exit:

The original string is : Hi! Is there a solution?
The string after Binary conversion : 
1001000 1101001 100001 100000 1001001 1110011 100000 1110100 1101000 1100101 1110010 1100101 100000 1100001 100000 1110011 1101111 1101100 1110101 1110100 1101001 1101111 1101110 111111

Nvidia GPU HW accelerated coding with FFMPEG!

Hi,

A question whose answer I still can't find on google. We were using CPUs to encode videos using FFmpeg and recently we decided to try the Nvidia graphics card that supports hardware accelerated video encoding using FFmpeg's NVF codec. As it has been said that hardware accelerated video coding assigns specific processing tasks to the GPU, does that mean that it balances the coding load between CPU and GPU to speed up processing?

Thanks in advance!

AbcVideo.cc | Streaming Ultra HD and SD | 100x fast coding | DMCA Leniency | Skype support | Proxies123.com

Hello wjucntion
We are AbcVideo.DC, a streaming platform without limits.
About:

  • Ultra HD + SD streaming
  • Live coding (coding during loading).
  • Option & # 39; No ads & # 39; for webmasters.
  • Multiple upload options (Web, Remote, FTP, API, Clone, Torrent, etc.)
  • No premium is needed. Everything is free.
  • DMCA Leniency (special accounts)
  • Unlimited storage / bandwidth (as long as you have good traffic), the same applies to inactive files
  • Contact us for Special custom accounts.
  • No loading and unloading Speed ​​limit.
  • The minimum payment is $ 25 through Paypal and Bitcoin and $ 50 for Payoneer. Weekly payment
  • Miniature time slider on the player

Rates:

For 10K views

Tier 1 United States, Canada, United Kingdom $ 30
Level 2 Australia, Denmark, France, Germany, Norway $ 18
Level 3 Austria, Finland, Italy, Japan, New Zealand, Spain, Sweden, Switzerland $ 10
Level 4 Belgium, Brazil, India, Israel, Mexico, Portugal, Romania, Russian Federation, Saudi Arabia, Slovak Republic, Turkey, United Arab Emirates $ 4
Tier 5 Others $ 2.5
  • 30% of the video must be viewed to be counted as paid
  • Account of 3 views by IP in 24 hours (8 hours each)
  • The proxy, server IPs, boots, owner IPs are not counted.
  • Ad blocker views would be multiplied by the 0.1 factor (because those views generate less money)

Register now!

Support:
E-mail: (protected email)
Skype: (protected email)
or PM in wjunction

NO adult content, please!

Having good traffic, you need a customized solution; leave a message

Last edition:

javascript: does my React.js code follow the coding standards?

Gradually I am digesting React.js, I found a couple of ways to write the same code:
Please say where I was wrong in the following code.

  1. I try to put logic inside render(), That's fine?
  2. Don't you use React life cycles for simple components?
  3. Use functional components instead of class components?

File 1: Batch_Status.js

import React, { Component } from 'react';
import ProgressBar from '../progress_bar/progress_bar';

export default class BatchStatus extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    let color;
    let percentage = (this.props.batch.number / this.props.targetBatchCount) * 100;

    switch (this.props.batch.status) {
      case 100:
        color = '#e7e4f1';
        break;
      case 200:
        color = '#c3dcec';
        break;
      case 300:
        color = '#ecc6eb';
        break;
      case 400:
        color = '#ecdec3';
        break;
      case 500:
        color = '#c8ecc7';
        break;
      default:
        color = '#e7e4f1';
    }

    return (
      
        {this.props.batch.number} / {this.props.targetBatchCount}
      
    );
  }
}

File 2: Progress_Bar.js

import React, { Component } from 'react';
import './progress_bar.css';

export default class ProgressBar extends Component {
  constructor(props) {
    super(props);
  }

  render() {
    let foregroundColor = this.props.foregroundColor || '#e7e4f1';
    let percentage = this.props.percentage || 0;
    let backgroundColor = this.props.backgroundColor || '#eceeef';

    let style = {
      backgroundImage:
        'linear-gradient(to right, ' +
        foregroundColor +
        ' ' +
        percentage +
        '%, ' +
        backgroundColor +
        ' 0%)'
    };

    return (
      
{this.props.children}
); } } ```

Python for beginners (with coding experience)

I am new to Python but I have experience in coding a dozen other languages ​​ranging from COBOL to Assembler to C, PHP and recently Rust.

I am learning Python now with a Discord bot for one of my hobby projects. Much is copied from several online sources.

I thought that a revision of the code from the beginning would ensure that you don't start with bad habits that are harder to eliminate the longer you keep them. So, if someone wants to tell me if this code is good, bad or nice, but not like Python, I would be very happy:

import os
import random
import discord
from discord.ext import commands
from dotenv import load_dotenv

load_dotenv()
token = os.getenv('DISCORD_TOKEN')

bot = commands.Bot(command_prefix='!')

@bot.command(name='ability', aliases=('a', 'ab'), help='Roll an ability check. Parameters: ability (no. of heroic dice).')
async def ability(ctx, ability:int, heroic:int=0):
    if ability < -5 or ability > 5:
        await ctx.send('Invalid ability value "{}". Must be between -5 and +5'.format(ability))
        return
    if heroic < 0 or heroic > 5:
        await ctx.send('Invalid heroic dice amount "{}". Must be between 0 and 5 (3 + 2 ritual dice)'.format(heroic))
        return

    dice = 2 + abs(ability) + heroic
    keep_dice = 2 + heroic
    if (ability < 0):
        keep = 'lowest'
    else:
        keep = 'highest'

    roll = ()
    for x in range(0, dice):
        roll.append(roll_die())

    result = sorted(roll)
    if keep == 'highest':
        result.reverse()
    outcome = result(:keep_dice)

    # check for critical success (a pair) or failure (all 1s)
    last = -1
    critical = False
    fail = True
    for d in outcome:
        if d != 1:
            fail = False
        if d == last and d != 1:
            critical = True
        last = d

    if critical:
        # critical success - add the next highest/lowest die as well
        if keep_dice == dice:
            # roll an additional die
            outcome.append(roll_die())
            outcome.sort()
        else:
            outcome = result(:keep_dice+1)
    elif fail:
        outcome = ()
        for x in range(0, keep_dice):
            outcome.append(0)

    # now sum up all our dice for the total
    sum = 0
    for d in outcome:
        sum += d


    embed = discord.Embed(title='**Dragon Eye** Ability Test for {}'.format(ctx.author.name),
                          description='Rolling {}d10, keep {} {}'.format(dice, keep, keep_dice),
                          color=0x22a7f0)
    embed.add_field(name='Roll', value=format(roll), inline=False)
    embed.add_field(name='Outcome', value=format(outcome), inline=True)
    embed.add_field(name='Total', value=format(sum), inline=True)
    if critical:
        embed.add_field(name='Additional Info', value='**Critical Success**', inline=True)
    elif fail:
        embed.add_field(name='Additional Info', value='**Critical Fail**', inline=True)

    await ctx.send(embed=embed)


def roll_die(sides=10):
    die = random.randint(1, sides)
    return die


bot.run(token)