Daily Archives

Articles indexed Saturday January 15 2011

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

  • Mixing expressions and expression language (<%= %> inside of c:if)

    - by Jack
    I need to access some constants in my jsp, and sadly the EL does not offer any functionality for it. There are some options like the unstandard tag library, but I'd like to keep it a bit more standard. I tried: <%@ page import = "com.jackdane.Constants"%> <c:if test="${object.display == '<%=com.jackdane.Constants.YES %>}'"> //some display logic </c:if> But that doesn't appear to do the trick. It's been a while since I've used an expression so I might have made an error. Any input is appreciated. Edit: To clarify, the constants class is not in my control. It's inside a jar file that I recieved. It contains no getters/setters. Just private static final Strings.

    Read the article

  • Advantage Database Replication

    - by Jon
    I have a client that wants two sites to have the ability to sync databases so information at Site A can be synced with Site B so the two sites can look at the same data. I'm not even sure of the infrastructure required. Would a VPN required to connect the 2 databases or would an internet based database work ie/Site A to InternetDatabase and Site B to InternetDatabase. Each site copies data to it periodically and then the InternetDatabase syncs it and the Sites can then pull data down. My other thought was something like Dropbox. If Site A and Site B use a Dropbox account to sync the ADT files etc can the database at each site then sync with those ADT files? Thanks

    Read the article

  • What's wrong with this SQL Server query ?

    - by ClixNCash
    What's wrong this T-SQL query : Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim SQLData As New System.Data.SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True") Dim cmdSelect As New System.Data.SqlClient.SqlCommand("SELECT COUNT(*) FROM Table1 WHERE Name ='" + TextBox1.Text + "'", SQLData) SQLData.Open() If cmdSelect.ExecuteScalar > 0 Then Label1.Text = "You have already voted this service" Return End If Dim con As New SqlConnection Dim cmd As New SqlCommand con.Open() cmd.Connection = con cmd.CommandText = "INSERT INTO Tabel1 (Name) VALUES('" & Trim(Label1.Text) & "')" cmd.ExecuteNonQuery() Label1.Text = "Thank You !" SQLData.Close() End Sub

    Read the article

  • How to generate complex url like stackoverflow?

    - by Freewind
    I'm using playframework, and I hope to generate complex urls like stackoverflow. For example, I want to generate a question's url: http://aaa.com/questions/123456/How-to-generator-a-complex-url Note the last part, it's the title of the question. But I don't know how to do it. UPDATED In the playframework, we can define routes in conf/routes file, and what I do is: GET /questions/{<\d+>id} Questions.show In this way, when we call @{Questions.show(id)} in views, it will generate: http://aaa.com/questions/123456 But how to let the generated has a title part, is difficult.

    Read the article

  • NHibernate: What are child sessions and why and when should I use them?

    - by stefando
    In the comments for the ayende's blog about the auditing in NHibernate there is a mention about the need to use a child session:session.GetSession(EntityMode.Poco). As far as I understand it, it has something to do with the order of the SQL operation which session.Flush will emit. (For example: If I wanted to perform some delete operation in the pre-insert event but the session was already done with deleting operations, I would need some way to inject them in.) However I did not find documentation about this feature and behavior. Questions: Is my understanding of child sessions correct? How and in which scenarios should I use them? Are they documented somewhere? Could they be used for session "scoping"? (For example: I open the master session which will hold some data and then I create 2 child-sessions from the master one. I'd expect that the two child-scopes will be separated but the will share objects from the master session cache. Is this the case?) Are they first class citizens in NHibernate or are they just hack to support some edge-case scenarios? Thanks in advance for any info.

    Read the article

  • Cannot open database requested by the login. The login failed. Login failed for user

    - by Cipher
    Hi, I have copied a DB from one my computers and using it here. On trying to open the page which requires the fetching content from DB, on con.open I am getting this exception: Unable to open the physical file "E:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\cakephp.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)". Unable to open the physical file "E:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\cakephp_log.LDF". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)". Cannot open database "cakephp" requested by the login. The login failed. Login failed for user 'Sarin-PC\Sarin'. I have attached the database from Management Studio Express 2008 and I have also checcked the connection string. Here it is: <connectionStrings> <add name="cn" connectionString="server=.\sqlexpress;database=cakephp;integrated security=true;uid=sarin;pwd=******"/> </connectionStrings> In Visual Studio, when I test the connection, it says "Test connection succeeded". However, there is one strange thing going on. When I login to the Management Studio, there is no + sign with the newly attached database, as shown. If the full WebConfig is reqiured to be seen, I have pasted it here: http://pastebin.com/sVAuN0Ug

    Read the article

  • Evaluating server certificate

    - by Raven
    Hi, How can I detect a self signed certificate from a revoked or expired ones? I'm using NSURLConnection and implementing connection:didReceiveAuthenticationChallenge: on delegate: - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{ if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]){ NSURLProtectionSpace *tmpSpace=[challenge protectionSpace]; SecTrustRef currentServerTrust=[tmpSpace serverTrust]; SecTrustResultType trustResult; OSStatus err = SecTrustEvaluate(currentServerTrust, &trustResult); BOOL trusted = (err == noErr) && ((trustResult == kSecTrustResultProceed) || (trustResult == kSecTrustResultUnspecified)); if (trusted){ // Do something } } } Currently the "if (trusted){}" block only work for certificates trusted by iOS, I want it to work for others as well, but only if the certificate isn't revoked or expired. The documentation is using SecTrustSettingsSetTrustSettings for changing the settings and reevaluate the trust. but I couldn't find this method (or the SecTrustSetting) for iOS, only for Mac. Thanks

    Read the article

  • PHP and storing stats

    - by John
    Using PHP5 and the latest version of MySQL I want to be able to track impressions and clicks for business listings. My question is if I did this myself what would be the best method in storing it so I can run reports? Before I just had a table that had the listing id, user ip address and if it was a click or impression as well as the date it was tracked. However the database itself is approaching 2GB of data and its very slow, part of the problem is its a pretty simple script that includes impressions and clicks from anyone including search engines and basically anyone or anything that accesses the listing page. Is there an api or file out there that has an update to date list that can detect if the person viewing is a actually person and not a spider so I dont fill up the database with unneeded stats? Just looking for suggestions, do I just have a raw database that gets just the hits then a cron job at night tally up for the day for each listing for each ip and store the cumulative stats in a different table? Also what type of database should it be? Innodb? MyISAM?

    Read the article

  • Searching a list of tuples in python

    - by Niclas Nilsson
    I'm having a database (sqlite) of members of an organisation (less then 200 people). Now I'm trying to write an wx app that will search the database and return some contact information in a wx.grid. The app will have 2 TextCtrls, one for the first name and one for the last name. What I want to do here is make it possible to only write one or a few letters in the textctrls and that will start to return result. So, if I search "John Smith" I write "Jo" in the first TextCtrl and that will return every single John (or any one else having a name starting with those letters). It will not have an "search"-button, instead it will start searching whenever I press a key. One way to solve this would be to search the database with like " SELECT * FROM contactlistview WHERE forname LIKE 'Jo%' " But that seems like a bad idea (very database heavy to do that for every keystroke?). Instead i thought of use fetchall() on a query like this " SELECT * FROM contactlistview " and then, for every keystroke, search the list of tuples that the query have returned. And that is my problem: Searching a list is not that difficult but how can I search a list of tuples with wildcards?

    Read the article

  • Which to use, XMP or RDF?

    - by zotty
    What's the difference between RDF and XMP? From what I can tell, XMP is derived from RDF... so what does it offer that RDF doesn't? My particular situation is this: I've got some images which need tagging with details of how an experiment was performed, and what sort of data analysis has been performed on the images. A colleague of mine is pushing for XMP, but he's thinking of the images as photos - they're not really, they're just bits of data. From what I've seen (mainly by opening images in notepad++) the XMP data looks very similar to RDF - even so far as using RDF in the tag names (e.g. <rdf:Seq>). I'd like this data to be usable by other people who use similar instruments for similar experiments, so creating a mini standard (schema?) seems like the way to go. Apologies for the lack of fundemental understanding - I'm a Doctor, not a programmer! If it makes any difference, the language of choice will be C#. Edit for more information: First off, thanks for the excellent replies - thinking of XMP as a vocabulary for RDF makes things a lot clearer. The sort of data I'll be storing wont be avaliable in any of the pre-defined sets. It'll detail experimental set ups, locations and results. I think using RDF is the way to go.

    Read the article

  • Which is better? private static vs private

    - by KiD0M4N
    In this code sample: public class SuperMan { private static bool IsProper(decimal x) { return x > 31.0m && x < 45.0m; } public bool CheckStuff(string a, string b, string c) { // lots of code, some of which introduces a variable x return IsProper(x) && /* other conditions */; } } Should IsProper(..) be a 'private static' or a 'private'. Assuming: IsProper(..) doesn't need to access any instance state.

    Read the article

  • C# / Visual Studio - Object is null unless I have a Breakpoint

    - by user576611
    Hi Everyone, I'm specifically using the Google Contacts API at the moment, but this could be true of other scinarios as well. I have the following code: Contact newContact = new Contact(); When I let the code run without any breakpoints, I get a NullReferenceException on all of the properties of this object. However, if I put a breakpoint just after this line, I can see all of the properties have been initialises and the rest of my code executes fine. Any idea's would be greatly appreciated

    Read the article

  • workflow 4 activity designer IValueConverter

    - by pdiddy
    Lets say i have an activity with InArgument<int> ProductId I'd like to expose in the activity designer a combobox to show all Products and the user can select a product. I can show the list of product in the combo no problem. But how do I bind the selected product to the InArgument<int> of my custom activity? I suppose I need some kind of ValueConverter? Not sure how to code the value converter for this case, if anybody has an idea, suggestion, will be helpful. I have to convert the InArgument<int> to an int? and the convert back from int to InArgument<int> Thanks,

    Read the article

  • jquery / javascript for upload the file from browser to server

    - by Lalit
    Hi, I am developing the application in asp.net mvc with c#. I want the functionality that , a div will popup, so that i can facilate to use to upload the image file from his browser to server , in application domains file system. as usual. This question may be repeat , but i expect something more like how to build this scenario, and what are the security issues may come? and what care have to take while coding in the security perspective ?

    Read the article

  • Is it a good practice for a .js file to rely on variables declared in the including html

    - by Bozho
    In short: <script type="text/javascript"> var root = '${config.root}'; var userLanguage = '${config.language}'; var userTimezone = '${config.timezone}'; </script> <script type="text/javascript" src="js/scripts.js"></script> And then, in scripts.js, rely on these variables: if (userLanguage == 'en') { .. } The ${..} is simply a placeholder for a value in the script that generates the page. It can be php, jsp, asp, whatever. The point is - it is dynamic, and hence it can't be part of the .js file (which is static). So, is it OK for the static javascript file to rely on these externally defined configuration variables? (they are mainly configuration, of course). Or is it preferred to make the .js file be served dynamically as well (i.e. make it a .php / .jsp, with the proper Content-Type), and have these values defined in there.

    Read the article

  • APress Deal of the Day 15/Jan/2011 - Windows Mobile Game Development: Building games for the Windows Phone and other mobile devices

    - by TATWORTH
    Todays Apress $10 deal of the the day is: Windows Mobile Game Development: Building games for the Windows Phone and other mobile devices This book will provide you with a comprehensive guide to developing games for both the Windows Mobile platform and the Windows Phone using the industry standard programming languages C# and VB.NET. $49.99 | Published Apr 2010 | The book dates from the VS2005/VS2008 era but should still be useful to VS2010 developers. Given that such games development can now be done within Visual Studio. Whilst these devices use the Compact Framework instead of the standard Dot Net Framework, it is still a familiar envirnment. This book should be of benefit not just to games developers but to anyone with an interest in development for mobile phones.

    Read the article

  • Is it safe to use Email service that provided from webhosting for business use?

    - by Kronass
    I work in a company who uses their web-hosting as their email provider, they use it for normal send, receive and basic contacts management, they use it in customers support, sales and marketing, I would prefer to use a dedicated or professional email hosting instead for this type of work. So for business use is it safe to use the email hosting that is included with hosting package or go with a professional email provider?

    Read the article

  • How to configure `lxc` like `openvz`

    - by cam
    I was going to fire up a OpenVZ node to test out some software, but it looks like OpenVZ is no longer supported in Ubuntu (deprecated in favor of lxc. It looks like can do more than simply virtualize an entire system, and I'm having trouble finding good documentation that would explain how I can start a virtualized system (using an openvz template or something). Could someone give me some pointers or direct me to some good documentation?

    Read the article

  • Mixed IP and Name Based Virtual Hosts with nginx

    - by nerkn
    I set up many domains but I dont know how to configure if only ip address is given. say foo.com I have a setup to go web/foo.com/htdocs, I want to 88.99.66.55 ip address like a domain to web/fook.com/htdocs server { listen 80; server_name 85.99.66.55; location / { root /home/web/fook.com/htdocs; } location ~ \.(php|php3|php4|php5)$ { root /home/web/fook.com/htdocs; include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } } resulted [warn]: conflicting server name "85.105.65.219" on 0.0.0.0:80, ignored

    Read the article

  • One server, Two APC UPS on redundant power supplies : How to trigger shutdown ?

    - by Falken
    I have a server racked and its redundant power supplies plugged in two APC Smart-UPS 3000 XLM. Each UPS is connected to two different mains power sources. Two instances of apcupsd are running, each one connected to its own UPS. They can both detect when an UPS is on Battery, and each UPS can then trigger a shutdown on the server. Question is : How NOT to shutdown if ONLY ONE UPS runs out of battery ? Note : Smart-UPS 3000 XLM has a "Power Sync" Function that is able to connect to its peer and detect its status. But when I pulled the plug out of one of them, the Shutdown order was sent anyway. I'm thinking about modifying the shutdown scripts to check with "apcaccess" if the other ups is down. Any experience on this would be appreciated !

    Read the article

  • Access denied for user 'root@localhost' (using password:NO)

    - by murgatroid99
    I am attempting to install a network management package called cacti onto Ubuntu running under Windows Virtual PC. I attempted to install MySQL as it is one of cacti's dependencies. I can install and start the MySQL server, but whenever I try to access it in any other way, such as to change the password, I get the error message Access denied for user 'root@localhost' (using password:NO). I would like to know what is causing this and how to fix it. Edit: (just in case my comments are not visible) The answers from HD and Devin Ceartas did not work for me.

    Read the article

  • [Notepad++] delete rest of line after specific string

    - by nixdagibts
    I'm looking for a way to search for a specific string e.g. '=UUID:' and delete it and all following characters per line. I would prefer a way/macro/addon for notepad++. But all other tools or scripts are welcome :) Before ://81.88.22.6/=UUID:63969B2469B7A94EBBDBD7CB5B9C00BA ://-ad.cgi*=UUID:3C8EFF48B674CC42BF5B6E2B7BA820E7 ://-ads/*=UUID:0D6CF7D5BE3F034C8A136CC99A074406 Note that the numbers are always different per line so you couldn't do a search 'n replace with them. Should look like this after ://81.88.22.6/ ://-ad.cgi* ://-ads/*

    Read the article

  • Job queueing in Toast Titanium 10?

    - by moonslug
    I have a bunch of .MP4 video files I'm burning to DVD-Video using Toast Titanium 10 on my MacBook Pro. Right now, I'm doing them one at a time. Because my computer is several years old, encoding video for a single DVD takes approximately six hours. I've discovered that it appears I can encode the video directly to a .toast format — however, I have yet to figure out if I can burn these directly to DVD. Also, I have quite a bit of video left to burn, and even that method would require me intervening manually to start a new encoding or burn job every six hours. Would it be possible to somehow queue up multiple DVD-Video encoding jobs at once, and have the computer work through them automatically? The actual writing to DVD disc doesn't take nearly as long, and if I had all my video encoded for me to begin with my job would be a lot quicker. Maybe this can be accomplished with a different piece of software?

    Read the article

  • ASP.NET MVC3 est disponible, et intègre l'IntelliSense et la coloration syntaxique Razor

    ASP.NET MVC3 est disponible et intègre l'IntelliSense et la coloration syntaxique Razor Mise à jour du 14/01/11 ASP.net MVC 3 est officiellement disponible en version finale. En prélude au lancement officiel de son EDI pour débutants ou petites entreprises « Webmatrix » qui a eu lieu dans la nuit, Microsoft a mis à la disposition des utilisateurs plusieurs produits gratuits parmi lesquels la version finale de son framework Web ASP.net MV...

    Read the article

  • BSNL Routers: Default Username and Password To Access Admin Interface

    - by Gopinath
    Problem You have BSNL broadband set up at home and everything is working fine. But one fine day you something went wrong or you would like to change the properties of your BSNL modem by logging in to the admin user interface of your modem. What is the default username and password to login to BSNL Router user interface? Solution Here are the default username, password to access your BSNL router admin interface URL: http://192.168.1.1/ Username: admin Password: admin Note: The above username and password are the default ones that works with all the BSNL routers until unless someone has changed them. This article titled,BSNL Routers: Default Username and Password To Access Admin Interface, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

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