This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.shortcuts import render | |
| def search_table(request): | |
| search_key = request.GET['search_key'] | |
| context = {'search_key':search_key} | |
| return render(request,'only_table.html',context) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.conf.urls import url | |
| from . import views | |
| urlpatterns = [ | |
| url(r'^table/$',views.table), | |
| url(r'^table/search/$', views.search_table, name="search_table"), | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| .... | |
| <fieldset id="search_fieldset"> | |
| <input id="search_input" type="search" /> | |
| <button id="search_button" type="submit"><i class="fa fa-search"></i></button> | |
| </fieldset> | |
| ... | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
| <script> | |
| $('#search_button').click(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% if result_list.has_other_pages %} | |
| <ul class = "pagination"> | |
| {% if result_list.has_previous %} | |
| <li><a href="?page={{ result_list.previous_page_number }}">«</a></li> | |
| {% else %} | |
| <li class = "disabled"><span>«</span></li> | |
| {% endif %} | |
| {% if result_list.number > 2 %} | |
| <li><a href="?page={{ 1 }}"> 1 </a></li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def compare_line(request): | |
| result_list = result_line() | |
| total_len = len(result_list) | |
| page = request.GET.get('page',1) | |
| paginator = Paginator(result_list, 40) | |
| try: | |
| lines = paginator.page(page) | |
| except PageNotAnInteger: | |
| lines = paginator.page(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input = "abcdefg" | |
| #1 | |
| output ="" | |
| for i in range(len(input)-1,-1,-1): | |
| output = output+input[i] | |
| #2 | |
| #output = input[::-1] | |
| print(output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class HelloWorld{ | |
| public static void main(String[] args) { | |
| String input = "abcdefg"; | |
| String output = ""; | |
| // #1 | |
| for (int i = input.length() -1; i>=0; i--) { | |
| output = output+input.charAt(i); | |
| } | |
| // #2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| int main(int argc, char* argv[]) { | |
| int i=0,j=0; | |
| char input[] = "abcdefghi"; | |
| int input_len = strlen(input); | |
| char output[sizeof(input)]=""; | |
| //1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import absolute_import | |
| import os | |
| from celery import Celery | |
| from celery.schedules import crontab | |
| from django.conf import settings # noqa | |
| os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'inyoung_scrap_prj.settings') | |
| app = Celery('inyoung_scrap_prj') | |
| app.config_from_object('django.conf:settings', namespace = 'CELERY') |