Search Results

Search found 884 results on 36 pages for 'acts as taggable on'.

Page 27/36 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • problems doing the Django tutorial on Dreamhost using Passengers

    - by Pietro Speroni
    I have looked and I could not find this question before, and it surprises me. I am reasonably proficient in Python, and I used Dreamhost for a number of years. Now I would like to learn Django. They are finally supporting it using Passenger. Which I do not know what is. Following the instructions on Dreamhost I installed Django. Then I started following the tutorial 01. This went well, except that I could not start the server (this in the tutorial) since the code was live on dreamhost. At the time this did not seem to make any difference. Then when I went on the second part of the tutorial I had to access the admin site. And it worked well going to myurl/admin/ , as it should. But here the problems started. According to the tutorial (here) I have to add a file in the poll application and then restart the server. But I never started the server in the first place, my code is running live on the web... but when I add a file the website the admin acts as if it does not see it. Probably dreamhost has started its own server, and I don't know how to restart it. But I assume this is going to be a common problem when you run django on dreamhost. Every time you add a file you will have to tell the server to consider it. So what should I do to let the server know about it? Thanks, Pietro

    Read the article

  • Using Array Controllers to restrict the view in one popup depending on the selection in another. Not

    - by mjohnh
    I am working on an app that is not core data based - the data feed is a series of web services. Two arrays are created from the data feed. The first holds season data, each array object being an NSDictionary. Two of the NSDictionary entries hold the data to be displayed in the popup ('seasonName') and an id ('seasonID') that acts as a pointer (in an external table) by matches defined for that season. The second array is also a collection of NSDictionaries. Two of the entries hold the data to be displayed in the popup ('matchDescription') and the id ('matchSeasonId') that points to the seasonId defined in the NSDictionaries in first array. I have two NSPopUps. I want the first to display the season names and the second to display the matches defined for that season, depending on the selection in the first. I'm new at bindings, so excuse me if I've missed something obvious. I've tried using ArrayControllers as follows: SeasonsArrayController: content bound to appDelegate seasonsPopUpArrayData. seasonsPopup: content bound to SeasonsArrayController.arrangedObjects; content value bound to SeasonsArrayController.arrangedObjects.seasonName I see the season names fine. I can obviously follow a similar route to see the matches, but I then see them all, instead of restricting the list to the matches for the season highlighted. All the tutorials I can find seem to revolve around core data and utilise the relationships defined therein. I don't have that luxury here. Any help very gratefully received.

    Read the article

  • Using the Proxy pattern with C++ iterators

    - by Billy ONeal
    Hello everyone :) I've got a moderately complex iterator written which wraps the FindXFile apis on Win32. (See previous question) In order to avoid the overhead of constructing an object that essentially duplicates the work of the WIN32_FIND_DATAW structure, I have a proxy object which simply acts as a sort of const reference to the single WIN32_FIND_DATAW which is declared inside the noncopyable innards of the iterator. This is great because Clients do not pay for construction of irrelevant information they will probably not use (most of the time people are only interested in file names), and Clients can get at all the information provided by the FindXFile APIs if they need or want this information. This becomes an issue though because there is only ever a single copy of the object's actual data. Therefore, when the iterator is incrememnted, all of the proxies are invalidated (set to whatever the next file pointed to by the iterator is). I'm concerned if this is a major problem, because I can think of a case where the proxy object would not behave as somebody would expect: std::vector<MyIterator::value_type> files; std::copy(MyIterator("Hello"), MyIterator(), std::back_inserter(files)); because the vector contains nothing but a bunch of invalid proxies at that point. Instead, clients need to do something like: std::vector<std::wstring> filesToSearch; std::transform( DirectoryIterator<FilesOnly>(L"C:\\Windows\\*"), DirectoryIterator<FilesOnly>(), std::back_inserter(filesToSearch), std::mem_fun_ref(&DirectoryIterator<FilesOnly>::value_type::GetFullFileName) ); Seeing this, I can see why somebody might dislike what the standard library designers did with std::vector<bool>. I'm still wondering though: is this a reasonable trade off in order to achieve (1) and (2) above? If not, is there any way to still achieve (1) and (2) without the proxy?

    Read the article

  • How to receive Email in JEE application

    - by Hank
    Obviously it's not so difficult to send out emails from a JEE application via JavaMail. What I am interested in is the best pattern to receive emails (notification bounces, mostly)? I am not interested in IMAP/POP3-based approaches (polling the inbox) - my application shall react to inbound emails. One approach I could think of would be Keep existing MTA (postfix on linux in my case) - ops team already knows how to configure / operate it For every mail that arrives, spawn a Java app that receives the data and sends it off via JMS. I could do this via an entry in /etc/aliases like myuser: "|/path/to/javahelper" with javahelper calling the Java app, passing STDIN along. MDB (part of JEE application) receives JMS message, parses it, detects bounce message and acts accordingly. Another approach could be Open a listening network socket on port 25 on the JEE application container. Associate a SessionBean with the socket. Bean is part of JEE application and can parse/detect bounces/handle the messages directly. Keep existing MTA as inbound relay, do all its security/spam filtering, but forward emails to myuser (that pass the filter) to the JEE application container, port 25. The first approach I have done before (albeit in a different language/setup). From a performance and (perceived) cleanliness point of view, I think the second approach is better, but it would require me to provide a proper SMTP transport implementation. Also, I don't know if it's at all possible to connect a network socket with a bean... What is your recommendation? Do you have details about the second approach?

    Read the article

  • Who likes #regions in Visual Studio?

    - by Nicholas
    Personally I can't stand region tags, but clearly they have wide spread appeal for organizing code, so I want to test the temperature of the water for other MS developer's take on this idea. My personal feeling is that any sort of silly trick to simplify code only acts to encourage terrible coding behavior, like lack of cohesion, unclear intention and poor or incomplete coding standards. One programmer told me that code regions helped encourage coding standards by making it clear where another programmer should put his or her contributions. But, to be blunt, this sounds like a load of horse manure to me. If you have a standard, it is the programmer's job to understand what that standard is... you should't need to define it in every single class file. And, nothing is more annoying than having all of your code collapsed when you open a file. I know that cntrl + M, L will open everything up, but then you have the hideous "hash region definition" open and closing lines to read. They're just irritating. My most stead fast coding philosophy is that all programmer should strive to create clear, concise and cohesive code. Region tags just serve to create noise and redundant intentions. Region tags would be moot in a well thought out and intentioned class. The only place they seem to make sense to me, is in automatically generated code, because you should never have to read that outside of personal curiosity.

    Read the article

  • jsf messed up links

    - by Mateusz
    I'm new to JSF. My application is working, but I'm confused with links in browser when using controller. BTW, there is also PrimeFaces in my app so don't be suprised with p: tags. Let's say I have 'list' and 'show' pages with controller doing redirection between them. First I'm on http://localhost:8080/y/r/conversation/list.xhtml page. There is link created with line <p:commandLink action="#{lazyConversationBean.doShow(conv)}" ajax="false" value="View"/>. lazyConversationBean acts here as my Controller. There is method: public String doShow(Conversation c) { this.setSelectedConversation(c); return "view"; } from which I got redirected to ...... again http://localhost:8080/y/r/conversation/list.xhtml (browser shows it) even when it's correct http://localhost:8080/y/r/conversation/view.xhtml page. There I have link <p:commandButton action="#{lazyConversationBean.doList()}" ajax="false" value="Back to list"/> and again controller has method: public String doList() { return "list"; } from which I got redirected to ... yeah, you guessed right ... http://localhost:8080/y/r/conversation/view.xhtml (that is again what browser shows) even when again it is correct http://localhost:8080/y/r/conversation/list.xhtml page. It seams as browser link area is always one step behind page currently being displayed. I don't even know if it's some incorrect behaviour as I have no idea how to query google for this :D Just for test I did this short tutorial, where netbeans created whole stack of code on one of my entities, and behaviour was the same, so it's not PrimeFaces magic related. Can you tell my why it happens, and how to fix it? Users likes to copy correct links ;)

    Read the article

  • What is the PastryKit Framework?

    - by Kerrick
    I'm trying to find any information I can on the PastryKit Javascript Framework. It appears to be in use on the iPhone User Guide that is displayed on the iPhone itself in Mobile Safari, but I cannot find any documentation or API. If you want to see it in action, open Safari 4, set your user agent to iPhone 3 (In the Develop menu) and check out the guide. Overall, it seems to be a way to write an HTML/CSS/Javascript application that acts like a native iPhone app. When it comes to Javascript, I used the JS Beautifier on (what I assume to be) the framework file and it was over 3,400 lines! Beautified, (again what I assume to be) their implementation of it was over 1,200 lines. On the CSS side, I used Clean CSS on (again what I assume to be) the framework CSS, and it came out to over 700 lines. Their implementation was shy of 500. Does anybody have, or know where to find, any information, documentation, or APIs on PastryKit? Or, can anybody figure out how to implement it?

    Read the article

  • What's a good Java-based Master-Slave communication mechanism?

    - by plecong
    I'm creating a Java application that requires master-slave communication between JVMs, possibly residing on the same physical machine. There will be a "master" server running inside a JEE application server (i.e. JBoss) that will have "slave" clients connect to it and dynamically register itself for communication (that is the master will not know the IP addresses/ports of the slaves so cannot be configured in advance). The master server acts as a controller that will dole work out to the slaves and the slaves will periodically respond with notifications, so there would be bi-directional communication. I was originally thinking of RPC-based systems where each side would be a server, but it could get complicated, so I'd prefer a mechanism where there's an open socket and they talk back and forth. I'm looking for a communication mechanism that would be low-latency where the messages would be mostly primitive types, so no serious serialization is necessary. Here's what I've looked at: RMI JMS: Built-in to Java, the "slave" clients would connect to the existing ConnectionFactory in the application server. JAX-WS/RS: Both master and slave would be servers exposing an RPC interface for bi-directional communication. JGroups/Hazelcast: Use shared distributed data structures to facilitate communication. Memcached/MongoDB: Use these as "queues" to facilitate communication, though the clients would have to poll so there would be some latency. Thrift: This does seem to keep a persistent connection, but not sure how to integrate/embed a Thrift server into JBoss WebSocket/Raw Socket: This would work, but require a lot more custom code than I'd like. Is there any technology I'm missing? Edit: Also looked at: JMX: Have the client connect to JBoss' JMX server and receive JMX notifications for bidirectional comms.

    Read the article

  • cakephp read and display from more than one related table

    - by z22
    I have 2 tables Users and Artists. User: id name password city_id state_id country_id Artist: id user_id description I wish to create add and edit form(single form acts as add and edit). But on click of edit link, I wish to fill in the form fields from user as well as artist table. How do i do that? Below is my controller code: public function artist_register() { $this->country_list(); if ($this->request->is('post')) { $this->request->data['User']['group_id'] = 2; if ($this->{$this->modelClass}->saveAll($this->request->data)) { $this->redirect(array('controller' => 'Users', 'action' => 'login')); } } $this->render('artist_update'); } public function artist_update($id) { $artist = $this->{$this->modelClass}->findByuser_id($id); $artist_id = $artist[$this->modelClass]['id']; if($this->request->is('get')) { $this->request->data = $this->{$this->modelClass}->read(null, $artist_id); $this->request->data = $this->{$this->modelClass}->User->read(null, $id); } else { if($this->{$this->modelClass}->save($this->request->data)) { $this->Session->setFlash('Your Profile has been updated'); $this->redirect(array('action' => 'index')); } } } The code doesnt work. how do i solve it?

    Read the article

  • View transform seems to be ignored when animating on iphone. Why?

    - by heymon
    I have views that can be rotated, scaled and moved around the screen. I want the view to resize and be orthogonal when the user double tap's the view to edit the textview within. The code is below. Somewhere the transform is getting reset. The NSLog statement below prints the identity transform, but a print of the transform when the animation is complete in transitionDidStop reveals that the transform is what it was before I thought I set it to identity. The view resizes, but it acts like the transform was never set to identity? Any ideas/pointers? originalBounds = self.bounds; originalCenter = self.center; originalTransform = self.transform; r = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width - 70, 450); [UIView beginAnimations: nil context: NULL]; [UIView setAnimationDelegate: self]; [UIView setAnimationDidStopSelector: @selector(transitionDidStop:finished:context:)]; self.transform = CGAffineTransformIdentity; NSLog(@"%@ after set", NSStringFromCGAffineTransform([self transform])); [self setBounds: r]; [self setCenter: p]; [self setAlpha: 1.0]; [UIView commitAnimations]; [textView becomeFirstResponder];

    Read the article

  • IKImageView, Buttons work intermittently in 10.5 but ok in 10.6

    - by markhunte
    Hi all, In IB,I have connected some buttons to a IKImageView. Using its received Action 'ZoomIn:', 'ZoomOut:','ZoomImageToActualSize:' When I build for 10.6 I have no issues these work as expected. But in 10.5 (ppc), they sometimes work as expected and sometimes do not. I have even tried it programatically. But I get the same results. It is intermittent with each build after I have made some small change in IB that I need. But not changes that should affect how the view acts. The only buttons that seem to work through out are 'ZoomImageToFit' and the rotate ones. When the do not work as expected, I see no change to the current image in the view, but when my app (/s, I have had this issue before in different apps) changes the image The view reflects the last request from a button. So for example when it does not work. An image is displayed, I click the 'ZoomImageToActualSize:' button, nothing happens. I load a new image and it is displayed at Actual size. Example when it does work. An image is displayed, I click the 'ZoomImageToActualSize:' button, It is displayed at Actual size. By the way, I know I can reset the view default , before I load a new image. Also if I run the 10.5 app in 10.6, it works ok, but as above I get intermittent results with the same build on multible 10.5 machines. Does anyone know what is going on, is this a known bug? Thanks for any help. MH

    Read the article

  • Linux network stack : adding protocols with an LKM and dev_add_pack

    - by agent0range
    Hello, I have recently been trying to familiarize myself with the Linux Networking stack and device drivers (have both similarly named O'Reilly books) with the eventual goal of offloading UDP. I have already implemented UDP on the NIC but now the hard part... Rather than ask for assistance on this larger goal I was hoping someone could clarify for me a particular snippet I found that is part of a LKM which registeres a new protocol (OTP) that acts as a filter between the device driver and network stack. http://www.phrack.org/archives/55/p55_0x0c_Building%20Into%20The%20Linux%20Network%20Layer_by_lifeline%20&%20kossak.txt (Note: this Phrack article contains three different modules, code for the OTP is at the bottom of the page) In the init function of his example he has: otp_proto.type = htons(ETH_P_ALL); otp_proto.func = otp_func; dev_add_pack(&otp_proto); which (if I understand correctly) should register otp_proto as a packet sniffer and put it into the ptype_all data structure. My question is about the dev_add_pack. Is it the case that the protocol being registered as a filter will always be placed at this layer between L2 and the device driver? Or, for instance could I make such a filtering occur between the application and transport layers (analyze socket parameters) using the same process? I apologize if this is confusing - I am having some trouble wrapping my head around the bigger picture when it comes to modules altering kernel stack functionality. Thanks

    Read the article

  • divert asp.net child controls

    - by Eric
    Hi Folks, I am trying to create an asp.net custom control that acts as a hosting container for any other controls, similar to the existing ‘Panel’ control. Basically, I need to build a web control that groups a bunch of other controls. It will consist of a header and a body pane, similar to a normal window in desktop application. The header will contain some simple text and some JavaScript driven code that shows/hides the body pane. The body pane simply hosts any number of other controls. +------------------------------------------------------+ | User Details Show/Hide | +------------------------------------------------------+ | Name: [Eric ] | | Address: [Some where] | | Date of Birth: [01/01/1980] | | | | (any other fields goes on) | | | | | +------------------------------------------------------+ Ideally I want to create a control that packs the whole thing together, so at design time I could use the following markup. <myCtl:SuperContainer runat=”server” Title=”User Details”> <asp:label id=”lblName” runat=”server” text=”Name:”/> <asp:textbox id=”txtName” runat=”server”/> <asp:label id=”lblDOB” runat=”server” text=”Date of Birth:”/> <asp:textbox id=”txtDOB” runat=”server”/> (…other controls definition…) </myCtl:SuperContainer> I plan to include two panels in my control, one for the header and another one for the body, but as you can see, the key issue is to find a way to ‘divert’ the child controls that are defined in the markup to the body panel, instead of the default parent container. I feel it can be some how simply override (manipulate) the control property, but don’t know how to properly do so. Can any one give some idea about how to implement this ‘SuperContainer’ control? Many thank, Eric

    Read the article

  • Apache ReWriteEngine throwing 500 Internal Server Error for too many internal redirects... why?!?!?!

    - by Stephen G
    I'm trying to implement a new ReWrite rule on my local dev machine. I have 13 rules set up already, and all work fine (even as of this writing). However, for some reason the newest one is throwing me 500 Internal Server Errors. The ReWrite rule is: RewriteRule stuff/public_html/vault/mystuff/view/(.*) /stuff/public_html/vault/mystuff/view/index.php?stuff=$1 RewriteRule stuff/public_html/vault/mystuff/view/(.*)/ /stuff/public_html/vault/mystuff/view/index.php?stuff=$1 Checked my apache logs and got this: [Thu Jan 13 22:07:43 2011] [error] [client ::1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary., referer: http://localhost:8888/stuff/public_html/vault/mystuff/all/index.php?curr=7 On the script I am trying to redirect to view/index.php?stuff=$1, there is nothing that even remotely resembles a redirect of any kind. I do have a very, very basic session verifier being called at the top of the landing script, which is as follows: //Start session session_start(); //Check whether the session variable SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) { header("location: ".$root_http.""); exit(); } However, when I access the page directly, it acts as it should, and there is no redirect. All of my other ReWrite rules and their corresponding landing pages are set up the exact same way. This is blowing my mind. Any help, PLEASE!?

    Read the article

  • Convert Google Analytics cookies to Local/Session Storage

    - by David Murdoch
    Google Analytics sets 4 cookies that will be sent with all requests to that domain (and ofset its subdomains). From what I can tell no server actually uses them directly; they're only sent with __utm.gif as a query param. Now, obviously Google Analytics reads, writes and acts on their values and they will need to be available to the GA tracking script. So, what I am wondering is if it is possible to: rewrite the __utm* cookies to local storage after ga.js has written them delete them after ga.js has run rewrite the cookies FROM local storage back to cookie form right before ga.js reads them start over Or, monkey patch ga.js to use local storage before it begins the cookie read/write part. Obviously if we are going so far out of the way to remove the __utm* cookies we'll want to also use the Async variant of Analytics. I'm guessing the down vote was because I didn't ask a question. DOH! My questions are: Can it be done as described above? If so, why hasn't it been done? I have a default HTML/CSS/JS boilerplate template that passes YSlow, PageSpeed, and Chrome's Audit with near perfect scores. I'm really looking for a way to squeeze those remaining cookie bytes from Google Analytics in browsers that support local storage.

    Read the article

  • jQuery sliding animation not working

    - by Jake Zeitz
    I have three divs stacked on each other but offset so that a part of each div is visible. When one of the bottom divs is clicked I want the top div to animate out and back into the stack at the bottom, then the div that is clicked will appear at the top. So far I only have the code for when the middle div is clicked, but I cannot get it to work properly. What am I doing wrong? (I also realize that the code I wrote is probably terrible, this is the first jQuery code I have written.) The css is very very simple: .first { z-index: 3; } .second { z-index: 2; } .third { z-index: 1; } The basic html is this: <div class="first"></div> <div class="second"></div> <div class="third"></div> Here is my code: $("div.second").click(function () { $("div.first").animate({ left: "-=200px"}, {duration: "fast", complete: function () { $("div.first").removeClass("first").addClass("third").animate({left: "+=350px", top: "+=60px"}, "fast"); } }); $("div.second").animate({ left: "-=24px", top: "-=30px"}, {duration: "fast", complete: function () { $("div.second").removeClass("second").addClass("first"); } }); $("div.third").animate({ left: "-=24px", top: "-=30px"}, {duration: "fast", complete: function () { $("div.third").removeClass("third").addClass("second"); } }); }); I can get the div.first to move to the side and back. But now I can't get the classes to stay changed. What keeps happening is the div.second will remove it's class and add .first in the animation, but when the animation is complete, it acts like it still has a class of .second.

    Read the article

  • Web development scheme for staging and production servers using Git Push

    - by ServAce85
    I am using git to manage a dynamic website (PHP + MySQL) and I want to send my files from my localhost to my staging and development servers in the most efficient and hassle-free way. I am currently convinced that the best way for me to approach this problem is to use this git branching model to organize my local git repo. From there, I will use the release branches to push to my staging server for testing. Once I am happy that the release code works on the staging server, I can then merge with my master branch and push that to my production server. Pushing to Staging Server: As noted in many introductory git posts, I could run into problems pushing into a non-bare repo, so, as suggested in this response, I plan to push the release branch to a bare repo on the server and have a post-receive hook that clones the bare repo to a non-bare repo that also acts as the web-hosted directory. Pushing to Production Server: Here's my newest source of confusion... In the response that I cited above, it made me curious as to why @Paul states that it's a completely different story when pushing to a live, development server. I guess I don't see the problem. Would it be safe and hassle-free to follow the same steps as above, but for the master branch? Where are the potential pit-falls? Config Files: With respect to configuration files that are unique to each environment (.htaccess, config.php, etc), it seems simplest to .gitignore each of those files in their respective repos on their respective servers. Can you see anything immediately wrong with this? Better solutions? Accessing Data: Finally, as I initially stated, the site uses MySQL databases to store data. How would you suggest I access that data (for testing purposes) from the staging server and localhost? I realize that I may have asked way too many questions for a single post, but since they're all related to the best way to set up this development scheme, I thought it was necessary.

    Read the article

  • Problems migrating databinding in VB.NET from Winforms to ASP.NET 2.0

    - by David
    And this was supposed to be so easy... I have existing business and data access layers that handle the retrieval and update of the data in question. These work great with the existing Winforms application (.Net V2.0) Now, in trying to write a new web-based UI, I'm running into all sorts of problems (last time I wrote asp.net code was in 1.1). Specifically, I can't data bind a text box to a business object. Oh, sure there's the ObjectDataSource but that wants to know how to do CRUD operations on the data. What I'm looking for is something that acts like the 'classic' binding objects so that, in my code, it's as simple as retrieving the object and doing a a refresh. The data component like FormView and DetailsView are so generic-looking that it's ridiculous. The existing application would have tabbed dialogs, text boxes grouped by panels, etc. On top of that, I have a directive to use master pages and unless one control causes it, I can't seem to get the content section to expand. I can't just put a text box 'below' the bottom of "Content1" and have it resize the content section - which gives me the same results as an earlier question I posted when the footer wasn't being 'pushed down' - relative position solved that but doesn't seem to solve it with placing small text boxes in the area. What I want is fairly simple. Something like: bindingobject.datasource = businessdataobject bindingobject.refresh ...and have the text boxes refresh with the new values. Likewise to have 'businessdataobject' properties updated as the user enters new data. I was able to do this with the GridView (grdRequests.DataSource = lstRequests) by making a list of asp:BoundField tags inside the collection of the GridView. Am I tilting at windmills here?

    Read the article

  • Is there any other way of using signed applets

    - by 640KB
    Hi There, If I want to deploy high privileged applets they need to be signed. For that a certificate is created and then a jar file is signed with a jarsigner. After that in the HTML code one has to specify code,codebase AND archive (jar) which we signed before. However I wrote a servlet which acts as two things: it sits at the URL pointed by the codebase and serves class bytecode to the applet. The same servlet also uses serialization to communicate with the applet whereby whenever the applet gets a class it does not know it goes to the codebase which ends up back at the servlet. Almost like a mini RMI setup but simpler. I hope you can see the power in this. Unfortunately for signed applets one needs the archive. Now the servlet is also able to load a Certificate object and can send it to the applet too. So here is the setup: At one point the applet receives class bytecode and it also has the Certificate. It would be nice if the applet could instantiate all received classes using that certificate (otherwise code from jar is signed and outside is not which prompts nasty messages to the user). So my question to you fine Java aficionados: Would there by any way for me to use the bytecode data and the Certificate to instantiate the class as a signed object so that the plugin pops the Security dialog, accepts teh certificate and elevates the object's privileges. What I could find is that the there is a class CodeSource that accepts codebase URL and certificate and is essential to the signing process. What I am not sure is how one could intercept the class loading inside applets to install additional certificates not obtained through a JAR file via archive. What do you say? Thanks a bunch.

    Read the article

  • ASPX page renders differently when reached on intranet vs. internet?

    - by MattSlay
    This is so odd to me.. I have IIS 5 running on XP and it's hosting a small ASP.Net app for our LAN that we can access by using the computer name, virtual directory, and page name (http://matt/smallapp/customers.aspx), but you can also hit that IIS server and page from the internet because I have a public IP that my firewall routes to the "Matt" computer (like http://213.202.3.88/smallapp/customers.aspx [just a made-up IP]). Don't worry, I have Windows domain authentication is in place to protect the app from anonymous users. So all the abovea parts works fine. But what's weird is that the Border of the divs on the page are rendered much thicker when you access the page from the intranet, versus the internet, (I'm using IE8) and also, some of the div layout (stretching and such) acts differently. Why would it render different in the same browser based on whether it was reached from the LAN vs. the internet? It does NOT do this in FireFox. So it must be just an IE8 thing. All the CSS for the divs is right in the HTML page, so I do not think it is a caching matter of a CSS file. Notice how the borders are different in these two images: Internet: http://twitpic.com/hxx91 . Lan: http://twitpic.com/hxxtv

    Read the article

  • Observer pattern and violation of Single Responsibility Principle

    - by Devil Jin
    I have an applet which repaints itself once the text has changed Design 1: //MyApplet.java public class MyApplet extends Applet implements Listener{ private DynamicText text = null; public void init(){ text = new DynamicText("Welcome"); } public void paint(Graphics g){ g.drawString(text.getText(), 50, 30); } //implement Listener update() method public void update(){ repaint(); } } //DynamicText.java public class DynamicText implements Publisher{ // implements Publisher interface methods //notify listeners whenever text changes } Isn't this a violation of Single Responsibility Principle where my Applet not only acts as Applet but also has to do Listener job. Same way DynamicText class not only generates the dynamic text but updates the registered listeners. Design 2: //MyApplet.java public class MyApplet extends Applet{ private AppletListener appLstnr = null; public void init(){ appLstnr = new AppletListener(this); // applet stuff } } // AppletListener.java public class AppletListener implements Listener{ private Applet applet = null; public AppletListener(Applet applet){ this.applet = applet; } public void update(){ this.applet.repaint(); } } // DynamicText public class DynamicText{ private TextPublisher textPblshr = null; public DynamicText(TextPublisher txtPblshr){ this.textPblshr = txtPblshr; } // call textPblshr.notifyListeners whenever text changes } public class TextPublisher implments Publisher{ // implements publisher interface methods } Q1. Is design 1 a SPR violation? Q2. Is composition a better choice here to remove SPR violation as in design 2.

    Read the article

  • Help with why my app crashed?

    - by Moshe
    I'm writing an iPad app that is a "kiosk" app. The iPad should be hanging on the wall and the app should just run. I did a test, starting the app last night (Friday, December 31) and letting it run. This morning, when I woke up, it was not running. I just checked the iPad's console and I can't figure out why it crashed. The iPad was plugged in and so the battery is not the issued. I did disable the idleTimer in my application delegate. The app was seen running as late as midnight last night. I would like to note that my app acts as a Bluetooth server through Game Kit and large portion of the console output is occupied by bluetooth status messages. When I opened the iPad, the app was paused and there was a system alert which prompted me to check an "Expiring Provisioning Profile". I tapped "dismiss" and the alert went away. The app crashed about a second after I dismissed the system alert. Any ideas how I can diagnose this problem? Why would my app crash? Here is my iPad's Console log, as copied from Xcode's organizer. Edit: A bit of Googling lead me to this site which says that alert views cause the app to lose focus. Could that be involved? What can I do to fix the problem? EDIT2: My Crash log describes the situation as: Application Specific Information: appname failed to resume in time Elapsed total CPU time (seconds): 10.010 (user 8.070, system 1.940), 100% CPU Elapsed application CPU time (seconds): 9.470, 95% CPU

    Read the article

  • What's the difference between these LINQ queries ?

    - by SnAzBaZ
    I use LINQ-SQL as my DAL, I then have a project called DB which acts as my BLL. Various applications then access the BLL to read / write data from the SQL Database. I have these methods in my BLL for one particular table: public IEnumerable<SystemSalesTaxList> Get_SystemSalesTaxList() { return from s in db.SystemSalesTaxLists select s; } public SystemSalesTaxList Get_SystemSalesTaxList(string strSalesTaxID) { return Get_SystemSalesTaxList().Where(s => s.SalesTaxID == strSalesTaxID).FirstOrDefault(); } public SystemSalesTaxList Get_SystemSalesTaxListByZipCode(string strZipCode) { return Get_SystemSalesTaxList().Where(s => s.ZipCode == strZipCode).FirstOrDefault(); } All pretty straight forward I thought. Get_SystemSalesTaxListByZipCode is always returning a null value though, even when it has a ZIP Code that exists in that table. If I write the method like this, it returns the row I want: public SystemSalesTaxList Get_SystemSalesTaxListByZipCode(string strZipCode) { var salesTax = from s in db.SystemSalesTaxLists where s.ZipCode == strZipCode select s; return salesTax.FirstOrDefault(); } Why does the other method not return the same, as the query should be identical ? Note that, the overloaded Get_SystemSalesTaxList(string strSalesTaxID) returns a record just fine when I give it a valid SalesTaxID. Is there a more efficient way to write these "helper" type classes ? Thanks!

    Read the article

  • Using Everyauth/Express and Multiple Configurations?

    - by Zane Claes
    I'm successfully using Node.js + Express + Everyauth ( https://github.com/abelmartin/Express-And-Everyauth/blob/master/app.js ) to login to Facebook, Twitter, etc. from my application. The problem I'm trying to wrap my head around is that Everyauth seems to be "configure and forget." I set up a single everyauth object and configure it to act as middleware for express, and then forget about it. For example, if I want to create a mobile Facebook login I do: var app = express.createServer(); everyauth.facebook .appId('AAAA') .appSecret('BBBB') .entryPath('/login/facebook') .callbackPath('/callback/facebook') .mobile(true); // mobile! app.use(everyauth.middleware()); everyauth.helpExpress(app); app.listen(8000); Here's the problem: Both mobile and non-mobile clients will connect to my server, and I don't know which is connecting until the connection is made. Even worse, I need to support multiple Facebook app IDs (and, again, I don't know which one I will want to use until the client connects and I partially parse the input). Because everyauth is a singleton which in configured once, I cannot see how to make these changes to the configuration based upon the request that is made. What it seems like is that I need to create some sort of middleware which acts before the everyauth middleware to configure the everyauth object, such that everyauth subsequently uses the correct appId/appSecret/mobile parameters. I have no clue how to go about this... Suggestions? Here's the best idea I have so far, though it seems terrible: Create an everyauth object for every possible configuration using a different entryPath for each...

    Read the article

  • DDD: Enum like entities

    - by Chris
    Hi all, I have the following DB model: **Person table** ID | Name | StateId ------------------------------ 1 Joe 1 2 Peter 1 3 John 2 **State table** ID | Desc ------------------------------ 1 Working 2 Vacation and domain model would be (simplified): public class Person { public int Id { get; } public string Name { get; set; } public State State { get; set; } } public class State { private int id; public string Name { get; set; } } The state might be used in the domain logic e.g.: if(person.State == State.Working) // some logic So from my understanding, the State acts like a value object which is used for domain logic checks. But it also needs to be present in the DB model to represent a clean ERM. So state might be extended to: public class State { private int id; public string Name { get; set; } public static State New {get {return new State([hardCodedIdHere?], [hardCodeNameHere?]);}} } But using this approach the name of the state would be hardcoded into the domain. Do you know what I mean? Is there a standard approach for such a thing? From my point of view what I am trying to do is using an object (which is persisted from the ERM design perspective) as a sort of value object within my domain. What do you think? Question update: Probably my question wasn't clear enough. What I need to know is, how I would use an entity (like the State example) that is stored in a database within my domain logic. To avoid things like: if(person.State.Id == State.Working.Id) // some logic or if(person.State.Id == WORKING_ID) // some logic

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >