Posts

Showing posts from June, 2010

c# - Monodroid - Set Custom font -

i using monodroid make app , can't figure out how make custom font. below code textview text = findviewbyid<textview>(resource.id.tvchange); typeface tf = typeface.createfromasset(assets,"fonts/gt.otf"); text.settypeface(tf); there no getassets() in monodroid have no idea if typeface correct, , text.settypeface(tf); expects 2 arguements, second don't know. thanks i found out problem here code below typeface tf = typeface.createfromasset(application.context.assets, "fonts/gt.otf"); textview explodevin = findviewbyid<textview>(resource.id.tvexvin); explodevin.settypeface(tf,typefacestyle.normal);

c# - ASP NET MVC array in controller to client side array -

my question how ( if possible ) array string[] a; pass view through viewbag , how can obtain javascript array of strings. i want use because set of data db , want in view make chart , need javascript array. it's easy "render" array javascript object, using string.join or similar: @{ viewbag.a = new int[] { 1, 2, 3 }; viewbag.b = new string[] { "a", "b", }; } <script type='text/javascript'> // number array var = [ @(string.join(", ", (int[])viewbag.a)) ]; console.log(a); // [1, 2, 3] // string array -- use html.raw var b = [@html.raw("'" + string.join("', '", (string[])viewbag.b) + "'")]; console.log(b); </script>

emacs - Shell prompt repeating when using ssh in ansi-term -

when use ssh login ubuntu 12.04 machine ansi-term session in emacs prompt displays incorrectly: 0;ubuntu@jumplin: ~ubuntu@jumplin:~$ this should following: ubuntu@jumplin:~$ i've tried few of suggestions in relation utf-8 , colour support don't seem working (colour works fine in ansi-term): strange characters in ansi-term in emacs i think might have unsupported ansi escape code or that, i'm not sure - value of ps1 terminal session is: \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ any advice appreciated :) seem bit lost when strange characters show in terminal sessions. \[\e]0;\u@\h: \w\a\] in prompt configure xterm(?)'s title bar. though ansi colorization supported ansi-term , escape sequences manipulate title bar not. why see prompt repeated twice - first section supposed go title bar. so either remove first sequence ps1 or similar suggested in bash prompt howto : function proml { case $term in xterm*) lo

bash - Extracting a word from the middle of a sentence -

i have log file this: 2013-07-10 21:40:54 [info] janus_mesca joined game 2013-07-10 21:40:54 [info] fenlig joined game 2013-07-10 21:41:21 [info] bigredhoodie joined game i'm trying print whatever appears in between "[info]" , "joined". with attempts i've been able remove 2 words themselves. tail -500 $rfile | grep "info.*joined game" | \ sed -e 's/\[info\]\(.*\)joined/\1/' can help? pure grep version lookahead/lookbehind. p.s. option -p might not available everywhere, thought clever. tail test.log | grep -po '(?<=\[info\] ).*(?= joined .*)'

Convert an image into digits with PHP? -

Image
i trying figure out how can convert color image numbers. for example, if have image 1 shown in figure (b) , how can output figure (a) in text file? i took in here mehdi karamosly mentioned in answer , modified little bit simipiler , made simple html output can modify outputs liking. might want add more data checking make sure file/real image if looking add security. i've checked out on computer , works , work need modification(s). function graycolor($img){ list($width, $height) = getimagesize($img); $mime = pathinfo($img, pathinfo_extension); switch($mime){#use appropriate function depending on image type case 'jpg': case 'jpeg': $im = imagecreatefromjpeg($img); break; case 'png': $im = imagecreatefrompng($img); break; case 'gif': $im = imagecreatefromgif($img); break; default: #invalid type

cmusphinx - Exception loading pocketsphinx_jni while running PocketSphinxDemo on Android device -

i've been trying pocketsphinx demo android running on device couple days now. whenever try run demo, however, error in logcat: fatal exception: main java.lang.exceptionininitializererror @ java.lang.class.newinstanceimpl(native method) then bunch of more errors, important last 1 is @ edu.cmu.pocketsphinx.demo.pocketsphinxdemo.<clinit>(pocketsphinxdemo.java.18) line 18 in pocketsphinxdemo.java is system.loadlibrary("pocketsphinx_jni"); when go pocketsphinx_jni folder, located in /pocketsphinxandroiddemo/obj/local/armeabi/objs-debug, appears empty. running ubuntu, if @ relevant. there should in folder? causing error? sort of answer appreciated. when go pocketsphinx_jni folder, located in /pocketsphinxandroiddemo/obj/local/armeabi/objs-debug, appears empty. system.loadlibrary doesn't load folder, loads library. libpocketsphinx_jni.so library built ndk-build during build process. objs-debug/pocketsphinx_jni temporary fo

jquery - If validation condition is met, then run main chat code after clicking button -

how can make main chat code only run if validation passed (i.e. fields not contain default values or empty) after user clicks on sendmessage button? right main chat code runs anyway whether validation passed or not. // main chat code $(function () { var iwannachat = $.connection.mychathub; iwannachat.client.addmessage = function (message) { $('#listmessages').append('<li>' + message + '</li>'); }; $("#sendmessage").click(function () { iwannachat.server.send($('#ideabody').val()); }); $.connection.hub.start(); }); // handling default values , validation $(function () { $('#ideatitle, #ideabody').each(function () { $.data(this, 'default', this.value); }).focus(function () { if (!$.data(this, 'edited')) { this.value = ""; } }).change(function () { $.data(this, 'edited', this.value !=

continuous integration - Triggering build on Bamboo for pull requests on Stash? -

i want know if possible configure similar accomplished jenkins+github the request builder plugin . specifically, triggering build on bamboo when pull request created on stash, using pull request branch build. bonus points triggering new builds when pull request updated, or if command given through comments (like jenkins plugin). i can't see way that, , can't see way create plugin make possible. maybe merge-checks trigger plugins work, looks triggered when goes @ pull request, not triggered when pull request arrives. we solved writing stash plugin, has been open sourced , available on github . the trick annotate methods com.atlassian.event.api.eventlistener , stash call them when corresponding event happens. listen events such as: com.atlassian.stash.event.pull.pullrequestcommentaddedevent com.atlassian.stash.event.pull.pullrequestopenedevent com.atlassian.stash.event.pull.pullrequestreopenedevent com.atlassian.stash.event.pull.pullrequestrescopedevent

python - Creating download link for user generated csv file on App Engine -

i having issue when trying create download link (1) generate csv file in-situ , (2) commence download automatically without being redirected page (i.e. ajax request). what happens follows: not seeing javascript errors , handler csvdownload executes without issues. however, download never starts. reason, if enter url (..website../csvdownload) create file using same handler. idea why is? any appreciated! html <button id="mainreportdownload" type="button"> download report </button> ajax request $('#mainreportdownload').on('click', function() { $.ajax({ type: 'get', url: "/csvdownload", beforesend: function() { notification('creating report..','info',false) } }); }); python def list2csv(data): csv = "" row in data: item in row: csv = csv + item + ',' csv = csv[:-1] + '\n' csv = csv[:-1] return csv class csvdown

performance - Inconsistent execution times in Javascript -

note: have checked mike brandt's answer if have since caught dumb mistake on dead/live pixel ratio. ken gets nod advice. i'm trying debug performance issues conway's game of life in canvas element , i'm getting strange performance issues. i'm getting 4-12 fps , benchmarking of drawing functions indicates overall performance should able go 60 fps. below canvas drawing code. updatebgcanvas being called @ 30fps requestanimationframe. whole thing being run , perf tested in chrome 28.0.1500.70. (my apologies messy code, i've been hacking code smaller subunits greater granularity in performance profiler without regard coding technique) unsurprisingly, canvas drawing functions (filldead , filllive biggest cpu hogs here's gets bizarre. filllive consumes 5-6% of cpu time (about expect fillrect benchmarking did) , filldead eats whopping 36-38% of cpu time. these identical functions except conditional test against 1 or 0. i've tried swapping c

sql - Updating Data-Tier Application version via SqlPackage.exe -

i automating deployment of applications database via command line using sqlpackage.exe , unable find way update version of data-tier application (development, of course...) http://msdn.microsoft.com/en-us/library/hh550080%28v=vs.103%29.aspx i using /action:publish push newly built *.dacpac, version remains @ v1.0.0.0, if not possible? how how change extendedproperty? i want have reference version installed looking @ database. any ideas? on database project go project settings, there section output types, click on properties button below "data-tier application (.dacpac) file): in dialog can set version number gets deployed, can query information from: select top 1000 [instance_id] ,[instance_name] ,[type_name] ,[type_version] ,[description] ,[type_stream] ,[date_created] ,[created_by] ,[database_name] [msdb].[dbo].[sysdac_instances]

Java Google Drive SDK SocketTimeoutException on File.insert.execute -

i have been using google drive sdk in both java , objective-c months , today (jul 10, 2013) inserting new files using java api (google-api-client-1.15.0-rc.jar & version 1.14) failing execute on fileinsert.execute(). here static helper method i've been using (basically copy dredit tutorials): public static file insertfile(drive driveservice, string title, string description, string parentid, string mimetype, java.io.file content) { system.out.println("<gdrive insertfile> start"); file body = new file(); body.settitle(title); body.setdescription(description); body.setmimetype(mimetype); if (parentid != null && parentid.length() > 0) { body.setparents( arrays.aslist(new parentreference().setid(parentid)) ); } insert fileinsert = null; system.out.println("<gdrive insertfile> before content attache"); if (content != null &

c# - How to use FirstOrDefault for two primary keys -

there 2 primary key , b 1 key can compiled how 2 keys var product = db.tmp_hello.firstordefault<tmp_hello>(instrmnt => (instrmnt.a == good.a; instrmnt.b == good.b)); use && operator in lambda. var product = db.tmp_hello .firstordefault<tmp_hello>( instrmnt => instrmnt.a == good.a && instrmnt.b == good.b);

visual studio 2012 - ServiceStack NUnit Test Debugging Connection Refused Issue -

in question: servicestack jsonserviceclient based test fails, service works in browser i'm looking clue why test generates exception, when interactive browser test succeeds. run tests , interact via browser. now i'm asking direction on how debug this. basically, if step through test case, reach line this: tranactions response = client.get(request); , raises exception. i'm thinking should download servicestack source , add project solution, in order step through code , further insight what's going on. advice? i decided update project latest servicestack release start. then, repeated earlier troubleshooting steps. problem resolved. see: servicestack jsonserviceclient based test fails, service works in browser further details.

vba - How to get value of a Yes/No checkbox control when passed to another class? -

i have form tform based on table t . there yes/no field choice in t . add field tform , added checkbox choicecheck form. trying choicecheck 's value in class, sqlpreparer , using construct sql statements based on values in tform : private function controltovaluestr(ctrl control) string if ctrl.name = "choicecheck" controltovaluestr = ctrl.value else 'return control's value wrapped in quote marks controltovaluestr = quotewrap(ctrl.value) end if end function however, when call sqlpreparer.controltovaluestr() , pass choicecheck , ctrl.value statement gives me error: run-time error '438': object doesn't support property or method i'm able value in class tform follows: me.choicecheck.value all of text box controls of type string work in both situations. i'm having problem textbox type in t long. the problem had named label choicecheck , not checkbox itself. same issue present textbox. in both case

php - How to autoload 'libraries' in laravel 4? -

i've created library folder in app folder add app libraries. i've updated app config file , composer.json autoload folder, when run command composer dump-autoload next error: {"error":{"type":"symfony\\component\\debug\\exception\\fatalerrorexception","message":"class 'app\\libraries\\search\\searchserviceprovider' not found","file":"d:\\users\\miguel borges\\documents\\trabalhos\\tese\\portal\\bootstrap\\compiled.php","line":4130}}php fatal error: class 'app\libraries\search\searchserviceprovider' not found in d:\users\miguel borges\documents\trabalhos\tese\portal\bootstrap\compiled.php on line 4130 [finished in 1.1s exit code 255] my app folder tree: app | ... + libraries | + search | | - search.php | | - searchfacade.php | | - searchserviceprovider.php | + lib2 | | - ... | + lib3 | | - ... | | - theme.php | - ... - filters.php - routes.php searchserviceprov

php - zip main folder with sub folder inside -

i have folder files , sub folder inside. how im going read directory , zip main folder? ex: maindirectory --- file 1 --- file 2 --- subdirectory 1 ------ file 3 ------ file 4 --- subdirectory 2 ------ file 5 ------ file 6 i'm using script: function zip($source, $destination, $include_dir = false) { if (!extension_loaded('zip') || !file_exists($source)) { return false; } if (file_exists($destination)) { unlink ($destination); } $zip = new ziparchive(); if (!$zip->open($destination, ziparchive::create)) { return false; } $source = str_replace('\\', '/', realpath($source)); if (is_dir($source) === true) { $files = new recursiveiteratoriterator(new recursivedirectoryiterator($source), recursiveiteratoriterator::self_child); if ($include_dir) { $arr = explode("/",$source); $maindir = $arr[count($arr)- 1]; $source = &

Using an alert in the Firefox add-on builder -

i'm trying write first firefox extension using ff add-on builder . don't understand why seems code isn't running @ neither alert pops up. why doesn't alert("main"); create popup? main.js alert("main"); var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*", contentscriptfile: data.url("noredirectlinks.js"), contentscriptwhen: "ready" }); noredirectlinks.js alert("content script"); var alllinks = document.getelementsbytagname("a"); (var i=0, il=alllinks.length; i<il; i++) { elm = alllinks[i]; if (elm.getattribute("onclick")) { elm.onclick = null; } if (elm.getattribute("onmousedown")) { elm.onmousedown = null; } } the alert in main.js cannot show in browser. main addon code has not access browser page. access content, have use content scri

sql - zero to many relationship mapping to model -

i'm having bit of issue mapping out model. have question model represents (obviously) question, , questiontype represents types of questions possible (text, multiple choice, list, multi-line text, , on...). the issue i'm having right trying set options associated each of questiontype model question model. example, if questiontype list type, , list contained 3 elements, i'm trying join elements on question model. problem i'm having not questions need have questionoptions variable set. example, simple text question (not shown in code). any suggestions on how achieve this? question model [table("questions")] public class question { [key] [databasegeneratedattribute(databasegeneratedoption.identity)] public int questionid { get; set; } [required] public string question { get; set; } public int questiontypeid { get; set; } [foreignkey("questiontypeid")] public virtual questiontype questionty

sql server - T-SQL How to translate multiple sub-strings to new values -

first of all, sorry because don't know how title problem. my situation is, have 1 lookup table format: +----+-----------+------------+ | id | fruit | color | +----+-----------+------------+ | 1 | banana | yellow | | 2 | apple | red | | 3 | blueberry | notyetblue | +----+-----------+------------+ and main table this: +-------+------------------------+------------+ | mixid | contains | mixedcolor | +-------+------------------------+------------+ | 1 | banana | | | 2 | apple:blueberry | | | 3 | banana:apple:blueberry | | +-------+------------------------+------------+ i want make look-up on first table , fill in mixedcolor column below: +-------+------------------------+-----------------------+ | mixid | contains | mixedcolor | +-------+------------------------+-----------------------+ | 1 | banana | yellow

ios - Presenting a View controller only in the DetailViewController of UISplitViewController -

Image
i working uisplitviewcontroller, , want present vc detail view controller of splitviewcontroller. this: [self presentmodalviewcontroller:vc animated:yes]; also tried master vc. [self.detailvc presentmodalviewcontroller:vc animated:yes]; it comes full screen mean presenting uisplitviewcontroller itself. tried changing modal presentation styles though got same results. what want vc presented should presented within bounds of detailvc , can of detailvc's entire frame, not come anywhere near mastervc. for using uiview animation achieve this, ideas on how presenting? as of xcode 6: in storyboard, select present modally segue, , go identity inspector, , choose current context presentation option.

objective c - Set UITextField to a "selected state" upon dismissing an alert -

i'm practicing on ios development , i'm making bmi calculator app. apart labels, view includes 2 uitextfields - height_textfield , weight_textfield , , uibutton calculatebmi . i have implemented if/else conditions catch empty text fields. meaning if user leaves height_textfield or weight_textfield or both blank, uialertview pops telling user fill in required fields. help: i want respective uitextfield "selected" or in "editable" state (cursor , keyboard appears , ready input) upon dismissing alert. have tried adding protocol .h file , implementing the - (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex and think idea might implementing code relevant " [self.height_textfield editingmode??] " in method can't figure out. this source code bmicalculatorviewcontroller.m file: http://pastebin.com/liwbscng i have not touched .h file (no variables or methods declared there.) thank in

java - Clearning Stack of Activities unto the Top -

i want perform logout function in want clear activities before logout , start new login activity here code utilities.logoutplayerdefaults(profile.this); utilities.vibrate(profile.this); intent myintent = new intent (profile.this,fblogin.class); myintent.addflags(intent.flag_activity_clear_top); startactivity(myintent); but doesn't work. if press button go profile try following way, @override public void onbackpressed() { intent myintent = new intent (profile.this,fblogin.class); myintent.addflags(intent.flag_activity_clear_top); myintent.addflags(intent.flag_activity_clear_task); myintent.addflags(intent.flag_activity_new_task); startactivity(myintent); super.onbackpressed(); }

java - How to use chained exceptions -

in application have never used chained exception. looking forward use believe can make code better. being new can provide me example in type of scenario , how can used? from docs directly the following example shows how use chained exception. try { } catch (ioexception e) { throw new sampleexception("other ioexception", e); } in example, when ioexception caught, new sampleexception exception created original cause attached , chain of exceptions thrown next higher level exception handler.

javascript - Inconsistent speed animating with linear interpolation -

i'm trying animate objects around canvas between 2 calculated points. however, method i'm using doesn't seem take account distance between points. example, far distances take same amount of time animate short distances. what's best method animating objects consistent speed? /** * update function called in setinterval. moves boid new position * **/ this.update = function(){ context.clearrect(0,0,canvas.width,canvas.height); this.amount += 0.005; if (this.amount > 1) this.kill(); this.x = this.origx + (this.destx - this.origx) * this.amount; this.y = this.origy + (this.desty - this.origy) * this.amount; this.drawboid(); //console.log(this.x + ' ' + this.y); } you want take approach animate based on time elapsed since last frame, , speed want animate at, in distance-units-per-unit-time. you have careful when calculating time elapsed; because scheduled setinterval fire every n milliseconds, doesn'

iphone - How to sort this JSON -

how sort json. json below output in browser. { event: { july: [ { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", } ], aug: [ { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", } ], sept: [ ], oct: [ ], nov: [ ], dec: [ { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", stamp: "1386019800" }, { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", stamp: "1387921620" } ], jan: [ ], feb: [ ], mar: [ ], apr: [ ], may: [ ], june: [ ] } } below in console when fetched. apr = ( ); aug = ( { createdseatmap: "yes", status: "1", completed: "1", eventpayment: "0", } ); dec = ( { createdseatmap: "yes", st

iphone - What happens to the views added via interface builder when memory warning is low? -

Image
when low memory warning, release views, set outlets nil, , recreate them on again. views added in interface builder, added when initwithnibname called. so, in general bad practice use lot of views via interface builder or automatically taken care of original uiviewcontroller implementation of didreceivememorywarning(ios 6+) or viewdidunload (ios 5 , below) ? the default behavior viewcontroller load view hierarchy when view property first accessed , thereafter keep in memory until view controller disposed of. there no indication view created using code different 1 created in interface builder. prefer interfacebuilder owing app maintenance since ui code gets complex pretty fast , separating ui elements functional aspect of ui elements clean bifurcation making easy new programmer maintain code base. but when comes releasing memory didreceivememorywarning delegate used explicitly release view hierarchy if additional memory necessary app. - (void)didreceivememorywarn

dns - Where do i find nameservers of my Heroku App? -

this can done thru zerigo. can't find nameservers myself somewhere , update @ accound purchased domain ? heroku doesn't provide dns services therefore there no name servers. you use domain name registrars control panel point dns records @ heroku application. typically cname record pointing @ .herokuapp.com entry. www.mydomain.com cname myapp.herokuapp.com.

How to build only java files with maven? -

i have project hierarchy below myproject--->pom.xml myproject--->src--->main--->java---> java files under different sub directories myproject--->src--->main--->resources---> non java files under different sub directories myproject--->src--->main--->webapp---> non java files under different sub directories i want build project builds java files , include corresponding class files in final jar file here relevant code pom.xml not find java files compile. not sure missing here? <build> <pluginmanagement> <plugins> <plugin> <artifactid>maven-jar-plugin</artifactid> <configuration> <verbose>true</verbose> <includes> <include>**/*.java</include> </includes> </configuration> </plugin>

maven - How to set env variable from within junit test case? -

i followed how set env variables maven run test correctly? , configured pom : <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.15</version> <configuration> <systempropertyvariables> <sendgrid_username>username</sendgrid_username> <sendgrid_password>password</sendgrid_password> </systempropertyvariables> </configuration> </plugin> when run mvn test command, giving following error, error in custom provider, java.lang.illegalstateexception: sendgrid_password env variable must set. what doing wrong ? when doing research find answer, found out following : processbuilder can used set env processes spawned it. dont know whether processbuilder helps in case not spawning processes. project maven project , run test mvn test command. can body explains me how set env situat

postgresql - postgres string type compatibility: varchar and character -

on postgresql database, i've declared string field as character(n) now have function takes string argument varchar(n) are 2 datatype compatible or should change type in function or in table declarement? character types character(n) , varchar(n) compatible , internally same type (but have different representation, when queried). details in this article

jquery - TinyMce File not found Error -

i using tinymce editor 4 in project. when try load shows error files not found . e.g. networkerror: 404 not found - localhost/plugins/tinymce/skins/lightgray/fonts/icomoon.woff networkerror: 404 not found - localhost/plugins/tinymce/skins/lightgray/fonts/icomoon.ttf but when try search directory files there . you can solve problem adding mime type iis follows open iis select site select mime types add new actions section extention : .woff --> mime type : application/x-woff cheers

c# - Azure Service Bus Client Connection Persistence -

i have below basic wrapper around azure service bus code using within worker role. servicebusclient instantiated each time worker role run; used access queue until there no remaining items left enumerate through. public class servicebusclient : idisposable, iservicebusclient { private const int default_wait_time_in_seconds = 120; private const string service_bus_connection_string_key = "service.bus.connection.string"; private readonly messagingfactory _messagingfactory; private readonly namespacemanager _namespacemanager; private readonly queueclient _queueclient; private readonly isettingsmanager _settingsmanager; public servicebusclient(isettingsmanager settingsmanager, string queuename) { _settingsmanager = settingsmanager; var connectionstring = _settingsmanager.getsetting<string>(service_bus_connection_string_key); _namespacemanager = namespacemanager.createfromconnectionstring(connectionstring

constant spin loading but no image popping up - colorbox -

when clicking links, popup box expected images won't load, spins , spins. paths ok far can see. html: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> <link rel="stylesheet" href="colorbox/colorbox.css" /> <script src="colorbox/jquery.colorbox.js"></script> <p><a class="group1" href="http://www.paycoservices.co.uk/colorbox/content/ohoopee1.jpg" title="me , grandfather on ohoopee.">grouped photo 1</a></p> <p><a class="group1" href="http://www.paycoservices.co.uk/colorbox/content/ohoopee1.jpg" title="on ohoopee child">grouped photo 2</a></p> <p><a class="group1" href="http://www.paycoservices.co.uk/colorbox/content/ohoopee1.jpg" title="on ohoopee adult">grouped photo 3</a></p&

Hibernate Too Lazy -

i have single parent/child @onetomany collection set (no dups). below error if try access child parent on server. if pass parent client side via request.setattribute , access parent using jstl, can access child objects members directly. parent/childs have getters/setters. i'm using tomcat 6.0.32, spring 3.1.0, jdk6, hibernate 3. parent @entity @table(name="suser") public class suser { @id @generatedvalue(strategy = generationtype.identity) private int su_id; @column(name="displayname", nullable=true, columndefinition="varchar", length=50, insertable=true, updatable=true) private string displayname; @column(name="last_activity", nullable=true, columndefinition="datetime", insertable=true, updatable=true) private string last_activity; @column(name="ldapuser", nullable=true, columndefinition="varchar", length=50, insertable=true, updatable=true) p

php - how do i take inputs from various textboxes and store it in an array? -

i have array of textboxes , submit button. want take values of textboxes , store in array , display it. there's kind of syntax error. pls help <form name="f1" method="post"> <?php include("dbconnect.php"); $res=mysql_query("select * gdc"); $n=mysql_num_rows($res); echo $n; $res2=mysql_query("select * service"); $n2=mysql_num_rows($res); echo $n2; echo "<table>"; for($i=0;$i<$n2;$i++) { echo "<tr>"; for($j=0;$j<$n;$j++) { echo "<td><input type='text' name='fte".$i.$j."'/></td>"; } echo "</tr>"; } echo "</table>"; ?> <p><input type="submit" name="btn" value="ok"/></p> <?php if(isset($_post['btn'])) { for($m=0;$m<$n2;$m++) { for($k=0;$k<$n;$k++) { echo $_post['

Make my jasperserver webapp the default tomcat application -

i installed jasperserver on ubuntu server. jasperserver using bundled tomcat. now go http://domain:8080/jasperserver and works. how can configure tomcat, can go http://domain:8080 i tried many things (searched on internet) nothing works... tomcat version = 6 i don't have war file here suggestions: default web app in tomcat since don't have war file -- 1 answer suggests renaming application root , suggests adding code server.xml file: <context path="" docbase="/usr/local/tomcat/mywebapps/myapplication"> <watchedresource>web-inf/web.xml</watchedresource> </context>

sql - Using GROUP BY clause to replace dissimilar rows with single value -

i trying (psuedo - of course): select city, case when count( [group] ) > 1 'multiple' else [group] end type offices group city where offices contains rows like: id | group | city ---------------------- 1 | 'a' | 'houston' 2 | 'b' | 'houston' 3 | 'c' | 'houston' 4 | 's' | 'boston' 5 | 'r' | 'detroit' and result like: city | group -------------------- 'houston'| 'multiple' 'boston' | 's' 'detroit'| 'r' i know can do: select city, case when count([group]) > 1 'multiple' else ( select [group] test t.city = city ) end cgroup test t group city i thought should simpler. without sub query? you can find min , max of column , act if not identical: declare @t table (id int not null,[group] char(1) not null,city varchar(2

java - Spring intgeration - recipientlistrouter - parallel processing -

how can achieve parallel processing in spring-integration recipient-list-router. my goal router has content based , sending messages various channel on parallel processing multicast. tried multicast in camel camel-spring-integration couldn't configure content based please if cane done thanks i have achieved similar sort of requirements extending spring-integrations's recipientlistrouter follows: public class cententbasedrecipientlistrouter extends recipientlistrouter { @override protected void handlemessageinternal(final message<?> message) { ...... } } in overridden method, can implement customized content based routing logic per requirements. this custom router can configured follows: <bean id="customrecipientlistrouter" class="cententbasedrecipientlistrouter"> <property name="channels"> <list> <ref bean="parallelprocessingchannel1"/> <ref

c# - New dictionary using LINQ to dictionary -

i have dictionary<position, list<gameobject>> , want create new dictionary dictionary<position, list<person>> collect positions including @ least 1 person in list<gameobject> . i tried: dictionary<position, list<person>> persons = positions.todictionary( => i.key, => i.value.where(obj => obj person)) positions first dictionary. but doesn't work because position null , not type of person because don't convert it. anyway, have ideas? var people = positions.select(x => new { x.key, values = x.value.oftype<person>().tolist() }) .where(x => x.values.any()) .todictionary(x => x.key, x => x.values)

windows - DPInst. Specify .sys file location -

i using dpinst -tool install driver (i have .inf , .sys files). in dpinst.xml specified search -element follows: <search> <subdirectory>*</subdirectory> </search> but during installation " files needed " popup-window appears asking me specify location of .sys file. possible specify it's location prior installation in dpinst.xml or maybe in .inf -file? dpinst searches .inf file. telling dpinst search recursivly in subfolders relative dpinst working directory. .inf file should point .sys file. look @ here info on .inf files , here more info on dpinst.

Java: sort a list of lists -

i have list of lists of points ie: list<list<point>> . e.g.: list<point> lp; list<list<point>> llp; llp.add(lp); lp would first line of matrix (x=0). llp is whole matrix. i want list ascendingly sorted according both x , y of each point. managed internal list sorted not whole list. can me please? thank you. here code sort internal list (ie. first line of matrix) according y. private void ord_horiz (list<point> tab) { boolean ordered_horiz = false; int size = tab.size(); while(!ordered_horiz) { ordered_horiz = true; for(int i=0 ; < size-1 ; i++) { if(tab.get(i).y > tab.get(i+1).y) { swap(tab, i, i+1); ordered_horiz = false; } } size--; } } private void swap(list<point> tab, int ind1, int ind2) { point c; c = tab.get(ind1); tab.set(ind1, tab.get(ind2)); tab.set(ind2, c); } here

xpages - Pager not displaying correct navigation in View panel for categorized view in IBM notes 9 -

i have created single category end view. mapped end view view panel control in xpages in notes 9 , set following property open xpage view in collapse mode. expandlevel "1" in properties of xpage view panel. initially view panel displaying in collapsed mode. when expand category, expand category , show list of document(default 30 entries display). navigate next page see rest of document , categories. when expand category, pager page count not changed. not calculating pages. unable find link enable navigate in pager. its work me in notes 853 , notes 852. any 1 else facing issue? reproduce issue create single category backend view(make sure have more document display in more pages) , map xpage view control , disable expand level property its not work me in both web browser , xpinc. is problem notes 9? or else? need enable other setting in notes 9 make work? using categories in views not recommended ui pattern web applications, might consider using alt

Injecting transaction in OSGi reference listener with blueprint -

i have osgi bundle has reference listener class keeping track of services registered other osgi bundles. have configured reference listener blueprint follows , have deployed necessary aries bundles in felix: <?xml version="1.0" encoding="utf-8" standalone="no"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0"> <reference-list id="servicelist" interface="com.test.myservice" availability="optional"> <reference-listener bind-method="bind" unbind-method="unbind"> <bean class="com.test.myservicemonitor" /> </reference-listener> </reference-list> </blueprint> everything works configuration , bind , unbind methods of myservicemonitor class called when servi