Search Results

Search found 3399 results on 136 pages for 'direct'.

Page 85/136 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • Castle Windsor Weak Typed Factory

    - by JeffN825
    In a very very limited number of scenarios, I need to go from an unknown Type (at compile time) to an instance of the object registered for that type. For the most part, I use typed factories and I know the type I want to resolve at compile time...so I inject a Func<IMyType> into a constructor ...but in these limited number of scenarios, in order to avoid a direct call to the container (and thus having to reference Windsor from the library, which is an anti-pattern I'd like to avoid), I need to inject a Func<Type,object>...which I want to internally container.Resolve(type) for the Type parameter of the Func. Does anyone have some suggestions on the easiest/most straightforward way of setting this up? I tried the following, but with this setup, I end up bypassing the regular TypedFactoryFacility altogether which is definitely not what I want: Kernel.Register(Component.For(typeof (Func<Type, object>)).LifeStyle.Singleton.UsingFactoryMethod( (kernel, componentModel, creationContext) => kernel.Resolve(/* not sure what to put here... */))); Thanks in advance for any assistance.

    Read the article

  • How to integrate existing Wordpress blog into Magento

    - by jcmeghan
    Our company has an existing Wordpress blog which I would like to integrate into our new Magento site. I'm not finding much luck out there on the interwebs, so I was hoping someone might be able to direct me to the best way of doing what i need here. All I need is to show the latest 5 posts on my page. It can either be done via an RSS feed or some other method, but I would prefer to not install Wordpress on the same server so as to lag down my sites server. Any ideas or thoughts would be greatly appreciated. Thanks, Meghan

    Read the article

  • python grep reverse matching

    - by thomytheyon
    Hi Alls, I would like to build a small python script that basicaly does the reverse of grep. I want to match the files in a directory/subdirectory that doesn't have a "searched_string". So far i've done that: import os filefilter = ['java','.jsp'] path= "/home/patate/code/project" for path, subdirs, files in os.walk(path): for name in files: if name[-4:] in filefilter : print os.path.join(path, name) This small script will be listing everyfiles with "java" or "jsp" extension inside each subdirectory, and will output them full path. I'm now wondering how to do the rest, for example i would like to be able if I forgot a session management entry in one file (allowing anyone a direct file access), to search for : "if (!user.hasPermission" and list the file which does not contain this string. Any help would be greatly appreciated ! Thanks

    Read the article

  • How to decide if a parameter is the click event

    - by sameold
    I have a function which can be called by either a click event or directly. When I call it directly, I need pass it a data parameter, so I've defined the function to accept a parameter to account for the direct call with the parameter. function myFunc(param){ } Within the function, I need to differentiate whether the function was called directly or from the click event, so what I thought I could simply check if param is set. If it's set, then the function is called directly. If it's not set, then it's called from the click event. The problem is that a click event by default passes an event object. So even when the function is called by the click event, param won't be null. So is there a way to check whether the param passed is the click event?

    Read the article

  • What features of Scala cannot be translated to Java?

    - by Paul
    The Scala compiler compiles direct to Java byte code (or .NET CIL). Some of the features of Scala could be re-done in Java straightforwardly (e.g. simple for comprehensions, classes, translating anonymous/inner functionc etc). What are the features that cannot be translated that way? That is presumably mostly of academic interest. More usefully, perhaps, what are the key features or idioms of Scala that YOU use that cannot be easily represented in Java? Are there any the other way about? Things that can be done straightforwardly in Java that have no straightforward equivalent in Scala? Idioms in Java that don't translate?

    Read the article

  • How to write a tool, inverting colors in Windows?

    - by vlood
    I read a topic in this site about it, but decided to post another one as I want to write such a tool, but I don't have much experience in C# & .NET, so it could take me too much time just digging the Net, while someone can just direct me to the right library or classes to be used. So, straight to the point. I want to write a tool that, when activated, inverts absolutely all items on the screen and lets you work that way without torturing your eyes with bright light colors. Does anyone have an idea of the needed .NET libraries or third-party frameworks, to implement this? Any help will be greatly appreciated! P.S. Changing to "High Contrast" theme in Windows is not the solution I seek, so please, don't mention it!

    Read the article

  • Fast ceiling of an integer division in C / C++

    - by andand
    Given integer values x and y, C and C++ returns as the quotient q = x/y the floor of the floating point valued equivalent. I'm interestd in a method of returning the ceiling instead? For example, ceil(10/5) = 2 and ceil(11/5) = 3. The obvious approach involves something like: q = x / y; if (q * y < x) ++q; This requires an extra comparison and multiplication; and other methods I've seen (used in fact) involve casting as a float or double. Is there a more direct method that avoids the additional multiplication (or a second division) and branch, and that also avoids casting as a floating point number?

    Read the article

  • How can I access Android private API's which doesn't exposed in TelephonyManager?

    - by Micha Valach
    Hi, I'm newbie in Android. I intend to write tests related the Phone and Direct SIM write. What are the alternatives in case the required API's does not exposed in TelephonyManager but exist as private APIs in PhoneBase.java or PhoneFactory.java or CommandInterface.java? examples: 1. What is the "replacement" for: mPhone = PhoneFactory.getDefaultPhone(); ? 2. What is the alternative in order to access the CommandsInterface, CommandsInterface mCmdIf = ((PhoneBase)mPhone).mCM ? Thanks In Advance, Micha

    Read the article

  • Calling C/C++ library function from PHP

    - by Anon. BlackBerry Developer
    We have a PHP web app running on a customer's machine. For an update, we have a bit of code in C that we'd like to include as a native opaque library along with the PHP web app. How does one go about calling a C/C++ lib. function from PHP? It cannot be assumed that the PHP app, called by the web server, has any sort of permission to call an exec(), eval(), or system() type of function to execute a C wrapper driver which in turn uses the C/C++ library, so it would need to be a direct C library use from within the PHP code.

    Read the article

  • Which relational databases exist with a public API for a high level language?

    - by Jens Schauder
    We typically interface with a RDBMS through SQL. I.e. we create a sql string and send it to the server through JDBC or ODBC or something similar. Are there any RDBMS that allow direct interfacing with the database engine through some API in Java, C#, C or similar? I would expect an API that allows constructs like this (in some arbitrary pseudo code): Iterator iter = engine.getIndex("myIndex").getReferencesForValue("23"); for (Reference ref: iter){ Row row = engine.getTable("mytable").getRow(ref); } I guess something like this is hidden somewhere in (and available from) open source databases, but I am looking for something that is officially supported as a public API, so one finds at least a note in the release notes, when it changes. In order to make this a question that actually has a 'best' answer: I prefer languages in the order given above and I will prefer mature APIs over prototypes and research work, although these are welcome as well.

    Read the article

  • PHP image resize on the fly vs storing resized images

    - by Pablo
    I'm building a image sharing site and would like to know the pros and cons of resizing images on the fly with php and having the resized images stored. Which is faster? Which is more reliable? how big is the gap between the two methods in speed and performance? Please note that either way the images go through a PHP script for statistics like views or if hotlinking is allow etc... so is not like it will be a direct link for images if i opt to store the resize images. I'll appreciated your comments or any helpful links on the subject, Thanks.

    Read the article

  • Creating "screenshots" with HTML 5 and CSS 3?

    - by Tower
    Hi, I need to create small thumbnails of HTML elements. I first thought using CSS 3 reflection, but it is limited to being only a reflection (and not a direct copy) and I can not move it from its standard position. Then I thought using JavaScript to copy the HTML element entirely along with all its contents and apply CSS 3 transform to scale it down to a thumbnail. That works pretty well, but is kind of a hack. Does anyone know a better way of doing this with JavaScript, HTML 5 and CSS 3. Flash, Java and such are not an option and it only needs to work in one browser.

    Read the article

  • database logic for tracking each and every operation in my web application

    - by ripa
    I am developing an Web application. In my application, I need to keep track of each and every operation for every logged in user. I have planned following for achieving this task:- I will create stored procedure in mysql. I will trigger this procedure on each table's insert , update delete. This is an tough job for me. Will anybody direct me in the right way? I am using PHP based Codeigniter framework and mysql database.

    Read the article

  • How to merge or copy anonymous session data into user data when user logs in?

    - by benhoyt
    This is a general question, or perhaps a request for pointers to other open source projects to look at: I'm wondering how people merge an anonymous user's session data into the authenticated user data when a user logs in. For example, someone is browsing around your websites saving various items as favourites. He's not logged in, so they're saved to an anonymous user's data. Then he logs in, and we need to merge all that data into their (possibly existing) user data. Is this done different ways in an ad-hoc fashion for different applications? Or are there some best practices or other projects people can direct me to?

    Read the article

  • What is a cross-platform way to get the current directory?

    - by rubenvb
    I need a cross-platform way to get the current working directory (yes, getcwd does what I want). I thought this might do the trick: #ifdef _WIN32 #include <direct.h> #define getcwd _getcwd // stupid MSFT "deprecation" warning #elif #include <unistd.h> #endif #include <string> #include <iostream> using namespace std; int main() { string s_cwd(getcwd(NULL,0)); cout << "CWD is: " << s_cwd << endl; } I got this reading: _getcwd at MSDN getcwd at Kernel.org getcwd at Apple.com There should be no memory leaks, and is should work on a Mac as well, correct?

    Read the article

  • Resources for dashboard app backend design

    - by Nix
    I am looking for examples of code/data/infrastructure design for a dashboard-style webapp. I am designing an interface for staff and faculty at a university to access departmental resources and be alerted of cyclical processes, events, deadlines, etc. Technologies I am working with: apache tomcat 6 and a mySQL database, JSP (including JSTL), bootstrap 3, and javascript/jquery. I have basic experience most of these technologies building smaller web apps but was hoping someone could direct me towards a book or other resource that discusses how to design the db architecture (and maybe how to template) for a dashboard, esp. for something like a notification systems. Any suggestions?

    Read the article

  • Are the atomic builtins provided by gcc actually translated into the example code, or is that just f

    - by Jared P
    So I was reading http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html, and came across this: type __sync_and_and_fetch (type *ptr, type value, ...) type __sync_xor_and_fetch (type *ptr, type value, ...) type __sync_nand_and_fetch (type *ptr, type value, ...) These builtins perform the operation suggested by the name, and return the new value. That is, { *ptr op= value; return *ptr; } { *ptr = ~*ptr & value; return *ptr; } // nand Is this code literal? or is it just to explain what gcc is doing atomically using c-like syntax? And if this is the direct translation, can someone explain how it is atomic?

    Read the article

  • Malware on a client's website - Ideas?

    - by Jeriko
    We recently got a call from one of our clients, complaining that their site has some "strange looking code" at the bottom of the page. We checked out the source code, and discovered that about 800 bytes of malicious javascript code had been appended to the templates/master file, after the </html> tag. I won't post said code because it looked particularly nasty. As far as I can tell, there would be no way for this file to be edited in any way, unless someone had direct access to the server and/or FTP login details. The actual file itself has been modified, so that rules out any kind of SQL attack. Besides a person physically gaining credentials and hand-modifying this file, would there be any other logical explaination for what happened? Has anyone else had experience with something like this happening?

    Read the article

  • Place text based divs in relative locations within a circle

    - by NickG
    Direct question - How would I place certain objects or small text within a certain area. For example, how would I replace the following image with html/javascript. --- I don't have enough reps to post an image :/ but try this URL - http://i.imgur.com/a3eWL.jpg Big picture - I am trying to create a kml file for Google Earth that when the point is clicked, the balloon description window pops up and I can display my html formatted diagram showing where the satellites are at that instant. Google Earth and KML docs allow for pretty much any html formatting within it, so currently looking for a good way to do this. Disclaimer: It has been a few years since i have done any html or javascript editing, so general examples and insight is greatful. Thanks

    Read the article

  • How to rename the original file before sending it to user

    - by Manish Jangir
    Actually I have some download link on my website something like "http://www.example.com/somesong.mp3". Now when user click on this link they get somesong.mp3 but I want to change it before they download. I found many scripts that made it possible but didn't get exact right script. Because I want that when the user clicks on download link the file downloading should be started just after the click with the new file name as I want to use. But in all the scripts which I downloaded, first the php processing starts for a few minute (I think it depends on the file size) and then rename it. Is there a way to direct force the file in header with new file name. Thanks.

    Read the article

  • Python: Access members of a set

    - by emu
    Say I have a set myset of custom objects that may be equal although their references are different (a == b and a is not b). Now if I add(a) to the set, Python correctly assumes that a in myset and b in myset even though there is only len(myset) == 1 object in the set. That is clear. But is it now possible to extract the value of a somehow out from the set, using b only? Suppose that the objects are mutable and I want to change them both, having forgotten the direct reference to a. Put differently, I am looking for the myset[b] operation, which would return exactly the member a of the set. It seems to me that the type set cannot do this (faster than iterating through all its members). If so, is there at least an effective work-around?

    Read the article

  • rails - form to disply non-input type fields in nested form

    - by nktokyo
    Hi, I guess this is a newbie question, but what is the syntax in a form to show contents of fields not as a text box/area, but rather like label would appear. <% form_for @user do |f| %> <% f.fields_for :user_ingreds do |builder| %> <p> <%= builder.??? %> </p> <% end %> <% end%> user has many user_ingreds and accepts_nested_attributes for user_ingreds. Basically I want to make a list of user_ingreds where the user can't edit the data but can remove the record from the list via a button - however the fields_for builder doesn't recognize a direct call to to the fields in user_ingreds model (ie, builder.user_id throws and error.

    Read the article

  • Should my web based app be a consumer of my api?

    - by seanbrant
    I will be developing a mobile app (iPhone) and a web based app (Django) soon. For the mobile app I will be creating a REST api (most likely using Django) to send data back and forth from phone to server. When I comes time to create the web based version does it make sense to just create it as any other client of the api. In other words both the mobile app and the web app will get there data from an external API over HTTP. Or should the web based app have direct access to the database that the api is using and just get its data that way?

    Read the article

  • need to changed markup with jquery

    - by user357034
    I have the following markup which I do not have direct access to... <a href="javascript:void(0);" onclick="window.open('/BulkDiscounts.asp?ProductID=318&ProductCode=' + escape('LB30X40ES') + '&Orig_Price=22.95', 'Discounts', 'scrollbars,status,resizable,width=330,height=300');"><iimg src="/v/vspfiles/templates/100/images/buttons/btn_quantitydiscounts.gif" border="0" align="absmiddle"></a> I need to "rewrite" the above as follows... A few things to point out is that the title is coming from a variable escape(global_Current_ProductCode) variable=productcode in the case above it is LB30X40ES The height and weight, price and product id used in the second markup must be from the first markup. Note that these change depending on the product loaded. These are not constants. I would guess the first thing to do was to add the thickbox class. Then I am lost as to what to do next. Basically I need to open up an thickbox iframe with the modified markup.

    Read the article

  • Entity Framework 4 Hiding Underlying Resolver Tables when model is generated from database

    - by grrrrrrrrrrrrr
    When creating an entity framework model from scratch it is possible to specify a Many to Many relationship in the model. e.g Entity1 * ----- * Entity2 When a database is then generated from this, a resolver table is then created automatically between the two entities, this is hidden in the code model, allowing direct access to each of the entities via properties. e.g. Entity1 ----* ResolverEntity *----- Entity2 My question is, when a model is generated from an existing database, which contains resolver tables, is it possible to create the same effect so the resolver tables do not appear in the generated object model? When I have attempted this, the entity framework appears to create entities in the model for the resolver tables with no obvious way of hiding them in the object model. Thanks.

    Read the article

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