Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
szabgab committed Nov 9, 2024
1 parent 21df4cd commit 7d80059
Show file tree
Hide file tree
Showing 17 changed files with 478 additions and 17 deletions.
34 changes: 33 additions & 1 deletion sites/en/pages/a-polling-station-with-flask.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books flask, python
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -221,4 +221,36 @@ $ git commit -m "show the results"
<a href="/testing-the-flask-poll">Testing the Flask Poll</a>.


<h2>Comments</h2>

hello in part where we add "

<code>
@app.route('/poll')
def poll():
vote = request.args.get('field')
return vote "
the /poll pagedoesn't show me the selection I've made

The code:
from flask import Flask, render_template
import os
app = Flask(__name__)

poll_data = {
'question' : 'Which web framework do you use?',
'fields' : ['Flask', 'Django', 'TurboGears', 'web2py', 'pylonsproject']
}

@app.route('/')
def root():
return render_template('poll.html', data=poll_data)
@app.route('/poll')
def poll():
vote = request.args.get('field')
return vote

if __name__ == "__main__":
app.run(debug=True)

</code>
20 changes: 19 additions & 1 deletion sites/en/pages/add-code-snippets-to-atom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books atom
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -76,3 +76,21 @@ I know this because I opened the <hl>Settings</hl> (Actually the <hl>Atom / Pref
and among the <hl>Packages</hl> looked for the one handling HTML files. This is how it looks like:

<img src="img/atom_html_file_type.png" alt="HTML file type in Atom" />


<h2>Comments</h2>

Exactly what I was looking for to bet a long ad code snippet working. Thanks..

<hr>

How can i stop auto-complete to mess with my snippets? When i tab, it does code completation instead of my snippet! Is it possible to do bind it in another key?

<hr>

Thank you! This was helpful. Do you know of a community site where snippet examples and shared? Maybe a github repo?

<hr>

This was super-helpful! Thank you!!

26 changes: 25 additions & 1 deletion sites/en/pages/ajax-request-for-json-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books javascript
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -75,3 +75,27 @@ to create and html string from various parts of this data object. This is not re
I am going to use this opportunity to show a more convincing reason to use Handlebars that I had in the
<a href="/introduction-to-handlebars-javascript-templating-system">introduction to Handlebars</a>

<h2>Comments</h2>

Awesome

<hr>

how do you fetch and render the entire json file content instead of fetching individual element values? i was thinking about something like below...

document.getElementById("TEXTAREA_ID").innerHTML = `${data}`;

but it doesnt work...
<hr>
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.google.fr/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

<hr>

why xmlhttp.readyState == 4, and xmlhttp.status == 200 ?

---

Good Question, see here https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState

This should give you an idea why.

8 changes: 7 additions & 1 deletion sites/en/pages/argv-raw-command-line-arguments-in-nodejs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books nodejs
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -108,4 +108,10 @@ $ node argv.js hello
Param: hello
</code>

<h2>Comments</h2>

thanks for awesome and simple entry guide

<hr>

Just used this to troubleshoot a problem in someone else's code. One of the arguments wasn't being passed correctly on the command line. Thanks!
7 changes: 6 additions & 1 deletion sites/en/pages/automatic-counter-using-angularjs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books angularjs, javascript
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -104,3 +104,8 @@ and create the new $timeout object only if the timer was <hl>null</hl>.


<try file="examples/angular/automatic_counter_with_stop_start.html">

<h2>Comments</h2>

Is it possible to add a save button and save the elapsed (time) count in the above script? Maybe make the elapsed time counter value a variable in an ionic application?

17 changes: 16 additions & 1 deletion sites/en/pages/convert-string-to-number-in-ruby.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books ruby
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -131,4 +131,19 @@ puts e.to_c # 23000.0+0i
<include file="examples/ruby/string_to_number.rb">


<h2>Comments</h2>

foo.to_i" works for simple cases. One might consider: "Integer(foo)".

"1.4.5".to_i => 1
Integer("1.4.5") => invalid value for Integer()

Latter is better suited as a result.

<hr>

Hi, in this case my string is "12345.678" when use to_f then result is: 12345.67 (only 2 number after dot)
How can i get enough 12345.678 . I mean how can i get more number after dot.
Thanks guys


97 changes: 96 additions & 1 deletion sites/en/pages/create-and-download-csv-with-javascript.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books javascript
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -47,3 +47,98 @@ However, what happens if the data can also contain quotes? We will then have to

This is not "unsolvable" of course, but it needs some more work and currently I did not have the need for that.

<h2>Comments</h2>

In Firefox is not working. I click the button and nothing happens.Thanks

---

Firefox requires the download A-element to be present in the DOM before clicking and not created dynamically. So, just add a hidden <a id=dummy_download> or similar and fetch that instead of using createElement and you're set. :)

(This might not be the official explanation, but it works)

<hr>

hye how can i click the save button and it will automatically save into my server not my laptop ?

<hr>
Excellent little example - just what I needed.
Thanks very much Gabor.

<hr>

Hi, is there any check to prevent delimiter inside data? What if any data will contain delimiter (",")? rows and columns wont match. Is there workaround for that?

<hr>

thanks, very handy!

<hr>

thank you .....its perfect

<hr>

I'm glad you explain each. line of code. Thanks!

<hr>

Thank you

<hr>
Chrome has an issue using encodeURI if the filesize is greater than 1mb. This discussion on StackOverflow shows how to use createObjectURL instead.
https://stackoverflow.com/questions/24610694/export-html-table-to-csv-in-google-chrome-browser/24611096#24611096

<hr>

Hi, It is not working in IE 11. I have added tag in DOM. Whenever call function to download csv, getting alert, "Do you want to open application from this website". After click on Allow csv is not dwonloading. Working fine on chrome. Please help to eun on IE 11.

<hr>

Thank you very much!

<hr>

hello....I need your help...i want to export form data into csv file using plain JS

<hr>

Is there any option to set password for the files.

<hr>

How can we download multiple sheets?

<hr>
what if my delimiter in the string is ; instead of comma
---

Then join with a semi-colon instead;

csv += row.join(';');


<hr>

Thank's for this solution, I'm saved :)

<hr>

i followed the steps hoewever i get my array values written in one row in CSV file, no \n is applied.
my data is an array returned by a function as :
var data = [days];
return data;
and i call this function from the downloadCSV ()

<hr>

Getting the following error: (TypeError: row.join is not a function) Any idea?

<hr>

Hi, How to achieve the same functionality in IE 11 ?

<hr>

Thank you!

13 changes: 12 additions & 1 deletion sites/en/pages/creating-an-iterator-in-python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books python
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -112,3 +112,14 @@ elements), or it can be totally unrelated. (e.g. some user input. Elapsed time.
Day of the week. Etc.)

<include file="examples/python/fibonacci_iterator.py">


<h2>Comments</h2>

Very nice. Thank you!

<hr>

%> python3 fibonacci_finate_iterator.py
TypeError: iter() returned non-iterator of type 'Fibonacci'

6 changes: 5 additions & 1 deletion sites/en/pages/dependency-injection-in-angularjs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=books angularjs
=author szabgab
=archive 1
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -109,4 +109,8 @@ the function call.



<h2>Comments</h2>

Simple, short, and great explanation. When i saw in tutorials both ways you mention i couldn't understand when to use one or the other, and now i do thanks to you.


Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
=books flask
=status show
=author szabgab
=comments_disqus_enable 1
=comments_disqus_enable 0

=abstract start

Expand Down Expand Up @@ -389,4 +389,10 @@ my-uswgi.ini.

For other options you might want to check out the <a href="http://flask.pocoo.org/docs/0.10/deploying/uwsgi/">Deploying Flask on uWSGI</a> in the documentation.

<h2>Comments</h2>

Got my app up and running, thank you, command "uwsgi --http-socket :9090 --plugin python --wsgi-file app.py --callabe app" worked. But there is still a typo - callale

---
fixed. thanks

Loading

0 comments on commit 7d80059

Please sign in to comment.