Wednesday, 15 February 2012

Are there some special rules to set a variable into a multidimensional array for php? -



Are there some special rules to set a variable into a multidimensional array for php? -

ok, i'm stumped here. i'm trying set variable multidimensional associative array, , not understand why not working.

class myclass { private $someproblem = 'data_is_here'; private $access_array = array ('key1a' => array ( 'key2a' => array('key3a' => 'data1','key3b' => 'data4', 'key3c' => $someproblem), 'key2b' => array('key3a' => 'data2','key3b' => 'data5', 'key3c' => $someproblem), 'key2c' => array('key3a' => 'data3','key3b' => 'data6', 'key3c' => $someproblem) ) ...more array values here, same pattern... }

in iteration, get:

parse error: syntax error, unexpected '$someproblem' (t_variable) in myclass.class.php on line 10

i've tried changing $someproblem constant, making static, making public, etc getting error variable appears (error changes, fatal).

appreciate help in advance- especially, please explain why it's not failing @ 'key3a'=>'data1', , why if replace $someproblem 'data_is_here', works.

apart quote problem, cannot want in php. according manual on class properties:

this declaration may include initialization, initialization must constant value--that is, must able evaluated @ compile time , must not depend on run-time info in order evaluated.

so cannot utilize variable assign value class property declare it. need in constructor.

and not utilize $someproblem, need utilize $this->someproblem.

php multidimensional-array variable-assignment

image - PHP generated png background issue -



image - PHP generated png background issue -

my php knowledge limited... searched, found , edited script write text on png, transparency not present:

<?php $string = "username"; $string2 = "example.com"; $image = imagecreatefrompng("http://i.imgur.com/y6hwkkw.png"); $cor = imagecolorallocate($image, 0, 0, 0); imagestring($image,5,126,22,urldecode($string),$cor); header('content-type: image/png'); imagepng($image,null); $stype = "png"; if ($stype = "png") { // integer representation of color black (rgb: 0,0,0) $background = imagecolorallocate($image, 0, 0, 0); // removing black placeholder imagecolortransparent($image, $background); // turning off alpha blending (to ensure alpha channel info // preserved, rather removed (blending rest of // image in form of black)) imagealphablending($image, false); // turning on alpha channel info saving (to ensure total range // of transparency preserved) imagesavealpha($image, true); } ?>

live script here faulty result ideal image

i have been searching web , couldn't find solution if can, please take time help me out

thank much

you need 'enable' transparency.

$string = "username"; $string2 = "example.com"; $image = imagecreatefrompng("http://i.imgur.com/y6hwkkw.png"); $cor = imagecolorallocate($image, 0, 0, 0); $background = imagecolorallocate($image, 0, 0, 0); imagecolortransparent($image, $background); imagealphablending($image, false); imagesavealpha($image, true); imagestring($image,5,126,22,urldecode($string),$cor); header('content-type: image/png'); imagepng($image,null);

php image printing png generator

javascript - How do I get this code to work on google sites? -



javascript - How do I get this code to work on google sites? -

i have code:

var links = [cant set links in yet] var visited = []; var button = document.getelementbyid('btn'); button.addeventlistener('click', function() { if (visited.length == links.length) { alert('you visited links'); return; } var random, url; { random = math.floor(math.random() * 4); url = links[random]; } while (contains(visited, url)); alert('opening: ' + url + ' #' + random); visited.push(url); var win = window.open(url, '_blank'); win.focus(); }); function contains(array, value) { (var = 0; < array.length; i++) { if (array[i] == value) homecoming true; } homecoming false; }

and need combine , set on google site. tried combing tags in html box, create button. doesn't run script , open links... code not work on google sites or doing wrong?

full code w/html , css

on html box , can't. can utilize code app engine or utilize google app script.

you can see illustration here : http://tutorialzine.com/2011/01/google-appengine-series/

javascript google-sites

c - How to read a file of names into an array -



c - How to read a file of names into an array -

i need help reading in list of names , storing them string. allocated memory strings, need help reading them , storing them in. here info , code written. need help insert_data function.

#include <string.h> #include <stdio.h> #include <stdlib.h> #define max_string_len 25 void insert_data(char **strings, const char *filename, int size); void allocate(char ***strings, int size); int main(int argc, char* argv[]){ if(argc != 4){ printf("wrong number of args"); } char **pointer; int size = atoi(argv[1]); allocate(&pointer, size); insert_data(pointer, argv[2], size); } void allocate(char ***strings, int size){ int i; *strings = (char**) malloc(sizeof(char**) * size); for( = 0; < size; i++) { (*strings)[i] = malloc(sizeof(char) * max_string_len); } }

this function need help with:

void insert_data(char **strings, const char *filename, int size){ file *input; input = fopen(filename, "r"); int i; (i = 0; < size; i++){ fscanf(input,"%s", (*strings)[i]); } fclose(input); }

here list reading in:

class="lang-none prettyprint-override">matt susan mark david aden phil erik john caden mycah

#include <string.h> #include <stdio.h> #include <stdlib.h> #define max_string_len 25 #define _s(x) #x #define s(x) _s(x) void insert_data(char **strings, const char *filename, int size); void allocate(char ***strings, int size); int main(int argc, char* argv[]){ if(argc != 3){ printf("wrong number of args\n"); printf("usage:%s size filename\n", argv[0] ? argv[0] : "prog"); exit(-1); } char **pointer; int size = atoi(argv[1]); allocate(&pointer, size); insert_data(pointer, argv[2], size); int i; for(i=0;i<size;++i){ printf("%s\n", pointer[i]); free(pointer[i]); } free(pointer); homecoming 0; } void allocate(char ***strings, int size){ int i; *strings = malloc(sizeof(char*) * size); for( = 0; < size; i++) { (*strings)[i] = malloc(sizeof(char) * (max_string_len+1)); } } void insert_data(char **strings, const char *filename, int size){ file *input= fopen(filename, "r"); int i; (i = 0; < size; i++){ fscanf(input,"%" s(max_string_len) "s", strings[i]); } fclose(input); }

c string fscanf

web services - WS02: Invoking external weather SOAP webservice from ESB -



web services - WS02: Invoking external weather SOAP webservice from ESB -

i trying utilize wso2 esb (version 4.8.1) invoke externally hosted soap web services. seek out using public web service weather info (http://wsf.cdyne.com/weatherws/weather.asmx?wsdl), more getweatherinformation operation.

i have consumed web service using soapui tool.

i newcomer soap , esb, tried follow number of blog entries, maintain on getting errors. tried using proxy service, payload mill , send still didn't manage. can please help me setting up?

thanks

here come sample api invoke getweatherinformation :

<?xml version="1.0" encoding="utf-8"?> <api xmlns="http://ws.apache.org/ns/synapse" name="testws3api" context="/testws3api"> <resource methods="get" url-mapping="/getweatherinformation"> <insequence> <payloadfactory media-type="xml"> <format> <getweatherinformation xmlns="http://ws.cdyne.com/weatherws/"/> </format> <args/> </payloadfactory> <send> <endpoint> <address uri="http://wsf.cdyne.com/weatherws/weather.asmx" format="soap11"/> </endpoint> </send> </insequence> <outsequence> <send/> </outsequence> </resource> </api>

you have send http request http://esb.hostname:8280/testws3api/getweatherinformation (use soapui or type address in net browser) , xml response weather ws

web-services soap wsdl wso2esb soapui

javascript - Removing wrapped event handlers -



javascript - Removing wrapped event handlers -

i have function wraps function around one, attaches element.

function addcustomevent(element, eventname, handler, usecapture) { var wrappedhandler = function () { // here. handler.call(); }; element.addeventlistener(eventname, wrappedhandler, usecapture); }

this works great , want implement function:

removecustomevent(element, eventname, handler, usecapture)

so want this.

var clickhandler= function () { /* ... */ }; addcustomevent(someelement, "click", clickhandler, false); removecustomevent(someelement, "click", clickhandler, false);

there problem because don't have reference wrappedhandler in removecustomevent.

the way can think of maintain track of handlers , corresponding wrappedhandlers in dictionary can find wrappedhandler handler within function, , remove it.

but i'm not fond of approach because browser must have info handlers attached, creating new dictionary seems redundant , waste of memory.

is there better, , much cleaner way?

personally, i'd wrap addcustomevent , removecustomevent single module, , maintain object tracks bound handlers. consider "a waste of resources", really, impact of approach negligible. upsides are: have origin of module can expanded on, handle more complex event handlers (like simulating tab event mobile devices using touchstart , touchend events).

an alternative approach unbind event handler internally, depending on event object itself. then, you'll have re-write removecustomevent function trigger special event, lets bound handler know want remove event listener.

//in wrappedhandler: var wrappedhandler = function(e) { e = e || window.event; if (e.synthetic === true) { e.preventdefault(); e.stoppropagation(); element.removeeventlistener(eventname, wrappedhandler, usecapture);//<-- utilize closure vars homecoming e;//or homecoming false. } //do normal event handler.apply(this, [e]);//pass event object, , phone call handler in same context! }; var removecustomevent = function(event, node, capture) { var e, eclass, doc = node.ownerdocument || (node.nodetype === (document.document_node || 9) ? node : document); if (node.dispatchevent) { if (event === 'click' || event.indexof('mouse') >= 0) eclass = 'mouseevents'; else eclass = 'htmlevents'; e = doc.createevent(eclass); e.initevent(event, !(event === 'change'), true); //this trick: e.synthetic = true; node.dispatchevent(e, true); homecoming true; } if (node.fireevent) { e = doc.createeventobject(); e.synthetic = true; node.fireevent('on' + event, e); homecoming true; } event = 'on' + event; homecoming node[event](); };

here's version of code documented

i've set synthetic property on event object passed event handler. handler checks property, , if it's set true, unbind listener , return. doesn't require maintain dom references , handlers in object, is, think you'll agree, quite lot of work, too. feels quite hacky, if don't mind saying so...

compared to:

var bindermodule = (function() { var module = {}, eventmap = {}, addevent = function (elem, eventname, handler, capture) { var i, wrappedhandler; if (!eventmap.hasownproperty(eventname)) eventmap[eventname] = []; (i=0;i<eventmap[eventname].length;++i) {//look elem reference if (eventmap[eventname][i].node === elem) break; } if (i>= eventmap[eventname].length) { = eventmap[eventname].length;//set key eventmap[eventname].push({ node: elem, handlers: []//keep handlers here, in array multiple handlers }); } wrappedhandler = function(e) { //stuff homecoming handler.apply(this, [e || window.event]);//pass arguments! }; eventmap[eventname][i].handlers.push(wrappedhandler); homecoming elem.addeventlistener(eventname, wrappedhandler, capture); }, removeevent(elem, eventname, capture) { var i, temp; if (!eventmap.hasownproperty(eventname)) return;//no handlers bound, end here (i=0;i<eventmap[eventname].length;++i) if (eventmap[eventname][i].node === elem) break; if (i < eventmap[eventname].length) {//found element, remove listeners! //get handlers temp = eventmap[eventname][i].handlers; //remove element + handlers eventmap: eventmap[evetnname][i] = undefined; (i=0;i<temp.length;++i) elem.removeeventlistener(eventname, temp[i], capture); } }; module.addcustomevent = addevent; module.removecustomevent = removeevent; //or, perhaps better: object.defineproperty(module, 'addcustomevent', {value: addevent});//read-only object.defineproperty(module, 'removecustomevent', {value: removeevent}); homecoming module; }());

note basic setup maintain track of event handlers bound particular dom nodes, , how mangage them. code not finished , not tested. contains typo's, syntax errors , consistency issues. should more plenty started.

javascript

javascript - Steroids and Angular: Preloading Multiple Webviews from data -



javascript - Steroids and Angular: Preloading Multiple Webviews from data -

i'm working steroids generator ng-resource, has generated controller/model/views based on local json data. has index.html , detailed.html

the boilerplate code provides list of cars click on, bringing new webview of car's detailed page. easy enough. problem is, view not preloaded - loads in after click auto in auto list. creates laggy experience.

i've read on preloading webviews - works great if don't have bunch of webviews powered dynamic data. preload detailed webviews based on initial listing of "cars". i've been reading next resources:

preloaded webviews different parts of app

sharing info between webviews

preloading webviews

i don't have lot of raw code provide - boilerplate examples of ng-resource. i'm wondering best technical approach needs. trying native app sense when navigating.

edit: here improve reply appgyver/steroids team

from have described utilize case suggest preload show.html in app 1 time , whenever need show show.html send postmessage view moving show.html should load content id provided.

if have load content remote server, should send 2 postmessages, first 1 including whatever info have on previous page used on show.html page.

i don't know if able explain in understandable way, please inquire more questions if explanation unclear ) turns out pretty easy:

the main problem solution below memory issues creating vast amount of webviews

old answer: for(var =0; var webview = new steroids.views.webview({location:"/views/cars/show.html? id="+id,id:id}); console.log(webview); webview.preload({}, { onsuccess: function() { //steroids.layers.push(webview); console.log('working'); } }); }

then function phone call webview same id:

$scope.open = function(id) { var webview = new steroids.views.webview({location:"/views/cars/show.html?id="+id,id:id}); steroids.layers.push(webview); };

javascript angularjs webview steroids

jquery - FullCalendar display event name only -



jquery - FullCalendar display event name only -

is possible display event name on calendar? right displays time , event name. event name displayed. know there timeformat function don't know how create time doesn't show. tried timeformat : false. didn't work. still showed time , showed date well.

you can css well. add together css display property none fc-event-time class.

.fc-event-time { display : none; }

jquery ajax fullcalendar

php - How to change Codeigniter safe mode off? -



php - How to change Codeigniter safe mode off? -

i trying utilize backquotes execute scheme command, says next message:

curlopt_followlocation cannot activated when safe_mode enabled or open_basedir set

so.. guess need turn off safe mode. have no thought how this.

can walk me through? phpinfo() says "safe_mode" directive off master value, on local value.

i guess there's switch somewhere need set?

thanks!

'master value' value within php.ini. 'local value' directory you're looking at.

a simple way turn off safe mode specific directory following

add end of httpd.conf , create sure restart apache server.

<directory /var/www/html> php_admin_flag safe_mode off </directory>

php codeigniter

html - Center image above text in bootstrap -



html - Center image above text in bootstrap -

i trying create main page website. want 3 images text underneath images not centered above text. here jsfiddle.

jsfiddle

<div class="row" style="text-align:center"> <div class="col-md-4 col-xs-8"> <img src="http://s27.postimg.org/5emjkk14v/image.jpg" class="img-responsive" style="height:180px;width:180px;" /> <h4> vaccinations</h4> <p>dogs , cats susceptible variety of illnesses can prevented next appropriate vaccination schedule.</p> </div> <div class="col-md-4 col-xs-8"> <img src="http://s27.postimg.org/5emjkk14v/image.jpg" class="img-responsive" style="height:180px;width:180px;" /> <h4>checkups</h4> <p>regular checkups key factor in pet wellness, , can unearth problems lead health issues downwards road. </p> </div> <div class="col-md-4 col-xs-8"> <img src="http://s27.postimg.org/5emjkk14v/image.jpg" class="img-responsive" style="height:180px;width:180px;" /> <h4> senior pets</h4> <p>senior pets require more medical attending younger counterparts, senior humans do. when pet considered “senior”? </p> </div> </div>

you need set left , right margins of images auto

.col-md-4.col-xs-8 img { margin: 0 auto; }

updated jsfiddle

html twitter-bootstrap center

I need some help about ajax in wordpress always return 0 -



I need some help about ajax in wordpress always return 0 -

this first time seek ajax in wordpress. need help.

in theme's functions.php, have:

function returnrandomposts(){ echo '123'; die(); } add_action('wp_ajax_returnrandomposts', 'returnrandomposts'); add_action('wp_ajax_nopriv_returnrandomposts', 'returnrandomposts');

and in single.php file, have

<script type="text/javascript"> jquery(document).ready(function($){ $.post("<?php echo admin_url("admin-ajax.php"); ?>", {"action": "returnrandomposts"}, function(response) { alert('response: ' + response); }); }); </script>

when run web page, alert "response: 0",

i hope can give me hints or tips, give thanks you.

update:

i checked has_filter function, new wp_ajax_xxxxx has add together $wp-filters, when phone call ajax wp-admin/admin-ajax.php, has_filter function homecoming false wp_ajax_xxxxx

anyone can give me hint?

finally, solved problem.

i have plugin, function is, preview theme adding "theme=name_of_theme" argument url.

( example, preview homepage "xxx.xx.xx/?theme=name_of_theme" )

the ajax failed in preview.

while add together same ajax function code online page (ie. activated theme), successes.

i hope experience may help somebody.

ajax wordpress

Android Weird Huge Menu sizes -



Android Weird Huge Menu sizes -

hi been trying add together share feature app. testing on moto g.

but sharemenu huge , larger screen. seems ok in portrait mode. brakes in landscape.

http://postimg.org/image/ne7zzup43/

anyway original code https://github.com/pocmo/instant-mustache/blob/article-09/src/com/androidzeitgeist/mustache/activity/photoactivity.java

seemed work, maybe because locked portrait>

i had alter code add together more menu items, share sub menu went weird.

heres current code.

@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); uri = getintent().getdata(); setcontentview(r.layout.activity_photo); imageview photoview = (imageview) findviewbyid(r.id.photo); photoview.setimageuri(uri); } @override public boolean oncreateoptionsmenu(menu menu) { //getmenuinflater().inflate(r.menu.activity_photo_menu, menu); //return super.oncreateoptionsmenu(menu); menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.activity_photo_menu, menu); homecoming true; } private void sharephoto() { intent share = new intent(intent.action_send); share.putextra(intent.extra_stream, uri); share.settype(mime_type); startactivity(intent.createchooser(share, "share")); } @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case r.id.menu_item_share: sharephoto(); homecoming true; case r.id.take_another: toast.maketext(getapplicationcontext(), "go main activity", toast.length_long).show(); homecoming true; } homecoming false; } protected void onresume() { super.onresume(); invalidateoptionsmenu(); ///????? redraw menu on rotate????? }

here current menu xml

<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/menu_item_share" android:actionproviderclass="android.widget.shareactionprovider" android:showasaction="ifroom" android:title="@string/action_share"/> <item android:title="@string/take_another" android:id="@+id/take_another"></item> </menu>

manifest //(no sdk requirements set)

<activity android:name="com.mycompany.myapp.photo.photoactivity" android:label="@string/app_name" />

photoactivity xml

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <imageview android:id="@+id/photo" android:layout_width="match_parent" android:layout_height="match_parent" android:scaletype="centerinside" /> </linearlayout>

android menu

javascript - Where to put .toFixed(2) in the script to limit to 2 decimel -



javascript - Where to put .toFixed(2) in the script to limit to 2 decimel -

i have next script calculate amount. limit amount 2 decimel. know need utilize .tofixed(2). don't know can set in script. hope can help me.

var base of operations = 39.95; var numberfield = document.getelementbyid('numberfield'); numberfield.onkeyup = numberfield.onpaste = function() { if(this.value.length == 0) { document.getelementbyid('mpdresult').innerhtml = ''; return; } var number = parsefloat(this.value); if(isnan(number)) return; document.getelementbyid('mpdresult').innerhtml = number * base; }; numberfield.onkeyup();

document.getelementbyid('mpdresult').innerhtml = (number * base).tofixed(2);

javascript

c# - DateTime is missing GetObjectData. Or am I missing something? -



c# - DateTime is missing GetObjectData. Or am I missing something? -

as far remember concrete implements interfaces :) looking @ datetime struct seems implement iserializable. suppose implement:

void getobjectdata(serializationinfo info, streamingcontext context);

i can't find implementation on meta info of datetime. also:

datetime.now.getobjectdata(null,null);

seems throw compile time exception. haven't checked ilspy yet...

ideas?

iserializable explicity implemented. can phone call method this:

iserializable = datetime.now; now.getobjectdata(null, new streamingcontext()); //don't send null first parameter

c# datetime serialization interface

erlang - Elixir parse binary data? -



erlang - Elixir parse binary data? -

​for example:

i have binary this:

bin1 = "2\nok\n3\nbcd\n\n"​

or

bin2 = "2\nok\n3\nbcd\n1\na\n\n"​

and on...

the format

byte_size \n bytes \n byte_size \n bytes \n \n

i want parse binary get

["ok", "bcd"]

how implement in elixir or erlang ?

go version

a golang version parse this

func (c *client) parse() []string { resp := []string{} buf := c.recv_buf.bytes() var idx, offset int idx = 0 offset = 0 { idx = bytes.indexbyte(buf[offset:], '\n') if idx == -1 { break } p := buf[offset : offset+idx] offset += idx + 1 //fmt.printf("> [%s]\n", p); if len(p) == 0 || (len(p) == 1 && p[0] == '\r') { if len(resp) == 0 { go on } else { c.recv_buf.next(offset) homecoming resp } } size, err := strconv.atoi(string(p)) if err != nil || size < 0 { homecoming nil } if offset+size >= c.recv_buf.len() { break } v := buf[offset : offset+size] resp = append(resp, string(v)) offset += size + 1 } homecoming []string{} }

thanks

a more flexible solution:

result = bin |> string.split("\n") |> stream.chunk(2) |> stream.map(&parse_bytes/1) |> enum.filter(fn s -> s != "" end) def parse_bytes(["", ""]), do: "" def parse_bytes([byte_size, bytes]) byte_size_int = byte_size |> string.to_integer <<parsed :: [binary, size(byte_size_int)]>> = bytes parsed end

erlang elixir

uninitialized value error in perl -



uninitialized value error in perl -

i'm pretty new perl (and programming in general i'm used python).

use strict; utilize warnings; utilize diagnostics; $simple_variable = "string"; print $simple_variable;

basically want know why script returns uninitialized value error, since variable defined.

thanks

my creates variable , initializes undef (scalars) or empty (arrays , hashes). returns variable creates.

as such,

print $simple_variable;

is same thing as

my $simple_variable = undef; print $simple_variable;

you meant do

my $simple_variable = "string"; print $simple_variable;

i'm not sure why asking because perl told much. programme outputs following:

"my" variable $simple_variable masks before declaration in same scope @ a.pl line 6 (#1) (w misc) "my", "our" or "state" variable has been redeclared in current scope or statement, eliminating access previous instance. typographical error. note before variable still exist until end of scope or until closure referents destroyed.

note how new declaration has effect of "effectively eliminating access previous instance".

perl

matplotlib - Drawing a custom diagram in python -



matplotlib - Drawing a custom diagram in python -

i wanna draw :

the closest thing find networkx border colormap:

http://networkx.github.io/documentation/latest/examples/drawing/edge_colormap.html

and here source code:

#!/usr/bin/env python """ draw graph matplotlib, color edges. must have matplotlib>=87.7 work. """ __author__ = """aric hagberg (hagberg@lanl.gov)""" try: import matplotlib.pyplot plt except: raise import networkx nx g=nx.star_graph(20) pos=nx.spring_layout(g) colors=range(20) nx.draw(g,pos,node_color='#a0cbe2',edge_color=colors,width=4,edge_cmap=plt.cm.blues,with_labels=false) plt.savefig("edge_colormap.png") # save png plt.show() # display

after playing around source code, i can't figure out how hardcode distance of border circles centre. right random.

also how label border circles , distance centre?

i know position comes pos=nx.spring_layout(g). looked @ spring_layout attribute , found position can specified using pos variable dictionary nodes keys , values list. (https://networkx.github.io/documentation/latest/reference/generated/networkx.drawing.layout.spring_layout.html)

but when next result random edges :

ap = {'uniwide':[55,34,1],'eduram':[34],'uniwide_webauth':[20,55,39],'uniwide_guest':[55,34],'tele9751_lab':[100],'homesdn':[100],'tp-link':[39]} pos=nx.spring_layout(g,pos=ap)

you can set node positions explicitly pos dictionary. example

import networkx nx import matplotlib.pyplot plt g = nx.graph() g.add_edge('center',1) g.add_edge('center',2) g.add_edge('center',3) g.add_edge('center',4) pos = {'center':(0,0), 1:(1,0), 2:(0,1), 3:(-1,0), 4:(0,-1) } nx.draw(g, pos=pos, with_labels=true) plt.show()

python matplotlib networkx

java - MapReduce code cleaning staging area error -



java - MapReduce code cleaning staging area error -

i new mapreduce running mapreduce program.its compiling fine , jar file created without error when run final hadoop command shows next error , stops. please help asap... finish log:

[u@h(ipc2-gold) w]$ hadoop jar join.jar runner -dmapred.job.queue.name=score2 /axp/rim/score2/dev/cmc_score/rishabh/inp/file1.txt /axp/rim/score2/dev/cmc_score/rishabh/inp/file2.txt /axp/rim/score2/dev/cmc_score/rishabh/asd 14/06/19 21:28:44 info fs.jobtrackerwatcher: current running jobtracker is: lgpbd1010.gso.aexp.com/10.22.45.20:9001 14/06/19 21:28:44 info mapred.jobclient: cleaning staging area maprfs:/var/mapr/cluster/mapred/jobtracker/staging/rdwiv5/.staging/job_201405310436_72947 exception in thread "main" org.apache.hadoop.mapred.filealreadyexistsexception: output directory /axp/rim/score2/dev/cmc_score/rishabh/inp/file2.txt exists @ org.apache.hadoop.mapreduce.lib.output.fileoutputformat.checkoutputspecs(fileoutputformat.java:132) @ org.apache.hadoop.mapred.jobclient$2.run(jobclient.java:926) @ org.apache.hadoop.mapred.jobclient$2.run(jobclient.java:885) @ java.security.accesscontroller.doprivileged(native method) @ javax.security.auth.subject.doas(subject.java:396) @ org.apache.hadoop.security.usergroupinformation.doas(usergroupinformation.java:1127) @ org.apache.hadoop.mapred.jobclient.submitjobinternal(jobclient.java:885) @ org.apache.hadoop.mapreduce.job.submit(job.java:536) @ org.apache.hadoop.mapreduce.job.waitforcompletion(job.java:566) @ runner.run(runner.java:55) @ org.apache.hadoop.util.toolrunner.run(toolrunner.java:65) @ runner.main(runner.java:64) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ org.apache.hadoop.util.runjar.main(runjar.java:197)

i see have 3 arguments (two input files , 1 output dir). think happening programme expecting two, 1 input , 1 output. if want files in directory input, utilize directory input

/axp/rim/score2/dev/cmc_score/rishabh/inp

hadoop grab files directory. what's happening hadoop taking sec argument (which file in same directory) output directory, that's why you're getting exception

note: check directories , see if

/axp/rim/score2/dev/cmc_score/rishabh/inp/file1.txt

directory exists. it's possible accidentily ran programme path output, , file1.txt directory (not file) created also. when ran 1 time again trying utilize same arguments exception because directory exists, perchance same reason discussed above (the programme expecting 2 args)

java hadoop mapreduce

google api - Select specific Calendar when using Java API to create calendar entry -



google api - Select specific Calendar when using Java API to create calendar entry -

i have created calendar entries using java .jar files google calendar api. go "rifle" calendar though have calendars shown below. need know how specify calendar entry falls under. example, specify "meetings" or "shotgun"

i'm not seeing or examples of how specify particular calendar.

public void create() { seek { calendarservice myservice = new calendarservice("my service"); myservice.setusercredentials("mycalendar", "mypassword"); url posturl = new url("http://www.google.com/calendar/feeds/myurl@junk.com/private/full"); calendarevententry myentry = new calendarevententry(); //myentry.seticaluid("rec fire"); datetime starttime = datetime.parsedatetime("2014-06-22t09:00:00"); datetime endtime = datetime.parsedatetime("2014-06-22t13:00:00"); when eventtimes = new when(); eventtimes.setstarttime(starttime); eventtimes.setendtime(endtime); myentry.addtime(eventtimes); eventlocation = new where(); eventlocation.setlabel("r-4"); eventlocation.setvaluestring("value string"); eventlocation.setrel("rel"); myentry.addlocation(eventlocation); eventwho eventwho = new eventwho(); eventwho.setattendeestatus("attendee status"); eventwho.setattendeetype("meetings"); eventwho.setvaluestring("who value string"); eventwho.setemail("myemailt@email.com"); eventwho.setrel("who rel"); myentry.addparticipant(eventwho); myentry.settitle(new plaintextconstruct("r-4 rifles only")); myentry.setcontent(new plaintextconstruct("paragraph hurst mullins")); calendarevententry insertedentry = myservice.insert(posturl, myentry); } grab (exception e) { e.printstacktrace(); }

i figured out. first have ids of secondary calendars

public void retrieve() { seek { calendarservice myservice = new calendarservice("quanticoshootingclub"); myservice.setusercredentials("calendar@quanticoshootingclub.com", "washington13"); url feedurl = new url("https://www.google.com/calendar/feeds/default/owncalendars/full"); calendarfeed resultfeed = myservice.getfeed(feedurl, calendarfeed.class); system.out.println("your calendars:"); system.out.println(); (int = 0; < resultfeed.getentries().size(); i++) { calendarentry entry = resultfeed.getentries().get(i); system.out.println("\t" + entry.gettitle().getplaintext()); system.out.println("\t\t" + entry.getid()); } } grab (exception e) { e.printstacktrace(); } }

you can goign google calendar on web. click drop-down , calendar settings > calendar address: (calendar id: @group.calendar.google.com)

then, when you're creating new calendar entry, substitute id primary id.

note: original code

url posturl = new url("http://www.google.com/calendar/feeds/***<secondary calendar id>***/private/full");

java google-api

knockout.js - How to dynamic render data after ajax with knockout.mapping.js? -



knockout.js - How to dynamic render data after ajax with knockout.mapping.js? -

i'm using knockout.js & knockout.mapping.js. alter info resource ajax, info couldn't refresh dynamically.

because in actual project, wanner customize html modules without alter js code, , info not certain, info construction complex , dynamic. 2 main goals want achieve:

1, multi-levels data, utilize knockout.mapping, it's not working. here example: http://jsfiddle.net/8ukal/

2, dynamic source, resources may have data2, data3, ..., , can alter source ref data2 data3 easily, thought should utilize <div data-bind="foreach: resources_ajax(key)" data-key="data1"> in html.

is there solution?

thanks.

you need think differently. knockout data-binding model dom, update dom on behalf. trying "call model" dom

updated code show example, key part:

.done(function(data) { data.data1 = json.parse(data.data1); // line prepare false ajax request self.resources_ajax(data.data1); });

jsfiddle:

http://jsfiddle.net/m389e/

knockout.js knockout-mapping-plugin

javascript - Appending DOM elements after page reload on ajax success call -



javascript - Appending DOM elements after page reload on ajax success call -

$.ajax({ type : 'post', url : requesturl, info : data, datatype : 'json', success : function(data) { location.reload(); $('#status').append( // append here!! ); $('#loader').hide(); } });

i'm having issues forcing page reload first , appending elements. need functionality occur since page initialize 1 time again on reload , wipe out elements i'm trying append.

once phone call location.reload() it's late. scripts won't go on run after page has reloaded.

it sounds may need rethink general approach here. mutual approach not utilize ajax @ (since plan reload page anyway), or have server render page in desired new state, including whatever going append it.

javascript jquery ajax dom reload

c# - Find Matches using Regex in File Lines -



c# - Find Matches using Regex in File Lines -

i reading list of files directory , looking patterns:

a. [[[something]]] > string "something" b. [[[something///comment]]] > strings "something" , "comment" c. [[[enter between %0 , %1 characters|||val 1|||val 2]]] >> string before first ||| "enter between %0 , %1 characters"

so tried following:

ilist<string> files = directory.getfiles(path, "*.cshtml", searchoption.alldirectories).tolist(); idictionary<string, tuple<int32, string>> items = new dictionary<string, tuple<int32, string>>(); regex regex = new regex(@"\[\[\[.*\]\]\]"); foreach (string file in files) { foreach (string line in file.readalllines(file)) { matchcollection matches = regex.matches(line); foreach (match match in matches) { if (match != null) { items.add(match.value, new tuple<int32, string>(number, file)); } } } }

note: using readalllines because need line number of each match find.

could have help in following:

when using regex @"[[[.*]]]" found situation not work:

viewinfo.title("[[[title]]]").description("[[[description]]]");

i title]]]").description("[[[description]]]

i have not been able apply rules (b) , (c).

is possible improve performance or code ok?

you need ungreedy expression: .*? seek consume as few characters possible .

try this: @"\[\[\[(?:(.*?)\|\|\|.*?|(.*?)///(.*?)|(.*?))\]\]\]" (it of import set longest possible alternatives first or .*? eat whole string)

use file.readlines along variable you'll increment @ each iteration counting lines. way won't have hold whole file in memory.

c#

Parse a csv file using Regex in java with '|' as seperator -



Parse a csv file using Regex in java with '|' as seperator -

can help me regex ? got java program, reads in .csv files load database.

currently ist uses pattern csvpattern = pattern.compile("\\s*(\"[^\"]*\"|[^|]*)\\s*,?");

but wenn matcher = csvpattern.matcher(line); read files line line null-values. files have next format (many morre lines, comma in it, '|' seperator , @ end of each line):

abstact of first file:

0|algeria|0| haggle. final deposits observe slyly agai| 1|argentina|1|al foxes promise slyly according regular accounts. bold requests alon| 2|brazil|1|y alongside of pending deposits. special packages ironic forges. slyly special |

second:

|customer#000000001|ivhziaperb ot,c,e|15|25-989-741-2988|711.56|building|to even, regular platelets. regular, ironic epitaphs nag e| 2|customer#000000002|xstf4,ncwdvawne6tegvwfmrchlxak|13|23-768-687-3665|121.65|automobile|l accounts. blithely ironic theodolites integrate boldly: caref| 3|customer#000000003|mg9kdtd2wbhm|1|11-719-748-3364|7498.12|automobile| deposits eat slyly ironic, instructions. express foxes observe slyly. blithely accounts abov| 4|customer#000000004|xxvsjslagtn|4|14-128-190-5944|2866.83|machinery| requests. final, regular ideas sleep final accou|

third:

5|supplier#000000005|gcdm2rjrzl5qltvzc|11|21-151-690-3663|-283.84|. slyly regular pinto bea| 6|supplier#000000006|tqxuvm7s7cnk|14|24-696-997-4969|1365.79|final accounts. regular dolphins utilize against furiously ironic decoys. | 7|supplier#000000007|s,4ticngb4uo6pasqnbuq|23|33-990-965-2201|6820.35|s unwind silently furiously regular courts. final requests deposits. requests wake quietly blit| 8|supplier#000000008|9sq4bbh2fqemafoocy45srtxo6yuog|17|27-498-742-3860|7627.85|al pinto beans. asymptotes haggl| 9|supplier#000000009|1khugzegwm3ua7dsymekybsk|10|20-403-398-8662|5302.37|s. unusual, requests along furiously regular pac|

fourth:

1|2|3325|771.64|, theodolites. regular, final theodolites eat after pending foxes. furiously regular deposits sleep slyly. bold realms above ironic dependencies haggle careful| 1|2502|8076|993.49|ven ideas. packages print. pending multipliers must have fluff| 1|5002|3956|337.09|after fluffily ironic deposits? blithely special dependencies integrate furiously excuses. blithely silent theodolites have haggle pending, express requests; fu| 1|7502|4069|357.84|al, regular dependencies serve after final pinto beans. furiously deposits sleep final, silent pinto beans. fluffily reg|

fifth:

1|155190|7706|1|17|21168.23|0.04|0.02|n|o|1996-03-13|1996-02-12|1996-03-22|deliver in person|truck|egular courts above the| 1|67310|7311|2|36|45983.16|0.09|0.06|n|o|1996-04-12|1996-02-28|1996-04-20|take return|mail|ly final dependencies: slyly bold |

sixth:

134823|saddle midnight thistle honeydew lime|manufacturer#4|brand#43|standard burnished brass|44|wrap can|1857.82|ges. furiously ir| 134824|coral reddish indian thistle sandy|manufacturer#5|brand#55|promo burnished copper|29|lg jar|1858.82|final p| 134825|saddle violet orchid cornsilk medium|manufacturer#4|brand#44|promo polished nickel|21|lg case|1859.82|nal accounts us| 134826|turquoise sky lime cornsilk peach|manufacturer#1|brand#11|small burnished tin|25|sm can|1860.82| haggle|

seventh:

0|africa|lar deposits. blithely final packages cajole. regular waters final requests. regular accounts according | 1|america|hs utilize ironic, requests. s|

eighth:

4|136777|o|32151.78|1995-10-11|5-low|clerk#000000124|0|sits. slyly regular warthogs cajole. regular, regular theodolites acro| 5|44485|f|144659.20|1994-07-30|5-low|clerk#000000925|0|quickly. bold deposits sleep slyly. packages utilize slyly|

(the csv created using dbgen-tool tpc fpr tpc-h, in case wonder)

i hope understand need , can help me out on this. give thanks much!

edit: using string.split("|");' sure seems obvious, thing is, programm i'm working quite complex , relies on regex.pattern , regex.matcher @ various parts. since i'm not familiar programme , java itself, solution me utilize given code , replace regular look 1 works me.

edit2: thing i'm trying utilize tpc-h implementation oltp-bench: https://github.com/ben-reilly/oltpbench/blob/master/src/com/oltpbenchmark/benchmarks/tpch/tpchloader.java#l347

where problematic line 347. it's total implemetation of tpc-h database benchmark, without info generator. utilize dbgen tool provided tpc generate csv files. can't in contact developer sadly.

given source, replace comma pipe, since comments, pattern split string on delimiter (except ones in double quotes)

eg: from

\\s*(\"[^\"]*\"|[^,]*)\\s*,?

to

\\s*(\"[^\"]*\"|[^|]*)\\s*\\|?

as number exception, need debug way you're calling csv loader.

i've never used tool before, if @ line 352

for (int = 0; < types.length; ++i) {

now @ switch block starts @ line 362: defines types each field should casted to.

switch(types[i]) { case double: prepstmt.setdouble(i+1, double.parsedouble(field)); break; ...

this type of conversion going cause issues if don't specify types.

java regex parsing csv

ios - viewForHeaderInSection is placing header above the tableView -



ios - viewForHeaderInSection is placing header above the tableView -

i overrided method viewforheaderinsection , realized default adds on top of uitableview, send of tableview. idea?

here code:

-(uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section{ uiimageview *imageview = [[uiimageview alloc] initwithimage:districtimage]; imageview.frame = cgrectmake(10,10,300,100); nslog(@"districtimage=%@",districtimage); homecoming imageview; }

edit

ok got scroll now:

self.tableview.tableheaderview = imageview;

my problem header big how can cut down it

-(cgfloat)tableview:(uitableview *)tableview heightforheaderinsection:(nsinteger)section{}

does not seem take effect.

just use

-(uiview *)tableview:(uitableview *)tableview viewforfooterinsection:(nsinteger)section

with same body should work

ios objective-c uitableview

batch file to read ever element in my .xml -



batch file to read ever element in my .xml -

i'm trying utilize batch file read through elements of .xml file retrieve file path , execute them in order playlist. heres illustration of .xml file:

<sunday> <id>1</id> <filepath>\\movieserver\movie1.mkv</filepath> </sunday> <sunday> <id>2</id> <filepath>\\movieserver\movie2.avi</filepath> </sunday> <sunday> <id>3</id> <filepath>\\movieserver\movie3.avi</filepath> </sunday> <sunday> <id>4</id> <filepath>\\movieserver\movie4.avi</filepath> </sunday> </dataroot>

right i'm using batch file reads first element "\movieserver\movie1.mkv" how either loop through or line line pull out filepaths in order?

@echo off /f "tokens=2 delims=<>" %%a in ('type "c:\vlctv\vlcplaylists\programs\version_3.0\00-sun.xml" ^|find /i "<filepath>" ') set "var=%%a"

any suggestions appreciated :)

you have activate delayed expansion :

@echo off setlocal enabledelayedexpansion /f "tokens=2 delims=<>" %%a in ('type "c:\vlctv\vlcplaylists\programs\version_3.0\00-sun.xml" ^|find /i "<filepath>" ') ( set var="%%a" echo !var!)

batch-file

node.js - Series flow with Async in NodeJS gets asynchrounously called -



node.js - Series flow with Async in NodeJS gets asynchrounously called -

i need phone call 3 functions in series x1() x2() x3(). since x1 , x2 time consuming operations x3 executes before them giving unexpected results. have used async library in nodejs series method below. how can solve without using settimeout x3()

async.series([function(callback) { x1();callback(null, null);}, function(callback) { x2();callback(null, null);}, function(callback) { x3(); callback(null, null); }], function(err, results) { } );

use recursive seek catch..

a=true; while(a){ try{ work..... a=false; }catch(exp ){ a=true } }

node.js asynchronous

batch file - Error in sending an email with BLAT -



batch file - Error in sending an email with BLAT -

i have code:

blat -to test@test.com -server -f test@test.com -subject "subject" -body "body" -attach data.log

it uses blat send email gives error:

not plenty arguments supplied

does 1 know i'm doing wrong? thanks.

try :

the server setted here gmx. have set provider.

blat.exe -server smtp.gmx.com -f your_e-mail_address -to destination_e-mail_adress -s "cc text" -body "body text" -u "login of e-mail" -pw "password of e-mail"

http://www.blat.net/syntax/syntax.html

and here list of commons smtp , pop servers :

http://www.arclab.com/en/amlc/list-of-smtp-and-pop3-servers-mailserver-list.html

edit :

apparently you'll need stunnel provide secure sockets layer (ssl) required gmail.

you can seek provider gmx worked me.

or can seek mailsend :

https://github.com/muquit/mailsend/

email batch-file blat

c# - REST services in a ASP.NET MVC application -



c# - REST services in a ASP.NET MVC application -

i come rubyonrails background sorry if looks silly question:

let's creating our app in asp.net mvc , need develop restful web services give json can utilize in our app.

how create services? wcf ? in ruby used java-jersey service side in current work place .net shop strong experience in silverlight , ria services. net approach of web services asp.net mvc ?

wcf super powerful incredibly complex communication framework allows systems talk on multiple protocols. sounded cool during microsoft's initial pitch, there incredible amount of overhead to, say, force scalar across wire. wcf still has place, it's beast of framework.

given how much effort there in integrating solution, mvc developers noticed that, hey! can homecoming jsonresult mvc controller , have ajax scripts consume that. quick , dirty!

microsoft refined experience web api, focused solely on developing http services. it's architected quite mvc, makes pretty darned easy pick up. typically restful, doesn't need be. design works really, http - remember, http application protocol transport protocol.

there neat stuff how takes care of serialization - if client wants xml, web api gives xml. if client wants json, web api gives json. little work, can come custom serialization formats!

so, before go off on 1 of many tangents how awesome sauce web api is, allow me if looking simple, powerful framework can deliver restful services on http, web api solution.

http://www.asp.net/web-api

c# asp.net-mvc

python - IDLE won't start when not connected to domain -



python - IDLE won't start when not connected to domain -

i teacher school laptop has had new image. installed python 3.4 @ home users idle open when connected school domain. otherwise get:

idle's subprocess didn't create connection. either idle can't start subprocess or personal firewall software blocking connection.

i have checked firewall , temporarily de-activated sophos no avail. help appreciated!

you can utilize process monitor see files idle tries access. chances tried home folder or accidentally installed on network share.

python subprocess python-idle

Rails ActiveRecord: 2 associations to same model -



Rails ActiveRecord: 2 associations to same model -

i have model, project, has 2 belongs_to associations same model:

belongs_to :source_connection, class: connection belongs_to :destination_connection, class: connection

but on other side, each connection should have 1 association project. adding

has_one :project, foreign_key_id: source_connection_id or has_one :project, foreign_key_id: destination_connection_id

isn't going cutting it, because connection has no knowledge of whether it's source or destination connection.

clearly there's flaw in how i've designed association, i'm curious right way go is. it's worth mentioning 'connection' has lot of inheriting classes (sshconnection, s3connection, etc), splitting connection class 'source' , 'destination' connection models cause lot of duplication.

any thoughts welcome.

you're close! redesign, or seek naming projects differently different connection types:

has_one :source_project, class: "project", foreign_key_id: source_connection_id or has_one :destination_project, class: "project", foreign_key_id: destination_connection_id

this allows phone call @connection.source_project project connection source connection, example. there may clearer way name goals.

ruby-on-rails activerecord

android - Calling API and adding buttons programmatically -



android - Calling API and adding buttons programmatically -

long story short, i'm making api phone call retrieves list of names.

for each name retrieved, i'd add together relativelayout (with children) parent linearlayout. relative layout looks this:

<relativelayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/border_bottom" android:clickable="true"> <imageview android:layout_width="100dp" android:layout_height="100dp" android:layout_weight="11.79" android:background="#58585a" android:id="@+id/imageview" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:text="large text" android:id="@+id/textview2" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" android:layout_margintop="26dp" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancesmall" android:text="small text" android:id="@+id/textview3" android:layout_below="@+id/textview2" android:layout_alignstart="@+id/textview2" /> </relativelayout>

i'd alter 'small text' , 'large text' fields info received querying server.

what best way go achieving this? can store above layout in separate xml file, , alter text values, , drop existing linear layout?

listing 1:

xml layout of each list item -

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/ apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" > <imageview android:id="@+id/listimage" android:layout_width="100dp" android:layout_height="100dp" android:layout_alignparentleft="true" android:layout_centervertical="true" android:layout_margin="10dp" android:background="#ffcccccc" /> <textview android:id="@+id/listtitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_aligntop="@+id/listimage" android:layout_torightof="@+id/listimage" android:text="a list item title" android:textsize="16sp" android:textstyle="bold" /> <textview android:id="@+id/listdescription" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/listtitle" android:layout_margintop="5dp" android:maxlines="4" android:layout_torightof="@+id/listimage" android:text="the list item description" android:textsize="14sp" /> </relativelayout>

listing 2:

xml layout containing listview -

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical" > <listview android:id="@android:id/list" android:fadingedge="vertical" android:fadingedgelength="10dp" android:longclickable="true" android:listselector="@drawable/list_selector_background" android:layout_width="match_parent" android:layout_height="match_parent" > </listview> <!-- --> <textview android:id="@android:id/empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="loading feed data..." /> <!-- --> </linearlayout> #1 listview id of "list" #2 textview id of "empty"

listing 3:

listactivity dynamic listview -

public class dynamiclistviewactivity extends listactivity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.list); imagelistadapter adapter = new imagelistadapter(this); setlistadapter(adapter); loadfeeddata loadfeeddata = new loadfeeddata(adapter); loadfeeddata.execute(); } }

listing 4:

loadfeeddata class used loading feed data -

public class loadfeeddata extends asynctask<void, void,="" arraylist<entry="">> { private final string murl = "url_quering_to_server"; private final imagelistadapter madapter; public loadfeeddata(imagelistadapter adapter) { madapter = adapter; } private inputstream retrievestream(string url) { defaulthttpclient client = new defaulthttpclient(); httpget httpget = null; httpget = new httpget(url); httpresponse httpresponse = null; seek { httpresponse = client.execute(httpget); httpentity getresponseentity = httpresponse.getentity(); homecoming getresponseentity.getcontent(); } grab (ioexception e) { httpget.abort(); } homecoming null; } @override protected arraylist<entry> doinbackground(void... params) { inputstream source = retrievestream(murl); reader reader = null; seek { reader = new inputstreamreader(source); } grab (exception e) { homecoming null; } gson gson = new gson(); searchresult result = gson.fromjson(reader,searchresult.class); homecoming result.getfeed().getentry(); } protected void onpostexecute(arraylist<entry> entries) { madapter.updateentries(entries); } }

listing 5:

imagelistadapter used populate listview info , images -

public class imagelistadapter extends baseadapter { private context mcontext; private layoutinflater mlayoutinflater; private arraylist<entry> mentries = new arraylist<entry>(); private final imagedownloader mimagedownloader; public imagelistadapter(context context) { mcontext = context; mlayoutinflater = (layoutinflater) mcontext .getsystemservice(context.layout_inflater_service); mimagedownloader = new imagedownloader(context); } @override public int getcount() { homecoming mentries.size(); } @override public object getitem(int position) { homecoming mentries.get(position); } @override public long getitemid(int position) { homecoming position; } @override public view getview(int position, view convertview, viewgroup parent) { relativelayout itemview; if (convertview == null) { itemview = (relativelayout) mlayoutinflater.inflate( r.layout.list_item, parent, false); } else { itemview = (relativelayout) convertview; } imageview imageview = (imageview) itemview.findviewbyid(r.id.listimage); textview titletext = (textview) itemview.findviewbyid(r.id.listtitle); textview descriptiontext = (textview) itemview.findviewbyid(r.id.listdescription); string imageurl = mentries.get(position).getcontent().getsrc(); mimagedownloader.download(imageurl, imageview); string title = mentries.get(position).gettitle().get$t(); titletext.settext(title); string description = mentries.get(position).getsummary().get$t(); if (description.trim().length() == 0) { description = "sorry, no description image."; } descriptiontext.settext(description); homecoming itemview; } public void updateentries(arraylist<entry> entries) { mentries = entries; notifydatasetchanged(); } }

great! way load dynamic info server , display in listview. obviously, may alter of or more add together suitable application. cheers!

android

python - How to string format OptionParser() help message? -



python - How to string format OptionParser() help message? -

how string format optionparser() help message? seems ignore new line character? please see below code.

parser = optionparser() parser.add_option("--s", dest="s", type="string", help="first line \n sec line")

intention:

current output: .... first line \n sec line expected output: .... first line sec line

might suggest argparse?

i'm not sure if supported in optionparser, suggest using triple quote i.e:

parser = optionparser() parser.add_option('--s', dest='s' type='string' help=''' triple quotes can straight set in including line spaces. \n appear string rather newline.''')

argparse example:

import argparse parser = argparse.argumentparser() parser.add_argument('--s', help='''first line sec line''') args = parser.parse_args() print args.s

python linux terminal optparse optionparser

javascript - angular js : How to call multiple asynchronous http request one after another and store the respone for later use? -



javascript - angular js : How to call multiple asynchronous http request one after another and store the respone for later use? -

please please help:( (disapointed)

i have table in mysql database stores avalabe book times;

in site , there buttons user can nail , related avalable book times , can see in image attached .

every time user hits arrow left/right , trigger mill function , i'll info contains avalabe books related day ,everything works fine far.

problem: when user first comes site , i'll current day , i'll show avalable book times related day(today) , , when user hits arrow left/right , i'll avalabe books related 3 days later today. works fine too.

but slow.

i want when user comes site , info related today until 2 month later .

but want show today's(and next day , , next 2day) avalabe books. when user clicks on arrow left/right , wont have phone call http request , forcefulness user wait until info avalabe see.

is there way define asynch http requests , store callback success info , dont utilize until user hits special key(in case arrow left/right)???

here http request function in mill :

app.factory('showbookingfacdrprofile',function($http){ return{ showbooking:function(scope){ $http.post("partials/search-drprofile/show_available_books.php",{today,nextday,next2day})// simplicized object send here .success(function(msg){ scope.booking=msg;; //here want : then.post('sameurl',{next3day,next4day,next5day}) // want repeat until 2 month later today then.post('sameurl',{next6day,next7day,next8day}) } } });

related controller:

$scope.hitarrow = function(current) { $scope.pager = current; searchfac.search($scope); };

noting special in controller

i know can utilize promises ! , how store them ? ?how utilize them later ?

i can't store them in new scope.booking , e.g : scope.booking2 , because can't utilize them :(

i cannot utilize cache because maybe every min avalabe books has changed :(

this view:

<div class='col-xs-4'> <table class='table table-responsive' > <tr data-ng-repeat='v in booking |filter:{month:date.next2month} |filter:{day:date.next2day}'> <td><a>{{v.hour}}</a></td> </tr> </table> </div> <div class='col-xs-4'> <table class='table table-responsive' > <tr data-ng-repeat='v in booking |filter:{month:date.nextmonth} |filter:{day:date.nextday}'> <td><a>{{v.hour}}</a></td> </tr> </table> </div> <div class='col-xs-4'> <table class='table table-responsive' > <tr data-ng-repeat='v in booking |filter:{month:date.today} |filter:{day:date.today}'> <td><a>{{v.hour}}</a></td> </tr> </table> </div>

note i've seen approach in site click

please see, , nail arrows you'll see how fast new avalable book times comes view

if $scope. booking array, have append contents of http responses (array.push(object)).

javascript angularjs

android - getParcelable returning null in app billing -



android - getParcelable returning null in app billing -

for reason, buyintentbundle.getparcelable("buy_intent"); returning null meaning app ceases function

here relevant code:

string sku; public void buyhint(){ seek { bundle buyintentbundle = mservice.getbuyintent(3, getpackagename(), sku, "inapp", "(id used here)"); boolean buyintent=false; if(buyintentbundle!=null){ buyintent=true; } log.d("buyintent"+buyintent,"daa"); pendingintent pendingintent = buyintentbundle.getparcelable("buy_intent"); boolean buyintentparcel=false; if(buyintentbundle.getparcelable("buy_intent")!=null){ buyintentparcel=true; } log.d("buyparcel"+buyintentparcel,"da"); seek { startintentsenderforresult( pendingintent.getintentsender(), 1131, new intent(), integer.valueof(0), integer.valueof(0), integer.valueof(0)); } grab (sendintentexception e) { // todo auto-generated grab block e.printstacktrace(); } } grab (remoteexception e) { // todo auto-generated grab block e.printstacktrace(); } }

so pretty much, using various log methods, able determine buyintent bundle not null, buyintentbundle.getparcelable("buy_intent") is... ideas

thank much help

pendingintent pendingintent = buyintentbundle.getparcelable("buy_intent"); can homecoming null if there no google business relationship logged in on android device.

android null parcelable

oracle - JDBC Batch Insert with Returning Clause -



oracle - JDBC Batch Insert with Returning Clause -

is there way values of affected rows using returning clause in java while using jdbc batch insert statement? able required values of single row affected.but not batch inserts?

code :

try { string query = "insert temp ( " + "org_node_id, org_node_category_id, org_node_name, " + "customer_id, created_by, created_date_time, " + "updated_date_time, activation_status )" + " values (seq_org_node_id.nextval, 11527, 'abcd', 9756, 1, sysdate, sysdate, 'ac')" +" returning org_node_id, org_node_name ?, ?"; con = dbutils.getoasconnection(); oraclepreparedstatement ps = (oraclepreparedstatement) con.preparestatement(query); ps.registerreturnparameter(1, types.integer); ps.registerreturnparameter(2, types.varchar); ps.execute(); resultset rs = ps.getreturnresultset(); rs.next(); system.out.println("org id : "+ rs.getint(1)); system.out.println("org name : "+ rs.getstring(2)); } grab (sqlexception e) { e.printstacktrace(); }

oracle jdbc batch-insert

android - Robolectric: use local SQLiteDatabase -



android - Robolectric: use local SQLiteDatabase -

how possible utilize local (db on file system) sqlitedatabase in robolectric 2.3? solutions on net refer robolectric < 2.3.

i want this, because robolectric not find created tables in sec or 3rd test.

i found solution using specific annotation:

import org.robolectric.util.databaseconfig.usingdatabasemap; import org.robolectric.util.databaseconfig.databasemap; .... @runwith(robolectrictestrunner.class) @usingdatabasemap(dbmap.class) public class generictest{....}

the class dbmap must implement

class dbmap implements databasemap { private static final string localdb = "/users/elcapitano/temp/mydb.db"; public string getdriverclassname() { homecoming "org.sqlite.jdbc"; } public string getselectlastinsertidentity() { homecoming "select last_insert_rowid() id"; } public int getresultsettype() { homecoming resultset.type_forward_only; } public string getconnectionstring(file arg0) { homecoming string.format("jdbc:sqlite:%s", localdb); } }

additionally location of 'dbmap.localdb' same during initializing db through 'sqlitedatabase.openorcreatedatabase(dbfile.getabsolutepath(), null);'. perhaps not relevant.

after can utilize local file-db in roboletric!

android robolectric

excel - Can a countifs do this or do I need an array? -



excel - Can a countifs do this or do I need an array? -

i have info range b5:l100. in column b string identifier, 'x' or 'y'. in columns c:l have different people's names entered (never more 1 time per row).

i want count how many times person's name appears in rows column b 'x'. next formula doesn't work (using "max" illustration person search for). can advise on elegantly?

=countifs(c5:l100,"max",b5:b100,"x")

i think array formula might in order, i'm not experienced on those.

=sumproduct((c5:l100="max")*(b5:b100="x"))

excel excel-formula

c# - WPF disabling the window close button via MVVM -



c# - WPF disabling the window close button via MVVM -

i trying disable close button on window via mvvm

i realise can in view (window) cs code stating

public window() { initializecomponent(); this.closing += new system.componentmodel.canceleventhandler(window_closing); } void window_closing(object sender, system.componentmodel.canceleventargs e) { e.cancel = true; }

however maintain consistent , seek mvvm.

thanks

change closing method variable viewmodel.

void window_closing(object sender, system.componentmodel.canceleventargs e) { e.cancel = (this.datacontext myviewmodel).processworking; }

in viewmodel (myviewmodel) add together property processworking :

public boolean processworking { { homecoming this.processworking; } }

and in method of background thread, modify processworking

private boolean processworking; private void mybackgroundthread() { this.processworking = true; // process this.processworking = false; }

you can add together raisepropertychange() when modify this.processworking if want show somewhere of ui state of background process.

c# wpf mvvm

sorting - jQuery & Isotope sort by numbers within an element -



sorting - jQuery & Isotope sort by numbers within an element -

i'm having problem trying figure out how specific type of sorting, sort class id time i'm trying accomplish different.

ok here's illustration code:

<div class="points-wrapper"> <span class="rewards-points"> <span data-bind="text: $data.points">1000</span> points </span> <span class="rewards-points"> <span data-bind="text: $data.points">5000</span> points </span> <span class="rewards-points"> <span data-bind="text: $data.points">5000</span> points </span> </div>

sorting buttons below.

<div id="sorts" class="button-group"> <button class="button is-checked" data-sort-value="original-order">original order</button> <button class="button" data-sort-value="points">500</button> <button class="button" data-sort-value="points">1000</button> <button class="button" data-sort-value="points">2000</button> <button class="button" data-sort-value="points">3000</button> <button class="button" data-sort-value="points">5000</button> </div>

this smaller illustration of i'm working on, real 1 has 30 different items various points count.

i'm trying figure out how sort according points count within span. options along lines of "0 - 1000", "1000 - 5000", "5000 - "10000" etc.

how can sort using jquery , isotope.js?

* sorting *

so assume rewards-points class isotope item, hence:

var container = $('#container').isotope({ itemselector: '.rewards-points', layoutmode: 'masonry', getsortdata: { points: function(item){ homecoming parsefloat($(item).find(".number").text()); } } }); container.isotope({ sortby: 'points' });

the getsortdata function returns value isotope sort by, sortby set name set in getsortdata function.

details here: http://isotope.metafizzy.co/sorting.html

* sorting filtering *

you'll need utilize filter function, so:

$(".button").click(function(e) { if($(this).text() == "all"){ container.isotope({ filter: function() { homecoming true; } }); } else { var btnval = parsefloat($(this).text()); container.isotope({ filter: function() { var itemval = parsefloat($(this).find(".number").text()); homecoming btnval == itemval; }}); } });

see: http://isotope.metafizzy.co/filtering.html

i think should sort it... if can alter markup, utilize data attributes hold values, , classes hold selectors , it'll create working isotope much easier!

update fiddle here: http://jsfiddle.net/y59s2/3/

again, tiding html create easier, consider.

jquery sorting jquery-isotope

javascript - Bootstrap 3 set options for individual modal -



javascript - Bootstrap 3 set options for individual modal -

i have next piece of code trying setup these properties bootstrap modal when place $(document).ready modal shows when page loads

$(document).ready(function(){ $('#mymodalbug').modal({ backdrop: 'static', keyboard: false }); });

how can create set these properties without dialog show on load page?

you need set show false. defaults true see options here

$(document).ready(function(){ $('#mymodalbug').modal({ backdrop: 'static', keyboard: false, show: false }); });

javascript jquery twitter-bootstrap

Django 1.5: When extending base.html, my tag displays in my child's -



Django 1.5: When extending base.html, my <head> tag displays in my child's <body> -

edit: adding total versions of base of operations , kid template.

i'm using django 1.5.8 , have base of operations template (in template root) , sub folders kid templates extend base.

when extend base.html contents of base of operations template show in body of kid template. happens on kid pages except index. there django template inheritance rule i'm not aware of?

here total base:

<!-- base.html --> <!doctype html> <html lang="en"> <head> {% load ganalytics %} {% load twitter_tag %} {% load compress %} {% load tags %} <meta charset="utf-8"> <!--<meta http-equiv="x-ua-compatible" content="ie=edge">--> <meta name="viewport" content="width=device-width, initial-scale=1"> {% block othermeta %} <meta name="description" content="welcome multimechanics"> <title>multimechanics</title> <link rel="icon" type="image/png" href="{{ static_url }}ico/favicon.ico" /> <!--needed salesforce--> <meta http-equiv="content-type" content="text/html; charset=utf-8"> {% endblock %} <!-- bootstrap core css --> <!--<link href="css/bootstrap.min.css" rel="stylesheet">--> {% compress css %} <link href="{{ static_url }}css/style.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"> <link href="{{ static_url }}css/animate.css" rel="stylesheet"> <link href="{{ static_url }}css/lightbox.css" rel="stylesheet"> <link href='http://fonts.googleapis.com/css?family=source+sans+pro:300,400,600,700' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=ubuntu:300,400,500,700' rel='stylesheet' type='text/css'> {% endcompress %} {% ganalytics %} {% block otherheader %}{% endblock %} </head> <body> <!-- navigation --> <header> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/"><img src="{{ static_url }}img/logo.png" alt="..."></a> </div> <div class="collapse navbar-collapse"> {% if user.is_authenticated %} <a href="/logout" class="navbar-btn btn btn-red pull-right hidden-sm hidden-xs">log out</a> {% else %} <a href="/login" class="navbar-btn btn btn-red pull-right hidden-sm hidden-xs">log in</a> {% endif %} <ul class="nav navbar-nav navbar-right"> <li class='dropdown {% active request "^/faqs/$" %} {% active request "^/multiscale/$" %} {% active request "^/about-us/$" %}'> <a href="#" class="dropdown-toggle" data-toggle="dropdown">about<b class="caret"></b></a> <ul class="dropdown-menu"> {% if request.get_full_path == "/" %} <li><a href="#about">product overview</a></li> <li><a href="#features">product applications</a></li> {% else %} <li><a href="/">multimech home</a></li> {% endif %} <li><a href="/about-us">multimech details</a></li> <li><a href="/multiscale">what's multiscale?</a></li> <!--<li><a href="/porfolio/demos">demos</a></li> <li><a href="/portfolio/case">case studies</a></li>--> <li><a href="/faqs">frequent questions</a></li> </ul> </li> <li class='dropdown {% active request "^/trueinnovation/$" %} {% active request "^/portfolio/$" %}'> <a href="/portfolio" class="dropdown-toggle" data-toggle="dropdown">showcases <b class="caret"></b></a> <ul class="dropdown-menu"> {% if request.get_full_path == "/" %} <li><a href="#showcases">featured demos</a></li> {% endif %} <li><a href="/portfolio">demo gallery</a></li> <li><a href="/trueinnovation">blog</a></li> </ul> </li> <li class='dropdown {% active request "^/careers/$" %} {% active request "^/contact-us/$" %} {% active request "^/login/$" %} {% active request "^/help/$" %} {% active request "^/register/$" %} {% active request "^/thanks/$" %}'> <a href="#" class="dropdown-toggle" data-toggle="dropdown">connect<b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="/contact-us">contact us</a></li> <li><a href="/careers">careers</a></li> <li><a href="/help">help</a></li> <li><a href="/login">user login</a></li> </ul> </li> {% if request.get_full_path != "/" %} <li class="dropdown"> <a href="/contact-us">contact</a> </li> {% else %} <li class="dropdown"> <a href="#contact">contact</a> </li> {% endif %} <!-- navbar search --> <li class="hidden-xs" id="navbar-search"> <a href="#"> <i class="fa fa-search"></i> </a> <div class="hidden" id="navbar-search-box"> <div class="input-group"> <input type="text" class="form-control" placeholder="search"> <span class="input-group-btn"> <button class="btn btn-default" type="button">go!</button> </span> </div> </div> </li> </ul> <!-- mobile search --> <form class="navbar-form navbar-right visible-xs" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="search"> <span class="input-group-btn"> <button class="btn btn-red" type="button">search!</button> </span> </div> </form> </div><!--/.nav-collapse --> </div> </div> </header> <!-- / .navigation --> {% block content %} {% endblock %} <!-- footer ================================================== --> <footer> <div class="container"> <div class="row"> <!-- contact --> <div class="col-sm-4"> <h4><i class="fa fa-map-marker text-red"></i> contact us</h4> <p>do not hesitate contact if have questions or feature requests:</p> <p> omaha, ne 68154<br /> 14301 fnb parkway, suite 100<br /> phone: +1 402 957 1336<br /> email: <a href="mailto:sales@multimechrd.com">sales@multimechrd.com</a> </p> </div> <!-- recent tweets --> {% load twitter_tag cache %} {% cache 60 my_tweets %} {% get_tweets "multimechanics" tweets limit 2 %} <div class="col-sm-4"> <h4><i class="fa fa-twitter-square text-red"></i> recent tweets</h4> {% tweet in tweets %} <div class="tweet"> <i class="fa fa-twitter fa-2x"></i> <p> {{ tweet.html|safe }} </p> </div> {% endfor %} </div> {% endcache %} <!-- newsletter --> <div class="col-sm-4"> <h4><i class="fa fa-envelope text-red"></i> newsletter</h4> <p> come in e-mail below subscribe our free newsletter. <br> promise not bother often! </p> <!--<form class="form" role="form" method="post" action="/newsletter{{ request.get_full_path }}">--> <form action="https://www.salesforce.com/servlet/servlet.webtolead?encoding=utf-8" method="post"> <input type=hidden name="oid" value="00di0000000fkhm"> <input type=hidden name="returl" value="http://multimech2.azurewebsites.net/thanks/newsletter"> <input type=hidden name="lead_source" id="lead_source" value="web"> <input type=hidden name="city" id="city" value="{{ip}}"> {% csrf_token %} <div class="row"> <div class="col-sm-8"> <div class="input-group"> <label class="sr-only" for="subscribe-email">email address</label> <!--<input type="email" class="form-control" id="subscribe-email" placeholder="enter email">--> <div class="fieldwrapper">{{ newsletter_form.email }}</div> <span class="input-group-btn"> <button type="submit" class="btn btn-default" name="newsletter_form">ok</button> </span> </div> </div> </div> </form> </div> </div> </div> </footer> <!-- copyright --> <div class="container"> <div class="row"> <div class="col-sm-12"> <div class="copyright"> copyright 2014 - multimechanics, llc | rights reserved </div> </div> </div> <!-- / .row --> </div> <!-- / .container --> <!-- bootstrap core javascript ================================================== --> <!-- placed @ end of document pages load faster --> {% compress js %} <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="{{ static_url }}js/bootstrap.min.js"></script> <script src="{{ static_url }}js/scrolltopcontrol.js"></script> <script src="{{ static_url }}js/lightbox-2.6.min.js"></script> <script src="{{ static_url }}js/custom.js"></script> {% endcompress %} {% block otherfooter %}{% endblock %} </body> </html>

here total child:

{% extends "base.html" %} {% block content %} <!-- wrapper --> <div class="wrapper"> <!-- topic header --> <div class="topic"> <div class="container"> <div class="row"> <div class="col-sm-4"> <h3>sign in</h3> </div> <div class="col-sm-8"> <ol class="breadcrumb pull-right hidden-xs"> <li><a href="/">home</a></li> <li class="active">log in</li> </ol> </div> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2"> <div class="sign-form"> <div class="sign-inner"> <h3 class="first-child">log in account</h3> <hr> <form role="form" action="" method="post"> {% csrf_token %} <div class="input-group"> <span class="input-group-addon"><i class="fa fa-user"></i></span> {{form.username}} </div> <br> <div class="input-group"> <span class="input-group-addon"><i class="fa fa-lock"></i></span> {{form.password}} </div> <div class="checkbox"> <!--<label> <input type="checkbox"> remember me </label>--> </div> <button type="submit" class="btn btn-red" name="login_form">submit</button> <hr> </form> <p>not registered? <a href="/register">create account.</a></p> <div class="pwd-lost"> <div class="pwd-lost-q show">lost password? <a href="#">click here recover.</a></div> <!--https://github.com/brutasse/django-password-reset--> <div class="pwd-lost-f hidden"> <p class="text-muted">enter email address below , send link reset password.</p> <form class="form-inline" role="form"> <div class="form-group"> <label class="sr-only" for="email-pwd">email address</label> <input type="email" class="form-control" id="email-pwd" placeholder="enter email"> </div> <button type="submit" class="btn btn-blue">send</button> </form> </div> </div> <!-- / .pwd-lost --> </div> </div> </div> </div> <!-- / .row --> </div> <!-- / .container --> </div> <!-- / .wrapper --> {% endblock %}

here how html rendered:

<html lang="en"> <head> <style type="text/css"></style> </head> <body style=""> <!-- base.html --> <!--[if lt ie 8 ]><html class="ie ie7" lang="en"> <![endif]--> <!--[if ie 8 ]><html class="ie ie8" lang="en"> <![endif]--> <!--[if (gte ie 8)|!(ie)]><!--> <!--<![endif]--> <meta charset="utf-8"> <!--<meta http-equiv="x-ua-compatible" content="ie=edge">--> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- navigation --> <header> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/"><img src="/static/img/logo.png" alt="..."></a> </div> <div c

here how render page (but utilize "render_to_response" other templates , same result:

url(r'^about-us/', templateview.as_view(template_name="about-us.html"), name='about-us'),

thanks in advance help.

are sure you're editing right "base.html" file? appears may editing file has same name, in different location. also, using javascript or populate <navigation> </navigation> ? rendered result not match base.html. if generating navigation section using javascript, culprit. if redacted readability, search instance of "base.html" or "about-us.html" in project folder. may find editing wrong file. can post finish files "base.html" , "about-us.html" , entire response?

edit: believe issue may in "othermeta" block. can see next lines render correctly:

<meta charset="utf-8"> <!--<meta http-equiv="x-ua-compatible" content="ie=edge">--> <meta name="viewport" content="width=device-width, initial-scale=1">

this point in result gets messy. point in base of operations when phone call {% block othermeta %}. there reason have block content inside? i'm not sure accepting {% endblock %} correctly. if want block othermeta dynamic, must have in own othermeta.html, extends base.html well. then, alter code simply:

{% block othermeta %} {% endblock %}

i think error may you're trying define contents of block in extended template. i'm new @ you, wrong, seek removing othermeta block exclusively , see if helps.

hope helps!

django django-templates