Search Results

Search found 2403 results on 97 pages for 'alex peta'.

Page 53/97 | < Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >

  • SQL indexing on varchar

    - by alex
    I have a table whose columns are varchar(50) and a float - I need to (very quickly) look get the float associated with a given string. Even with indexing, this is rather slow. I know, however, that each string is associated with an integer, which I know at the time of lookup, so that each string maps to a unique integer, but each integer does not map to a unique string. One might think of it as a tree structure. Is there anything to be gained by adding this integer to the table, indexing on it, and using a query like SELECT floatval FROM mytable WHERE phrase=givenstring AND assoc=givenint? This is Postgres, and if you couldn't tell, I have very little experience with databases.

    Read the article

  • Problem with virtual mouse click

    - by Alex
    Hi. I have a program that simulates mouse click. Code is something like this: [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo); private const int MOUSEEVENTF_LEFTDOWN = 0x02; private const int MOUSEEVENTF_LEFTUP = 0x04; public static void DoMouseClick(int x, int y) { Cursor.Position = new Point(x, y); mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, x, y, 0, 0); } This code works perfectly. For example I call this function every 30 minutes. But if I press WINKEY+L (Windows is locked) only cursor is moved but not press occurs. Any ideas?

    Read the article

  • Is it possible from Spring to inject the result of calling a method on a ref bean?

    - by Alex Worden
    Hi, Is it possible from Spring to inject the result of calling a method on a ref bean? I'm trying to refactor some cut/pasted code from two separate projects into a common class. In one of the projects, the code lives in a class I'll call "MyClient" that is being instantiated from Spring. It is injected with another spring-instantiated class "MyRegistry", then the MyClient class uses that class to look up an endpoint. All I really need is the endpoint String in my refactored class, which can be initialized via a Setter. I really cannot have a dependency on MyRegistry from MyClient in the refactored code. So, my question is this... is there a way I can inject the endpoint String from spring that was looked up in the MyRegistry class. So, I currently have: <bean id="registryService" class="foo.MyRegistry"> ...properties set etc... </bean> <bean id="MyClient" class="foo.MyClient"> <property name="registry" ref="registryService"/> </bean> But I'd like to have (and I know this is imaginary Spring syntax) <bean id="MyClient" class="foo.MyClient"> <property name="endPoint" value="registryService.getEndPoint('bar')"/> </bean> where MyRegistry will have a method getEndPoint(Stirng endPointName) Hope that makes sense from a the standpoint of what I'm trying to achieve. Please let me know if something like this is possible in Spring!

    Read the article

  • How do I avoid web method parameters using proxy classes?

    - by Alex Angas
    I have a serializable POCO called DataUnification.ClientData.ClientInfo in a .NET class library project A. It's used in a parameter for a web service defined in project B: public XmlDocument CreateNewClient(ClientInfo ci, string system) I now wish to call this web method from project C and use the original DataUnification.ClientData.ClientInfo type in the parameter. However due to the generated proxy class it has now become a different type: WebServices.ClientDataUnification.DataUnificationWebService.ClientInfo. As far as .NET is concerned these are not the same types. How can I get around this?

    Read the article

  • Performance of fopen vs stat

    - by Alex Marshall
    Hello, I'm writing several C programs for an embedded system where every bit of performance we can squeeze out will matter. Part of that is accessing log files. When determining if a file exists, is there any performance difference between using open / fopen, and stat ? I've been using stat on the assumption that it only has to do a quick check against the file system, whereas fopen would have to actually gain access to a file and manipulate internal data structures before returning. Is there any merit to this ?

    Read the article

  • How to group photos in Wordpress?

    - by alex
    Hi, For a custom theme template i like to use particular photos i have uploaded. I just need x rows of 4 images. So i was thinking of using a loop for images which belong to photo Album..... But in WP i can't find a place where i can group images i am using 2.9.2 Any tips how to fix this??

    Read the article

  • Some encoded Javascript that I need in plain text. Halp!

    - by Alex
    Hey, I'm having some issues trying to decode some javascript.. I have no idea what kind of encoding this is.. i tried base 64 decoders etc. If you can please help me out with this, here's a fragment of the code: \x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C","\x61\x70\x70\x34\x39\x34\x39\x3 Any ways I can get plain text from that? Thanks!

    Read the article

  • Documenting Objective C classes, methods and variables

    - by Alex Reynolds
    What are good approaches to documenting ObjC classes, variables and methods, esp. for automated, downstream class creation, documentation creation, and general integration with Xcode? As an example, I like to use: #pragma mark - #pragma mark UITextField delegate methods for demarcating chunks of code of interest, for quick access from within Xcode.

    Read the article

  • Is there a tool that can refactor this C code correctly?

    - by Alex
    Lets say I have the following code (the array* function are what we use for resizable arrays and they operate on pointers-to-arrays that are null initialized): typedef struct MyStruct { int i; } MyStruct; MyStruct* GetNewMyStruct(int i) { MyStruct* s = malloc(sizeof(MyStruct)); s->i = i; return s; } int SomeFunction(int number, MyStruct *elem) { MyStruct **structs = NULL; int i; for (i = 0; i < number; i++) arrayPush(&structs, GetNewMyStruct(i)); arrayPush(&structs, elem); return arraySize(&structs); } I decide that SomeFunction is too large and I want refactor it. Currently where I work we use VisualAssist X, which has some refactoring capabilities, but when I use it on this it does not work correctly. If I attempt to use it to refactor out the loop, this is what I get: void MyMethod( int number, MyStruct ** structs ) { int i; for (i = 0; i < number; i++) arrayPush(&structs, GetNewMyStruct(i)); } int SomeFunction(int number, MyStruct *elem) { MyStruct **structs = NULL; MyMethod(number, structs); arrrayPush(&structs, elem); return arraySize(&structs); } This is not correct. MyMethod should take a MyStruct ***, not a MyStruct **. This is because the code I'm refactoring takes the address of structs. The result is that the refactored version will always return 1 (since only one object has been pushed into my array) rather than number+1. Are there other tools out there that do this type of refactoring correctly?

    Read the article

  • Debugging CodeIgniters 404 errors

    - by Alex
    I'm having a nightmare uploading my site to the production server. The site runs fine locally and on a staging server (exactly the same server, settings as the production site). However when I deploy to production I'm getting a 404 error from CI. CodeIgniters 404 error pages are frustrating because it seems as if i can't access other libraries from them. How can I go about debugging the error? See which controller is trying to be called etc.

    Read the article

  • Loading CI controller in PHP on the same server

    - by Alex
    How can include CodeIgniter content in a regular PHP page on the same server but not part of the CI app? For example I'm am trying to load a header from CI into Wordpress. Whats the best way to include a CI controller (eg; index.php/mycontroller/header/) on the same server?

    Read the article

  • LINQ DataLoadOptions - Retrieval of data via Fulltext/Broken Foreign Key Relationship

    - by Alex
    I've hit a brick wall: I have an SQL Function: FUNCTION [dbo].[ContactsFTS] (@searchtext nvarchar(4000)) RETURNS TABLE AS RETURN SELECT * FROM Contacts INNER JOIN CONTAINSTABLE(Contacts, *, @searchtext) AS KEY_TBL ON Contacts.Id = KEY_TBL.[KEY] which I am calling via LINQ public IQueryable<ContactsFTSResult> SearchByFullText(String searchText) { return db.ContactsFTS(searchText); } I am projecting the ContactsFTSResult collection into a List<Contact> which is then given to my viewmodel. Here is the problem: My Contacts table (and therefore the Contact object created via LINQ to SQL) has multiple FK relationships to other information, such as Contact.BillingAddressId is an FK to an Address.Id. That information is missing after I do the fulltext search (e.g. if I try to access Contact.BillingAddress it is null). Can I add this information somehow via DataLoadOptions? I tried LoadWith<Contact>(c => c.BillingAddress) but this doesn't work, I assume because of the fact that I'm calling the function instead of doing the whole query via LINQ.

    Read the article

  • Problems when data save on database by Hibernate

    - by alex
    Hi; I'm trying do save data to database by help of Hibernate , in Java. But when i run codes , i had lot of problems. Can anyone help me about that? Thanks... My code: package org.ultimania.model; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; public class Test { public static void main(String[] args) { Session session = null; SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); session = sessionFactory.openSession(); Transaction transaction = session.getTransaction(); BusinessCard card = new BusinessCard(); card.setId(1); card.setName("Özgür"); card.setDescription("Aciklama"); try{ transaction.begin(); session.save(card); transaction.commit(); } catch(Exception e){ e.printStackTrace(); } finally{ session.close(); } } } Problems : SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255) at org.hibernate.cfg.Configuration.(Configuration.java:152) at org.ultimania.model.Test.main(Test.java:14) Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 8 more

    Read the article

  • Maximum float value in php

    - by Alex Deem
    Is there a way to programmatically retrieve the maximum float value for php. Akin to FLT_MAX or std::numeric_limits< float >::max() in C / C++? I am using something like the following: $minimumCost = MAXIMUM_FLOAT_VALUE??; foreach ( $objects as $object ) { $cost = $object->CalculateCost(); if ( $cost < $minimumCost ) { $minimumCost = $cost; } } (using php 5.2)

    Read the article

  • Call jquery datepicker from link and send the date through a post call

    - by Alex
    Hi all, I need to make the datepicker show when I click on a link and then send the selected date to a different page through a post call. T tried to use this code for the link call: $(".click-on-link").click(function(){ $('#datepicker').datepicker({ changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy', firstDay: 1 }); }); but it's not working. Any idea? Thanks!

    Read the article

  • Examples of how to visualize a versioning system?

    - by Alex Gilbert
    My shop is trying to formalize the release management process for an OSS product we maintain. It's a sort of a web development framework/CMS kind of thing, as in it's a product that other projects are built on top of. This makes clear communication about the versioning system especially critical for developers that are using the tool. I'm hoping to find some examples of how best to graph this system so we can communicate it better internally and with outside developers. I know there are lots of standards and best practices around versioning, so I'm hoping this extends to some sort of visual vocabulary as well. As one example, there is a nifty graph at http://en.wikipedia.org/wiki/Versioning#Software_Versioning_schemes. Are there any guides out there on how these sorts of things should be designed?

    Read the article

  • Exception handling in Boost.Asio

    - by Alex B
    Boost.Asio documentation suggests the following exception handling pattern: boost::asio::io_service io_service; ... for (;;) { try { io_service.run(); break; // run() exited normally } catch (my_exception& e) { // Deal with exception as appropriate. } } The problem with it is that the context of exception is lost at the point when it's handled. For example, if I have multiple socket sessions going on, I don't know which one caused the exception to be thrown. What would be a better way to handle the exceptions from asynchronous handlers without wrapping them in try/catch blocks?

    Read the article

  • Attention JavaScript gurus: Need a hand with setInterval()

    - by alex
    I am trying to make a non interactive display for a real estate shop window. It's been a while since I've played with setInterval(). The first time my script steps through, it is fine. But when it tries to get the next property via getNextProperty(), it starts to go haywire. If you have Firebug, or an equivalent output of console.log(), you'll see it is calling things it shouldn't! Now there is a fair bit of JavaScript, so I'll feel better linking to it than posting it all. Store Display Offending JavaScript It is worth mentioning all my DOM/AJAX is done with jQuery. I've tried as best to make sure clearInterval() is working, and it seems to not run any code below it. The setInterval() is used to preload the next image, and then display it in the gallery. When the interval detects we are at the last image ((nextListItem.length === 0)), it is meant to clear that interval and start over with a new property. It has been driving me nuts for a while now, so anyone able to help me? It is probably something really obvious! Many thanks!

    Read the article

< Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >