Posts

Showing posts from September, 2010

python - Django Slug Generated URL Returning: 'No Fund matches the given query.' -

i trying use slug generate urls, wherever visit url 'page not found @ /funds/[slug_generated_value]' raised by: apps.funds.views.details no fund matches given query here models.py, generate fund_id using fund.name create acronym , add datetime value deadline minus hour, min, sec values: class fund(models.model): name = models.charfield(max_length=128, unique=true) description = models.textfield() duration = models.charfield(max_length=10) slug = models.slugfield(unique=true) def save(self, *args, **kwargs): self.slug = slugify(self.name) super(fund, self).save(*args, **kwargs) def __str__(self): return self.name class offeredfunds(models.model): fund_id = models.charfield(max_length=55, blank=true) fund_name = models.foreignkey(fund) deadline = models.datetimefield('deadline') slug = models.slugfield(unique=true) def save(self, *args, **kwargs): output = '' in self

google spreadsheet - Filter to the latest month and then filter to the best score per person -

Image
i've got google sheet holds results of monthly competition. format is name | date | score -------------------------------- alan smith | 14/01/2016 | 500 bob dow | 14/01/2016 | 450 bob dow | 16/01/2016 | 470 clare allie| 16/01/2016 | 550 declan ham | 16/01/2016 | 350 alan smith | 10/02/2016 | 490 bob dow | 10/02/2016 | 425 declan ham | 12/02/2016 | 400 declan ham | 12/02/2016 | 390 clare allie| 12/02/2016 | 560 i want 2 things data i want create new sheet holds latest 'best' results. data presented here be alan smith | 10/02/2016 | 490 bob dow | 10/02/2016 | 425 declan ham | 12/02/2016 | 400 clare allie| 12/02/2016 | 560 i.e. results february 'best' score per person. here declan ham's lower score of '390' removed. i want sheet hold tournament ranking. people ranked top 3 monthly scores. i.e. best score each person each month obtained , top 3 scores combined give place in tournament. so far i've attempted use

spring security concurrent session not working -

i using spring 4 , hibernate 4 have implemented spring security , working fine but, not want allow concurrent logins using same credentials. 1. have added listener "httpsessioneventpublisher" web.xml , used "session management" tag in spring security implement concurrency control not working following complete code: web.xml: <?xml version="1.0" encoding="utf-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <listener> <listener-class> org.springframework.security.web.session.httpsessioneventpublisher </listener-class> </listener> <servlet> <servlet-name>appservlet</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherse

tinkerpop3 - How to add multiple edges in a single gremlin query? -

my scenario add multiple edges between vertices in single query: assume nodes below: these labels , ids have users : 4100 songs : 4200 4355 4676 i have establish edges between these vertices 4100 --> 4200, 4100 --> 4355, 4100 --> 4676. we can creating single edge between node.it not efficient method if want create edge between more 50 vertices @ time. using tinkerpop 3.0.1 . if have vertex ids, efficient lookup id. if using gremlin server, each request gremlin server treated single transaction. can pass multiple statements in gremlin query on single request (with bindings) rather sending multiple requests. separate statements in gremlin query semicolons. l=[4200, 4355, 4676]; v=graph.vertices(4100).next(); l.each { v.addedge("knows", graph.vertices(it).next()) }

windows phone 8.1 - SpeechSynthesizer::SynthesizeTextToStreamAsync function takes forever -

i have following c++/cx code: windows::media::speechsynthesis::speechsynthesizer^ synth = ref new windows::media::speechsynthesis::speechsynthesizer(); platform::string^ text = "this string of text."; concurrency::create_task(synth->synthesizetexttostreamasync(text)) .then([&](windows::media::speechsynthesis::speechsynthesisstream^ stream) { mediaelement->autoplay = true; mediaelement->setsource(stream, stream->contenttype); mediaelement->play(); }); if understanding correct, supposed synthesize string this string of text. stream played through mediaelement . after execute code, however, lambda specified in task.then() never runs. missing something? this works fine me. few possibilities: you don't have microphone capability , swallowing access denied exception(*) calling play throwing , swallowing exception(**) you running on device doesn't have default speech language installed ( defaultvoice == null

Debugging Django on Docker on Vagrant with IDE -

i have quite docker stack @ moment, compiled many containers, 1 of running instance of django. at moment, i'm limited debugging importing logging , using logger = logging.getlogger(__name__) logger.debug("your variable: " + variablename) it's totally inefficient , requires me rebuild docker stack every time want re-evaluate change. i'm used working in komodo , having robust, step-able debugger @ disposal, can's seem find documents on how wire docker container inside vagrant vm ide (or command line debugger) let me step through code without rebuild. how can wire debugging ide docker container inside vagrant vm? thanks. i recommend use docker compose handle , link containers. i'm using docker stack on dev env container - django - postgres - nginx you have synchronize code code inside docker container. that, use volumes command in docker-compose file. here example, 2 containers (django , postgres) : db: image: postgres web

javascript - How to Display Page Number for iFrame Pagination -

Image
i have main page includes iframe , pagination. i want display page numbers of iframe pages on sidebar of main page (means, not in iframe in page contain iframe) here image display want do: i use jquery code (using jquery-1.9.1.js): <script> var locations = ["./pages/0.html","./pages/1.html", "./pages/2.html", "./pages/3.html","./pages/4.html"]; var currentindex = 0; var len = locations.length; $(document).ready(function(){ $(':button').click(function() { currentindex = this.value == "next" ? currentindex < len - 1 ? ++currentindex : len - 1 : currentindex > 0 ? --currentindex : 0; $('#zoome').attr('src', locations[currentindex]); }); }); </script> i wonder correct code display page numbers between next , previous buttons? here live link: coreneto you can code html $('#iframe')

jquery - How escape spaces and "&" characters in the selector -

i escape spaces , & in id selector: $("input[name='therapeuticarea']").click(function () { var area = $(this).val(); // = "first & last" $("div[id=" + area + ']').show(); }); i suggest using clean data-value="first-last" , using $(this).data('value') so code like: html <input name="therapeuticarea" value="first & last" data-value="first-last"> js $("input[name='therapeuticarea']").click(function () { var area = $(this).data('value'); $("div[id=" + area + ']').show(); });

Conflict when using the same slug name for page and post type in Wordpress -

i have problems permalink in wordpress. i have created page "grid-services" have permalink : example.com/grid-services/ i registered , costum post type "markets", , after created market named "grid-services", permalink: example.com/markets/grid-services/ the problem when try access example.com/grid-services/ url, automaticly redirect me example.com/markets/grid-services/ page url what have tried when register post type have tried change code in diferent combination, nothing seems work. register_post_type( 'markets', array( 'labels' => $labels, 'public' => true, 'supports' => $supports, 'hierarchical' => true, 'rewrite' => array("slug" => "markets"), 'has_archive' => false, ) ); what can problem? giving function, can -- function wp_cpt_unique_post_slug($slug, $post_id, $post_status, $post_type, $post_parent, $original_

Get data from a ListView item and send to another activity (Android) -

Image
i trying send object information activity intent. information in picture. first activity intent intent = new intent(getapplicationcontext(),anotheractivity.class); intent.putserializable("value", listitem); second activity intent intent=this.getintent(); object list = intent.getserializable("value");

javascript - How do I return the response from an asynchronous call? -

i have function foo makes ajax request. how can return response foo ? i tried return value success callback assigning response local variable inside function , return one, none of ways return response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- tried 1 } }); return result; } var result = foo(); // ends being `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify inside of function? - asynchronous code reference -> if understand problem, skip possible solutions below. the problem the a in ajax stands asynchronous . means sending request (or rather receiving response) taken out of normal execution flow. in example, $.ajax returns , next statement, return result; , executed before function passed success callback

c# - Apply Include and ThenInclude based on Lambda Expressions Dictionary -

i have few entity framework 7 (core) entities: public class person { public virtual address address { get; set; } public virtual icollection<hobby> hobbies { get; set; } } public class address { public string street { get; set; } public virtual country country { get; set; } } and have string array follows: string[] entities = new string[] { "hobbies", "address.country" } given string array got: context.persons .include(x => x.hobbies) .include(x => x.address).theninclude(x => x.country); in ef6 like: context.persons.include(entities[0]).include(entities[1]); but in ef7 include not allow strings. created dictionary: private readonly dictionary<string, lambdaexpression> _properties = new dictionary<string, lambdaexpression>(); which have like: x => x.hobbies "hobbies" x => x.address.country "address.country" and have extension: public static iqueryable<t> inc

c# - xml deserialization <string> tag -

i wrote web service using system.servicemodel system.servicemodel.web system.servicemodel.activation namespaces. [xmlserializerformat] [operationcontract] [webget(uritemplate = routing.getclientroute, bodystyle = webmessagebodystyle.bare)] string getclientnamebyid(string id); i described data class: [xmlroot("servicexmlreply")] public class servicexmlreply { [xmlelement] public string name; } problem respond, receive service. looks this: "<?xml version=\"1.0\" encoding=\"utf-8\"?> <string> <servicexmlreply xmlns:xsd=\"http://www.w3.org/2001/xmlschema\" xmlns:xsi=\"http://www.w3.org/2001/xmlschema-instance\"> <name>igor<name> <servicexmlreply> </string>" as can see there not supposed "string" tag, is. because of can't deserialize respond , data. class same on server , client's side.

How long is Android ViewTreeObserver alive? -

i working on app listens view events scrolling, layout drawn using viewtreeobserver. viewtreeobserver has method check if it's alive before doing eg. adding listeners. i have reproduce issue of dead / not alive viewtreeobserver see if code works in production. don't see in android documentation reproduce it. i appreciate / pointers. thanks in fact, if check source code of class viewtreeobserver, there "kill" function set malive false, here, but never invoked. /** * marks viewtreeobserver not alive. after invoking method, invoking * other method {@link #isalive()} , {@link #kill()} throw exception. * * @hide */ private void kill() { malive = false; } in opinion, observer become unavailable (but not un-alive, couldn't use isalive() determine current observer's state) after: you removed listener(s), such view.getviewtreeobserver().removeongloballayoutlistener(this); the current activity containing view destroyed

html - Using <select multiple> to populated text field in PDF -

i have 3 files: , html file, xml file, , pdf form. have pdf auto populating data entered html via xml code. need have drop down menu can select multiple items , have them auto populate text field in pdf form. possible? this possible, if using listbox multiple selections flag set (as opposed combobox, allows single selections only). most in target (multiline) text field evaluate currentvalueindices property of listbox, , use indices there read out values via getitemat() method. those, can write text field. see acrobat javascript documentation.

c++ - Weird behavior with operator defined as friend inside class -

i don't understand going on in following piece of code: struct { }; struct b { b() { } b(const a&) { } friend b operator*(const b&, const b&) { return b(); } }; int main() { b x = a() * a(); return 0; } when compile (with both clang , gcc 4.9.2) error message on "b x = a() * a()" line; clang says "invalid operands binary expression". if take operator* definition inside class, 100% ok! struct { }; struct b { b() { } b(const a&) { } friend b operator*(const b&, const b&); }; b operator*(const b&, const b&) { return b(); } int main() { b x = a() * a(); return 0; } what going on? since operator*() defined inside function friend, can found adl , not normal unqualified lookup. type of lookup requires arguments exact types, not types implicitly convertible. means operator cannot found if a can converted b . when declare function outside class, can found normal unqualified

linux - Vim, find the n'th occurence of a word -

i tried using following syntax, in vim find n'th occurence of word(i replace word one) :6:myword and replace newword i not understand getting wrong, can me? s/\%(\(myword\).\{-}\)\{6}\zs\1/newword/ ^ ^ ^ pattern occurrence replace pattern it replace 6th occurrence of myword newword.

datetime - What's the right way to compare two dates in php? -

i need compare dates database current day. id code, in eloquent: $posts = post::where('date', '=', date('y-m-d'))->get(); i want retrieve today's posts only. knowing 'date' field of type date, how make work? tried convert date('y-m-d') string 'format' method, seems date('y-m-d') somehow returning boolean, , thus, method 'format' can't applied it.. i use handle database dates //get database date, , format $database_date = date_format($database_date, 'y-m-d'); //get today date or date of choice $today_date = new datetime(); //format $today_date = date_format($today_date, 'y-m-d'); // use strtotime() compare dates or datetime::diff more cleaner imo $difference = strtotime($today_date) - strtotime($database_date);

rotation - Kivy/Python rotates the display (test,buttons, pictures). Test programs that worked, are now rotated -

i learning python & kivy: (life lot easier using assembly embedded controllers). whole display rotated 90 degrees ccw. demo programs used work displayed rotated. presumably did set permanent "rotate display" flag while running python. , how can reset it? rebooted computer no improvement. win-7 64. python 3.4 i ran problem while when learning kivy. left frustrated comment on a youtube video . there's file @ c:\users\[username]\.kivy\config.ini need modify or delete.

python - Setting up Django environments for Python2.X and 3.X? -

i'm trying set django environment work on website project python group. we're using 2.7 project, when followed guide https://www.howtoforge.com/tutorial/django-install-ubuntu-14.04/ set 3.4. how can differentiate set of setup tools installs? here pip version when type --version ~ $ pip --version pip 1.5.6 /usr/local/lib/python3.4/dist-packages/pip-1.5.6-py3.4.egg (python 3.4) you can point python executable via -p : virtualenv -p /usr/bin/python2.7 <path/to/new/virtualenv/> while creating new virtualenv.

python - IO Error - Flask-mail and running server with proxy -

i'm very wierd bug... i have flask app using flask-mail send email messages. in redhat server, tryied using runserver (flask-manager) , gunicorn. have apache server connecting app using proxy. when run app, using user (root or other), app runs , sends emails normally. but when close session server (exit in terminal) stops send mail , gives me stack trace: in send_mail return mail.send(msg) file "/usr/local/lib/python2.7/site-packages/flask_mail.py", line 415, in send self.connect() connection: file "/usr/local/lib/python2.7/site-packages/flask_mail.py", line 123, in __enter__ self.host = self.configure_host() file "/usr/local/lib/python2.7/site-packages/flask_mail.py", line 144, in configure_host host.login(self.mail.username, self.mail.password) file "/usr/local/lib/python2.7/smtplib.py", line 575, in login self.ehlo_or_helo_if_needed() file "/usr/local/lib/python2.7/smtplib.py", line

c# - How to access nested div based on class name -

i have html code: <div class="searchresult webresult"> <div class="resulttitlepane"> google </div> <div class="resultdisplayurlpane"> www.google.com </div> <div class="resultdescription"> search </div> </div> i want access innertext inside divs in diffrent variables know accessing div class hould write var titles = hd.documentnode.selectnodes("//div[@class='searchresult webresult']"); foreach (htmlnode node in titles) {?} what code should write innertext of each dive in different variables.tnx i extend current xpath expression have match inner div elements: //div[@class='searchresult webresult']/div[contains(@class, 'result')] then, text, use .innertext property: c# - text inside tags using html agility pack c#: htmlagilitypack extract inner text

javascript - knockout data-bind syntax in js ( not HTML) -

i understand can create bindings using following syntax in dom: <span id="namespan" data-bind="text: personname"> working example here: https://jsfiddle.net/m14mohda/ but can create such span element in js? i.e. using like: createspans = function (){ var s = document.createelement('span') s.id = "namespan" s.data-bind ="text: personname" -----> ???? document.body.appendchild(s) } the dom element api offers 2 ways of doing this. more general one, should work custom attribute using setattribute method. var s = document.createelement('span'); s.setattribute("someattribute", "somevalue"); s.setattribute("data-bind", "text: personname"); document.body.appendchild(s); creates element <span someattribute="somevalue" data-bind="text: personname"></span> specifically attributes data- prefixed, specification incl

java - Spring integration dynamic message selector -

i have application 2 queues, first queue has control messages , other has data messages. based on jmscorrelationid of message control queue need read messages jmscorrelationid data queue. i able selectively read messages data queue using selector defined below. <int-jms:message-driven-channel-adapter id="messagedriveninboundadapter" channel="inboundchannel" destination-name="inboundmq" selector="jmscorrelationid = 'jmscorelis1234'" connection-factory="connectionfactory" extract-payload="false"/> i need dynamically update value jmscorrelationid selector based on messages received on different channel. is possible that? there different way implement solution in spring integration? it's not possible message-driven adapter; selector baked message listener container constructed during initialization. you can change message selector of polled <inbound-channel-adapter/> ; cha

Am I creating a temporary c struct and sending it through socket? -

i have managed send c struct on socket. but, have read there 2 ways of doing this: by dynamically allocation memory , filling struct elements returning pointer structure create temporary struct , filling struct members returning content of struct. my code here: i have struct: typedef struct enquery { char type[7]; char table_name[53]; char columns[5][53]; struct values { char doc[129]; char key[2][206]; char iv[17]; char td[53]; char s[206]; }values; struct encondition { int k; char attr[53]; char val[53]; }encondition; int len; int rn; }enquery; and declared in main(): struct enquery * ieq; ieq = (enquery *)malloc(sizeof(enquery)); strcpy(ieq->type,"insert"); strcpy(ieq->table_name,"table_name"); strcpy(ieq->columns[0],"hello"); strcpy(ieq->columns[1],"hi"); strcpy(ieq->columns[2],"an"); strcpy(ieq-&g

How to have a separate tab for one namespace and its sub-namespaces in doxygen? -

i have 3 namespaces (let's "a", "b", "modules"). documentation of namespace "modules" interesting other people programmers working me. idea have separate tab on top (like classes, namespaces) call example "modules" sub-namespaces of namespace "modules" should appear. way, 1 has easy access descriptions available namespace. change main page | namespaces | classes | files to main page | modules | namespaces | classes | files and have tab "modules" list of namespaces part of namespace "module". i know how document code using doxygen. however, have no idea how change layout of generated documentation idea above. in short change header of doxygen documentation have additional tab called "modules" add treeview of namespaces part of namespace "modules" tab (similar namespaces tab) take @ this accepted answer guess find necessary i

angularjs - angular jstree does not showing -

i trying show ngjstree in loaded ng-veiw tree not showed here html definition : <div js-tree="treeconfig" ng-model="treedata" should-apply="vm.applymodelchanges()"></div> and here controller inject angular : app.registerctrl('orgchartctrl', ['$scope', '$http', function ($scope, $http) { $scope.treeconfig = { core: { multiple: false, error: function (error) { alert('treectrl: error js tree - ' + angular.tojson(error)); }, }, version: 1 } $scope.$on('$viewcontentloaded', function () { alert(""); $scope.treedata = [ { id: 'ajson1', parent: '#', text: 'simple root node' }, { id: 'ajson2', parent: '#', text: 'root node 2' }, { id: 'ajson3', parent: 'ajson2', text: 'child 1' },

Swift 2.0 soap request with Alamofire send xml parameters -

Image
i want request web service example: http://www.holidaywebservice.com//holidayservice_v2/holidayservice2.asmx?wsdl i need send 1 parameter "countrycode". don't know how can alamofire. , how response parse xml result. this how did in postman, want know how same in swift. thanks help. try it will make post request url = http://holidaywebservice.com/holidayservice_v2/holidayservice2.asmx?wsdl the parameters sent encoding section encoding: .custom => created mutblerequest a. can take directly url or b. new url the important mutablerequest.httbody, soap-message placed necessary values (type string) the headers can vary according web service , api, in 1 case can have login / password / token or authorisation the line --> "content-type" : or "content-length" depends on situation. swxmlhash.parse(response.data!) handle response, can see more in [alamofire / usage / response handling ] ( https://github.com/alamofire/alamofir

raspberry pi - How to get class picamera.array in python -

how class picamera.array in python?? when write commands "help('modules')", there no list 'picamera.array'. there picamera. want capture rgb image , make array picture the way picamera: import picamera import picamera.array it's question because normally, import picamera , give access attribute picamera.array . however, in case of picamera , in order avoid adding hard dependency on numpy picamera , module not automatically imported main picamera package , must explicitly imported.

java - Intellij idea triggered brakepoint without having one -

i faced strange problem while debugging project. problem idea triggered breakpoint @ lines no breakpoints actually. however, breakpoints have been set @ lines before, not now. advices? screenshot attached.

.htaccess - Relative Url in Subdirectory -

i have site on domain.com , want add sub site on blog subdirectory. in domain.com/blog/index.html files in subdirectory, tried use post-1 , /post-1 , ./post-1 link single post. an url expected domain.com/blog/post-1 however, url on link domain.com/post-1 . can .htaccess update baseurl of subdirectory domain.com/blog/ ? means relative url in blog directory domain.com/blog/[some-url-here] . i tried incorrect: <ifmodule mod_rewrite.c> rewriteengine on rewritebase /blog/ rewriterule ^index\.html$ / [r=301,l] rewriterule ^blog/(.*)/index\.html$ /$1/ [r=301,l] </ifmodule> thank help. your substitutions (2nd parameter rewriterule) start slash ('/'). means base never used. make them relative if want rewritebase incorporated.

$fromInput.datepicker is not a function yadcf on datatables -

i trying use range_date column in yadcf, get: $frominput.datepicker not function my code: var table = $('#{{ table.opts.id }}').datatable({ "buttons": [ 'csv', 'excel', 'pdf', 'print' ], .... }).yadcf([ { column_number: 0, filter_type: "range_date", date_format: "mm/dd/yyyy", filter_delay: 500 }, { column_number: 1, filter_type: "text", filter_delay: 500 }, { column_number: 2, filter_type: "text", filter_delay: 500 }, { column_number: 3, filter_type: "text", filter_delay: 500 }, { column_number: 4, filter_type: "text", filter_delay: 500 }, ]); }); and import following files

Spring Security not populating database with hashed password -

i'm trying populate database hashed password , log in application, matching data i'm submitting through log in form, how typical hashed password suppose work. i'm using spring security , spring boot, , far know log in form working because error encoded password not bcrypt . , know when i'm submitting user database it's not working because see plain string in password column in database. i'm not sure i'm going wrong here. here's user object package com.example.objects; import java.util.hashset; import java.util.set; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.fetchtype; import javax.persistence.generatedvalue; import javax.persistence.generationtype; import javax.persistence.id; import javax.persistence.onetomany; import javax.persistence.table; import javax.persistence.version; import com.example.security.passwordcrypto; import com.example.security.roleenum; @entity @table(name = "users&q

dns - Why can I not ping addresses with leading or trailing underscores on linux -

on windows: accessing _.github.com in browser works nslookup _.github.com works ping _.github.com works on linux (tested on 2 separate networks): accessing _.github.com in browser works host _.github.com works ping _.github.com does not python -c "import requests; requests.get('_.github.com')" does not what going on here? because linux (more specifically, component of such libresolv or ping itself) honoring rfcs. underscores not allowed in hostnames, , hostname looking when using ping. (underscores allowed in other types of dns records, example srv records, txt records such used dkim...) see rfc 1123 section 2.1, , rfc 952 . here other links discussion of topic: stack overflow - can (hostname) subdomains have underscore “_” in it? domainkey - underscores in dns quora - why underscores not allowed in dns host names? update : couple of people pointed out in comments, linux ping happy a_a.github.com . doing few more tests

correlation - How to inform R that the first column of my dataset is row names? And how should change the class of data frame to vector or matrice? -

apd<- read.csv("apd.csv",header=false) rar<- read.csv("rar.csv",header=false) ## making column name labels tree<-rep("tree",100) tree_labels<-c(1:100) colnames(apd)<-c(paste(tree,tree_labels, sep="")) colnames(rar)<-c(paste(tree,tree_labels, sep="")) correlation.csv<- cor(x=apd, y=rar, method = "spearman") the above script suppose 2 calculated correlation between columns of 2 data sets . there 2 problem starts labeling output first column (which row name) last score gets na label. i'm not sure if i'm thinking correctly or not maybe same reason r thinks apd data frame not calculate last line. cheers subset of csv file v1 v2 v3 v4 t1 9.368703877 9.693286792 12.44129352 13.06908296 t10 8.128921254 8.940227268 11.40226603 12.17704779 t11 7.87062995 8.697508965 11.39250803 12.17704779 after read in it's below v2 v3

Android - Why ListView inside ListView does not work? -

my xml file: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:text="" android:id="@+id/address" /> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="" android:layout_below="@+id/address" android:id="@+id/win_title" /> <listview android:layout_width="match_parent" android:layout_height="wr

excel - Unhide worksheet within a macro does not work when workbook is protected -

i have issue unprotecting / protecting sheet when run macro. read few posts stating should insert activesheet.unprotect password:="my password" bit before , activesheet.unprotect password:="my password" , macro, has not worked. suggestions gratefully appreciated. activesheet.unprotect password:="my password" sheets("sheet1").select sheets("sheet2").visible = true sheets("sheet2").select cells.select selection.copy workbooks.add cells.select activesheet.paste application.cutcopymode = false selection.copy selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false application.cutcopymode = false range("a1").select application.displayalerts = false activeworkbook.saveas filename:="c:\file.csv" _ , fileformat:=xlcsv, createbackup:=false application.displayalerts = true application.displayalerts = false activeworkbook.save application.displayalerts = t

How to make comment box (like in facebook comment box) in django -

i want add comment box in item_view.html. comment box in facebook doesn't need refresh page. possible in django? the basic idea is: 1) use ajax send post message server. read jquery's ajax function . 2) then, whatever server needs add comment database. 3) fetch list of comments on particular topic via ajax again, , display. this subset of kind of architecture called spa (single page application) btw.