Search Results

Search found 3286 results on 132 pages for 'arthur br'.

Page 31/132 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • How to pass dynamic values using MVC AJax.BeginForm

    - by Arthur
    I'm using MVC and AJax.BeginForm to do some ajax updating of my page. The BeginForm code looks something like: using (Ajax.BeginForm("HandleCrop", "Card", new { accept = true, id = Model.ImageUpload.ID, file = Model.ImageUpload.File, imageCropX = Model.CropInfo.X, imageCropY = Model.CropInfo.Y, imageCropWidth = Model.CropInfo.Width, imageCropHeight = Model.CropInfo.Height }, new AjaxOptions { HttpMethod = "POST", OnComplete = "ConfirmCompleted", OnSuccess = "ReloadUpload", OnFailure = "Failure" }, null)) The Model.CropInfo is being put in as hidden fields like so: <%=Html.HiddenFor(m => m.CropInfo.X) %> <%=Html.HiddenFor(m => m.CropInfo.Y) %> <%=Html.HiddenFor(m => m.CropInfo.Width) %> <%=Html.HiddenFor(m => m.CropInfo.Height) %> However, these values are being dynamically modified by some client side javascript, and these values need to be posted through the Ajax call back to the server. The above code will obviously not work as the imageCrop.. parameters in the Ajax form are being filled when the page is rendered (therefore being all 0). My question is: what is the correct way to approach this situation?

    Read the article

  • Cutomizing dired

    - by Arthur Debert
    I just came across this dired mode screen at Wikipedia. I am looking into those customizations. Regarding colors, I guess just specifying the correct faces will do, but how do I get dired to show file sized in kbytes by default? And the available space in MBs (top line)?

    Read the article

  • Writing Java code in Matlab?

    - by scooziexp
    Hi, I'm trying to use the Java commands pw.println() and br.readLine() in Matlab because I have set up a socket (input_socket2) between Matlab and a command-line program I want to control using Java classes BufferedReader and PrintWriter. Before the following snippet of code, I implemented another socket that goes between 2 computers. This works great and I also know that the following snippet of code successfully opens up a communication line between Matlab and the other program. However, Matlab throws an error at pw.println('noop'). I think it has something to do with syntax, but I'm not sure how to write the command in Matlab syntax then: try input_socket2 = Socket(host2,port2); input_stream2 = input_socket2.getInputStream; d_input_stream2 = DataInputStream(input_stream2); br = BufferedReader(InputStreamReader(input_stream2)); pw = PrintWriter(input_socket2.getOutputStream,true); pw.println('noop') br.read end Any ideas?

    Read the article

  • Getting the correct node

    - by YsoL8
    Hello I have this structure in my dom: <label>London<input type="checkbox" name="London"></label><br> <div class="innerpost"> <label>N1 2AB<input type="checkbox" name="N1 2AB"></label><br> <label>E1 1AB<input type="checkbox" name="E1 1AB"></label><br> </div> I need a way to select the div from the first checkbox. Something like parentNode.parentNode.getElementsByTagName("div"); But I'm not getting it right - that particular line selects all the divs one parent above the one I need.

    Read the article

  • What is this for an IP in my google app engine log file?

    - by Christian Harms
    I get many normal log lines in my google app engine application. But today I go these instead the 4-part number: 2a01:e35:2f20:f770:6c54:3ee8:67fb:df8 What is this for an format? ipv6 are 6 numbers, mac address too... Normal logfile line: 187.14.44.208 - - [19/Mar/2010:14:31:35 -0700] "GET /geo_data.js HTTP/1.1" 200 776 "http://www.xxx.com.br/spl19/index.php?refid=gv_av_ri" "Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729),gzip(gfe)" This special logfile line: 2a01:e35:2f20:f770:6c54:3ee8:67fb:df8 - - [18/Mar/2010:17:00:37 -0700] "GET /geo_data.js HTTP/1.1" 500 450 "http://www.xxx.com.br/spl19/index.php?refid=cm_av_ri" "Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-PT; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe)"

    Read the article

  • How to map a test onto a list of numbers

    - by Arthur Ulfeldt
    I have a function with a bug: user> (-> 42 int-to-bytes bytes-to-int) 42 user> (-> 128 int-to-bytes bytes-to-int) -128 user> looks like I need to handle overflow when converting back... Better write a test to make sure this never happens again. This project is using clojure.contrib.test-is so i write: (deftest int-to-bytes-to-int (let [lots-of-big-numbers (big-test-numbers)] (map #(is (= (-> % int-to-bytes bytes-to-int) %)) lots-of-big-numbers))) This should be testing converting to a seq of bytes and back again produces the origional result on a list of 10000 random numbers. Looks OK in theory? except none of the tests ever run. Testing com.cryptovide.miscTest Ran 23 tests containing 34 assertions. 0 failures, 0 errors. why don't the tests run? what can I do to make them run?

    Read the article

  • Accessing the params hash for year and month rails and using in helper

    - by Matt
    So I took some php code and turned it into a calendar with a helper to make a simple calendar. I got my data from inside the helper: def calendar_maker a = Time.now b = a.month d = a.year h = Time.gm(d,b,1) #first day of month Now I want to try and do it with parameters within my method #from the helper file def calendar_maker(year, month) a = Time.now b = month c = year h = Time.gm(d,b,1) #first day of month #from my html.erb file <%= @month %> and <%= @year %> <%= params["month"] %><br /> <%= params["action"] %><br /> <%= params["year"] %><br /> <%= calendar_maker( @year, @month) %> #from controller file def calendar @month = params[:month] @year = params[:year] end Anyways mistakes were made and not finding documentation anywhere or not looking in the right place. How do I get this to work with my params hash. Thanks for the help.

    Read the article

  • How can I make email template in Zend Framework?

    - by Billy
    I want to make email templates in Zend Framework. For example, <html> <body> Dear {$username$}, <br> This is a invitation email sent by your {$friend$}.<br> Regards,<br> Admin </body> </html> I want to make this file, get it in Zend framework, set those parameters (username, friend) and then send the email. How can I do that? Does Zend support this?

    Read the article

  • why can't I call .update on a MessageDigest instance

    - by Arthur Ulfeldt
    when i run this from the repl: (def md (MessageDigest/getInstance "SHA-1")) (. md update (into-array [(byte 1) (byte 2) (byte 3)])) I get: No matching method found: update for class java.security.MessageDigest$Delegate the Java 6 docs for MessageDigest show: update(byte[] input) Updates the digest using the specified array of bytes. and the class of (class (into-array [(byte 1) (byte 2) (byte 3)])) is [Ljava.lang.Byte; Am I missing something in the definition of update? Not creating the class I think I am? Not passing it the type I think I am?

    Read the article

  • Relogging a user in with different Spring Security Authorities programmatically

    - by user1331982
    PreReq: User logs in and is given roles got from the database using a custom implementation of userService. i.e. authentication-provider user-service-ref="securityPolicyService" The implemented method loadUserByUsername gets called and the roles are load for the user for the particular club they are logging into, Default one is loaded first time in. The user then click on a different club from the UI and I call a method on a service that gets the new list of authorities for this club. I then perform the following: Object principle = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); SecureMember sm = (SecureMember) principle; Authentication auth = new UsernamePasswordAuthenticationToken(sm, null, newAuthories); <br><br> SecurityContextHolder.getContext().setAuthentication(auth);<br> request.getSession(false).invalidate(); SecureMember extends User from SpringFramework. The problem is the SecureMember authorities are never updated with the new ones. thanks Gary

    Read the article

  • PHP Export Date range

    - by menormedia
    I have a working database export to xls but I need it to export a particular date range based on the 'closed' date. (See code below). For example, I'd like it to export all 'closed' dates for last month and/or this month (Range: Sept 1, 2012 to Sept 30, 2012 or Oct 1, 2012 to Oct 31, 2012) <?PHP //EDIT YOUR MySQL Connection Info: $DB_Server = "localhost"; //your MySQL Server $DB_Username = "root"; //your MySQL User Name $DB_Password = ""; //your MySQL Password $DB_DBName = "ost_helpdesk"; //your MySQL Database Name $DB_TBLName = "ost_ticket"; //your MySQL Table Name //$DB_TBLName, $DB_DBName, may also be commented out & passed to the browser //as parameters in a query string, so that this code may be easily reused for //any MySQL table or any MySQL database on your server //DEFINE SQL QUERY: //edit this to suit your needs $sql = "Select ticketID, name, company, subject, closed from $DB_TBLName ORDER BY closed DESC"; //Optional: print out title to top of Excel or Word file with Timestamp //for when file was generated: //set $Use_Titel = 1 to generate title, 0 not to use title $Use_Title = 1; //define date for title: EDIT this to create the time-format you need $now_date = DATE('m-d-Y'); //define title for .doc or .xls file: EDIT this if you want $title = "MDT Database Dump For Table $DB_TBLName from Database $DB_DBName on $now_date"; /* Leave the connection info below as it is: just edit the above. (Editing of code past this point recommended only for advanced users.) */ //create MySQL connection $Connect = @MYSQL_CONNECT($DB_Server, $DB_Username, $DB_Password) or DIE("Couldn't connect to MySQL:<br>" . MYSQL_ERROR() . "<br>" . MYSQL_ERRNO()); //select database $Db = @MYSQL_SELECT_DB($DB_DBName, $Connect) or DIE("Couldn't select database:<br>" . MYSQL_ERROR(). "<br>" . MYSQL_ERRNO()); //execute query $result = @MYSQL_QUERY($sql,$Connect) or DIE("Couldn't execute query:<br>" . MYSQL_ERROR(). "<br>" . MYSQL_ERRNO()); //if this parameter is included ($w=1), file returned will be in word format ('.doc') //if parameter is not included, file returned will be in excel format ('.xls') IF (ISSET($w) && ($w==1)) { $file_type = "msword"; $file_ending = "doc"; }ELSE { $file_type = "vnd.ms-excel"; $file_ending = "xls"; } //header info for browser: determines file type ('.doc' or '.xls') HEADER("Content-Type: application/$file_type"); HEADER("Content-Disposition: attachment; filename=MDT_DB_$now_date.$file_ending"); HEADER("Pragma: no-cache"); HEADER("Expires: 0"); /* Start of Formatting for Word or Excel */ IF (ISSET($w) && ($w==1)) //check for $w again { /* FORMATTING FOR WORD DOCUMENTS ('.doc') */ //create title with timestamp: IF ($Use_Title == 1) { ECHO("$title\n\n"); } //define separator (defines columns in excel & tabs in word) $sep = "\n"; //new line character WHILE($row = MYSQL_FETCH_ROW($result)) { //set_time_limit(60); // HaRa $schema_insert = ""; FOR($j=0; $j<mysql_num_fields($result);$j++) { //define field names $field_name = MYSQL_FIELD_NAME($result,$j); //will show name of fields $schema_insert .= "$field_name:\t"; IF(!ISSET($row[$j])) { $schema_insert .= "NULL".$sep; } ELSEIF ($row[$j] != "") { $schema_insert .= "$row[$j]".$sep; } ELSE { $schema_insert .= "".$sep; } } $schema_insert = STR_REPLACE($sep."$", "", $schema_insert); $schema_insert .= "\t"; PRINT(TRIM($schema_insert)); //end of each mysql row //creates line to separate data from each MySQL table row PRINT "\n----------------------------------------------------\n"; } }ELSE{ /* FORMATTING FOR EXCEL DOCUMENTS ('.xls') */ //create title with timestamp: IF ($Use_Title == 1) { ECHO("$title\n"); } //define separator (defines columns in excel & tabs in word) $sep = "\t"; //tabbed character //start of printing column names as names of MySQL fields FOR ($i = 0; $i < MYSQL_NUM_FIELDS($result); $i++) { ECHO MYSQL_FIELD_NAME($result,$i) . "\t"; } PRINT("\n"); //end of printing column names //start while loop to get data WHILE($row = MYSQL_FETCH_ROW($result)) { //set_time_limit(60); // HaRa $schema_insert = ""; FOR($j=0; $j<mysql_num_fields($result);$j++) { IF(!ISSET($row[$j])) $schema_insert .= "NULL".$sep; ELSEIF ($row[$j] != "") $schema_insert .= "$row[$j]".$sep; ELSE $schema_insert .= "".$sep; } $schema_insert = STR_REPLACE($sep."$", "", $schema_insert); //this corrects output in excel when table fields contain \n or \r //these two characters are now replaced with a space $schema_insert = PREG_REPLACE("/\r\n|\n\r|\n|\r/", " ", $schema_insert); $schema_insert .= "\t"; PRINT(TRIM($schema_insert)); PRINT "\n"; } } ?>

    Read the article

  • Why is PHP date() adding +1 hour in diff calculation?

    - by Lex
    Hi there, I've got kind of a tricky question, I already searched every related question on Stackoverflow and neither solved my conundrum, although I think I'm running in circles, so here's the question: I've got this code: $val = (strtotime('2010-03-22 10:05:00')-strtotime('2010-03-22 09:00:00')) This returns correctly $val = 3900 (3600 seconds = 1 hour, 300 seconds = 5 mins) But doing this: echo date("H:i",$val)."<br>"; returns 02:05 even doing this: echo date("H:i",3900)."<br>"; returns 02:05 (just to be naively sure) Doing this: echo date("H:i eTO",3900)."<br>"; returns 02:05 System/LocaltimeCET+0100 Which is correct, my timezone is CET and is +1. What's going on? Is date() correcting the timezone for some reason? Or am I doing anything wrong?

    Read the article

  • How to give FTP address in java?

    - by i2ijeya
    I have written the code which downloads the file from FTP server. Since I have my FTP server locally and I want to access like "ftp://localhost/alfresco". It was alfresco's FTP. I have the following Code public class FtpTransfer { public static final void main(String[] args) { FTPClient ftp = new FTPClient(); FileOutputStream br = null; try { ftp.connect("ftp://localhost/alfresco"); ftp.login("admin", "admin"); String file = "KPUB//Admin//TMM//Pickup//TMM_TO_ARTESIA_06152010220246.xml"; br = new FileOutputStream("file"); ftp.retrieveFile("/"+file, br); System.out.println("Downloaded..."); } catch(IOException exception) { System.out.println("Error : "+exception); } } } The following exception occurs. Error : java.net.UnknownHostException: ftp://localhost/alfresco Please let me know how should I give the FTP Host Address?

    Read the article

  • CSS Containers and Framing

    - by CaffeineAddiction
    I am attempting to code a dynamic object for use in an unordered list. I have a mock up of the HTML here: <ul class='Main'> <li class='Node'> <span class='Node_Light'> </span> <span class='Node_Control'> <span class='Ctrl_Name'> <span class='CtrlN_Text'>Random Name</span> <span class='CtrlN_Edit'>[%]</span> </span><br/> <span class='Ctrl_ID'>ff:ff:ff:ff:ff:ff</span><br/> <span class='Ctrl_Buttons'> <span class='CBttn_On'>[%]</span> <span class='CBttn_Off'>[%]</span> <span class='CBttn_Blink'>[%]</span> <span class='CBttn_Config'>[%]</span> <span class='CBttn_Graph'>[%]</span> </span> </span> <span class='Node_Data'> <span class='ND_Sens0'> <span class='Sens_Lable'>temp:</span> <span class='Sens_Data'>72</span> <span class='Sens_Units'>&#176;F</span> </span><br/> <span class='ND_Sens1'> <span class='Sens_Lable'>Sens1:</span> <span class='Sens_Data'>Off</span> <span class='Sens_Units'></span> </span><br/> <span class='ND_Sens2'> <span class='Sens_Lable'>Sens2:</span> <span class='Sens_Data'>Off</span> <span class='Sens_Units'></span> </span><br/> <span class='ND_Sens3'> <span class='Sens_Lable'>Sens3:</span> <span class='Sens_Data'>Off</span> <span class='Sens_Units'></span> </span><br/> <span class='ND_Sens4'> <span class='Sens_Lable'>Sens4:</span> <span class='Sens_Data'>Off</span> <span class='Sens_Units'></span> </span> </span> </li> </ul> and I am attempting to wrangle this HTML into something like: My first problem was that the 3x Outer elements would stack vertically instead of horizontally ... I solved this with the following CSS, but it doesnt feel like the right solution: ul { list-style-type: none; padding:0; margin:0; } .Node { } .Node_Light { height:6em; width:2em; position:absolute; border-style:solid; border-width:1px; } .Node_Control { height:6em; width:15em; position:absolute; left:2.55em; border-style:solid; border-width:1px; } .Node_Data { height:6em; width:6em; position:absolute; left:17.6em; border-style:solid; border-width:1px; } One thought was to use a table, but I dont think that is the correct solution either. Ideas? I would like to have the content dynamically resize on page resize and am not opposed to doing it all via JavaScript, but I have a feeling it would be more efficient to do it via CSS ... I just dont know where to begin.

    Read the article

  • Is there a better way to declare an empty, typed matrix in MATLAB?

    - by Arthur Ward
    Is there a way to "declare" a variable with a particular user-defined type in MATLAB? zeros() only works for built-in numeric types. The only solution I've come up with involves using repmat() to duplicate a dummy object zero times: arr = repmat(myClass(), [1 0]) Without declaring variables this way, any code which does "arr(end+1) = myClass()" has to include a special case for the default empty matrix which is of type double. Have I missed something a little more sensible?

    Read the article

  • Just an experiment changing the application data path

    - by Arthur
    When I change the Appication Data path in windows xp registry to a network folder I get this error message on the next system startup: "windows cannot load the user's profile but has logged you with the default profile system" The registry keys are: "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]" "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]" under the names "AppData" and "Local AppData" I dont care if "Windows logins you with the default profile system" but is there a way to disable that message, or change the message timeout form 30 seconds to 0?,or maybe create an script that changes the Application Data path every system startup? P.S. The computer with the shared folder is always on.

    Read the article

  • Java BufferedReader behavior in CSV vs TXT file

    - by Gabriel
    If i try to read a CSV file called csv_file.csv. The problem is that when i read lines with BufferedReader.readLine() it skips the first line with months. But when i rename the file to csv_file.txt it reads it allright and it's not skipping the first line. Is there an undocumented "feature" of BufferedReader that i'm not aware? Example of file: Months, SEP2010, OCT2010, NOV2010 col1, col2, col3, col4, col5 aaa,,sdf,"12,456",bla bla bla, xsaffadfafda and so on, and so on, "10,00", xxx, xxx The code: FileInputStream stream = new FileInputStream(UploadSupport.TEMPORARY_FILES_PATH+fileName); BufferedReader br = new BufferedReader(new InputStreamReader(stream, "UTF-8")); String line = br.readLine(); String months[] = line.split(","); while ((line=br.readLine())!=null) { /*parse other lines*/ }

    Read the article

  • How to get Anchor text using DomDocument?

    - by Click Upvote
    Say I have this html: <a href="http://example.com">Test</a> I parse it using dom document with this code: $dom = new DomDocument(); @$dom->loadHTML($html); $urls = $dom->getElementsByTagName('a'); And then I run this code: foreach ($urls as $url) { //echo "<br> {$url->getAttribute('href')} , {$url->getAttribute('title')}"; foreach ($url->attributes as $a) { echo "<br>$a->name is $a->value"; } echo "<hr><br>"; } When I do this, I only see 'href' as an attribute of the url, there's no way to get the 'anchor text' (in the above case 'Test'). How can I get the anchor text of the link?

    Read the article

  • GAE datastore - count records between one minute ago and two minutes ago?

    - by Arthur Wulf White
    I am using GAE datastore with python and I want to count and display the number of records between two recent dates. for examples, how many records exist with a time signature between two minutes ago and three minutes ago in the datastore. Thank you. #!/usr/bin/env python import wsgiref.handlers from google.appengine.ext import db from google.appengine.ext import webapp from google.appengine.ext.webapp import template from datetime import datetime class Voice(db.Model): when = db.DateTimeProperty(auto_now_add=True) class MyHandler(webapp.RequestHandler): def get(self): voices = db.GqlQuery( 'SELECT * FROM Voice ' 'ORDER BY when DESC') values = { 'voices': voices } self.response.out.write(template.render('main.html', values)) def post(self): voice = Voice() voice.put() self.redirect('/') self.response.out.write('posted!') def main(): app = webapp.WSGIApplication([ (r'.*', MyHandler)], debug=True) wsgiref.handlers.CGIHandler().run(app) if __name__ == "__main__": main()

    Read the article

  • How can I push to a git-svn repo?

    - by Arthur Ulfeldt
    I cloned an svn repo with git svn clone ... and now I want to push changes to it. after that I will use this repo to rebase everything and commit back to svn. The problem that pushing to a non-bare repo seems to not be a good idea, and git svn seems unhappy about working with a bare one?

    Read the article

  • jQuery .parent() does not work

    - by Misha Moroshko
    Why the following code fails with: Error: class_a_jquery_objects[0].parent is not a function ? HTML: <div> <div class='a b'></div> <div class='b c'></div> <div class='c a'></div> </div> <div id='log'></div> JS: $(function() { var class_a_jquery_objects = $(".a"); $("#log").append(class_a_jquery_objects.length + "<br />"); $("#log").append(class_a_jquery_objects[0] + "<br />"); $("#log").append(class_a_jquery_objects[0].parent() + "<br />"); });

    Read the article

  • Business Tier | client state in desktop application- way around Stateful Session Beans?

    - by arthur
    I read positive inputs on the following posts concerning client state management: Stateful EJBs in web application?, here, and here. I want to know how implement such client state management for desktop applications (Swing, AWT, SWT, and other). let's assume there are n desktop clients supposed to use some (remote) services provided on an Application Server. How to maintain a separate and permanent data state for each client , distinct from the other without have to use using stateful session Beans (SFSB) ? is that even possible on this application type ? With Webapp(Servlets / JsSF and JSP) some can avoid using SFSB by HttpSession object and/or coupling it with stateless session beans (SLSB). HttpSession object would keep information for each (Web)client separate and the SLSB would play the business logic music. But HttpSession objects aren't present on desktop application and I go stuck with only SFSB and SLSB. Knowing the problems(Concurrency, Error Handling, usw ) of SFSB, I would have not wanted to use it. What would be the other options? is there only SFSB available? Thanks in advances

    Read the article

  • When are referenced Assemblies loaded?

    - by Daniel
    I wrote a program that makes a reference to Microsoft.Web.Administration.dll, which is not present on Windows Server 2003. The program checks for the os and does not reference the dll if the os is 2003. if(OSVersion == WindowsServer2003) //do the job without referencing the Microsoft.Web.Administration.<br> else if(OSVersion == WindowsServer2008) //reference the Microsoft.Web.Administration.dll file.<br> When I tested this program on Windows Server 2003, an error occured telling me it couldn't locate the Microsoft.Web.Administration.dll. But when I separated the if-else block into 2 different methods as below, and the error did not occur. if(OSVersion == WindowsServer2003) //do the job without referencing the Microsoft.Web.Administration.<br> else if(OSVersion == WindowsServer2008) //DoIt2008Style(); So I wanted to know about reference file loading time in more detail. could you point me to some resources?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >