Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Alex Can Work

@Alex Can Work
About
Posts
2
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to write the handler for buttons using JQUERY
    A Alex Can Work

    Hello! )) I try to write handler for buttons in JS through CSS-selectors. But i meet with difficulties. in case of links this code JQuery works fine:

    $(document).ready(function() { // waiting for page loading
    var steps = $("form").children(".step"); // find all steps of the form
    $(steps[0]).show(); // show 1st step
    var current_step = 0; // set the current step
    $("a.next").click(function(){ // Event of link-click "necxt step"
    if (current_step == steps.length-2) { // checking - will it the next step is last
    $(this).hide(); // i hide the link "next step"
    $("form input[type=submit]").show(); // show thge button "OK"
    }
    $("a.back").show(); // show the link "Back"
    current_step++; // increase the counter of the current slide
    changeStep(current_step); // change a step
    });

    $("a.back").click(function(){ // Click event on a small window

    if (current_step == 1) { // checking - will it the next step is last
    $(this).hide(); // hide the link "back"
    }

    $("form input[type=submit]").hide(); // hide the button "OK"

    $("a.next").show(); //hide the link "Next step"

    current_step--; // increase the counter of the current slide

    changeStep(current_step);// change a step

    });

    function changeStep(i) { // the function of step changing

    $(steps).hide(); // hide all steps

    $(steps[i]).show(); // show the current

    }

    });

    But i'd rather to prefer make this fuctionality for buttons - "Next" and "Back" My HTML-code

    Page

    step 1

    Name:

    step 2

    Sourname:

    step 3

    E-mail:

    JavaScript javascript html css tutorial

  • Addind hide information to a file of NTFS
    A Alex Can Work

    Hello! I have seen example of a code that was written with using python 3.-- but i work with 2.7 and i don't know how to fix a problem with coding symbols from extensional latin. I suppose that there is little error with syntax. But ok will use Python 3. In this code - example i work with a NTFS-file, which allow you add some additional information for effective using. Here it use for translating some word in different languages. When i input a desire word which i want to translate i get a error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128). I write some comments to my lines. When the block "Write streams" begins to work - is print only first 2 streams even i input any word which include usuallatin simbols, for example: "White". But, if i work in python 3 - it code works but i get following error. I parse my list named DATA to the list WORDS and i'd to write this content in a streams in 3 languages, but if i use this:

    with open(filestream, mode='w', encoding='utf8') as stream:
    stream.write(stream_content(dataitem))

    i get incorrect content after reading. It looks like as:

    T:
    r
    R:
    o
    R:
    o
    J:
    u
    R:
    o
    B:
    e
    D:
    o
    T:
    w
    S:
    t
    S:
    t
    O:
    p
    W:
    h
    Y:
    e
    C:
    a
    B:
    u
    T:
    r
    C:
    y
    M:
    o
    P:
    e
    Д:
    о
    Д:
    о
    У:
    ч
    У:
    с
    П:
    е
    О:
    п
    О:
    п
    Д:
    в
    К:
    р
    К:
    р
    Р:
    а
    Б:
    е
    Ж:
    ё
    В:
    о
    В:
    о
    В:
    о
    В:
    е
    М:
    о
    П:
    е
    K:
    r
    Ú:
    t
    Ú:
    t
    E:
    l
    K:
    ö
    V:
    e
    E:
    g
    S:
    z
    V:
    e
    V:
    e
    F:
    e
    S:
    á
    G:
    é
    B:
    u
    T:
    e
    K:
    e
    M:
    o
    G:
    y

    Also i have a mistake, when i try return Word from function find_language. As i know if i put Word in some list and try to return it as list[0], because Word it is single right value, which i try to get through the loop for it in range(len(Result)):

    # -*- coding: utf-8 -*-
    """
    Created on Sat Dec 31 03:33:00 2016

    @author: SKY_SHY
    """

    from codecs import open

    def stream_content(data):
    return '\n'.join(item[0] + ':\n ' + '\n '.join(item[1]) for item in data)

    filename = "DATA_"

    def translate():
    Des_word = input("Enter a word you desire to translate:")# here i input a word, which i desire to translate in another language
    print ('EN = 0', 'RU = 1', 'HU = 2')
    Des_language = int(input("Select a language:"))# here i define a language, to which i desire

    Windows Forms help tutorial python
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups