Posts

combinatorics - Weekly group assignment algorithm with odd number of participants -

there round-robin solution question i asked before . works great number of people none of suggestions seem work once implement algorithm , try them out. i've tried many variations , (grouping last 1 whole bunch of other people, second group last group, different combinations, 2 , 4 last of bottom row, thought give me optimal solution still many duplicates). can suggest way go, or proof there cannot solution without 2 people working more once can stop trying make work. if want algorithm in java can post can play it. thanks. 14 weeks 23 students in groups of 2 , 1 3 sufficiently undemanding local search able find solution. 18 1 11| 3 4| 5 7| 9 6| 0 17| 2 12| 10 19| 15 16| 21 8| 14 20| 13 22| 6 13 18| 17 4| 5 0| 20 1| 12 11| 10 9| 2 14| 15 7| 3 8| 19 16| 21 22| 21 17 7| 19 22| 3 1| 2 8| 0 10| 14 12| 13 11| 6 16| 5 15| 18 20| 9 4| 8 1 13| 18 2| 6 11| 20 0| 12 10| 14 15| 5 17| 9 21| 4 19| 3 22| 16 7| 0 4 16| 17 20| 21 3| ...

javascript - How to add a new Dijit widget to a page? -

i have form variable number of inputs. behavior looking have link in user can click on , add new input form can filled. this html: <form id="myform"> <input data-dojo-type="dijit.form.textarea"/> <a href="#" onclick="add_new_input()"> add new input</a> </form> javascript: <script> function add_new_input(){ var newinput = $("<input data-dojo-type='dijit.form.textarea'/> "); $('#myform').append(newinput); } </script> this add regular text input html , not dijit widget! have suggestions? i defining class input file , bind input type on ($document).ready() did not work either! :( it pretty simple problem solve creating textarea widget programmatically (as mentioned @paul grime). can see example here textareas created link dijit widgets. did not use jquery in fiddle, need change add_new_input function to function ad...

iphone - list style not showing up on chrome iOS -

i'm in process of building web site needs viewable on mobile devices. when viewing in safari on iphone 4s looks great. if view chrome on same device none of styles navigation list show up. ends looking basic html links. links in question are, va leadership, nursing, , anesthesiology staff bellow link live dev site, css. link: http://xeroproject.com/sqwm/category/resources/ css: #leftnav{ max-width:402px; } #leftnav ul li { list-style-type: none !important; width:100%; text-decoration:none; font-weight:bold; font-size:24px; color:#fff; } #leftnav ul a:hover { color:#85b6ce; } #leftnav ul li:nth-child(odd){ padding:10px; margin-bottom:5px; background: #0b5a42 url('images/arrow_dark.jpg') no-repeat right; } #leftnav ul li:nth-child(even){ padding:10px; margin-bottom:5px; background: #688879 url('images/arrow_light.jpg') no-repeat right; } the site renders fine me using google chrome ios latest on iphone 4s (at least looks same on safari running ...

Javascript "this" scope -

i writing javascript code. little confused keyword. how access logger variable in datareceivedhandler function? myclass: { logger: null, init: function() { logger = logfactory.getlogger(); }, loaddata: function() { var datareceivedhandler = function() { // how access logger variable here? } // more stuff } }; assuming loaddata called so: myclass.loaddata(); then: loaddata: function() { var self = this; var datareceivedhandler = function() { self.logger ... } // more stuff }

Google maps on none google API build target Android -

is possible run google maps (api v1 fine) on none google api build target? have special emulator not have google api built in. when try adding maps.jar libs folder in project mapactivity can reference getting stack trace shown below. using google maps api v1 maps.jar this. i have tried setting manifest use , , removed it, both not work. thanks! 04-04 17:23:20.553: e/androidruntime(12458): fatal exception: main 04-04 17:23:20.553: e/androidruntime(12458): java.lang.runtimeexception: unable instantiate activity componentinfo{com.google.android.maps/com.google.android.maps.mapmainactivity}: java.lang.runtimeexception: stub 04-04 17:23:20.553: e/androidruntime(12458): @ android.app.activitythread.performlaunchactivity(activitythread.java:1569) 04-04 17:23:20.553: e/androidruntime(12458): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1663) 04-04 17:23:20.553: e/androidruntime(12458): @ android.app.activitythread.access$1500(...

php - Break a WordPress post on paragraph tags -

i have site 2 databases. 1 attached wordpress install runs part of content of site; other runs site overall. let's call them cwordpress , tdasite. i have figured out how access wordpress database , pull content it, i'm not sure how break down on p tags, because i'm pulling post_content file. need display text in sidebar, , readability it's nice have in actual paragraphs. articles i'm pulling short, there 3 5 paragraphs in each. i'm not seeing how wordpress saves formatting. does, since wordpress pages display appropriately, , tags show in view source, they're not visible in database. otherwise, i'd use explode break them paragraphs , display them way. far, can't turn post_content object variable , print it! i'm trying possible, or need reconcept? this query code. //define query retrieve international news posts $newsquery = 'select wp_posts.post_title, wp_posts.id, wp_posts.post_content wp_posts, wp_term_relationships, wp_te...

javascript - Loop through folder images in Canvas -

i'm trying have canvas element on page loop through set of images within folder. i've figured out how set image on canvas im not sure how multiple images 1 after another. i've thought possible using loop , array im not sure best way store images in array. this site working 1 image. onload shows image, after set time canvas hidden , reply button appears: http://www3.carleton.ca/clubs/sissa/html5/ what i'm trying images (25) show 1 after pretty fast. kinda marvel intro animation lot worst :) this i've done far canvas set up window.addeventlistener("load", initcanvas); var canvas, play, ctx, playlenght, img; function initcanvas(){ getelements(); setcanvas(); } function getelements(){ canvas = document.getelementbyid('canvas'); play = document.getelementbyid('canvasplay'); play.addeventlistener("click",setcanvas); } function setcanvas(){ //hide ctx play button play.style.visibil...