Navigation

    Cyberian
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Pro Blog
    • Users
    • Groups
    • Unsolved
    • Solved
    Quiz 100% Result
    • This page isn’t working example.com is currently unable to handle this request. HTTP ERROR 500

      zaasmi

      This page isn’t example.com is currently unable to handle this request. HTTP ERROR 500

      cd23deb6-52b2-41a8-9179-535501e13d89-image.png

      Development Troubleshooting
    • How to iterate over every n-th line from a file?

      sweet friends

      I have a file called data.txt containing lines of data:

      This is line one This is line two This is line three This is line four This is line five This is line six This is line seven

      …
      I have the following code:

      with open('data.txt', 'r') as f: for x, line in enumerate(f): if x == 3: print(line) In this case it only prints

      “This is line four”.
      I do understand why but how do I take it from here and have it print the lines 4, 7, 10, 13, …?

      Development Troubleshooting
    • JavaScript: Modifying DOM and populating it with JSON data

      zaasmi

      i’ve got a JSON data base, and need to populate a website with it’s content. It’s the first time a try doing something like this (still learning JS).

      <div class="cardsection"> <div class="card"> <div class= "photoandname"> <div class="profilphoto"> </div> <h2 class="name"> </h2> </div> <div class="informations"> <h3 class="location"> </h3> <p class="caption"> </p> <p class="price"> </p> </div> <div class="tags"> <button class="tagButton"> </button> <button class="tagButton"> </button> </div> </div> </div>
      Development Troubleshooting
    • Which data type should be used in c++ to store address because address consists of both integers and characters

      Mohammad Maaz

      You basically answered your own question. If you need to save something that is a mixture of numbers and characters, I see two obvious choices:

      You just need it as a text: I would go with a simple std::string

      You need the individual elements (e.g. street name, street number): define a custom struct, e.g.

      struct Address { std::string street_name; int house_number = -1; };
      Development Troubleshooting
    • There has been a critical error on your website.

      cyberian

      There has been a critical error on your website.

      Development Troubleshooting
    • Unrecognized Content-Security-Policy directive 'worker-src'. Selected Element <p>…</p>

      zaasmi

      Unrecognized Content-Security-Policy directive ‘worker-src’.
      Selected Element
      <p>…</p>

      Development Troubleshooting
    • SyntaxError: Can't create duplicate variable: 'changeCurr'

      zaasmi

      facing issue create duplicate variable safari

      Development Troubleshooting
    • DevTools failed to load Source Map: Could not load content for

      hadia ejaz

      DevTools failed to load SourceMap: Could not load content for https://localhost/wp-content/themes/godaddo/assets/js/popper.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

      Development Troubleshooting
    • Object not found! If you think this is a server error, please contact the webmaster.

      zaasmi

      Object not found!
      The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

      If you think this is a server error, please contact the webmaster.

      Error 404
      domain.com
      Apache
      760f650c-d843-43df-aecb-4afd52551f63-image.png

      Development Troubleshooting
    • The execution failed. Please check error.log

      zaasmi

      While theme import demo data error.
      The execution failed. Please check error.log

      Development Troubleshooting
    • Installation failed: Could not create directory.

      zaasmi

      Although it seems unlikely, the error “Installation failed, could not create directory.” might be caused by insufficient disk space in your server. It is a common issue if you are using shared hosting. Ensure you have enough space for the new files to be installed.

      Development Troubleshooting
    • 404 - PAGE NOT FOUND

      zaasmi

      404 - PAGE NOT FOUND

      The page you are looking for might have been removed had its name changed or is temporarily unavailable.

      Development Troubleshooting
    • This app isn't verified Sign in Issue with Google Auth iss

      zaasmi

      This app hasn’t been verified by Google yet. Only proceed if you know and trust the developer.
      Google hasn’t reviewed this app yet and can’t confirm it’s authentic. Unverified apps may pose a threat to your personal data. Learn more
      74eb8898-71a8-431b-8120-1f975b4954ab-image.png ue

      Development Troubleshooting
    • How to configure your web server's document / web root to the /public/ directory

      zaasmi

      Upload all files from the /Application/ folder to your web server. Then you have to configure your web server’s document / web root to the /public/ directory. The index.php in this directory serves as the front controller for all HTTP requests entering the application. Wrong: http://www.yoursite.com/public Right: http://www.yoursite.com/

      Development Troubleshooting
    • This package is incompatible with this version of macOS.

      zareen

      SideSync is a new PC-Mobile solution that enables screens, windows, and data to be shared easily. Share between a PC and a Galaxy smartphone, or between a Galaxy Tab and Galaxy smartphone.
      But Samsung SideSync 4.7 incompatible Catalina.
      a65b95f4-95f9-4d3e-a724-fc32fe90b553-image.png

      Development Troubleshooting
    • How to Generate a HAR file

      M

      how can i generate HAR file.

      ▶ In Chrome
      ▶ In Firefox
      ▶ In Microsoft Edge
      ▶ In Safari

      Development Troubleshooting
    • how to change whatsapp dark mode

      zareen

      How can i change the dark mode of whatsapp

      Development Troubleshooting
    • Why http url auto redirect to https?

      zareen

      How to force your site to redirect to https (SSL)
      I’m facing issue please help?

      Development Troubleshooting

    SOLVED How to iterate over every n-th line from a file?

    Development Troubleshooting
    every n-th line iterate n-th line over every python
    2
    2
    7
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • sweet friends
      sweet friends last edited by zaasmi

      I have a file called data.txt containing lines of data:

      This is line one
      This is line two 
      This is line three 
      This is line four 
      This is line five 
      This is line six 
      This is line seven
      

      …
      I have the following code:

      with open('data.txt', 'r') as f:
          for x, line in enumerate(f):
              if x == 3:
                  print(line)
      In this case it only prints
      

      “This is line four”.
      I do understand why but how do I take it from here and have it print the lines 4, 7, 10, 13, …?

      1 Reply Last reply Reply Quote 0
      • zaasmi
        zaasmi Cyberian's Gold last edited by

        Demo:

        data.txt:

        line1
        line2
        line3
        line4
        line5
        line6
        line7
        line8
        line9
        line10
        line11
        line12
        line13
        

        Code:

        from itertools import islice
        
        with open('data.txt') as f:
            for line in islice(f, 3, None, 3):
                print line,  # Python3: print(line, end='')
        

        Produces:

        line4
        line7
        line10
        line13
        

        Reff

        1 Reply Last reply Reply Quote 0
        • zaasmi
          zaasmi Cyberian's Gold last edited by

          Demo:

          data.txt:

          line1
          line2
          line3
          line4
          line5
          line6
          line7
          line8
          line9
          line10
          line11
          line12
          line13
          

          Code:

          from itertools import islice
          
          with open('data.txt') as f:
              for line in islice(f, 3, None, 3):
                  print line,  # Python3: print(line, end='')
          

          Produces:

          line4
          line7
          line10
          line13
          

          Reff

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          50% Off on Your FEE Join US!

          Quiz 100% Result If you want to know how you can join us and get 50% Discout on your FEE ask Cyberian in Chat Room! Quiz 100% Result Quiz 100% Result
          solution1241 discussion1193 fall 2019813 assignment 1425 assignment 2295 spring 2020265 gdb 1246 assignment 382 crw10174 spring 201955
          | |
          Copyright © 2021 Cyberian Inc. Pakistan | Contributors
          Live Chat