Search Results

Search found 1588 results on 64 pages for 'pure'.

Page 42/64 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • The C vs. C++ way

    - by amc
    Hi, So I have to write a program that will iterate through an image and record the pixel locations corresponding to each color pixel that appears in it. For example, given http://www.socuteurl.com/fishywishykissy I need to find the coordinates of all yellow, purple, dark pink, etc pixels. In C++ I would use a hash table to do this. I would iterate through the image, check each pixel's value, look up that value and either add to a vector of pixel coordinates if it were found or add a new entry to the table if the value were not already there. The problem is that I may need to write this program in pure C instead of C++. How would I go about doing this in C? I feel like implementing a hash table would be pretty obnoxious and error-prone: should I avoid doing that? I'm pretty inexperienced with C and have a fair amount of C++ experience, if that matters. Thanks.

    Read the article

  • Indexed key vs indexed separate columns, which one is faster ?

    - by Jerry
    In MYSQL, from a pure performance perspective, if I have a table with large amount of data with 10/1 read/write ratio. is it faster in read/write performance to have 4 search criteria in separate columns and all indexed or have them combined in to one single string acting as a key and store in one indexed column ? e.g. say this table with 5 columns, first name, last name, sex, country and file where the first four columns will ALWAYS be given as a part of search parameters in a search or have a table with two columns, key and file. where the value of key can be john-smith-male-australia ?? I don't quite get the pros and cons. the point I try to stress is the fact that all parameters will be given.in a search.

    Read the article

  • Controlling a browser from Python

    - by Noio
    I am looking for a way to control a browser from Python, i.e. fill out form fields and submit them, possibly call JS functions. I've looked around a bit, but as far as I could see PyWebKitGtk only lets you show the browser as a GUI element, not interface with it. Is there a way to do this easily? I wrote my program logic in Python, and I would hate to port it to JS. Besides that, even if I'd use pure JS "bookmarklets", those wouldn't be able to read/write to my local filesystem, would they? P.S. to quell your suspicions, I'm not trying to automatically fill out forum account creation forms or something similarly spammious, though the task is technically similar. I need to crawl/scrape sites for my research project.

    Read the article

  • iPhone / Android: what protocol stacks do apps use for connecting to centralised services?

    - by Richard
    Hi All, Aplogies for the ignorant question, I have no experience with app development on any mobile platform. Basically what I want to know is what communication protocols do apps typically use for accessing/querying centralised services? E.g if I port a webapp/service to iPhone/Andriod, typically how would I access/query this web service in my app? E.g is it over HTTP, or are there other protocols? Also, presumably the GUI of an app is constructed with Apple/Andriod GUI libraries (in java? cocoa?). Can an app GUI be defined with HTML/javascript like a webpage? Sorry again for the pure noob questions. Thanks

    Read the article

  • CodeIgniter Question: How to delete records using ActiveRecord with mySQL function as WHERE conditio

    - by Jhourlad Estrella
    I have a table named ChatSessions where I keep track of active users in the chatroom. I need to prune expired user sessions from the table every 10 minutes. Using pure php-mysql is plain simple but I'm totally clueless how to convert this into ActiveRecord in CodeIgniter. The plain SQL query is below: SELECT * FROM `ChatSessions` WHERE `SessionExpires` < DATE_SUB( NOW( ) , INTERVAL 10 MINUTE ) Can anybody tell me what is the equivalent code in CodeIgniter using ActiveRecord? Thanks in advanced.

    Read the article

  • Getting list of all existing vtables.

    - by Patrick
    In my application I have quite some void-pointers (this is because of historical reasons, application was originally written in pure C). In one of my modules I know that the void-pointers points to instances of classes that could inherit from a known base class, but I cannot be 100% sure of it. Therefore, doing a dynamic_cast on the void-pointer might give problems. Possibly, the void-pointer even points to a plain-struct (so no vptr in the struct). I would like to investigate the first 4 bytes of the memory the void-pointer is pointing to, to see if this is the address of the valid vtable. I know this is platform, maybe even compiler-version-specific, but it could help me in moving the application forward, and getting rid of all the void-pointers over a limited time period (let's say 3 years). Is there a way to get a list of all vtables in the application, or a way to check whether a pointer points to a valid vtable, and whether that instance pointing to the vtable inherits from a known base class?

    Read the article

  • Finding mySQL duplicates, then merging data

    - by Michael Pasqualone
    I have a mySQL database with a tad under 2 million rows. The database is non-interactive, so efficiency isn't key. The (simplified) structure I have is: `id` int(11) NOT NULL auto_increment `category` varchar(64) NOT NULL `productListing` varchar(256) NOT NULL Now the problem I would like to solve is, I want to find duplicates on productListing field, merge the data on the category field into a single result - deleting the duplicates. So given the following data: +----+-----------+---------------------------+ | id | category | productListing | +----+-----------+---------------------------+ | 1 | Category1 | productGroup1 | | 2 | Category2 | productGroup1 | | 3 | Category3 | anotherGroup9 | +----+-----------+---------------------------+ What I want to end up is with: +----+----------------------+---------------------------+ | id | category | productListing | +----+----------------------+---------------------------+ | 1 | Category1,Category2 | productGroup1 | | 3 | Category3 | anotherGroup9 | +----+----------------------+---------------------------+ What's the most efficient way to do this either in pure mySQL query or php?

    Read the article

  • How do I attach an event handler to the document or window in GWT?

    - by Raph Levien
    In a GWT app centered around a canvas, I'm having trouble keeping focus directed in the right place - particularly for keyboard shortcuts. For now, I've wrapped the canvas in a FocusPanel, but that causes the canvas to not respond to the RequiresResize protocol, because FocusPanel does not plumb that. A second (related, I think) problem is that the FocusPanel is not getting Ctrl-A keypress events at all (tested on Mac Chrome). I can get Ctrl-Z and other keys (such as arrows) just fine. In a pure JavaScript world, I think the best answer to this would be to attach mouse and key handlers to the document or window object (I'm not positive which is better). However, I don't see an obvious way to do this in GWT - in particular, the Document and Window classes lack methods for attaching these kind of event handlers? Anyone know how to do it, or, perhaps, to solve the more general problem of keeping focus on an appropriate widget able to handle keyboard shortcuts?

    Read the article

  • some questions about python

    - by avon_verma
    I have a few questions about python I've seen many pages like these on Google http://mail.google.com/support/bin/answer.py?answer=6583 https://www.google.com/adsense/support/bin/topic.py?topic=13488 ...that have .py extensions. 1: Are pages like these built on pure python code, but printing out html like print "<div etc..." or like the typical asp,jsp,php type of pages with html pages and embedded python code like: <html> <% some python code %> </html> 2: What is python mainly used for making? windows apps or web or .. ? Also, are ruby and perl also similar to python?

    Read the article

  • Redirecting before POST upload has been completed

    - by vartec
    I have form with file upload. The files to be uploaded actually are pictures and videos, so they can be quite big. I have logic which based on headers and first 1KB can determine if the rest will be processed or immediately rejected. In the later case I'd like to redirect client to error page without having to wait for upload to finish. The case is, that just sending response before POST is complete doesn't seem to work. The redirect get's ignored and if I close connection, browser complains with "Connection reset by peer" error. So the question is: is it even possible to do that in pure HTTP (without JavaScript on client-side), and if so, how?

    Read the article

  • is it better to use a "natural" language to write codes ?

    - by M.H
    I recently saw a programming language called supernova and they said in the web page : The Supernova Programming language is a modern scripting language and the First one presents the concept of programming with direct Fiction Description using Clear subset of pure Human Language. and you can write codes like : i want window and the window title is Hello World. i want button and button caption is Close. and button name is btn1. btn1 mouse click. instructions are you close window end of instructions my question is not about the language itself but it is that are we need such languages and did they make writing codes more easier or not ?

    Read the article

  • Changing gmail Settings with Ruby

    - by Technocrat
    I need to configure my gmail account(s) programmatically with Ruby. I checked out the apps api and it looks like the simplest possible solution would be to use ClientLogin for logging in and a simple XML PUT for changing the forwarding setting, for example. I wrote a little test script like so: http://gist.github.com/373457 It would appear that the call to ClientLogin works because it comes back with an Auth= token. When it sends the PUT request to google, however, it comes back with a RestClient::Unauthorized exception. I rewrote the script with pure net/https and it turns out the message I'm getting is invalid token, yet I can't figure out what is wrong with my token. Can anyone else see it?

    Read the article

  • Fixing too long comment lines in Vim

    - by Tomek Kaftal
    I'm looking for a convenient way to fix comments where line lengths exceed a certain number of characters in Vim. I'm fine with doing this manually with code, especially since it's not that frequent, plus refactoring long lines is often language, or even code-style dependent, but with comments this is pure drudgery. What happens is I often spot some issue in a comment, tweak one or two words and the line spills out of the, say, 80 character limit. I move the last word to the next line and then the next line spills, and so on. Does anyone know a way to do this automatically in Vim?

    Read the article

  • Usage patterns/use cases for DI or when to start using it

    - by Fabian
    I'm not sure for which use cases one should to use DI in the application. I know that injecting services like PlaceService or CalculationService etc fits very well but should I also create my domain objects with DI like a User? What is if the User has only one constructor which requires a first and lastname. Is this solveable with DI? Should I use DI to create the instances for Set/List interfaces or is this pure overkill? I use guice primarily.

    Read the article

  • GIt Deployment + Configuration Files + Heroku

    - by Andrew
    I'm using Heroku to host a Rails app, which means using Git to deploy to Heroku. Because of the "pure Git workflow" on Heroku, anything that needs to go upstream to the server has to be configured identically on my local box. However I need to have certain configuration files be different depending on whether I'm in the local setup or deployed on Heroku. Again, because of the deployment method Heroku uses I can't use .gitignore and a template (as I have seen suggested many times, and have used in other projects). What I need is for git to somehow track changes on a file, but selectively tell git not to override certain files when pulling from a particular repo -- basically to make certain changes one-way only. Can this be done? I'd appreciate any suggestions!

    Read the article

  • Slick PHP based image manager for managing user profile images

    - by franko75
    Hi, I'm just throwing this out there as I'm plodding my way through creating a Member Photo album on a site i'm working on, where they can login and upload their photos to a personal gallery. I want this to be nice and lightweight, but still slick and "modern" with a modal based interface for the user. I'm surprised though that there is seemingly nothing open source out there which fits the bill - I've done a few searches on Google to no avail and can't seem to find anything. Lots of bloated photo galleries out there but nothing looks like it has been developed using more recent technologies. Is anyone aware of anything which might suit what I'm looking for? I'm fully prepared to try and code it myself but I'd be delighted if I didn't have to! Pure laziness you might say, but there's no point reinventing the wheel.

    Read the article

  • ask. help me to compare two array of integers and the order does not matter.

    - by stdnoit
    [Example] <1 2 3 4 = <3 1 2 4 <1 2 3 4 != <3 4 1 1 and ummm it is in java. cant use hashmap table or anything just pure without library. I know there are two ways. 1. sort them and compare the array index by index 2. use two for loops and compare the outer index with the inner index. ( i have been trying with this but still not working) for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { if(a[i] != a[j] && j == n) return false; } } return true; anything wrong with the code ? thanks

    Read the article

  • How do you reference another element in a xaml list

    - by Ball
    I'm using xaml as a datastore because It's quick and we haven't yet defined a file format. But I can only seem to create xaml that is a pure tree, even if it is acyclic. I know how to create a list of items in xaml, but How do I share objects in two lists? Below is an example of what I'm trying to say. <CreaturFile> <CreatureFile.Monsters> <Monster Name="Kobold" x:Name="Mepo"/> <Monster Name="Goblin"/> </CreatureFile.Monsters> <CreatureFile.Encounters> <Encounter> <Reference ElementName="Mepo"/> </Encounter> </CreatureFile.Encounters> </CreatureFile>

    Read the article

  • Entity Framework 4 - Delete Object

    - by GibboK
    I have 3 Tables in my DataBase CmsMasterPages CmsMasterPagesAdvSlots (Pure Juction Table) CmsAdvSlots Here a Picture of my EDM: I need find out all objects CmsAdvSlot connected with a CmsMasterPage (it is working in my code posted belove), and DELETE the result (CmsAdvSlot) from the DataBase. My Problem is I am not able to DELETE this Objects when I found theme. Error: The object cannot be deleted because it was not found in the ObjectStateManager. int findMasterPageId = Convert.ToInt32(uxMasterPagesListSelector.SelectedValue); CmsMasterPage myMasterPage = context.CmsMasterPages.FirstOrDefault(x => x.MasterPageId == findMasterPageId); var resultAdvSlots = myMasterPage.CmsAdvSlots; // It is working until here foreach (var toDeleteAdv in resultAdvSlots) { context.DeleteObject(myMasterPage.CmsAdvSlots.Any()); // ERORR HERE!! context.SaveChanges(); } Any idea how to solve it? Thanks for your time! :-)

    Read the article

  • 3-clique counting in a graph

    - by Legend
    I am operating on a (not so) large graph having about 380K edges. I wrote a program to count the number of 3-cliques in the graph. A quick example: List of edges: A - B B - C C - A C - D List of cliques: A - B - C A 3-clique is nothing but a triangle in a graph. Currently, I am doing this using PHP+MySQL. As expected, it is not fast enough. Is there a way to do this in pure MySQL? (perhaps a way to insert all 3-cliques into a table?)

    Read the article

  • Which programming paradigm or language open most your mind?

    - by Dom De Felice
    It is often said that some programming languages exist that once grasped can open your mind and change the way you write software. A sort of "software design enlightenment", we can say. I heard this about Lisp, Smalltalk, Haskell, pure functional programming in general.. What are your experiences about this? I know that the right language to use depends on your needs, but I would like to know the one that better improve your programming skills in general. What do you think would be the best language/paradigm to learn to end up being a better programmer in the long run?

    Read the article

  • Writing complex records to file

    - by DrSobhani
    Hi I have defined some records in my project which may be consisted of other records and also dynamic arrays of normal data types and other records , it is n example of a record type Type1=record x:integer; end; Type2=record Y:array of X; str:string; end; When I tried to save one of variables of these records type to file with blockwrite function like this : var Temp1:Type2; begin setlength(temp1.y,100); blockwrite(MyFile,Temp1,sizeOf(Temp1); it just wrote as much as the size of pure record is ,but temp1 has a dynmic arrays which is resized , Could someone please tell me how I can write a complex record to a file , I mean something like what is used in VB6 . Thanks

    Read the article

  • reorder list elements - jQuery?

    - by Alex
    Hello, I am experimenting with jQuery lately, and I was wondering if it's possible with js or pure jquery to reorder <li> elements. So if I have a silly list like the following: <ul> <li>Foo</li> <li>Bar</li> <li>Cheese</li> </ul> How would I move the list elements around? Like put the list element with Cheese before the list element with Foo or move Foo to after Bar. So is it possible? If so, how? Thanks!!

    Read the article

  • Fixing CSS positioning and scaling

    - by Louis
    I was contemplating writing a UI toolkit where setting the position and size of an element/widget was intuitive and powerful. Here are some examples of how it would be used (not currently implemented): ui("Panel").size(". 40").pos("0 0").attach(element); ui("Textarea").size(". %-10").pos("0 40").attach(element); ui("Panel").size(". 10").pos("0 bottom+5"); Where . means auto, % means 100% and the possibility to add pixels to percentages. Does anything like said exist (even as a jQuery plugin or something)? Somethings just aren't possible with pure CSS.

    Read the article

  • Help in setting the setClientInfo with JPA

    - by enrique
    i am trying to set to jpa the new JDBC method which allows the application to be identified with a name it is the setClientInfo() and i could do it using pure JDBC using the lines Properties jdbcProperties = new Properties(); jdbcProperties.put("user", "system"); jdbcProperties.put("password", "sw01"); jdbcProperties.put("v$session.program", "Clients"); Connection connection = DriverManager.getConnection(url,jdbcProperties); However i have new requirements and i need to make it with JPA EclipseLink i have been googling and could not find something substantial on how to set this property out in JPA i guess it is by annotating something but i do not know what, i was trying to setting the persistence unit by putting the following in the persistence unit: <properties> <property name="toplink.ddl-generation" value="create-tables"/> <property name="v$session.program" value="Clients"/> </properties> but no lucky ...does somebody know how to do it or any idea...? thanks in advanced.-

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >