Posts

python - Clientside Scripting Language -

is javascript language can utilise dom api? there dom wrapper python? there in-browser implementations of python: http://www.skulpt.org/

Example of how to add secondary index when storing object in Riak with Java Client? -

i storing hash-map in riak bucket this: bucket.store(key, dochashmap).execute(); i store object secondary index. how accomplish this? aware iriakobject has addindex method, how access iriakobject before stored? i think trying expected use-case, yet not able find documentation or examples on this. if can point me 1 appreciated. thanks! update: @brian roach answered on riak mailing list , below. here custom class wrote extends hashmap: class docmap extends hashmap<string, object> { /** * generated id */ private static final long serialversionuid = 5807773481499313384l; @riakindex(name="status") private string status; public string getstatus() { return status; } public void setstatus(string status) { this.status = status; } } i can still use object ordinary hashmap , store keys , values, write "status" secondary index (and end being called "status_bin" since it's stri...

java - Bundle and putExtra -

i new learner when copy practicing code book bought, tells me putextra not defined bundle can use putlong instead? or what? public class remindereditactivity extends fragmentactivity { @override public void oncreate (bundle savedinstancestate) { super.oncreate (savedinstancestate); setcontentview (r.layout.reminder_edit_activity); fragment fragment = getsupportfragmentmanager().findfragmentbytag(remindereditfragment.default_edit_fragment_tag); if (fragment == null) { fragment = new remindereditfragment(); bundle args = new bundle(); args.putextra(reminderprovider.column_rowid, getintent().getlongextra(reminderprovider.column_rowid, 0l)); fragment.setarguments(args); fragmenttransaction transaction = getsupportfragmentmanager ().begintransaction(); transaction.add (r.id.edit_container, fragment, remindereditfragment.default_edit_fragment_tag); transaction.commit(); } } } yes, can try putlong method, bundle don't ...

javascript - OpenTextFile gives error Automation server can't create Object -

i created method create text file log page has different buttons call functions parameters different textfields: function writetofile(data) { var currentdate = new date(); var datetime = "time: " + currentdate.getdate() + "/" + (currentdate.getmonth()+1) + "/" + currentdate.getfullyear() + " @ " + currentdate.gethours() + ":" + currentdate.getminutes() + ":" + currentdate.getseconds(); var fso = new activexobject("scripting.filesystemobject"); var = fso.opentextfile("c:\\logs\\log.txt", 8); a.writeline(datetime); a.writeline(data + "\n"); a.close(); } and works fine when i'm using c: drive. unfonrtunately, used in production in z: drive other people can use page well. when copy z: drive , change line: var = fso.opentextfile("c:\\logs\\log.txt", 8); to following: var = fso.opentextfile("z:\\logs\\log.txt", 8); it gives me error ...

javascript - Crossfilter filtering and displaying on array properties -

i have array of data objects this: { index: "m1", first: "first", last: "last", distance: 5, specialties: ["pediatrics", "internal"], languages: ["english", "french"] } in addition filtering distance: var cf = crossfilter(physicians); var bydistance = cf.dimension(function (d) { return d.distance; }); i'd filter specialty. i've looked @ this question , gives me structure count of each specialty entire dataset. ideally i'd display matching specialties based on distance filter, , use specialties further filter results. is possible given structure of objects? there easier way represent data lend better filtering? thanks. fiddle here: http://jsfiddle.net/colin_young/xrqjx/35/ support custom filter functions has been added in crossfilter-1.2.0. should able do: var specialties = cf.dimension(function(d) { return d.specialties; }); specialties.filterfunction(fun...

jquery - Hide/Show content with many variables -

i'm using jquery reveal/hide content on click event follows: $('#staffer1').click(function() { $("#staff1").show(); $("#staff2").hide(); $("#staff3").hide(); }); $('#staffer2').click(function() { $("#staff2").show(); $("#staff1").hide(); $("#staff3").hide(); }); $('#staffer3').click(function() { $("#staff3").show(); $("#staff1").hide(); $("#staff2").hide(); }); this issue lies in volume. if have 60 staffers, there way circumvent listing out 60 lines each click event? html so: <div> <p><a id="staffer1">staff name 1</a></p> <p><a id="staffer2">staff name 2</a></p> <p><a id="staffer3">staff name 3</a></p> </div> <div id="staff1"> <div class="slider"> <img src="i...

c# - can there be two different columns of type link in datagridview? -

if how handle cellcontentclick event of each separately? adding columns dynamically. heres code:- datagridviewshow.columns.add(new datagridviewtextboxcolumn { headertext = "date", datapropertyname = "date", celltemplate = new datagridviewtextboxcell() }); datagridviewlinkcolumn tocomputer = new datagridviewlinkcolumn(); tocomputer.headertext = "status"; tocomputer.name = "link1"; tocomputer.usecolumntextforlinkvalue = true; tocomputer.text = "save file"; tocomputer.activelinkcolor = color.white; tocomputer.linkcolor = color.blue; tocomputer.trackvisitedstate = true; tocomputer.visitedlinkcolor = color.green; datagridviewshow.columns.add(tocomputer); datagridviewshow.cellcontentclick += (savefiletype_click); datagridviewlinkcolumn tonet = new datagridviewlinkcolumn(); tolinx.headertext = " "; tolinx.name = "link2...