Posts

php - correct htaccess query string code -

is correct code htaccess setting header noindex nofollow rewritecond %{query_string} (^|&)cart? [nc] rewriterule .* - [e=my_set_header:1] header set x-robots-tag "noindex, nofollow" env=my_set_header so following url cannot indexed search engines. http://www.mysite.com/cart?qty=1&id_product=8&token=7775324f4cd8c884155af53ca90e44ad&add actually moz analytics crawling these types of url in <a href="http://www.mysite.com/cart?qty=1&id_product=8&token=7775324f4cd8c884155af53ca90e44ad&add">add cart</a> as duplicate page content. dont know why these url add cart url , these nothing content. also need suggestion online tutorial on playing htaccess . thanks. /cart isn't query_string request uri. can use rule instead: rewritecond %{query_string} .+ rewriterule ^cart/?$ - [e=my_set_header:1]

php - MySQL: Select date plus 6 months if less than now() plus 1 month -

i have given date: 2013-12-20 this issue date of product product expiries in 6 months date of issue. expiration date not stored want check given issue date if expiring in next month of now(). so guess add 6 months issue date , check + interval of 1 month if expiring? here tried: select * `products` date_add(`issue_date`,interval 6 month) < date(now() + interval 1 month) order `issue_date` asc what i'm doing wrong? select * products now() <= date_add(issue_date, interval 7 month) && now() >= date_add(issue_date, interval 6 month) order issue_date asc; the first item has returned has due date today (so issue date + 6 months = today); than due date tomorrow (so issue date + 6 months + 1 day = today); ... than due date 1 month today(so issue date + 6 months + 1 month = issue date + 7 months = today)

how to check that behavior is undefined in c? -

i know following undefined because trying read , write value of variable in same expression, is int a=5; a=a++; but if why following code snippet not undefined int a=5; a=a+1; as here trying modify value of a , write @ same time. also explain why standard not curing or removing undefined behavior , in spite of fact know undefined? long story short, can find every defined behavior in standard. not mentioned there defined - undefined. intuitive explanation example: a=a++; you want modify variable a 2 times in single statement. 1) a= //first time 2) a++ //second time if here: a=a+1; you modify variable once: a= // (a+1) - doesn't change value of why don't standard define a=a++ behavior? one of possible reasons is: compiler can perform optimizations. more cases define in standard, less freedom compiler has optimize code. because different architectures can have different increasing instructions implementations, compiler wouldn't use...

Information Extraction from Text into Structured Data with Python -

i'm near total outsider of programming, interested in it. work in shipbrokering company , need match between positions (which ship open @ where, when) , orders (what kind of ships needed @ where, when kind of employment). , send , receive such info (positions , orders) emails , our principals , co-brokers. there thousands of such emails each day. matching reading emails manually. i want build app matching us. one important part of app information extraction email text. ==> question how use python extract unstructured info structured data. sample email of order [annotation in brackets, not included in email]: email subject: 20k dwt requirement, 20-30/mar, santos-conti content: acct abc [account name] abt 20,000 mt deadweight [size of ship needed] delivery make santos [delivery point/range, owners deliver ship charterers here] laycan 20-30/mar [laycan (the time spread in delivery can accepted] 1 time charter grains [what kind of empolyment/t...

email - Using HTML from Python Code -

i trying mail html code python. till 900 characters coming fine in mail. however, increasing characters missing of characters. example : #!/usr/bin/env python import os,logging,sys subprocess import popen, pipe import shutil,configparser,shlex,subprocess mail import sendmail str="0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" str+="0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" str+="0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" str+="0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" str+="0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" str+="0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" str+=...

codeigniter - getting a value from an array in model -

i need value of array in model compare value.how can it? code in model: function get_order(){ $this->db->select('order'); $this->db->order_by('order','desc'); $this->db->limit(1); $query=$this->db->get('section'); i need last order record $query.i tried code not show . echo $query['order']; thanks help try this, function get_order() { $result = $this->db->select('order'); ->order_by('order','desc'); ->limit(1) ->get('section') ->row(); return $result->order; } this function return order . hope helps :)

linux - what does the flag IRQF_SAMPLE_RANDOM specify while registering interrupt handlers? -

in request_irq() register interrupt handlers, why use flag irqf_sample_random , entropy pool? the entropy pool collects randomness /dev/random , /dev/urandom devices. in outdated kernels, have used irqf_sample_random tell kernel times @ device generates interrupts unpredictable. since kernel version 3.6, kernel handles interrupt randomness automatically, , flag no longer exists.