Search Results

Search found 4677 results on 188 pages for 'alternative'.

Page 114/188 | < Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >

  • logging in scala

    - by IttayD
    In Java, the standard idiom for logging is to create a static variable for a logger object and use that in the various methods. In Scala, it looks like the idiom is to create a Logging trait with a logger member and mixin the trait in concrete classes. This means that each time an object is created it calls the logging framework to get a logger and also the object is bigger due to the additional reference. Is there an alternative that allows the ease of use of "with Logging" while still using a per-class logger instance? EDIT: My question is not about how one can write a logging framework in Scala, but rather how to use an existing one (log4j) without incurring an overhead of performance (getting a reference for each instance) or code complexity. Also, yes, I want to use log4j, simply because I'll use 3rd party libraries written in Java that are likely to use log4j.

    Read the article

  • How to check if a form is submited via javascript?

    - by SteD
    I have this conventional submit button which submit a form like this: <form method="post" id="form_submit"> ... <input class="button" type="submit" name="Submit" value="Submit"> </form> And I check if the submit button is clicked using this: if(isset($_POST['Submit'])){ //update DB } Now I have a submit link using jquery: <a href="#" onclick="publish(); return false;">Submit</a> JS code: $("#form_submit").submit(); What is the alternative way here to be used here for if(isset($_POST['Submit'])) since I'm submitting the form using javascript?

    Read the article

  • Worst side effects from chars signedness. (Explanation of signedness effects on chars and casts)

    - by JustSmith
    I frequently work with libraries that use char when working with bytes in C++. The alternative is to define a "Byte" as unsigned char but that not the standard they decided to use. I frequently pass bytes from C# into the C++ dlls and cast them to char to work with the library. When casting ints to chars or chars to other simple types what are some of the side effects that can occur. Specifically, when has this broken code that you have worked on and how did you find out it was because of the char signedness? Lucky i haven't run into this in my code, used a char signed casting trick back in an embedded systems class in school. I'm looking to better understand the issue since I feel it is relevant to the work I am doing.

    Read the article

  • Is it okay to use try catch inside finally?

    - by Hiral Lakdavala
    Hi, I am using a buffered writer and my code, closes the writer in the finally block. My code is like this. ........... BufferedWriter theBufferedWriter = null; try{ theBufferedWriter =..... .... ...... ..... } catch (IOException anException) { .... } finally { try { theBufferedWriter.close(); } catch (IOException anException) { anException.printStackTrace(); } } I have to use the try catch inside the clean up code in finally as theBufferedWriter might also throw an IOException. I do not want to throw this exception to the calling methos. Is it a good practice to use a try catch in finally? If not what is the alternative? Please suggest. Regards, Hiral

    Read the article

  • How simplify iPhone localization?

    - by mamcx
    I need to localiza a in development app for English & Spanish. Despite the fact I follow the Apple way of use NSLocalizedString & create nibs for both, I already lost the track of the new string that need to get localized and found with surprise that I need to redo the nibs in spanish when I change the master. (Just like this http://www.gigliwood.com/weblog/Cocoa/A_Great_Need_for_Be.html) I wonder if exist a better/alternative/more automated way. I know the use of gettext & poedit and wonder if something like that can be used. Or if exist some script or tool for this.

    Read the article

  • Using table-of-contents in code?

    - by AareP
    Do you use table-of-contents for listing all the functions (and maybe variables) of a class in the beginning of big source code file? I know that alternative to that kind of listing would be to split up big files into smaller classes/files, so that their class declaration would be self-explanatory enough.. but some complex tasks require a lot of code. I'm not sure is it really worth it spending your time subdividing implementation into multiple of files? Or is it ok to create an index-listing additionally to the class/interface declaration?

    Read the article

  • lucene get matched terms in query

    - by iamrohitbanga
    what is the best way to find out which terms in a query matched against a given document returned as a hit in lucene? I have tried a weird method involving hit highlighting package in lucene contrib and also a method that searches for every word in the query against the top most document ("docId: xy AND description: each_word_in_query"). Do not get satisfactory results? hit highlighting does not report some of the words that matched for a document other than the first one. i am not sure if the second approach is the best alternative.

    Read the article

  • Is it possible to take a screenshot of a web page with Javascript or HTML5/Canvas?

    - by Ryan Kearney
    Is there a way I could insert some code into a page that would take a screenshot of what the user sees in the browser window, then upload that image via a web form of some sort? I'm working on a clone of a pay-to-use service that lets you install a widget on a web page which in turn allows viewers to report bugs in the sites layout. Currently they use a Java applet to take the screenshot, which, in my opinion, is probably the worst way to go about it (aside from requiring the user to install a plugin) Is there a javascript/flash/other alternative? Thanks

    Read the article

  • Asset tracking in "real-time" - how best to display in browser?

    - by mawg
    I am developing an asset tracking system, standard LAMP, and now am wondering how best to present the data to the user in the browser. I expect to track and most a few thousand items, and to refresh them every second or so. I want to draw a floorplan or map of the area and represent the assets the assets symbolically on that (with different symbols for different classes of assets). Additionally, the user should be able to click on an asset to interact with it, and search for a particular asset and centre the screen on it, draw a circle round it, etc http://graphite.wikidot.com/ Looks good - is there any alternative? At its simplest, I suppose I could just generate a JPEG and display it, using CSS to let me know if/where a user clicks ... but what's the "best" way to do it?

    Read the article

  • SQL Server T-SQL statement to replace/delete sub-strings

    - by StefanE
    Hi, I have a table with 6 columns containing HTML content with some markups in it and now when moving to a new designed site most of this HTML code has to be deleted. More or less all tags except <B> and </B>. Is there a nice way of doing this, identify all tags end delete them within the data? I'm sure there are no < symbols in the test so a regular expression would maybe work? My alternative is to fetch every row, process it and update the database but I'm guessing this is possible to do in T-SQL directly. My server is an MSSQL 2008 and is located in a hosted environment but I can fetch a local copy if needed. Thanks, Stefan

    Read the article

  • Per query relevance elevation for solr?

    - by plusplus
    I want to tune the relevance of solr search results on a per user basis - based on the number of times the user has clicked through a result before. Frequently hit items FOR THAT USER should rise to the top of their search results. Is there a way to provide custom boost/elevation for particular document ids on the query? I'm thinking in the order of ~100s of particular documents to elevate. The elevation should have no effect if the rest of the query doesn't find those documents. Alternatively, if this isn't possible, what is a sane way for setting up an alternative indexing approach that would make this possible? Could I add a field per user in the index to store their scores? I'm thinking in the order of 1000 users. The major drawback of that approach is the number of times a document would need to be reindexed (i.e. each time it was used by the user).

    Read the article

  • Payment Gateway Question

    - by Sphynx
    Hi, My question is not exactly about coding, and I'm not sure if I can ask it here. Nevertheless, it's somewhat related to the payment integration process. I'm going to establish a service, and deliver it through a website. When you accept payments through PayPal, they display your actual name to every client, and I'm not that comfortable with such lack of privacy. Is there any way around that? Perhaps an alternative payment gateway that doesn't display your personal info to everyone? Any suggestions welcome! Thanks

    Read the article

  • Redirecting user from an old web to another in Sharepoint

    - by BeraCim
    Hi all: I want to add the ability to redirect users when they visit certain old sites. The URL of the old sites are unknown, but the server name is the same, e.g. Old site url: http://sharepoint/mySite/default.aspx New site url: http://sharepoint/myNewSite/... There are a lot of other pages within mySite, most of which must be redirected to the new site, but there are exceptions (e.g. user can still view the documents within the site). I thought I have to do this programmatically by somehow capturing the http request and read the url myself. Being no sharepoint guru, I had a quick google, and found that writing a web part is prehaps the best alternative for my situation. But I'm just wondering, given my situation and needs, is writing a web part, or something programmatically, really the ideal solution? Or is there a faster and quicker way to achieve what I want using Sharepoint? Thanks.

    Read the article

  • Bash: Check if file was modified since used in script

    - by Thomas Münz
    I need to check in a script if a file was modified since I read it (another application can modify it in between). According to bash manual there is a "-N" test which should report if a file was modified since last read. I tried it in a small script but it seems like it doesn't work. #!/bin/bash file="test.txt" echo "test" > $file cat $file; if [ -N $file ]; then echo "modified since read"; else echo "not modified since read"; fi I also tried an alternative way by touching another file and using if [ "file1" -nt "file2 ]; but this works only on a seconds accuracy which may under rare conditions not be sufficient. Is there any other bash-inbuilt solution for this problem or I do really need to use diff or md5sum?

    Read the article

  • Alternatives to nested interfaces (not possible in C#)

    - by ericdes
    I'm using interfaces in this case mostly as a handle to an immutable instance of an object. The problem is that nested interfaces in C# are not allowed. Here is the code: public interface ICountry { ICountryInfo Info { get; } // Nested interface results in error message: // Error 13 'ICountryInfo': interfaces cannot declare types public interface ICountryInfo { int Population { get; } string Note { get; } } } public class Country : ICountry { CountryInfo Info { get; set; } public class CountryInfo : ICountry.ICountryInfo { int Population { get; set; } string Note { get; set; } ..... } ..... } I'm looking for an alternative, anybody would have a solution?

    Read the article

  • Developing "Command Line" in .NET?

    - by Sergey Malyan
    Imagine a "search box" on the right top side of the UI Windows Application. When user types a desired action, a matching functionality is executed. Screen gets opened, or action gets performed. For example: user types "create" and intellisence offered next word options "client"/"product", user picks "client", and "Create New Client" screen opens up. So what I am looking for if there is a framework support for this. I assume that framework shall bind together text commands names, commands and show in intellisense. Same framework possibly could have been used in alternative "Command Line interface". I recall Microsoft had some recent framework that helps to setup "command Line Interface" environmental. It is hard to search on web for this keywords, so relying on intelligent help from you guys. Thanks in advance.

    Read the article

  • MS-SQL statement to replace/delete sub-strings

    - by StefanE
    Hi, I have a table with 6 columns containing HTML content with some markups in it and now when moving to a new designed site most of this HTML code has to be deleted. More or less all tags except and . Is there a nice way of doing this, identify all tags end delete them within the data? I'm sure there are no < symbols in the test so a regular expression would maybe work? My alternative is to fecth every row, process it and update the database but I'm guessing this is possible to do in SQL directly. Thanks, Stefan

    Read the article

  • How to implement Auto_Increment per User, on the same table?

    - by Jonas
    I would like to have multiple users that share the same tables in the database, but have one auto_increment value per user. I will use an embedded database, JavaDB and as what I know it doesn't support this functionality. How can I implement it? Should I implement a trigger on inserts that lookup the users last inserted row, and then add one, or are there any better alternative? Or is it better to implement this in the application code? Or is this just a bad idea? I think this is easier to maintain than creating new tables for every user. Example: table +----+-------------+---------+------+ | ID | ID_PER_USER | USER_ID | DATA | +----+-------------+---------+------+ | 1 | 1 | 2 | 3454 | | 2 | 2 | 2 | 6567 | | 3 | 1 | 3 | 6788 | | 4 | 3 | 2 | 1133 | | 5 | 4 | 2 | 4534 | | 6 | 2 | 3 | 4366 | | 7 | 3 | 3 | 7887 | +----+-------------+---------+------+ SELECT * FROM table WHERE USER_ID = 3 +----+-------------+---------+------+ | ID | ID_PER_USER | USER_ID | DATA | +----+-------------+---------+------+ | 3 | 1 | 3 | 6788 | | 6 | 2 | 3 | 4366 | | 7 | 3 | 3 | 7887 | +----+-------------+---------+------+ SELECT * FROM table WHERE USER_ID = 2 +----+-------------+---------+------+ | ID | ID_PER_USER | USER_ID | DATA | +----+-------------+---------+------+ | 1 | 1 | 2 | 3454 | | 2 | 2 | 2 | 6567 | | 4 | 3 | 2 | 1133 | | 5 | 4 | 2 | 4534 | +----+-------------+---------+------+

    Read the article

  • What is a right way to use servlets?

    - by vikp
    Hi, I'm studying EJB3. I have a session bean which provides services to create/update customer accounts. This session bean offers services on the lines of: public void addCustomer(Customer c); public void updateCustomer(Customer c); Ideally I'd like to have a single servlet: CustomerServlet and it would invoke the session beans that I have listed above. Problem is that I have two JSPs: UpdateAccount.jsp and CreateAccount.jsp. Both of these JSPs have a form with a method POST and action "CustomerServlet". How can I distinguish in a customer servlet which operation I should carry out: createAccount or updateAccount? I guess the alternative is to have a separate servlet for each operation... Thank you

    Read the article

  • How do I stop Safari from caching my Servlet response?

    - by Cliff
    I'm having trouble testing a web app with Safari. My app returns wave audio data. The problem happens when I change the application and hit it again from Safari. Safari caches the original response so no matter how many times I hit refresh it seems like I've not updated anything. I can almost get around this using force refresh with Firefox but because I'm having trouble generating the wave headers using the javax.sound API Firefox only plays the first second of audio returned. A few weeks ago I tried setting the HTTP header in my servlet to prevent caching but I don't think I was setting it correctly. (What is the header for browser cache control?) This is becoming a real pain and I'm looking for any ideas, comments, or alternative approaches. I'm getting ready to try again but I figured I'd ask here in the interim to see if someone can provide help.

    Read the article

  • End User Ad-Hoc Reporting Tool: Microsoft SQL Server Management Studio or Microsoft Access?

    - by schultkl
    Our centralized IT department has suggested two primary ad hoc query tools for our general user base of approximately 200 staff members: Microsoft SQL Server Management Studio 2008 (SSMS) Microsoft Access 2003 Environment The backend database is a read-only Microsoft SQL Server 2005 database. The schema is 400+ tables; allowing access to the raw data for our general staff would be a disaster. We will be building an "abstraction layer" over the raw data for our general staff to run ad hoc queries against. The abstraction layer will most likely contain a number of views. A number of users have basic knowledge in Microsoft Access; none have used SSMS. Which of the above tools (or alternative) would be best for a decidedly non-techie user base of approximately 200 people? What are the pros and cons of each? Also, the IT department has suggested teaching people T-SQL so they may use SSMS. Is this reasonable?

    Read the article

  • sql Database to save different contact details for a message sending site

    - by jagan
    I am working for a project to create a database for saving different persons contact details in sql. For example, X person saves 10 contacts, Y persons save 15 contacts, z persons save 20 contacts and so on. I cant create seperate tables to save contacts of x,y,z and so on. But i just want to know the alternative method to do that. Is there any easy method to save different cotacts and is there any easy method to retrieve it. I'm just a student, i don't know much about sql and don't have much experience in this. So i need your help to know much about this.

    Read the article

  • Building a professional company website

    - by Sphynx
    Hi fellows, I want to create a professional website for my company. I'm not a designer. I know some html/css, but I don't have much experience making up advanced pages and layouts. I'd expect public area, with various articles, and a "customer zone", accessible via username and password, where clients will be able to track their orders and download files. It needs to look very modern. I don't want to use website templates, because they're too simple. I know some Wordpress, but that's mostly for blogs, and anyways you need to find a right theme besides the CMS itself... Is there any alternative solution, some kind of framework for building such portals? Preferably a system that doesn't require designer skills. Thanks!

    Read the article

  • How can we disable the button in my iphone app?

    - by wolverine
    In my application, there is one button in the navigation bar. I want it to work only for the 1t click of the user. If he continousally presses on it 2 or 3 times just after the 1st click the button shouldnt recieve the following ones. How can I do this? My app always crashes if the user presses it for more than once. I dont want to make it multithread and use lock. Thats why i want to know whether there is anyother alternative.

    Read the article

  • Performance - User defined query / filter to search data

    - by Cagatay Kalan
    What is the best way to design a system where users can create their own criterias to search data ? By "design" i mean, data storage, data access layer and search structure. We will actually refactor an existing application which is written in C# and ASP .NET and we don't want to change the infrastructure. Our main issue is performance and we use MSSQL and DevExpress to build queries. Some queries run in 4-5 minutes and all the columns included in the queries have indexes. When i check queries, i see that DevExpress builds too many "exists" clauses and i'm not happy with that because i have doubts that some of these queries skip some indexes. What may be the alternatives to DevExpress? NHibernate or Entity Framework? Can we build dynamic criteria system and store these to database in both of them ? And also do we need any alternative storage like a lucene index or OLAP database?

    Read the article

< Previous Page | 110 111 112 113 114 115 116 117 118 119 120 121  | Next Page >