Daily Archives

Articles indexed Wednesday October 3 2012

Page 12/17 | < Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How can one describe a rock-paper-scissors relationship between 3 items?

    - by Madara Uchiha
    Let's say I have the following structure: abstract class Hand {} class Rock extends Hand {} class Paper extends Hand {} class Scissors extends Hand {} The goal is to make a function (or a method) Hand::compareHands(Hand $hand1, Hand $hand2), which would return the winning hand in a rock-paper-scissors match. That would be very easy with a bunch of ifs, but the point is to have a more robust structure, that's relying on polymorphism rather than on procedural code. P.S. this is done in actual production code, if someone is asking. This isn't some sort of challenge or homework. (It's not really rock-paper-scissors, but you get the point).

    Read the article

  • php paging and the use of limit clause

    - by Average Joe
    Imagine you got a 1m record table and you want to limit the search results down to say 10,000 and not more than that. So what do I use for that? Well, the answer is use the limit clause. example select recid from mytable order by recid asc limit 10000 This is going to give me the last 10,000 records entered into this table. So far no paging. But the limit phrase is already in use. That brings to question to the next level. What if I want to page thru this record particular record set 100 recs at a time? Since the limit phrase is already part of the original query, how do I use it again, this time to take care of the paging? If the org. query did not have a limit clause to begin with, I'd adjust it as limit 0,100 and then adjusting it as 100,100 and then 200,100 and so on while the paging takes it course. But at this time, I cannot. You almost think you'd want to use two limit phrases one after the other - which is not not gonna work. limit 10000 limit 0,1000 for sure it would error out. So what's the solution in this particular case?

    Read the article

  • CSS/JQUERY make div scrollable without showing scrollbar

    - by Ispuk
    is there any way to make a div scrollable with overflow-y:hidden; and overflow-x:hidden? i'm trying without success, maybe i need some js or jquery script? i mean, i would like to make div scroll on y axes without showing scrollbar on right side( as it is now). itryed: .get-list{ position:absolute; z-index:444; text-align: center; display: none; bottom:0; clear:both !important; left:0; right:0; top:11%; margin:0 auto; background:#fff; max-height:800px; overflow-y:no-display; overflow-x:hidden; display: block; } thanks EDIT log-widget-list{ position:absolute; z-index:444; text-align: center; display: none; width:99%; margin:0 auto; background:#fff; height:800px; overflow: hidden; } .log-widget-list .scroller{ overflow: scroll; height:800px; width:100%; } it shows right scrollbar anyway

    Read the article

  • Java Error beeping

    - by user1281385
    Im working on a Chat client that i didnt write the bulk of the code for. It works fine however when someone sends a message it beeps (system error beep) when using Java 7. Java 6 and below doesn't have this beep. I cant seem to find whats causing the beep is there any way to find it ? I dont think its calling beep as i have public class nobeep extends sun.awt.windows.WToolkit { @Override public void beep() { System.out.println("tried to beep"); new Exception().printStackTrace(); } } and then called System.setProperty("awt.toolkit", "nobeep"); in the main method. Using the method to send a beep doesnt make it beep. Its only when sent normally. Is there a quick way to track down the cause of the beep ? Edit: After looking in the bugs database - its confirmed. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7194469 I know it says no work around but is there one (java not c++) or just wait until update 8 ?

    Read the article

  • selecting and formating text in richtextbox control vb6

    - by Smith
    i need to bold some text as i add them to the richtextbox control, currently here is my code With txtDetails If Not IsNullOrEmpty(title) Then .SelStart = Len(.Text) .Text = .Text & title .SelLength = Len(title) .SelBold = True .SelLength = 0 .Text = .Text & vbNewLine End If If Not IsNullOrEmpty(value) Then .Text = .Text & value & vbNewLine End If .Text = .Text & vbNewLine End With can anyone help me with the fix

    Read the article

  • Unzip a memorystream (Contains the zip file) and get the files

    - by user1621791
    I have a memory stream that contains a zip file in byte[] format . Is there any way I can unzip this memory stream, without any need of writing the file to disk ? In general I am using ICSharpCode.SharpZipLib.Zip.FastZip to unzip a file , But any way to unzip a memory stream ? and store the files in another memorystream or in byte[] format according to the files/folders present in the zip ? Any way I can use the Memorymapped files feature in this scenario ?

    Read the article

  • Running multiple environments on one AWS EC2 instance (Elastic Beanstalk)

    - by Abbas
    I am very new to the Amazon AWS services. I was wondering if there is a way to run an instance of EC2 (say, Amazon Linux AMI) and then connect two environments to this instance. Particularly, I'd like to run a PHP and a Tomcat environment on a single EC2 instance. The problem is, every time I create a new environment in Elastic Beanstalk, it seems to create a new EC2 instance as well. Am I missing something here? I'd appreciate any hint on this.

    Read the article

  • How to use prepared statements (named parameters) on a php Class

    - by Mohamed Adib Errifai
    This is my first post here. I've searched in the site, but inforutunaly no matchs. Anyway, i want to know how to use named parameters on a class. so the pdo basic form is something like. $query = $bdd->prepare('SELECT * FROM table WHERE login = :login AND pww = :pww'); $query->execute(array('login' => $login, 'pww' => $pww)); and i want to integrate this on a class regardless of the number of parameters. Currently, i have this code http://pastebin.com/kKgSkaKt and for parameters, i use somethings like ( which is wrong and vulnerable to injection ) require_once 'classes/Mysql.class.php'; $mysql = new Mysql(); $sql = 'SELECT * FROM articles WHERE id = '.$_GET['id'].' LIMIT 1'; $data = $mysql->select($sql); And Thanks.

    Read the article

  • .htaccess redirect noticably increasing load time

    - by GTCrais
    I set up a SEF link via .htaccess RewriteRule to one of the articles on my website just to see how that works, and it does work but it considerably increases the load time of that particular page. On average the articles (including the one I'm talking about, when not using the rewrite rule) load in about 1.3 seconds. With the rewrite rule, the load time is 3.3 seconds on average until the page displays, and the loader thingy in the firefox tab keeps spinning for another 2 seconds. I have WAMP setup on my computer, and the website is being accessed through no-ip.com. Here is the .htaccess config (very simple, as you can see): Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^o-sw-liji /NewSWL/o-nama.php?body=o-sw-liji In httpd.conf I have this (somewhere I read this might affect the load time for some reason - searching for files through all the directories or something, I don't remember exactly what I read): <Directory /> Options None AllowOverride None Order deny,allow Deny from all </Directory> DocumentRoot "Z:/Program Files (x86)/wamp/www/" <Directory "Z:/Program Files (x86)/wamp/www/"> Options None AllowOverride All Order allow,deny Allow from all </Directory> Any ideas why .htaccess redirect increases the load time by so much? UPDATE: so I put a session based counter in the "o-nama.php" script. Apparently when I access the web via the 'normal' link i.e. 'o-nama.php?body=o-sw-liji', the counter increases by one, as it should - it's one page load. But when the page is accessed through the redirected link, i.e. 'o-nama/o-sharewood-liji' the counter increases by 6-8, which naturally makes the load time a lot longer, since it's loading the same page for 6-8 times. I have no idea why this is happening. Any help is appreciated.

    Read the article

  • My xcode mapview wont work when combined with webview

    - by user1715702
    I have a small problem with my mapview. When combining the mapview code with the code for webview, the app does not zoom in on my position correctly (just gives me a world overview where i´m supposed to be somewhere in California - wish I was). And it doesn´t show the pin that I have placed on a specific location. These things works perfectly fine, as long as the code does not contain anything concerning webview. Below you´ll find the code. If someone can help me to solve this, I would be som thankful! ViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #define METERS_PER_MILE 1609.344 @interface ViewController : UIViewController <MKMapViewDelegate>{ BOOL _doneInitialZoom; IBOutlet UIWebView *webView; } @property (weak, nonatomic) IBOutlet MKMapView *_mapView; @property (nonatomic, retain) UIWebView *webView; @end ViewController.m #import "ViewController.h" #import "NewClass.h" @interface ViewController () @end @implementation ViewController @synthesize _mapView; @synthesize webView; - (void)viewDidLoad { [super viewDidLoad]; [_mapView setMapType:MKMapTypeStandard]; [_mapView setZoomEnabled:YES]; [_mapView setScrollEnabled:YES]; MKCoordinateRegion region = { {0.0,0.0} , {0.0,0.0} }; region.center.latitude = 61.097557; region.center.longitude = 12.126545; region.span.latitudeDelta = 0.01f; region.span.longitudeDelta = 0.01f; [_mapView setRegion:region animated:YES]; newClass *ann = [[newClass alloc] init]; ann.title = @"Hjem"; ann.subtitle = @"Her bor jeg"; ann.coordinate = region.center; [_mapView addAnnotation:ann]; NSString *urlAddress = @"http://google.no"; //Create a URL object. NSURL *url = [NSURL URLWithString:urlAddress]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [webView loadRequest:requestObj]; } - (void)viewDidUnload { [self setWebView:nil]; [self set_mapView:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } - (void)viewWillAppear:(BOOL)animated { // 1 CLLocationCoordinate2D zoomLocation; zoomLocation.latitude = 61.097557; zoomLocation.longitude = 12.126545; // 2 MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE); // 3 MKCoordinateRegion adjustedRegion = [_mapView regionThatFits:viewRegion]; // 4 [_mapView setRegion:adjustedRegion animated:YES]; } @end NewClass.h #import <UIKit/UIKit.h> #import <MapKit/MKAnnotation.h> @interface newClass : NSObject{ CLLocationCoordinate2D coordinate; NSString *title; NSString *subtitle; } @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *subtitle; @end NewClass.m #import "NewClass.h" @implementation newClass @synthesize coordinate, title, subtitle; @end

    Read the article

  • nodejs daemon wrong architecture

    - by Greg Pagendam-Turner
    I'm trying to run 'dali' a highcharts exporter from nodejs on my Mac under OSX Mountain Lion I'm getting the following error: module.js:485 process.dlopen(filename, module.exports); ^ Error: dlopen(/Users/greg/node_modules/daemon/lib/daemon.v0.8.8.node, 1): no suitable image found. Did find: /Users/greg/node_modules/daemon/lib/daemon.v0.8.8.node: mach-o, but wrong architecture at Object.Module._extensions..node (module.js:485:11) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) at require (module.js:378:17) at Object.<anonymous> (/Users/greg/node_modules/daemon/lib/daemon.js:12:11) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) The key part is: "wrong architecture" If I run: lipo -info /Users/greg/node_modules/daemon/lib/daemon.v0.8.8.node It returns: Non-fat file: /Users/greg/node_modules/daemon/lib/daemon.v0.8.8.node is architecture: i386 I'm guessing a x64 version is requried. How do I get and install the 64 bit version of this lib?

    Read the article

  • How to get corresponding build artifacts of a job in jenkins ?

    - by kaleeswaran14
    I create Jenkins jobs using hudson.cli.CLI jar. I have selected "Archive the artifacts" option in the "Post-build steps" section. It archives the artifacts on each succesfull build. I am using jenkins remote access api http://localhost:8080/job/job_name/api/json to get details about jobs. and http://localhost:8080/job/job_name/job_number/api/json to get details about builds. When I delete a build corresponding archived artifacts are not deleted. I'd like to make sure that they are deleted. When I use jenkins remote access api http://localhost:8080/job/[job_name]/[job_number]/api/json for a build, it returns json data which contains all previously archived artifacts (other successful builds artifacts) with this (running build) build artifact. How do I get related artifact of a build (a successful build should return its artifact, not all previous successfull artifacts). Any suggestions or ideas ?

    Read the article

  • More Than a Map - Upande

    More Than a Map - Upande In Nairobi, Kenya, we met with Mark de Blois and Bernadette Ndege. Upande has created a variety of geospatial solutions using Google Maps and Earth for a diverse range of business clients, UN organizations, Government, Non-Governmental Organizations and the public sector. Upande project Virtual Kenya is an online geospatial platform to visualize and share data about Kenya. Read more on morethanamap.com #morethanamap From: GoogleDevelopers Views: 11 0 ratings Time: 02:05 More in Science & Technology

    Read the article

  • More Than a Map - Epungo

    More Than a Map - Epungo In Sao Paulo, Brazil we met with Epungo founders André Tannús and Rodrigo Hanashiro. Epungo is real estate startup that is making waves in the Brazilian real estate market with their well designed site. We met up with the founders at their global headquarters (also known as their apartment living room). Read more on morethanamap.com #morethanamap From: GoogleDevelopers Views: 5 0 ratings Time: 02:30 More in Science & Technology

    Read the article

  • More Than a Map - Ubilabs

    More Than a Map - Ubilabs In Hamburg, Germany we met with certified Google Maps API development partner Ubilabs. Ubilabs founders Michael Pletziger and Martin Kleppe showed us some of the Google Maps API driven projects they have built for Germany's largest brands such as Deutsche Telekom, Blitzer.de, and BMW. Read more on morethanamap.com #morethanamap From: GoogleDevelopers Views: 6 0 ratings Time: 01:48 More in Science & Technology

    Read the article

  • More Than a Map - Computerlogy

    More Than a Map - Computerlogy In Bangkok, Thailand we met with the co-founder of Computerlogy, Vachara Aemavat. Computerlogy is a Google Maps API development shop. Among their many great projects, they have built a great store locator for Siam Commercial Bank and a viral maps app that helps people find high ground during the Thai flood seasons. Read more on morethanamap.com #morethanamap From: GoogleDevelopers Views: 60 4 ratings Time: 02:04 More in Science & Technology

    Read the article

  • More Than a Map #morethanamap

    More Than a Map #morethanamap Morethanamap.com also features stories from our community of developers who are using the Google Maps API to start businesses, help improve their communities or save the environment. Starting next week we'll showcase these stories weekly on the Geo Developers Blog. And follow us on Google+ to learn more. From: GoogleDevelopers Views: 305 49 ratings Time: 01:48 More in Science & Technology

    Read the article

  • Feedback Filtration&ndash;Processing Negative Comments for Positive Gains

    - by D'Arcy Lussier
    After doing 7 conferences, 5 code camps, and countless user group events, I feel that this is a post I need to write. I actually toyed with other names for this post, however those names would just lend itself to the type of behaviour I want people to avoid – the reactionary, emotional response that speaks to some deeper issue beyond immediate facts and context. Humans are incredibly complex creatures. We’re also emotional, which serves us well in certain situations but can hinder us in others. Those of us in leadership build up a thick skin because we tend to encounter those reactionary, emotional responses more often, and we’re held to a higher standard because of our positions. While we could react with emotion ourselves, as the saying goes – fighting fire with fire just makes a bigger fire. So in this post I’ll share my thought process for dealing with negative feedback/comments and how you can still get value from them. The Thought Process Let’s take a real-world example. This week I held the Prairie IT Pro & Dev Con event. We’ve gotten a lot of session feedback already, most of it overwhelmingly positive. But some not so much – and some to an extreme I rarely see but isn’t entirely surprising to me. So here’s the example from a person we’ll refer to as Mr. Horrible: How was the speaker? Horrible! Worst speaker ever! Did the session meet your expectations? Hard to tell, speaker ruined it. Other Comments: DO NOT bring this speaker back! He was at this conference last year and I hoped enough negative feedback would have taught you to not bring him back...obviously not...I will not return to this conference next year if this speaker is brought back. Now those are very strong words. “Worst speaker ever!” “Speaker ruined it” “I will not return to this conference next year if the speaker is brought back”. The speakers I invite to speak at my conference are not just presenters but friends and colleagues. When I see this, my initial reaction is of course very emotional: I get defensive, I get angry, I get offended. So that’s where the process kicks in. Step 1 – Take a Deep Breath Take a deep breath, calm down, and walk away from the keyboard. I didn’t do that recently during an email convo between some colleagues and it ended up in my reacting emotionally on Twitter – did I mention those colleagues follow my Twitter feed? Yes, I ate some crow. Ok, now that we’re calm, let’s move on to step 2. Step 2 – Strip off the Emotion We need to take off the emotion that people wrap their words in and identify the root issues. For instance, if I see: “I hated this session, the presenter was horrible! He spoke so fast I couldn’t make out what he was saying!” then I drop off the personal emoting (“I hated…”) and the personal attack (“the presenter was horrible”) and focus on the real issue this person had – that the speaker was talking too fast. Now we have a root cause of the displeasure. However, we’re also dealing with humans who are all very different. Before I call up the speaker to talk about his speaking pace, I need to do some other things first. Back to our Mr. Horrible example, I don’t really have much to go on. There’s no details of how the speaker “ruined” the session or why he’s the “worst speaker ever”. In this case, the next step is crucial. Step 3 – Validate the Feedback When I tell people that we really like getting feedback for the sessions, I really really mean it. Not just because we want to hear what individuals have to say but also because we want to know what the group thought. When a piece of negative feedback comes in, I validate it against the group. So with the speaker Mr. Horrible commented on, I go to the feedback and look at other people’s responses: 2 x Excellent 1 x Alright 1 x Not Great 1 x Horrible (our feedback guy) That’s interesting, it’s a bit all over the board. If we look at the comments more we find that the people who rated the speaker excellent liked the presentation style and found the content valuable. The one guy who said “Not Great” even commented that there wasn’t anything really wrong with the presentation, he just wasn’t excited about it. In that light, I can try to make a few assumptions: - Mr. Horrible didn’t like the speakers presentation style - Mr. Horrible was expecting something else that wasn’t communicated properly in the session description - Mr. Horrible, for whatever reason, just didn’t like this presenter Now if the feedback was overwhelmingly negative, there’s a different pattern – one that validates the negative feedback. Regardless, I never take something at face value. Even if I see really good feedback, I never get too happy until I see that there’s a group trend towards the positive. Step 4 – Action Plan Once I’ve validated the feedback, then I need to come up with an action plan around it. Let’s go back to the other example I gave – the one with the speaker going too fast. I went and looked at the feedback and sure enough, other people commented that the speaker had spoken too quickly. Now I can go back to the speaker and let him know so he can get better. But what if nobody else complained about it? I’d still mention it to the speaker, but obviously one person’s opinion needs to be weighed as such. When we did PrDC Winnipeg in 2011, I surveyed the attendees about the food. Everyone raved about it…except one person. Am I going to change the menu next time for that one person while everyone else loved it? Of course not. There’s a saying – A sure way to fail is to try to please everyone. Let’s look at the Mr. Horrible example. What can I communicate to the speaker with such limited information provided in the feedback from Mr. Horrible? Well looking at the groups feedback, I can make a few suggestions: - Ensure that people understand in the session description the style of the talk - Ensure that people understand the level of detail/complexity of the talk and what prerequisite knowledge they should have I’m looking at it as possibly Mr. Horrible assumed a much more advanced talk and was disappointed, while the positive feedback by people who – from their comments – suggested this was all new to them, were thrilled with the session level. Step 5 – Follow Up For some feedback, I follow up personally. Especially with negative or constructive feedback, its important to let the person know you heard them and are making changes because of their comments. Even if their comments were emotionally charged and overtly negative, it’s still important to reach out personally and professionally. When you remove the emotion, negative comments can be the best feedback you get. Also, people have bad days. We’ve all had one of “those days” where we talked more sternly than normal to someone, or got angry at something we’d normally shrug off. We have various stresses in our lives and sometimes they seep out in odd ways. I always try to give some benefit of the doubt, and re-evaluate my view of the person after they’ve responded to my communication. But, there is such a thing as garbage feedback. What Mr. Horrible wrote is garbage. It’s mean spirited. It’s hateful. It provides nothing constructive at all. And a tell-tale sign that feedback is garbage – the person didn’t leave their name even though there was a field for it. Step 6 – Delete It Feedback must be processed in its raw form, and the end products should drive improvements. But once you’ve figured out what those things are, you shouldn’t leave raw feedback lying around. They are snapshots in time that taken alone can be damaging. Also, you should never rest on past praise. In a future blog post, I’m going to talk about how we can provide great feedback that, even when its critical, can still be constructive.

    Read the article

  • Building a Repository Pattern against an EF 5 EDMX Model - Part 1

    - by Juan
    I am part of a year long plus project that is re-writing an existing application for a client.  We have decided to develop the project using Visual Studio 2012 and .NET 4.5.  The project will be using a number of technologies and patterns to include Entity Framework 5, WCF Services, and WPF for the client UI.This is my attempt at documenting some of the successes and failures that I will be coming across in the development of the application.In building the data access layer we have to access a database that has already been designed by a dedicated dba. The dba insists on using Stored Procedures which has made the use of EF a little more difficult.  He will not allow direct table access but we did manage to get him to allow us to use Views.  Since EF 5 does not have good support to do Code First with Stored Procedures, my option was to create a model (EDMX) against the existing database views.   I then had to go select each entity and map the Insert/Update/Delete functions to their respective stored procedure. The next step after I had completed mapping the stored procedures to the entities in the EDMX model was to figure out how to build a generic repository that would work well with Entity Framework 5.  After reading the blog posts below, I adopted much of their code with some changes to allow for the use of Ninject for dependency injection.http://www.tcscblog.com/2012/06/22/entity-framework-generic-repository/ http://www.tugberkugurlu.com/archive/generic-repository-pattern-entity-framework-asp-net-mvc-and-unit-testing-triangle IRepository.cs public interface IRepository : IDisposable where T : class { void Add(T entity); void Update(T entity, int id); T GetById(object key); IQueryable Query(Expression> predicate); IQueryable GetAll(); int SaveChanges(); int SaveChanges(bool validateEntities); } GenericRepository.cs public abstract class GenericRepository : IRepository where T : class { public abstract void Add(T entity); public abstract void Update(T entity, int id); public abstract T GetById(object key); public abstract IQueryable Query(Expression> predicate); public abstract IQueryable GetAll(); public int SaveChanges() { return SaveChanges(true); } public abstract int SaveChanges(bool validateEntities); public abstract void Dispose(); } One of the issues I ran into was trying to do an update. I kept receiving errors so I posted a question on Stack Overflow http://stackoverflow.com/questions/12585664/an-object-with-the-same-key-already-exists-in-the-objectstatemanager-the-object and came up with the following hack. If someone has a better way, please let me know. DbContextRepository.cs public class DbContextRepository : GenericRepository where T : class { protected DbContext Context; protected DbSet DbSet; public DbContextRepository(DbContext context) { if (context == null) throw new ArgumentException("context"); Context = context; DbSet = Context.Set(); } public override void Add(T entity) { if (entity == null) throw new ArgumentException("Cannot add a null entity."); DbSet.Add(entity); } public override void Update(T entity, int id) { if (entity == null) throw new ArgumentException("Cannot update a null entity."); var entry = Context.Entry(entity); if (entry.State == EntityState.Detached) { var attachedEntity = DbSet.Find(id); // Need to have access to key if (attachedEntity != null) { var attachedEntry = Context.Entry(attachedEntity); attachedEntry.CurrentValues.SetValues(entity); } else { entry.State = EntityState.Modified; // This should attach entity } } } public override T GetById(object key) { return DbSet.Find(key); } public override IQueryable Query(Expression> predicate) { return DbSet.Where(predicate); } public override IQueryable GetAll() { return Context.Set(); } public override int SaveChanges(bool validateEntities) { Context.Configuration.ValidateOnSaveEnabled = validateEntities; return Context.SaveChanges(); } #region IDisposable implementation public override void Dispose() { if (Context != null) { Context.Dispose(); GC.SuppressFinalize(this); } } #endregion IDisposable implementation } At this point I am able to start creating individual repositories that are needed and add a Unit of Work.  Stay tuned for the next installment in my path to creating a Repository Pattern against EF5.

    Read the article

  • Unobtrusive Maximum Input Lengths with JQuery and FluentValidation

    - by Steve Wilkes
    If you use FluentValidation and set a maximum length for a string or a maximum  value for a numeric property, JQuery validation is used to show an error message when the user inputs too many characters or a numeric value which is too big. On a recent project we wanted to use input’s maxlength attribute to prevent a user from entering too many characters rather than cure the problem with an error message, and I added this JQuery to add maxlength attributes based on JQuery validation’s data- attributes. $(function () { $("input[data-val-range-max],input[data-val-length-max]").each(function (i, e) { var input = $(e); var maxlength = input.is("[data-val-range-max]") ? input.data("valRangeMax").toString().length : input.data("valLengthMax"); input.attr("maxlength", maxlength); }); }); Presto!

    Read the article

  • Get the Windows 7 Start Menu Back in Windows 8 with Classic Shell

    - by deadlydog
    I just thought I’d give readers a heads up that you can use Classic Shell to get the old Windows 7 style of start menu back instead of using the new crappy Windows 8 metro start screen; plus it’s free and open source .  You can still access the metro start screen with Shift+WindowsKey or Shift clicking the start menu button.  This program also defaults to showing the desktop on startup instead of the metro start screen (but that can be disabled), and is super configurable and has tons of options to tweak it just the way you want if you are picky like me   The only thing I would say is when installing the app, only install the Classic Start Menu; you don’t need the other ones. You’re welcome, and happy coding!

    Read the article

  • added shell script to sudoers still getting permission denied

    - by Bill S
    I don't understand this? Other uses of sudo work fine. [oracle@o plugins]$ su Password: [root@ plugins]# su nrpe bash-3.2$ /home/oracle/obiee/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/bi-init.sh bash: /home/oracle/obiee/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/bi-init.sh: Permission denied bash-3.2$ sudo -l Matching Defaults entries for nrpe on this host: env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY" Runas and Command-specific defaults for nrpe: User nrpe may run the following commands on this host: (ALL) NOPASSWD: /home/oracle/obiee/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/bi-init.sh bash-3.2$

    Read the article

  • Apache: Use requested directory as a parameter

    - by friendlycello
    Here's what I'd like to do: If a user goes to www.example.com/thislocation, I'd like to redirect to a particular script and give it "thislocation" as a parameter. So if a user navigated to www.example.com/thislocation, I'd like to redirect to www.example.com/cgi-bin/test.pl?parameter=thislocation, and similarily, if the user navigated to www.example.com/thatlocation, I'd like to redirect to www.example.com/cgi-bin/test.pl?parameter=thatlocation. Is this possible with Apache?

    Read the article

  • How to check if redis master is OK?

    - by e-satis
    On the documentation, they advice the monitor command. But it has a 50% performance penalty for the whole system, and how should I do that ? Whatching the ouput using SSH until I don't see anything ? Let's say I have 3 servers: 1 with a redis master, 1 with a redis slave, and one with my website querying the redis master. How can I, from my website server, make cleany the decision to fallback to the slave by sending the SLAVEOF NO ONE command ? My first step would be to put some kind of timeout check with a simple ping, just to be sure the server is online. But for redis specifically, I have no clue.

    Read the article

  • 'The RPC server is unavailable' when converting a physical ISA/Forefront TMG machine to virtual (P2V) in SCVMM

    - by Goran B.
    When I try to convert a physical ISA/TMG machine to virtual using SCVMM, i keep getting an error in the Collect machine configuration step ('Scan Now' button): VMM is unable to complete the request. The connection to the agent MACHINE_NAME was lost. Ensure that the computer MACHINE_NAME exists on the network, WMI service and the agent are installed and running and that a firewall is not blocking HTTP and WMI traffic. ID: 3157 Details: The RPC server is unavailable (0x800706BA) Firewall rules allow for RPC traffic from the SCVMM machine to ISA/TMG machine.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17  | Next Page >