Daily Archives

Articles indexed Friday April 2 2010

Page 7/105 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • C# HttpListener Prefix issue with anything other than localhost

    - by jchristner
    Hello, I'm trying to use C# and HttpListener with a prefix of anything other than localhost and it fails (i.e. if I give it "server1", i.e. h t t p : / / l o c a l h o s t : 1 2 3 4 works, but h t t p : / / s e r v e r 1 : 1 2 3 4 fails (sorry, but the site thinks I'm trying to spam... the spaces are there because of that...) The code is... HttpListener listener = new HttpListener(); String prefix = "h t t p : / / s e r v e r 1 : 1 2 3 4/"; listener.Prefixes.Add(prefix); listener.Start(); The failure occurs on listener.Start() with an exception of "Access is denied.". Any ideas? Thanks!

    Read the article

  • LINQ to SQL join when there aren't results

    - by Boarder2
    Given the following database structure I'm trying to write a LINQ query that will return images grouped by tags it's associated with. So far I've got this: var images = from img in db.Images join imgTags in db.ImageTags on img.idImage equals imgTags.idImage join t in db.Tags on imgTags.idTag equals t.idTag where img.OCRData.Contains(searchText.Text) group img by new { t.TagName } into aGroup select new { GroupName = aGroup.Key.TagName, Items = from x in aGroup select new ImageFragment() { ImageID = x.idImage, ScanDate = x.ScanTime } }; Which works great. However, I also want to return Images that do not have any tags associated with them in a group of "(Untagged)" or something. I can't wrap my head around how I would do this without inserting a default tag for every image and that seems like generally not a very good solution.

    Read the article

  • Dynamically Added CheckBox Column is Disabled in GridView

    - by Mark Maslar
    I'm dynamically adding a Boolean column to a DataSet. The DataSet's table is the DataSource for a GridView, which AutoGenerates the columns. Issue: The checkboxes for this dynamically generated column are all disabled. How can I enable them? ds.Tables["Transactions"].Columns.Add("Retry", typeof(System.Boolean)); ds.Tables["Transactions"].Columns["Retry"].ReadOnly = false; In other words, how can I control how GridView generates the CheckBoxes for a Boolean field? (And why does setting ReadOnly to False have no effect?) Thanks!

    Read the article

  • .NET MVC custom routing with empty parameters

    - by user135498
    Hi All, I have a .net mvc with the following routes: routes.Add(new Route( "Lookups/{searchtype}/{inputtype}/{firstname}/{middlename}/{lastname}/{city}/{state}/{address}", new RouteValueDictionary( new { controller = "Lookups", action = "Search", firstname = (string)null, middlename = (string)null, lastname = (string)null, city = (string)null, state = (string)null, address = (string)null, SearchType = SearchType.PeopleSearch, InputType = InputType.Name }), new MvcRouteHandler()) ); routes.Add(new Route( "Lookups/{searchtype}/{inputtype}", new RouteValueDictionary( new { controller = "Lookups", action = "Search", firstname = "", middlename = "", lastname = "", city = "", state = "", address = "" }), new MvcRouteHandler()) ); routes.Add(new Route( "Lookups/{searchtype}/{inputtype}", new RouteValueDictionary( new { controller = "Lookups", action = "Search", firstname = "", middlename = "", lastname = "", city = "", state = "", address = "", SearchType = SearchType.PeopleSearch, InputType = InputType.Name }), new MvcRouteHandler()) ); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Account", action = "LogOn", id = "" } // Parameter defaults ); The following request works fine: http://localhost:2608/Lookups/PeopleSearch/Name/john/w/smith/seattle/wa/123 main This request does not work: http://localhost:2608/Lookups/PeopleSearch/Name/john//smith//wa/ Not all requests will have all paramters and I would like empty parameters to be passed to the method as empty string or null. Where am I going wrong? The method: public ActionResult Search(string firstname, string middlename, string lastname, string city, string state, string address, SearchType searchtype, InputType inputtype) { SearchRequest r = new SearchRequest { Firstname = firstname, Middlename = middlename, Lastname = lastname, City = city, State = state, Address = address, SearchType = searchtype, InputType = inputtype }; return View(r); }

    Read the article

  • How to make CFileDialog synchronize the displayed filename with the selected extension?

    - by RobH
    We have a class that derives from CFileDialog that overrides the OnTypeChange() method to allow it to change the filename to keep it in synch with the selected extension whenever the user selects a new extension from the filter combobox. (Our filters are set to contain only one extension per filter entry.) Unfortunately, the way we are doing this seems to have been broken by the Vista style dialogue. (We were using SetControlText() to set the filename edit box to the filename with the newly selected extension, but the control ID seems to be different for the Vista style dialogue, and the one that I found using Spy++ works just as well as the old ID (i.e., it doesn't)..) Is there a better way to tell the CFileDialog object to update the filename field to use the new extension when the user selects a new filter? It has to work with the old XP style dialogue as well. Failing that, how to I force the use of the XP style dialogue so that I get my functionality back without the dialogue crashing on me? (I'd rather not go that route if at all possible.) I've found a way to get it to fall back to the XP style. I still want to get the new style dialogue to do what I want though.

    Read the article

  • Storing Twitter OAuth in MySQL

    - by nute
    I'm about to add a feature on my website that will post stuff to the users' twitter accounts. I read that storing an "OAuth" token is better than storing their usernames and passwords (which makes sense). What should I store in my MySQL database? The token, secret and username? Or just the token? What data type(s) would you use? How big are they? Thanks!

    Read the article

  • How can I extract URLs from plain text with Perl?

    - by Russell C.
    I need the Perl regex to parse plain text input and convert all links to valid HTML HREF links. I've tried 10 different versions I found on the web but none of them seen to work correctly. I also tested other solutions posted on StackOverflow, none of which seem to work. The correct solution should be able to find any URL in the plain text input and convert it to: <a href="$1">$1</a> Some cases other regular expressions I tried didn't handle correctly include: URLs at the end of a line which are followed by returns URLs that included question marks URLs that start with 'https' I'm hoping that another Perl guy out there will already have a regular expression they are using for this that they can share. Thanks in advance for your help!

    Read the article

  • 640 enterprise library caching threads - how?

    - by JohnW
    We have an application that is undergoing performance testing. Today, I decided to take a dump of w3wp & load it in windbg to see what is going on underneath the covers. Imagine my surprise when I ran !threads and saw that there are 640 background threads, almost all of which seem to say the following: OS Thread Id: 0x1c38 (651) Child-SP RetAddr Call Site 0000000023a9d290 000007ff002320e2 Microsoft.Practices.EnterpriseLibrary.Caching.ProducerConsumerQueue.WaitUntilInterrupted() 0000000023a9d2d0 000007ff00231f7e Microsoft.Practices.EnterpriseLibrary.Caching.ProducerConsumerQueue.Dequeue() 0000000023a9d330 000007fef727c978 Microsoft.Practices.EnterpriseLibrary.Caching.BackgroundScheduler.QueueReader() 0000000023a9d380 000007fef9001552 System.Threading.ExecutionContext.runTryCode(System.Object) 0000000023a9dc30 000007fef72f95fd System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 0000000023a9dc80 000007fef9001552 System.Threading.ThreadHelper.ThreadStart() If i had to give a guess, I'm thinkign that one of these threads are getting spawned for each run of our app - we have 2 app servers, 20 concurrent users, and ran the test approximately 30 times...it's in the neighborhood. Is this 'expected behavior', or perhaps have we implemented something improperly? The test ran hours ago, so i would have expected any timeouts to have occurred already.

    Read the article

  • Authlogic and functional tests - Authlogic::Session::Activation::NotActivatedError: You must activat

    - by adam
    Im getting the errors below despite following the documentation. In test_helper.rb ENV["RAILS_ENV"] = "test" require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require "authlogic/test_case" require 'test_help' require 'shoulda' require File.dirname(__FILE__) + "/factories" In my functional test require 'test_helper' class SentencesControllerTest < ActionController::TestCase setup do :activate_authlogic end context "logged in" do setup do @user = Factory(:user) UserSession.create(@user.id) end context "on GET to :new" do setup do get :new end should "present form with text field" do assert_select('form#new_sentence') do assert_select('textarea#sentence_text') end end end end #context logged in. end in environments.rb config.gem "authlogic" Im not sure why it isnt working. Can anyone help out on this? Authlogic::Session::Activation::NotActivatedError: You must activate the Authlogic::Session::Base.controller with a controller object before creating objects authlogic (2.1.3) lib/authlogic/session/activation.rb:47:in `initialize' authlogic (2.1.3) lib/authlogic/session/klass.rb:64:in `initialize' authlogic (2.1.3) lib/authlogic/session/scopes.rb:79:in `initialize' authlogic (2.1.3) lib/authlogic/session/existence.rb:29:in `new' authlogic (2.1.3) lib/authlogic/session/existence.rb:29:in `create' test/functional/sentences_controller_test.rb:11:in `__bind_1270172858_922804' shoulda (2.10.3) lib/shoulda/context.rb:380:in `call' shoulda (2.10.3) lib/shoulda/context.rb:380:in `run_current_setup_blocks' shoulda (2.10.3) lib/shoulda/context.rb:379:in `each' shoulda (2.10.3) lib/shoulda/context.rb:379:in `run_current_setup_blocks' shoulda (2.10.3) lib/shoulda/context.rb:371:in `run_all_setup_blocks' shoulda (2.10.3) lib/shoulda/context.rb:375:in `run_parent_setup_blocks' shoulda (2.10.3) lib/shoulda/context.rb:359:in `test: logged in on GET to :new should present form with text field. ' /opt/rubymine/rb/testing/patch/testunit/test/unit/ui/testrunnermediator.rb:36:in `run_suite' /opt/rubymine/rb/testing/patch/testunit/test/unit/ui/teamcity/testrunner.rb:215:in `start_mediator' /opt/rubymine/rb/testing/patch/testunit/test/unit/ui/teamcity/testrunner.rb:191:in `start'

    Read the article

  • Blank subreport in Jasper Reports

    - by Andy Chapman
    Hi all, I'm trying to launch a report that I created in iReport which contains a main report and a subreport. In iReport, the subreport launches fine and contains data, however when I try to launch it from within my java code, the subreport is blank. What I've done so far: I have a String parameter in the main report called "SUBREPORT" that is used to define the path to the subreport. E.g. value: "E:\java\ReportLauncher\reports\test_subreport1.jasper" The subreport expression in the main report is set to: $P{SUBREPORT} The subreport connection expression is: $P{REPORT_CONNECTION} I also have a subreport parameter defined called "INVOICE_NUMBER" that is set to $F{InviInvNo}, which maps to a field in the main report. In my java code, I have: HashMap<String, Object> paramHash = new HashMap(); paramHash.put("INVOICE_NUMBER", invoiceID); paramHash.put("REPORT_CONNECTION", this.conn); paramHash.put("SUBREPORT", subReportPath); JasperPrint jasperprint = JasperFillManager.fillReport(this.reportPath, paramHash, this.conn); The main report is created fine and is populated. The subreport area however is blank. Any thoughts for what I'm doing wrong? Thanks in advance, Andy.

    Read the article

  • asp.net mvc ajax form helper/post additional data

    - by Jopache
    I would like to use the ajax helper to create ajax requests that send additional, dynamic data with the post (for example, get the last element with class = blogCommentDateTime and send the value of that last one to the controller which will return only blog comments after it). I have successfully done so with the help of jQuery Form plugin like so: $(document).ready(function () { $("#addCommentForm").submit(function () { var lastCommentDate = $(".CommentDateHidden:last").val(); var lastCommentData = { lastCommentDateTicks: lastCommentDate }; var formSubmitParams = { data: lastCommentData, success: AddCommentResponseHandler } $("#addCommentForm").ajaxSubmit(formSubmitParams); return false; }); This form was created with html.beginform() method. I am wondering if there is an easy way to do this using the ajax.beginform() helper? When I try to use the same code but replace html.beginform() with ajax.beginform(), when i try to submit the form, I am issuing 2 posts (which is understandable, one being taken care of by the helper, the other one by me with the JS above. I can't create 2 requests, so this option is out) I tried getting rid of the return false and changing ajaxSubmit() to ajaxForm() so that it would only "prepare" the form, and this leads in only one post, but it does not include the extra parameter that I defined, so this is worthless as well. I then tried keeping the ajaxForm() but calling that whenever the submit button on the form gets clicked rather than when the form gets submitted (I guess this is almost the same thing) and that results in 2 posts also. The biggest reason I am asking this question is that I have run in to some issues with the javascript above and using mvc validation provided by the mvc framework (which i will set up another question for) and would like to know this so I can dive further in to my validation issue.

    Read the article

  • mysql startup, shtudown and logging on osx

    - by Joelio
    Hi, I am trying to troubleshoot some mysql problems (I have a table I cant seem to delete or drop, it hangs forever) I have 10.5.8 osx, I dont remember how/if I installed mysql, here is what I know: it automatically starts on boot the process looks like this: /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/Joels-New-Pro.local.pid _mysql 96 0.0 0.0 75884 684 ?? Ss Sat06PM 0:00.02 /bin/sh /usr/local/mysql/bin/mysqld_safe when I run: /usr/local/mysql/libexec/mysqld --verbose --help it says: /usr/local/mysql/libexec/mysqld Ver 5.0.45 for apple-darwin9.1.0 on i686 (Source distribution) it seems to use my.cnf from /etc/my.cnf Now here are my questions: I dont see anything in the startupitems that remotely looks like mysql ls /Library/StartupItems/ BRESINKx86Monitoring ChmodBPF HP IO HP Trap Monitor Parallels ParallelsTransporter 1.) So how does it startup automatically? 2.) How do I start & stop this type of installation? Also, looking at the config, the logs have no values: /usr/local/mysql/libexec/mysqld --verbose --help|grep '^log' log (No default value) log-bin (No default value) log-bin-index (No default value) log-bin-trust-function-creators FALSE log-bin-trust-routine-creators FALSE log-error log-isam myisam.log log-queries-not-using-indexes FALSE log-short-format FALSE log-slave-updates FALSE log-slow-admin-statements FALSE log-slow-queries (No default value) log-tc tc.log log-tc-size 24576 log-update (No default value) log-warnings 1 3.) Does that mean there is no logging enabled in mysetup? thanks in advance! Joel

    Read the article

  • Mantaining Wordpress website with subversion

    - by Geries
    I want to setup a website using wordpress, which we can modified locally and then via subversion commit the site and make it public. This means to installing new plugins, changing the content, testing updates of wordpress to see if they work with the theme, etc. The idea is to control the development on the site, in case we need to keep track of the dev or roll back, because of unexpected bugs in a the plugins, theme, etc. I've read this article in codex, however I'm not sure how this is done when, we want to include the content and changes on the options of worpdress and plugins (which is in the mysql). Thanks

    Read the article

  • Is there a way to sort my windows within a screen session?

    - by jv1975
    I use screen and have ssh sessions open to a number of different machines from within my screen session. I'd like to keep them in order, for obvious reasons. Often I'll have to connect to a new machine which alphabetically/numerically should fit in between two existing windows. I can't find any way to reorder the windows other than with the "number" command, which swaps my current window with that at the number I specified. So adding a new window to the 15 I already have and then sticking it at position 2, while keeping all the other windows in order as well is cumbersome, to say the least, requiring swaps for all windows past #2. Is there anyway to sort the windows alphabetically? Or a way to "shift" all windows after a certain point up one spot? Or any other suggestions to insert a new window at an arbitrary point while still maintaining the order of all other windows? Thanks!

    Read the article

  • Is the 4pin atx power plug required?

    - by rockinthesixstring
    I know the answer is probably a resounding YES, but I just wanted to double check. I just purchased a new chassis for my PC and now my 4pin cpu power plug doesn't reach. I'm wondering if the 4 pins are required for operation, or can I get by for the weekend without it until I can go get an extension?

    Read the article

  • lscape and supertabular in Latex

    - by Tim
    Hi, I would like to put pictures into a supertabular table within lscape enviroment. The code is: \newcounter{themenumber} \newcounter{classnumber} \newcounter{imagenumber} \tablefirsthead{ \hline \backslashbox{Concept}{Class} &\multicolumn{3}{|c|}{Class 0} & \multicolumn{3}{|c|}{Class 1} \\ %\textbf{A} & \textbf{B}\\ \hline} \tablehead{ \hline \multicolumn{7}{|l|}{\small\sl continued from previous page}\\ \hline \backslashbox{Concept}{Class} &\multicolumn{3}{|c|}{Class 0} & \multicolumn{3}{|c|}{Class 1} \\ %\textbf{A} & \textbf{B}\\ \hline} \tabletail{ %\hline \multicolumn{7}{|l|}{\small\sl continued on next page}\\ \hline} \tablelasttail{} %\tablelasttail{\hline} \begin{landscape} \begin{supertabular}{| c || c | c | c || c | c | c |} \topcaption{Examples of All the Concepts. \label{tab:conceptsimgs}} \forloop{themenumber}{1}{\value{themenumber} < 24}{ \arabic{themenumber} \forloop{classnumber}{0}{\value{classnumber} < 2}{ \forloop{imagenumber}{1}{\value{imagenumber} < 4}{ & \includegraphics[scale=0.5]{../\arabic{themenumber}/\arabic{classnumber}_\arabic{imagenumber}.eps} } } \\ \hline } \end{supertabular} \end{landscape} However there is something wrong with the result: no caption is shown, the height of the part of table in each page exceeds the page height and there is something extra unwanted at the last page. See images below: page1 page2 page3 page4 How to fix the problems? Thanks and regards!

    Read the article

  • Keybd is not working right =(

    - by user302131
    i can't get this to work right this should press left for 1sec then wait 10secs then right 1sec. keybd_event(0x25, 0xCB, 0, 0); // press left cout << "Ldown\n"; // so i know it worked Sleep(1000); // hold it for 1sec keybd_event(0x25, 0xCB, KEYEVENTF_KEYUP, 0);// let go of the key cout << "Lup\n"; // so i know i let go Sleep(10000); // Sleep for 10secs keybd_event(0x27, 0xCD, 0, 0); // press right cout << "Rdown\n"; // so i know i pressed right Sleep(1000); // sleep 1sec keybd_event(0x27, 0xCD, KEYEVENTF_KEYUP, 0);// let go of the key cout << "Rdown\n"; // so i know i let go. this is in a loop but it wont do anything :( unless i close the program before the key is let go then it will just keep the keydown until i press the key again. i know you can use only one key code if you want but i need to use both. so what i'm i missing?

    Read the article

  • How to use SharpSVN in ASP.NET?

    - by Bryan
    Trying to use use SharpSVN in an ASP.NET app. So far, it's been nothing but trouble. First, I kept getting permission errors on "lock" files (that don't exist), even though NETWORK SERVICE has full permissions on the directories. Finally in frustration I just granted Everyone full control. Now I get a new error: OPTIONS of 'https://server/svn/repo': authorization failed: Could not authenticate to server: rejected Basic challenge (https://server) This happens whether I have the DefaultCredentials set below or not: using (SvnClient client = new SvnClient()) { //client.Authentication.DefaultCredentials = new System.Net.NetworkCredential("user", "password"); client.LoadConfiguration(@"C:\users\myuser\AppData\Roaming\Subversion"); SvnUpdateResult result; client.Update(workingdir, out result); } Any clues? I wish there was SOME documentation with this library, as it seems so useful.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >