<tbody id="iajvf"></tbody>

    1. <em id="iajvf"><acronym id="iajvf"><menuitem id="iajvf"></menuitem></acronym></em>
        <li id="iajvf"><acronym id="iajvf"></acronym></li>

        [技術分享]Python 工程師面試寶典一線大廠資深面試官親授

        jiafeimao123發布于3 個月前 ? 92 次閱讀

        download:Python工程師面試寶典一線大廠資深面試官親授

        Python服務端工程師學什么,面試問什么,你該準備什么?別苦惱,別害怕,別糾結,這門課程帶你系統梳理面試知識,增加面試成功幾率,提升后端開發技能,在面試之前解決你的各種問題,讓你技術實力和面試技巧得到雙重提升。

        適合人群

        Python服務端工程師(后端工程師)

        初/中級 web 開發者和全棧開發者

        使用 Python 語言的開發者

        (運維工程師,爬蟲工程師,數據分析師等)

        技術儲備要求

        掌握Python編程語言

        會使用Python進行網站開發,了解網站工作原理

        有一定的網站后端基礎知識 public Book() { }

        復制 public Book(String id, String name, String price, String auth, String publish, String description) { super(); this.id = id; this.name = name; this.price = price; this.auth = auth; this.publish = publish; this.description = description; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getAuth() { return auth; } public void setAuth(String auth) { this.auth = auth; } public String getPublish() { return publish; } public void setPublish(String publish) { this.publish = publish; } }

        import java.util.LinkedHashMap; import java.util.Map; import cn.huiyu.ben.Book; public class BookDao { private static Map<String,Book> bookMap = new LinkedHashMap<String, Book>(); private BookDao() { } static{ bookMap.put(“1”, new Book(“1”,“1111”,“11.0”,“zqwang”,“111出版社”,“111111111”)); bookMap.put(“2”, new Book(“2”,“2222”,“22.0”,“zqwang”,“222出版社”,“222222222”)); bookMap.put(“3”, new Book(“3”,“3333”,“33.0”,“zqwang”,“333出版社”,“333333333”)); }

        復制 public static Map<String,Book> getBooks(){ return bookMap; }

        public static Book getBook(String id){ return bookMap.get(id); } }

        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(“text/html;charset=utf-8”); //1.查詢數據庫中一切的書展現 Map<String,Book> map = BookDao.getBooks(); for(Map.Entry<String , Book> entry : map.entrySet()){ Book book = entry.getValue(); response.getWriter().write("<a href=’"+request.getContextPath()+"/servlet/BookInfoServlet?id="+book.getId()+"’>"+book.getName()+" “); } response.getWriter().write(” ");

        復制 //2.顯現之前看過的書 Cookie [] cs = request.getCookies(); Cookie findC = null; if(cs!=null){ for(Cookie c : cs){ if(“last”.equals(c.getName())){ findC = c; } } } if(findC == null){ response.getWriter().write(“沒有看過任何書!”); }else{ response.getWriter().write(“您曾經閱讀過的書: “); String[] ids = findC.getValue().split(”,”); for(String id : ids){ Book book = BookDao.getBook(id); response.getWriter().write(book.getName()+" "); } } }

        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(“text/html;charset=utf-8”); //1.獲取要看的書的id,查詢數據庫找出書,輸出書的細致信息 String id = request.getParameter(“id”); Book book = BookDao.getBook(id); if(book==null){ response.getWriter().write(“找不到這本書!”); return; }else{ response.getWriter().write(" 書名:" +book.getName()+""); response.getWriter().write(" 作者:" +book.getAuth()+""); response.getWriter().write(" 售價:" +book.getPrice()+""); response.getWriter().write(" 出版社:" +book.getPublish()+""); response.getWriter().write(" 描畫信息:" +book.getDescription()+""); }

        復制 //2.發送cookie保管最后看過的書 // — 1 --> 1 // 1 --2,1 --> 2,1 // 2,1–3,2,1 --> 3,2,1 // 3,2,1 – 4,3,2 --> 4,3,2 // 4,3,2 --3,4,2 --> 3,4,2 String ids = “”;

        Cookie [] cs = request.getCookies();
        Cookie findC = null;
        if(cs!=null){
            for(Cookie c : cs){
                if("last".equals(c.getName())){
                    findC = c;
                }
            }
        }
        
        if(findC == null){
            //闡明之前沒有看過書的記載
            ids += book.getId();
        }else{
            //闡明之前有歷史看過的書的記載,需求依據歷史記載算一個新的記載出來
            String [] olds = findC.getValue().split(",");
            StringBuffer buffer = new StringBuffer();
            buffer.append(book.getId()+",");
            for(int i = 0;i<olds.length && buffer.toString().split(",").length<3 ;i++){
                String old = olds[i];
                if(!old.equals(book.getId())){
                    buffer.append(old+",");
                }
            }
            ids = buffer.substring(0, buffer.length()-1);
        }
        
        Cookie lastC = new Cookie("last",ids);
        lastC.setMaxAge(3600*24*30);
        lastC.setPath(request.getContextPath());
        response.addCookie(lastC);
        

        }

        共收到 0 條回復