Search Results

Search found 15499 results on 620 pages for 'non obvious'.

Page 87/620 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • How to use PHP-based authentication from non-PHP based AJAX app?

    - by DavidR
    I've been asked to create a stand-alone webapp using "straight" HTML and Javascript that does user authentication against an existing PHP app (backend is MySQL). Unfortunately, I really don't have a firm grasp on how PHP authentication works, and I'd rather not invest a lot of time in learning PHP just for this particular case. I can see two possibilites so far 1) create a PHP wrapper around my new app and use native PHP authentication (don't like this) 2) create a simple REST-ful webservice around the PHP authentication (don't know how to do this) Anything else I should consider? Help is much appreciated!

    Read the article

  • Does it ever make sense to make a fundamental (non-pointer) parameter const?

    - by Scott Smith
    I recently had an exchange with another C++ developer about the following use of const: void Foo(const int bar); He felt that using const in this way was good practice. I argued that it does nothing for the caller of the function (since a copy of the argument was going to be passed, there is no additional guarantee of safety with regard to overwrite). In addition, doing this prevents the implementer of Foo from modifying their private copy of the argument. So, it both mandates and advertises an implementation detail. Not the end of the world, but certainly not something to be recommended as good practice. I'm curious as to what others think on this issue. Edit: OK, I didn't realize that const-ness of the arguments didn't factor into the signature of the function. So, it is possible to mark the arguments as const in the implementation (.cpp), and not in the header (.h) - and the compiler is fine with that. That being the case, I guess the policy should be the same for making local variables const. One could make the argument that having different looking signatures in the header and source file would confuse others (as it would have confused me). While I try to follow the Principle of Least Astonishment with whatever I write, I guess it's reasonable to expect developers to recognize this as legal and useful.

    Read the article

  • Fluent nHibernate - How to map a non-key column on an association table?

    - by The Matt
    Taking an example that is provided on the Fluent nHibernate website, I need to extend it slightly: I need to add a 'Quantity' column to the StoreProduct table. How would I map this using nHibernate? An example mapping is provided for the given scenario above, but I'm not sure how I would get the Quantity column to map: public class StoreMap : ClassMap<Store> { public StoreMap() { Id(x => x.Id); Map(x => x.Name); HasMany(x => x.Employee) .Inverse() .Cascade.All(); HasManyToMany(x => x.Products) .Cascade.All() .Table("StoreProduct"); } }

    Read the article

  • Why won't this TextArea return to non-Bold format, or is Font.PLAIN just like an "add-on"?

    - by JIM
    I am trying to Create a Simple Notepad in Java, i would post the full code but i didnt think it would be necessary since the problem is here(i think). Please Help. if(cb.getSelectedItem().equals("Plain")){ MainText.setFont(new Font(getFontName(MainText),Font.PLAIN,getFontSize(MainText)));} here are the above used methods public int getFontSize(TextArea t){ return t.getFont().getSize(); } public String getFontName(TextArea t){ return t.getFont().getFontName(); } public int getFontStyle(TextArea t){ return t.getFont().getStyle(); }

    Read the article

  • Is it possible to build a Mac binary on a non-Mac unix machine?

    - by nbolton
    I would like to set up a Mac buildbot slave, but unfortunately it's not possible to install Mac OS X 10.5 on my XenServer hypervisor. So, I've had an idea, but not quite sure whether or not it'll work. The application is C++, and on Mac it's compile using GNU Make. I have a Mac desktop PC, and I was hoping I could copy the .h and .lib files on to a Linux box, and try to build against the Mac headers: #include <mach-o/dyld.h> #include <AvailabilityMacros.h>

    Read the article

  • How to make a cross browser, W3C valid, semantic, non-javascript ROUND corner?

    - by jitendra
    I want to make a cross-browser (FF3, IE6, Safari, Opera), W3C valid (HTML and CSS both), stretchable (horizontally vertically), without JavaScript and with Semantic and lesser HTML markup Round CORNER. Images can be used for IE6. I've tried and tested many techniques available on community. But everything has one of the problems mentioned above . If anyone knows what I want please share with me? Remember I want to make it without any type of JavaScript, jquery or any type of js.

    Read the article

  • C# 4.0 Named Parameters - should they always be used when calling non-Framework methods?

    - by David Neale
    I really this is a hugely subjective topic but here is my current take: When calling methods which do not form part of the .NET BCL named parameters should always be used as the method signatures may well change, especially during the development cycle of my own applications. Although they might appear more verbose they are also far clearer. Is the above a reasonable approach to calling methods or have I overlooked something fundamental?

    Read the article

  • Query takes time on comparing non numeric data of two tables, how to optimize it?

    - by Muhammad Kashif Nadeem
    I have two DBs. The 1st db has CallsRecords table and 2nd db has Contacts table, both are on SQL Server 2005. Below is the sample of two tables. Contact table has 1,50,000 records CallsRecords has 75,000 records Indexes on CallsRecords: CallFrom CallTo PickUP Indexes on Contacts: PhoneNumber I am using this query to find matches but it take more than 7 minutes. SELECT * FROM CallsRecords r INNER JOIN Contact c ON r.CallFrom = c.PhoneNumber OR r.CallTo = c.PhoneNumber OR r.PickUp = c.PhoneNumber In Estimated execution plan inner join cost 95% Any help to optimize it.

    Read the article

  • C#: Non-constructed generics as properties (eg. List<T>)

    - by Dav
    The Problem It's something I came across a while back and was able to work around it somehow. But now it came back, feeding on my curiosity - and I'd love to have a definite answer. Basically, I have a generic dgv BaseGridView<T> : DataGridView where T : class. Constructed types based on the BaseGridView (such as InvoiceGridView : BaseGridView<Invoice>) are later used in the application to display different business objects using the shared functionality provided by BaseGridView (like virtual mode, buttons, etc.). It now became necessary to create a user control that references those constructed types to control some of the shared functionality (eg. filtering) from BaseGridView. I was therefore hoping to create a public property on the user control that would enable me to attach it to any BaseGridView in Designer/code: public BaseGridView<T> MyGridView { get; set; }. The trouble is, it doesn't work :-) When compiled, I get the following message: The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?) Solutions? I realise I could extract the shared functionality to an interface, mark BaseGridView as implementing that interface, and then refer to the created interface in my uesr control. But I'm curious if there exists some arcane C# command/syntax that would help me achieve what I want - without polluting my solution with an interface I don't really need :-)

    Read the article

  • How to commit a non-subversioned file into a repository ?

    - by devdude
    The environment: SVN, Netbeans, Hudson SVN Project A: Builds a library file (foo.jar). The build file is under /dist, which is ignored for svn, the sourcecode is under svn control. SVN Project B: holds all library files. (other SVN projects get all their libraries from here via external svn) Question: I want to commit foo.jar from A into B. How to do that ? foo.jar cannot be added or committed because it is not under SVN control. Thanks for any hints ! (The question is independent from the IDE and CI Server)

    Read the article

  • Can I make PDOStatement->fetchObject not use non-member variables?

    - by threendib
    Lets say I have a class like this: Class User { var $id var $name; } And I run a query using PDO in php like so: $stm = $db->prepare('select * from users where id = :id'); $r = $stm->execute(array(':id' => $id)); $user = $r->fetchObject('User'); If I vardump my user object it has all kinds of other fields in it that I have not defined in the User class. Obviously I could make my query specific so that it only gives me back the fields I need/want. But if I don't want to do that is there any way to make this work the way I want it to? I like the idea of fetchObject, because it's one line of code to create this object and set member variables for me. I just don't want it to set variables I haven't defined in my class.

    Read the article

  • What was the most refreshingly honest non-technical comment you saw in the code?

    - by DVK
    OK, so we all saw the lists of "funny" or "bad" comments. However, today, when maintaining an old stored proc, I stumbled upon a comment which I couldn't classify other than "refreshingly brutally honest", left by a previous maintainer around a really freakish (both performance and readability-wise) page-long query: -- Feel free to optimize this if you can understand what it means So, in the first (and hopefully only) poll type question in my history of Stack Overflow, I'd like to hear some other "refreshingly brutally honest" code comments you encountered or written.

    Read the article

  • How can I call a GWT RPC method on a server from a non GWT (but Java) gapplication?

    - by hansi
    I have a regular Java application and want to access an GWT RPC endpoint. Any idea how to make this happen? My GWT application is on a GAE/J and I could use REST for example but I already have the GWT RPC endpoints and don't want to build another façade. Yes, I have seen http://stackoverflow.com/questions/1330318/invoke-a-gwt-rpc-service-from-java-directly, but this discussion goes into a different direction.

    Read the article

  • How to distinguish between <expr> and non-<expr> mappings?

    - by ZyX
    I want to add a possibility of restoring mappings overwritten by my plugin. But the problem is that I cannot distinguish between the following mappings: inoremap <expr> @ test and inoremap @ test First mapping inserts the contents of the variable test, while second inserts text «test». Both mappings give maparg("@", 'i')=="test" and identical output of inoremap i.

    Read the article

  • How can I load scripts, styles and images from a non-URL source?

    - by Jen
    I am integrating WebKit (via Qt) into an application. Instead of having WebKit retrieve scripts, CSS files and images via URLs, I want my application to provide them (e.g. retrieved from a database). For example, a "regular" web page may contain this tag: <IMG src="photos/album1/123456.jpg"> Instead of WebKit fetching this image from a server or the file system, I would prefer some kind of callback that allows my application to provide this image. How can I accomplish this?

    Read the article

  • Java - Reading a csv file line by line - stuck with weird non-existent characters being read!

    - by rockit
    hello fellow java developers. I'm having a very strange issue. I'm trying to read a csv file line by line. Im at the point where Im just testing out the reading of the lines. ONly each time that I read a line, the line contains square characters between each character of text. I even saved the file as a txt file in wordpad and notepad with no change. Thus I must be doing something stupid... I have a csv file, standard csv file, yes a text file with commas in it. I try to read a line of text, but the text is all f-ed up and cannot find the phrase within the text. Any advice? code below. //open csv File filReadMe = new File(strRoot + "data2.csv"); BufferedReader brReadMe = new BufferedReader(new InputStreamReader(new FileInputStream(filReadMe))); String strLine = brReadMe.readLine(); //for all lines while (strLine != null){ //if line contains "(see also" if (strLine.toLowerCase().contains("(see also")){ //write line from "(see also" to ")" int iBegin = strLine.toLowerCase().indexOf("(see also"); String strTemp = strLine.substring(iBegin); int iLittleEnd = strTemp.indexOf(")"); System.out.println(strLine.substring(iBegin, iBegin + iLittleEnd)); } //update line strLine = brReadMe.readLine(); } //end for brReadMe.close();

    Read the article

  • Do you do unit tests for non production code?

    - by Ikaso
    I am interested in the following scenario specifically. Suppose you have team that writes production code and a team that writes automatic tests. The team that writes automatic tests has a dedicated framework intended to write the automatic tests. Should the testing team write unit tests for their framework although the framework is not used in production?

    Read the article

  • How do I make php page return a 503 error (or anything non-200).

    - by Benju
    A former developer wrote or client-server api in PHP. It simply sends messages as xml using post/response in a very simplistic fashion. The problem is that even when there is an error (ex: invalid arguments passed into the server side) we get a HTTP 200 response with a page like this <h4>Unknown error!</h4> In firebug I can see that the actually HTTP response is a 200. How can we send a different response (ie:503) when we programatically detect in our php code that it is appropriate to do so.

    Read the article

  • How to create a non-persistent Elixir/SQLAlchemy object?

    - by siebert
    Hi, because of legacy data which is not available in the database but some external files, I want to create a SQLAlchemy object which contains data read from the external files, but isn't written to the database if I execute session.flush() My code looks like this: try: return session.query(Phone).populate_existing().filter(Phone.mac == ident).one() except: return self.createMockPhoneFromLicenseFile(ident) def createMockPhoneFromLicenseFile(self, ident): # Some code to read necessary data from file deleted.... phone = Phone() phone.mac = foo phone.data = bar phone.state = "Read from legacy file" phone.purchaseOrderPosition = self.getLegacyOrder(ident) # SQLAlchemy magic doesn't seem to work here, probably because we don't insert the created # phone object into the database. So we set the id fields manually. phone.order_id = phone.purchaseOrderPosition.order_id phone.order_position_id = phone.purchaseOrderPosition.order_position_id return phone Everything works fine except that on a session.flush() executed later in the application SQLAlchemy tries to write the created Phone object to the database (which fortunatly doesn't succeed, because phone.state is longer than the data type allows), which breaks the function which issues the flush. Is there any way to prevent SQLAlchemy from trying to write such an object? Ciao, Steffen

    Read the article

  • Can someone explain an Enterprise Service Bus to me in non-buzzspeak?

    - by Jason Baker
    Some of our partners are telling us that our software needs to interact with an Enterprise Service Bus. After researching this a bit, my instinct is to say that this is just buzz speak for saying that we need to have a platform-indpendent way to pass messages back and forth. I'm just trying to get a feel for what our partners are telling us. Am I correct in dismissing our partners' request as just trying to get our software to be more buzzword-compliant, or are they telling us something we should listen to (even if encoded in buzzspeak)?

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >