Posts

Showing posts from February, 2010

perl - How to split in blocks a file and count the intermediate lines -

i have file this: fixedstep chrom=chr22 start=14430001 step=1 144300010.000 0.002 0.030 0.990 0.000 0.000 0.000 fixedstep chrom=chr22 start=14430001 step=1 0.000 0.000 0.000 and take number of start every line starts fixedstep , put counter in every of other lines. eg. fixedstep chrom=chr22 start=14430001 step=1 14430001 0.000 14430002 0.002 14430003 0.030 fixedstep chrom=chr22 start=16730005 step=1 16730005 0.990 16730006 0.000 ......... i wrote code doesn't work. open $scores_info, $scores_file or die "could not open $scores_file: $!"; while( $sline = <$scores_info>) { if ($sline=~ m/fixedstep/) { @data = split(' ', $sline); @begin = split('=', $data[2]); $start = $begin[1]; print "$start\n"; $nextline = <$scores_info>; $start++; print $start . "\t" . $nextline; } an print in new file. me please?? thank in advance if encou

php - Issue with retrieving some values out of my Database -

<?php include 'session.php'; ?> <html> <head> <link href="css/adminopmaak.css" rel="stylesheet" type="text/css"/> <?php mysql_connect("localhost", "admin", "") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); ?> </head> <body> <div class = "header"> <a href="index.php"><img src="home-icon.png" width="25" height ="25"></a> </div> <!--header--> <div class = "menu"> </div> <!--menu--> <div class ="content"> <form action="login.php" method="post"> <input type="text" align="center" name="account" value="<?php echo isset ($_post['account'])?$_post['account']:"";?>"/> <br /> <input

javadoc - Reading Java class documentation from code into a GUI -

my question today have gui interfaces program. have text area within gui display class documentation of specific components user selects. example: user selects 'protocol' setting want show javadoc 'protocol'. how go recognising correct javadoc , presenting within text area? i suggest 3 possible approaches: as part of build, create javadoc html normal, , include in deployable, , have gui use embedded browser of kind (eg. webkit) study how it's been done other gui's, such eclipse's javadoc view, or using a project extends eclipse javadoc view use java source (javadoc) parsing library / tool , such qdox example code qdox: javadocbuilder builder = new javadocbuilder(); builder.addsource(new filereader("myfile.java"));

PHP process takes a long time to finish, how can I farm it off to a worker -

i have lot of calculations on single thread (request/response). how can multi-thread work? php cant multi-thread, can fork - when not going through apache! look @ using worker system, php-resque it makes life easier :)

javascript - How to Hide an image stored in second TD based on the values of table stored in first TD with JQuery? -

i have 2 columns table first td containing table 3 rows of contents , second td image below:- <table id="mytable" cellspacing="0" cellpadding="0"> <tbody> <tr> <td style="padding-top: 10px;"> <table> <tbody> <tr> <td align="left"> wellness , care </td> </tr> <tr> <td align="left"> 630 woodbury drive </td> </tr> <tr> <td align="left"> 641.613.1450 </td> </tr> <tr> <td align="left"> no webaddress </td>

Reference to static image in django using template -

for fun monitoring free disk space on linux box. have indexed mount points , store contents in mysql database. want display info using django. cron job automatically creates plots of free space last 24 hours. named "graph_day_drive_1.png" "graph_day_drive_3.png", number stands id of mount point. have put these images in static directory of app. now, want display them when showing details view selected mount point. i've read usual way access image is: <img src="{% static "diskspace/graph_day_drive_1.png" %}" alt="last 24h"/><br> which, of course, displays same image regardless of drive select. i've tried using following (drive refers model read database): <img src="{% static "diskspace/graph_day_drive_{{ drive.id }}.png" %}" alt="last 24h"/><br> but doesnt work creates following html code: <img src="/static/diskspace/graph_day_drive_%7b%7b%20drive

c# - Bitmask (flags) enum beyond 64 with bitarray with logical grouping stored in database -

the first answer question: what when bit mask (flags) enum gets large precisely i'm trying do, don't know how store in database using linq sql , tie users without creating 2 tables each thing/logical group. this best explained via code (these linqpad friendly although incomplete): // requirements: // 1) using linq sql // 2) track user's crud rights in different parts of application (parts referred below 'things') // example: thinga.create, thingb.read, thingb.update, thingc.delete // desired usage: if (user.isallowed(thinga.create)) { // allowed } else { // not allowed } // 3) allow more 64 'things' // 4) not want refer permissions using strings user.isallowed("create thinga"); // // scenario a: works, limited adding 60 'things' // example usage: // user bob = new user(); // var desiredpermissions = permissions.create | permissions.thinga; // permission = unique binary value combination of flags // if ((bob.permissions & desir

Spring MVC, Returning HTML -

here controller method: @requestmapping(value = "/login/{id}", method = requestmethod.get) public string dologin(@pathvariable long id, httpservletrequest request, httpservletresponse response, model model) { logger.info(string.format( constants.logmessages.new_get_request_from_ip, request.getremoteaddr())); logger.info("/login/{id}"); return "login"; } and appservlet-context.xml: <!-- resolves views selected rendering @controllers .jsp resources in /web-inf/views directory --> <beans:bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <beans:property name="prefix" value="/web-inf/views/" /> <beans:property name="suffix" value=".html" /> </beans:bean> the exception in method : warn pagenotfound - no mapping found http request uri [/project/web-inf/views/login.html] in dispatcherservlet name &#

c++ - Multicasting big packet contain all info to multiple clients vs individual packets to targeted clients -

i'm writing c++ application mymasterapp sends information (osc via udp) multiple clients (about 5-10), mobile devices (android or iphone) via wifi. each device receive unique information, of same type. 100-200 bytes per device, , i'll updating devices @ 30hz. i send unique data packet each device, or create 1 big structure contains each of unique bits of data each device, target id, multicast devices, each device picks out data needs. i.e. send data1 device1 send data2 device2 send data3 device3 send data4 device4 vs create new data contains data1, data2, data3 etc. multicast data devices, , each device picks relevant data use. before attempt both approaches, there theoretical, or recorded practical advantages of 1 on other (e.g. better performance, less collision, lost packets etc)? or differences negligible? i have related network performance question same project @ should listen on different ports, or same port? one of major advantages of

c# - System::Drawing::Bitmap to unsigned char * -

i have c# .net library grabs frames camera. need send frames native application takes images unsigned char* . i take frames system::drawing::bitmap . so far can retrieve byte[] bitmap . test done image of resolution 400*234, should getting 400*234*3 bytes 24bpp rgb image requires. however, i'm getting byte[] of size 11948. this how convert bitmap byte[] : private static byte[] imagetobyte(bitmap img) { imageconverter converter = new imageconverter(); return (byte[])converter.convertto(img, typeof(byte[])); } what proper way convert system::drawing::bitmap rgb unsigned char* ? this has done using lockbits method, here code example: rectangle rect = new rectangle(0, 0, m_bitmap.width, m_bitmap.height); bitmapdata bmpdata = m_bitmap.lockbits(rect, imagelockmode.readonly, m_bitmap.pixelformat); intptr ptr = bmpdata.scan0; int bytes = math.abs(bmpdata.stride) * m_bitmap.height; byte[] rgbvalues = new byte[bytes]; ma

How I view every contents in jquery dialog using php -

i creating table using php , how create table body. while (mysqli_stmt_fetch($stmt)) { // create table body $html .= "<tr>\n"; $html .= " <td>$title</td>\n"; $html .= " <td>$date</td>"; $html .= " <td align='center'>\n"; $html .= " <a href='#'>\n"; $html .= " <span class='view' title='view comment'></span>\n"; $html .= " </a>\n"; $html .= " </td>\n"; $html .= " <td class='td_catchall' align='center'>\n"; $html .= " <a href='#'>\n"; $html .= " <span class='edit' title='edit comment'></span>\n"; $html .= " </a>\n"; $html .= " </td>

unix - Explain awk command -

today searching command online print next 2 lines after pattern , came across awk command i'm unable understand. $ /usr/xpg4/bin/awk '_&&_--;/pattern/{_=2}' input can explain it? see https://stackoverflow.com/a/17914105/1745001 answer duplicated here.

office interop - What are all the possible types in an Outlook folder? -

i trying iterate through items collection of inbox folder of account. class of item if ndr message? reportitem. can see object in outlookspy : select item, click item button on outlookspy ribbon.

c++ - Redefining QTreeWidgetItem::operator< -

my main goal here redefine operator< can sort columns numerically instead of alphabetically. code have far: mainwindow.h #ifndef mainwindow_h #define mainwindow_h //bunch of includes... #include <qtreewidgetitem> #include <qtreewidget> extern qsqldatabase db; extern qstring prefix; extern qstring site; extern qstring dbname; extern qstring user; namespace ui { class mainwindow; } class clientinfo; class mainwindow : public qmainwindow { q_object public: explicit mainwindow(qwidget *parent = 0); void rpopulate(); void rbookingdisplay(); qpushbutton *button; ~mainwindow(); public slots: //slots... private: ui::mainwindow *ui; void closeevent(qcloseevent *close); }; class treewidgetitem : public qtreewidgetitem { public: treewidgetitem(qtreewidget *tree) : qtreewidgetitem(tree) {} treewidgetitem(qtreewidget * parent, const qstringlist & strings) : qtreewidgetitem (parent,strings) {} bo

how to display multivalued fields in velocity -

i want display multivalued field in velocity. the field extracted oracle database. my problem not display values per line. rather wraps rows 1 after other instead of creating new line new row. the follow code used: <div>#field('bugdescription')</div> how break down, it's more readable? use #foreach directive loop through values of collection.

c++ - Apache Cross Compilation Error ./gen_test_char: cannot execute binary file -

i looked quite time find solution bug. when trying cross-compile apache arm (i sure happen many other architectures), bug in server folder: ./gen_test_char: cannot execute binary file this means apache trying compile test_char.h generator actual device while need run on ubuntu cross-compiling. ubuntu not recognize compiled gen_test_char executable need compiled correctly ubuntu. i searched , searched , found several tries patch none of them worked. of these patches suggested directly apache dev group. but came across apache mail list . suggests straight forward solution patches not provide. compile gen_test_char app before trying cross-compile apache. did. , followed suggestions , worked charm. instead compile gen_test_char.c 1st like: gcc -wall -o2 -dcross_compile gen_test_char.c -s -o gen_test_char run , put output include folder (or placed normaly); and after compilation run desired output with: ./gen_test_char > test_char.h

PHP code for weather info of the visitor -

<?php require_once('geoplugin.class.php'); $geoplugin = new geoplugin(); // if wanted change base currency, uncomment following line // $geoplugin->currency = 'eur'; $geoplugin->locate(); echo "<p </span></p> </br>"; echo "<p style='text-align: center;'><span style='font-size: 50px; font-family: georgia,palatino; color: #202020 ;'> ip address {$geoplugin->ip} </span></p> </br>"; echo "<p style='text-align: center;'><span style='font-size: 16px; font-weight: bold; text-decoration: underline; font-family: georgia,palatino; color: #d67900;'> more information </span></p>"; echo "<p style='text-align: center;'><span style='font-size: 13px; font-family: georgia,palatino; color: #686868;'> country: {$geoplugin->countryname} | city: {$geoplugin->city} | country code: {$geoplugin->co

reporting services - How to default a SSRS report to PRINT PREVIEW -

i converting access reports ssrs reports client application. clients requirement is, when open ssrs report, should default open print preview. unable find property in ssrs sets it. suggestions? or help? please! nope, have assume mean when open 'reportviewer' can immiediately see option save file. however.... ssrs has pretty cool features built can depending on access rights , levels. you can give user rest uri can set 'format' render , give them report in format. excel , pdf junkies. works this: ( ensure understand landing page ssrs reports , service reportserver) http:// (servername)/reportserver/pages/reportviewer.aspx?%2f(directoryname)%2f(reportname)&rs:command=render&rs:format=pdf the rest uri on ssrs's service pretty cool can put parameters in, set rendering options, , choose other options. expanding on 1 if client needs on custom viewer, can consume ssrs web service in form object in html so: <form id="frmrender"

c# - WPF Control Visibility w/ ICommand & OnPropertyChanged -

i have user window 3 controls - 'execute' button, results control, , processing control. goal display processing control after execute pressed, hide when execute method finishes. however, processing control not display when assumed would... instead displays when (if) callback function creates window prompting user input called. the processing control has visibility bound bool processing in viewmodel via booltovis converter. execute method sets processing true @ start, false when finishes. setter of processing calls onpropertychanged. view model implements inotifypropertychanged. private bool _processing; public bool processing { { return _processing; } set { _processing = value; this.onpropertychanged("processing"); } } private relaycommand _search; public relaycommand search { { return _search ?? (_search = new relaycommand(p => onsearch(), p => ca

ruby on rails - (How) Can I use a form object for the edit/update routines? -

couldn't resist try out relaunched railsforum , crossposted question here . i have following form object (in rails 4) class stationform include virtus include activemodel::model # think unnecessary # extend activemodel::naming # include activemodel::conversion # include activemodel::validations # station attr_reader :station attribute :station_name, string attribute :station_description, string # address attr_reader :address attribute :address_url, string attribute :address_priority, integer attribute :address_is_active, boolean def persisted? false end def save if valid? persist true else false end end private def persist @station = station.create(name: station_name, description: station_description) @address = @station.addresses.create(url: address_url, priority: address_priority, is_active: address_is

sql - QTP Excel ADO Query -

Image
i developing test framework scratch , datamodel (xls) file in such way has each column each test scenario (each scenario has multiple steps part of script). depicted below now provide option in queries can know test cases need run based on execute row "y" flag , read particular rows excel has correspoinding parameters. e.g. test case: tc_001_login has 2 parameters susername & suserpin. @ run time query these 2 fields. during script know scenario name (tc_001_login) , fields (susername & suserpin). can tell me how can form query retrieve desired results , don't use select * from.... thanks i suggest have field names column header , test scenarios in row wise, form key value pair each scenarios.

javascript - radio button sets text box value -

$(function () { $("input[name='rbselection']").change(function () { switch (this.value) { case "1": caption = "daily"; form_content = '<div class="divborder"><input type="radio" class="inputed" name="every_days" value="every_days" /><span>every</span> <input type="text" size="1" name="every_days_amount" value="1" /> <span>day(s)</span><br /></div><div class="divborder"><input type="radio" class="inputed" name="every_dayweekday" disabled="disabled" value="every_weekday" /><span>every weekday</span></div>'; break; case "2": caption = "weekly"; form_content = '<div cla

html - CSS Background Hover Text -

i have background image getting set opacity 0.3, when hovering, getting set 0.8, seen in css code. the image code. <td background="images/1a.png" class="logo" width="160" height="160"> <div class="ch-info"> <h3><br>add new deal</h3> </div> </td> the css code. .ch-info { letter-spacing: 2px; font-size: 20px; /* margin: 0 30px; padding: 45px 0 0 0;*/ height: 140px; font-family: 'open sans', arial, sans-serif; -webkit-text-stroke: 1px black; color: #d3d3d3; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black; vertical-align:middle; text-align:center; } .logo { opacity:0.3; filter:alpha(opacity=30); /* ie8 , earlier */ background-repeat:no-repeat; background-position:center; } .logo:hover { opacity:0.8; filter:alpha(opacity=80); /* ie8 , earlier */ background-repeat:no-repeat;

apache - getting node.js app to work on port 3001 -

ok, 1 confusing me greatly! if add apache conf: proxyrequests off <proxy *> order deny,allow allow </proxy> <location /node> proxypass http://localhost:3001/ proxypassreverse http://localhost:3001/ </location> now, when go .../node, see following page: "welcome socket.io." but want happen, see page typing in website:3001, doesn't work. why might be? addiitional: the server has private ip, router forwards ip traffic on ports 3000 , 3001. can load page using curl or wget using private ip, not public ip. ideas why might be?

c# - WIFI Direct IP Address issue -

i have checked , found problem ip address being assigned connectionendpointpair carrying ip of wi-fi direct network adapter , don't know how open port on specific ip, ip different when ping pc windows listening on port 5009 , connection established when use wi-fi ip when use wi-fi direct ip addresses i'm having issue the wi-fi direct connection between device , windows 8.1 application ok, awaiting sockets connect not happen issue ? i error on visual studio: no connection made because target machine actively refused it. (exception hresult: 0x8007274d) on windows side using code: string deviceselector = wifidirectdevice.getdeviceselector(); deviceinformationcollection devicecollection = await deviceinformation.findallasync(deviceselector); if(devicecollection.count > 0) { try { wfddevice = await wifidirectdevice.fromidasync(devicecollection[0].id); wfddevice.connectionstatuschanged

c - When is MPI_wait necessary with non-blocking calls? -

i'm little bit confused when should call mpi_wait (or other variants such as: mpi_waitall, mpii_waitsome, etc). consider following situations: (note: pseudo code) case (1) mpi_isend (send_buffer, send_req); // local work mpi_probe (recv_msg); mpi_irecv (recv_buffer, recv_req); // wait msgs finish mpi_wait (recv_req); // <--- needed? mpi_wait (send_req); // <--- how this? so confusion stems mpi_probe in case. since blocking call, wouldn't mean blocks caller until message received? if case, think mpi_waits unnecessary here. how following case? case (2) mpi_isend (send_buffer, send_req); // local work mpi_probe (recv_msg); mpi_recv (recv_buffer); // wait msgs finish mpi_wait (send_req); // <--- necessary? similar first case mpi_irecv replaced blocking version. in case, message received time mpi_wait called means mpi_isend must have been finished ... also separate question, mean when mpi_probe blocking? block until of message received

plugins - Launch URL in Android Browser From Unity -

this follow question here i trying open url in browser in android device - modified link code - public void geturl(object url) { intent intent = new intent(intent.action_view, uri.parse(url.tostring())); startactivity(intent.createchooser(intent, "chose browser")); } but unfortunately unable open browser dialog. logcat stats - checkcomponentpermission, not doing fancy in project (this test project). any clue ? you need go manifest add this <manifest xlmns:android...> ..... <uses-permission android:name="android.permission.internet"></uses-permission> ...... </manifest>

java - Moving objects on path -

Image
i'd create moving arrows on path, this: how done? edit: i've succcessfully created these moving arrows way: i've divided path same parts , in beginning of each part i've placed arrow. positions of arrows periodically updated , when @ end, set position start. moving arrow i've implemented using this example of moving object along path . problem i'd have arrow in middle of path, not on or under it. how done? this ondraw method: @override protected void ondraw(canvas canvas) { canvas.drawbitmap(bmbackground, rsrc, rdest, null); canvas.drawpath(ptcurve, paint); //animate sprite matrix mxtransform = new matrix(); if (icurstep <= imaxanimationstep) { pm.getmatrix(fsegmentlen * icurstep, mxtransform, pathmeasure.position_matrix_flag + pathmeasure.tangent_matrix_flag); mxtransform.pretranslate(-bmsprite.getwidth(), -bmsprite.getheight()); canvas.drawbitmap(bmsprite, mxtransform, null);

Plist sort by name in Xcode? -

is there way sort plist in xcode name? <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>alpha</key> <string>this letter alpha</string> <key>beta</key> <string>this letter beta</string> etc... i got plist xcode refuses display plist in order.... any ideas? the problem isn't plist, data structure you're attempting place within it. dictionaries (in context <dict> ) store information in key-value relationship in there no concept of order. if wish keep objects of type in specific order, should save nsarray object plist instead of nsdictionary. arrays have concept of order store items numeric index representing order of items within array.

osx - Mouse events and switch -

i'm very new cocoa , i'm looking way execute applescript when mouse dragged, @ global level. need app running time , has no interface really, running in background , intercept mouse event in conditions. so far, bit of code can close want applescript executed countless times instead of once. - (void)applicationdidfinishlaunching:(nsnotification *)anotification { [nsevent addglobalmonitorforeventsmatchingmask:nsleftmousedraggedmask handler:^(nsevent *event) { if (nsleftmousedragged) //with more conditions nsapplescript *run = [[nsapplescript alloc] initwithsource:@"myscripthere"]; [run executeandreturnerror:nil]; } ]; }

Get the last value after spliting a string with hyphen in jquery? -

hi have string separated hyphens in , want lastindex of string , replace new value var str1="new-new_folder"; //replace new_folder folder str becomes var newstr1="new-folder"; var str2="new-new_folder-new_folder"; //replace last new_folder sub_folder str becomes var newstr2="new-new_folder-sub_folder"; can 1 me here? you can use split last index length minus one: var string = "some-hyphen-string"; var parts = string.split("-"); var lastpart = parts[parts.length - 1]; //lastpart final index string split demo: http://jsfiddle.net/acfru/

why string concatenation getting strange result in c++? -

i trying concatenate 2 strings in c++: "g1-2" + "-%02d.jpg" and getting following result: g1-2-1537817269.jpg why isn't result this: "g1-2-%02d.jpg" wild guess! you're printing concatenated string by printf(str); where str "g1-2-%02d.jpg" printf("g1-2-%02d.jpg"); ^^^^ // but, corresponding integer in following? as can see there's %02d in string , printf seek integer argument. can not find , undefined behavior occurs. in best situation prints out random value string. if guess true, try print string in form: printf("%s",str);   or use double % chis mentined: "g1-2-%%02d.jpg"

ruby on rails - requests are not considered local in test environment -

i have below code provide custom error page production environments unless rails.application.config.consider_all_requests_local rescue_from standarderror, :with => :render_500 end when run rspec spec/controllers/some_controller_spec.rb fine , value rails.application.config.consider_all_requests_local set true(which case in config/environments/test.rb) but when run rspec spec/controllers , configuration value set false , rendering custom error page in test why rails.application.config.consider_all_requests_local returned false when run rspec spec/controllers eventhough have set true in config/environments/test.rb ?

c# - How to modify the contents of a method in .NET -

i'd know if there way in can "shadow" function, following class in assembly reference of current project, cannot modify in way assembly's content. public class coordinatespace public function frompixelsy(byval y single) single return (me.m_originy + ((y * me.zoomy) / (me.m_dpiy / 100.0f))) end function public function topixelsy(byval y single) single dim num2 single = ((y - me.m_originy) / me.zoomy) * (me.m_dpiy / 100.0f) me.checkoverflow(num2) return num2 end function end class in addition, within assembly have many calls in many classes following: public class printer public function testpx() boolean dim c new coordinatespace return c.topixelsy(18) > 500 end function end class for project need above class return in frompixelsy when call topixelsy occurs. is there way this? if inherit class , override or shadow these methods, when testpx calls function topixelsy, calling coordinatespace method , n

javascript - id field not appending to div mvc 4 -

i have dialog opens items window. want select item click add have item's id appended div can submit db. i'm getting id in alert nothing appending. want append on add button click trying on click of li isn't working either. dialog options $('.ita').dialog({ autoopen: false, draggable: true, width: 450, resizable: false, dialogclass: "ui-dialog", modal: true, show: { effect: 'fade', duration: 200 }, buttons: [{ id: "addtoaddpage", text: "send trade", click: function () { // on close item selected added `div ita` //$(this).dialog("close"); }); get <li> clicked , append div ita $(".ita").on("click", "li", function () { //get div var div = $("#divtoaddto"); //get id of item var itemtoadd = $(this).attr("data-id"); alert(itemtoadd);//for debug //apendto? $(itemtoadd).appendto(div); });

javascript - Python server does not accept JSON sent by jquery ajax -

i use json manage data between client/server. however, works except json... think come python server, not specialist in server programming don't know how change in python server. python server simple because don't know how program inside. if don't use json works not efficient sort data. there easy way modify python server accept json (if comes python server)? here html: <form method="post" id="formu" > <textarea class="field span10" id="sequence" name="sequence" cols="4" rows="5"></textarea> <input type="submit" value="submit" class="btn btn-primary"> </form> my javascript: $(document).ready(function() { // formular $('#formu').on('submit', function(e) { e.preventdefault(); // prevent default behavior var sequence = $('#sequence').val();

windows store apps - XAML ComboBox default SelectedIndex is not shown -

i have combobox values, , want have 2 things working @ once. here combobox , want show 10 default value , bind double? distance property. <combobox grid.row="5" grid.column="1" selectedindex="1" selectedvalue="{binding distance, mode=twoway, converter={staticresource stringtodoubleconverter}}"> <comboboxitem>1</comboboxitem> <comboboxitem isselected="true">10</comboboxitem> <comboboxitem>100</comboboxitem> <comboboxitem>1000</comboboxitem> </combobox> and here converter: public class stringtodoubleconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, string language) { return null; } public object convertback(object value, type targettype, object parameter, string language) { comboboxitem item = value comboboxitem; if (item != null)

java - Why would my samba connection fail after an upgrade to windows 2012? -

Image
i have jsp running on tomcat 6.0.26 (windows server 2008 r2 sp1) has samba (jcifs-1.3.17.jar) connection list files found on remote server. this worked without problems until ad controller updated windows 2012 (fully patched). now, can't list files on samba share anymore. smbfile sffile = new smbfile("smb://myserver.com/share/", "subfolder", new ntlmpasswordauthentication("mydom", session.getattribute("userid").tostring(), session.getattribute("usercode").tostring())); smbfile[] asfdirectorylist = sffile.listfiles("webversion" + session.getattribute("plcode").tostring().substring(0,3) + "*.xls"); the second line returns following exception: org.apache.jasper.jasperexception: jcifs.smb.smbexception: network name cannot found. org.apache.jasper.servlet.jspservletwrapper.handlejspexception(jspservletwrapper.java:491) org.apache.jasper.servlet.jspservletwrapper.service(jspservlet

php - Building a URL rules map for MVC Framework -

i have built own php mvc framework after following tutorials online. have working using entry script in .htaccess follows: rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?rt=$1 [l,qsa] i have router class translates url , divides in action / controller segments: $route = (empty($_get['rt'])) ? '' : $_get['rt']; if (empty($route)) { $route = 'index'; } else { /*** parts of route ***/ $parts = explode('/', $route); $this->controller = $parts[0]; if(isset( $parts[1])) { $this->action = $parts[1]; } } what want take 1 step further , define url rewriting rules work in addition automatic routing. want able this: $rules = array( 'directory/listing/<id>' => 'listing/index', 'directory/<category>/<location>' => 'directory/view', ); in above, array key entered ur

java - How can I get the external sd card of a phone? Android -

i working on file manager android , training purpose. having issues trying external sd card of phone. tried many of solutions on here, none of them allow happen. how can this? have file adapater set takes file objects , lists them in listview. internal sd card, used enviorment.getexternalstorage() method, works phones sd card built in. know path sd card different every manufacturer, how can accomplish this? trying ask is

asp.net mvc - Html.ActionLink() not working for passing a C# object -

i'm trying pass object through actionlink method in mvc controller. the razor syntax: @html.actionlink("export excel","returnexcelofviewableresponses",new { searchobject = model.searchobject}) what's being displayed in markup: <a href="/educationagency/returnexcelofviewableresponses?searchobject=dto.searchobject" tabindex="29">export excel</a> the controller method being called fine, hence no reason post here. needs done actual values passed actionlink instead of dto.searchobject ? according html.actionlink method looks have right syntax (using mvc 4). you should able pass dto, assuming it's that, parameter actionlink : @html.actionlink("export excel","returnexcelofviewableresponses",model.searchobject) any public fields added query parameter key/value pair.

jquery - How to use Google Maps JavaScript API v3's Geocoding Service in Filter.js? -

i using filter.js in website along google maps api v3 shows in its demo/example(of filter.js) 1 difference, requirements use address instead of latitude or longitude , far know done using geocoding service of google maps. have modify of code: before addmarker: function(salon){ var = this; var marker = new google.maps.marker({ position: new google.maps.latlng(salon.lat, salon.lng), map: this.map, title: salon.title }); marker.info_window_content = salon.title + '<br/> treatments: ' + salon.treatments + '<br/> booking: ' + salon.bookings_1 + '<br/> address: ' + salon.address + '<br/><a href="' + salon.permalink + '"> view full details </a>' this.markers[salon.id] = marker google.maps.event.addlistener(marker, 'click', function() { that.infowindow.setcontent(marker.info_window_content) that.infowindow.open(that.map,marker); });