Search Results

Search found 968 results on 39 pages for 'closest'.

Page 22/39 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Delete an entity by key without fetching it first in app engine (using JDO)

    - by Peter Recore
    Is there a way to delete an entity without having to fetch it from the datastore first? I am assuming I already have the key or id for the entity. I'm thinking of something like deleteObjectById that would be an analogue to getObjectById on PersistenceManager. The closest I can think of is using Query.deletePersistentAll() (as seen here) and specifying a query that only relies on the key, but I can't tell if that is going to fetch the entity before deleting it. thanks EDIT: I know how to do this using the low level API, as well as in the python API. I was wondering if there was a way to do it within the JDO layer.

    Read the article

  • className method?

    - by fuzzygoat
    I have just been watching the Stanford iPhone lecture online from Jan 2010 and I noticed that the guy from Apple keeps referring to getting an objects class name using "className" e.g. NSArray *myArray = [NSArray arrayWithObjects:@"ONE", @"TWO", nil]; NSLog(@"I am an %@ and have %d items", [myArray className], [myArray count]); However, I can't get this to work, the closest I can come up with it to use class, is className wrong, did it get removed, just curious? NSArray *myArray = [NSArray arrayWithObjects:@"ONE", @"TWO", nil]; NSLog(@"I am an %@ and have %d items", [myArray class], [myArray count]); Gary

    Read the article

  • How to select elements from a set that are children of another element

    - by Tatu Ulmanen
    Hi, The title is a bit confusing but here's what I'm after: I have a set of elements containing all the h3 elements in a page. In jQuery terms: var mySet = $('h3'). I also have an div element var myContainer = $('div#foo') I need to find all items in the set mySet that are children of myContainer. Any ideas? I bet there's some magical one liner for this but I cannot think of any. I'd rather not loop through every element in the set manually and use .closest(myContainer) or something like that to determine the relationship. Note that in my scenario, I cannot use a new selector like $('div#foo h3') (that would be too easy) as I don't have access to the actual selector values. So it has to be dynamic.

    Read the article

  • How would I create a technology standards document for my company?

    - by Rob O
    I'm a Director of Product Engineering for my company. My CEO has asked me to create a technology standards document, explaining things like the technology we use, our policy on adapting to new technology, and design standards like percent of code covered by unit tests. I've never had to do something like this, and I've spent a significant amount of time searching the web for examples, but I haven't found any at all. The closest I've found are documents describing technical specifications for an individual product. However, I'm trying to define this for the entire company. Can someone provide examples of how this document could be formatted/organized, and what the typical content would be? Thanks!

    Read the article

  • Font for mac osx that is as readable and compact as the default xterm (X11) font.

    - by dreeves
    The font used in xterms is extremely compact yet readable. What font is that? The closest I've found that I can use in other other applications is DejaVu Sans Mono or Bitstream Vera Sans Mono. Those are as compact as xterms vertically but take up more space horizontally. I'd really like to switch from xterms to Terminal.app and this is the one thing holding me back. (I also think that font would be much better for emacs, xcode, or whatever editor.) ADDED: In Terminal.app you can adjust the character and line spacing for any font. Is this possible in other applications? I'm open to any other font that is as compact and readable as the xterm font. Dina looks really nice but it doesn't seem to work for Mac.

    Read the article

  • Building FFmpeg for Android

    - by varevarao
    I've spent almost a week on this now, trying to get FFmpeg "Angel" to build for Android. I've tried build scripts from all over the internet to no avail. I got closest was using this. A sthe author himself says the script doesn't work for newer versions of FFmpeg due to this bug, which has been dismissed on that ticket saying "I found a Makefile that does it." This was dis-heartening, being the only post on all of the cast Google world that was anywhere close to my problem. So, question time: Is there a way to get around the above bug? I'm trying to use the newest ffmpeg API, and "Love" is just giving me "undefined reference" errors while trying to use av_encode_video2(), and av_free_frame(). The code I was working on the lines of is at the ffmpeg git repo, under /doc/examples/decoding_encoding.c (the function starting on line 338)

    Read the article

  • smallest perimiter rectangle with given integer area and integer sides

    - by remuladgryta
    Given an integer area A, how can one find integer sides w and h of a rectangle such that w*h = A and w+h is as small as possible? I'd rather the algorithm be simple than efficient (although within reasonable efficiency). What would be the best way to accomplish this? Finding out the prime factors of A, then combining them in some way that tries to balance w and h? Finding the two squares with integer sides with areas closest to A and then somehow interpolating between them? Any other method i'm not thinking of?

    Read the article

  • Excel - check if row contains ANY value *more than once*

    - by user2536778
    I am doing data analysis and sometimes I need to check and to make sure each row in excel does not have any repeated value. I hope that there is a formula where each time if there's a repeated value in the same row, the value will be highlighted and it doesn't matter what value it is, as long as it's repeated in the same row. I try to search it everywhere but the closest I can find is below question & answer ( which couldn't apply to me as I need a formula that can highlight any value that's repeated and not only zero): I have rows which contain grades for students (numerical values), where the number 0 means they missed a class. I want the row to be highlighted in one color if they have "0" 3 or 4 times, and in another color if they have "0" 5 times or more. =COUNTIF(1:1,0)=5 Anyone can help me? Thanks in advance!

    Read the article

  • Play song during call

    - by golemnagesh
    please help me how to play song during call if we are in same call both should listen that song, and call must be disconnected automatically once playing done... present my application behaving like,if i call to anyone once call lifted song is playing but i am only hearing that song but i want to do other person also should listen that song. but i found in one forum to do like : The closest thing you can do, is have the call set to speaker-phone and then play the voice over the speaker.sounds straight to the mic in a phone call then that would be done. but that i didn't find in API. please help me how to do if anyone knows this.

    Read the article

  • ASP.Net Treeview - Client side event handling (jQuery??)

    - by The Great Gonzo
    I have a Treeview (bog standard ASP.Net Treeview) that is bound to an Xml source which allows the user to navigate to various parts of our system. Nothing special.... However, I wanted to generate a breadcrumb for use in the main content area on the client side when the user clicks a node in the Treeview control. I know there are mechanisms available for breadcrumb generation (such as site maps) but for various reasons I need to do it when a node is clicked. So far hooking up a click event using the document ready function available as part of jQuery is easy. However, having spent sometime looking I can not see how I navigate back up the tree nodes to get to each parent nodes text value to build the breadcrumb. I have been playing with .parent(), .parents() and .closest() available via jQuery but don't seem to be getting anywhere. Has anyone done anything like this or can anyone provide a better method? Thanks in advance....

    Read the article

  • How do I set up a test duplicate of a Django and Postgresql based web application?

    - by cojadate
    Not sure if this is an excessively broad and newbie-ish question for Stack Overflow but here goes: I paid someone else to build a web application for me and now I want to tweak certain aspects of it myself. I learn best by trial and error – changing stuff and seeing what happens. Obviously that's not a great way to treat a live site, so I need to duplicate the site on some kind of test server which I can play with without fear of the consequences. Unfortunately the closest I've come to programming has been creating ActionScript-based websites. I've never touched a database. So I really don't know where to start with setting up a test server. I would really appreciate any advice about where to start. I am completely ignorant and lost here. The web application is built in python/django using a Postgresql database. I use Mac OS X 10.6 if that makes any difference.

    Read the article

  • Setting many key/value pairs

    - by Andrew
    Hi, I'm working on a rake task which imports from a JSON feed into an ActiveRecord called Person. Person has quite a few attributes and rather than write lines of code for setting each attribute I'm trying different methods. The closest I've got is shown below. This works nicely as far as outputing to screen but when I check the values have actually been set on the ActiveRecord itself it's always nil. So it looks like I can't use .to_sym to solve my problem? Any suggestions? I should also mention that I'm just starting out with Ruby, have been doing quite a bit of Objective-c and now need to embrace the Interwebs :) http = Net::HTTP.new(url.host, url.port) http.read_timeout = 30 json = http.get(url.to_s).body parsed = JSON.parse(json) if parsed.has_key? 'code' updatePerson = Person.find_or_initialize_by_code(parsed['code']) puts updatePerson.code parsed.each do |key, value| puts "#{key} is #{value}" symkey = key.to_sym updatePerson[:symkey] = value.to_s updatePerson.save puts "#{key}....." # shows the current key puts updatePerson[:symkey] # shows the correct value puts updatePerson.first_name # a sample key, it's returning nil end

    Read the article

  • Firefox - Stashing Requests for Deliberate Resubmission to Django App

    - by Koobz
    I've got an object creation form that's somewhat complicated, it contains a few dynamic formsets etc. I'm trying to ensure that these dynamic formsets are intact if the form runs into an error and returns you to the given page. In cases like this, the refresh button actually works well in re-submitting the request, but I can't rely on it. I'm doing some ad-hoc testing in the browser that I'd like to make a bit more repeatable, and eventually move to a unit test using Django's mock client. Is there an extension, or some convenient method to stash requests for later re-submission. The goal: I resubmit the request, tweak the code, eyeball the results, rinse and repeat. Three days later I can come back to it an try it again to make sure it's still working. The closest thing I can think of in this case is simply recording my activity with Selenium ide and replaying it.

    Read the article

  • Add HttpOnly flag to cookies on the fly with Apache?

    - by Zack
    So I have a java webapp that uses tomcat with an apache proxy layer. I'm looking to make all cookies set from the app have the httpOnly flag. The problem with this is that tomcat is responsible for setting the flag from the application side and its default (in servlet api 2.5) is false. I was hoping I could set this flag for all cookies on the fly using apache. I've been trying different combinations and the closest I have gotten is setting the last cookie passed to httpOnly which is of course wrong: Header append Set-Cookie "; HttpOnly" I have no way of knowing what cookies/values are going to be passed from the app. Is this even possible?

    Read the article

  • how to get the particluar row value from grid using jquery

    - by kumar
    I defined this code in the script <script type="text/javascript"> var RowClick = function(e) { $('#Grid td:first-child').click(function() { var resultArray = $(this).closest('tr').find('td').map(function() { var val = $(this).text(); alert(val); }); }); }; </script> I am calling this RowClick for SingleClick event server side.. something like this.. grid.ClientSideEvents.RowSelect = "RowClick"; Here my intension was to get the perticular row value on row click? but this code which I wrote above its not working for me.. Please can anybody help me out how to get the perticular column eq(0) or eq(1) ? thanks

    Read the article

  • Anonymous code blocks in Groovy

    - by piepera
    Is there a way to use anonymous code blocks in Groovy? For example, I'm trying to translate the following Java code into Groovy: { int i = 0; System.out.println(i); } int i = 10; System.out.println(i); The closest translation I can come up with is the following: boolean groovyIsLame = true; if (groovyIsLame) { int i = 0; System.out.println(i); } int i = 10; System.out.println(i); I know anonymous code blocks are often kind of an antipattern. But having variables with names like "inputStream0" and "inputStream1" is an antipattern too, so for this code I'm working on, anonymous code blocks would be helpful.

    Read the article

  • Sprintf equivalent in Mathematica?

    - by jxy
    I don't know why Wikipedia lists Mathematica as a programming language with printf. I just couldn't find the equivalent in Mathematica. My specific task is to process a list of data files with padded numbers, which I used to do it in bash with fn=$(printf "filename_%05d" $n) The closest function I found in Mathematica is PaddedForm. And after some trial and error, I got it with "filename_" <> PaddedForm[ Round@#, 4, NumberPadding -> {"0", ""} ]& It is very odd that I have to use the number 4 to get the result similar to what I get from "%05d". I don't understand this behavior at all. Can someone explain it to me? And is it the best way to achieve what I used to in bash?

    Read the article

  • How do I create a WPF Dropdown panel

    - by Mitch
    I'd like to create a dropdown panel in WPF the acts like a ComboBox/Expander hybrid. I'm currently using an Expander but it pushes the the controls underneath it down when it expands. I simply want it to act like a ComboBox and overlay it's dropdown. I've looked at using Popups but they don't move with the underlying window if it's moved. So, I've concluded that the closest control to my needs is a ComboBox with allows me to put a Grid or StackPanel into its dropdown area. Any ideas how to achieve this?

    Read the article

  • Accented character regex

    - by user314573
    I'm trying to create a regex that will look for french words whether a user specifies the accented characters or not. So if the the user has searched for "déclaré" but types in declare instead I would like to be able to match the text still. I'm having difficulty making this more dynamic so that it can be matched on any french word... Closest example from another user from a different post was: d[eèéê]cl[aàáâ]r[eèéê] Is it even possible to write a regex for something like this? Any advice would be much appreciated.

    Read the article

  • How might I assume a "default value" when parsing using boost::spirit?

    - by tJener
    Let's say I have a grammar defined to something like: a b c d where c, and d are optional and default to 14 if not given. Can I get it to automatically return the 14 if the value isn't given? The closest I've come is like the following: qi::rule<Iterator, std::vector<int>(), ascii::space_type> some_rule; some_rule %= >> int_ >> int_ >> -int_ >> -int_; // ... some_other_rule = some_rule[&some_callback_for_int_vectors]; which will then get 0 for the optional values that didn't show up (I believe). I then change consecutive 0s at the end into 14. Not only is this horribly wrong, but its also just not elegant. Is there a better way to do this?

    Read the article

  • How do I resize a flat vector icon so that it preserves hard edges in Photoshop (CS4)

    - by Adam Singer
    I recently purchased Drew Wilson's Pictos icon library. It is a library of flat, monochromatic icons for use on the web and elsewhere. The only issue is: they're vectors. I know my way around Illustrator a little bit, but ultimately I want to import these icons into Photoshop and resize to various dimensions. The problem I'm having: when I import an icon and resize it to, say, 20x20 pixels, I notice that there is a fair bit of aliasing around the edges of the icon. I'm sure there is some magic number where the edges of these icons will remain crisp, but I can't find any option or setting that will allow me to size these icons properly. Is there a way in Photoshop to snap these icons to the closest size that removes or minimizes the aliasing?

    Read the article

  • Wordpress show next 3 x number adjacent custom posts from existing

    - by user2463284
    On a single/detail Custom Post Page I would like to display a custom nav of li's or divs in a sidebar that displays both title, excerpt and permalink for the next 3 posts within the custom post series. So if we are on custom post 3 then it would show 4, 5, 6 in the sidebar. The closest I've found to this is :-= global $post; $current_post = $post; // remember the current post for($i = 1; $i <= 3; $i++){ $post = get_previous_post(); // this uses $post->ID setup_postdata($post); // do your stuff here the_title(); } $post = $current_post; // restore Problem is this only shows the first next post and I need to show 3. Thanks Glennyboy

    Read the article

  • How to partition a plane

    - by puls200
    Let's say I have a fixed number (X) of points, e.g. coordinates within a given plane (I think you can call it a 2-D point cloud). These points should be partitioned into Y polygons where Y < X. The polygons should not overlap. It would be wonderful if the polygons were konvex (like a Voronoi diagram). Imagine it like locations forming countries. For example, I have 12 points and want to create 3 polygons with 4 points each. I thought about creating a grid which covers the points. Then iterate across the points, assigning them to the closest grid cells. Maybe I miss the obvious? I am sure there are better solutions. Thanks, Daniel I just found an optimization (kmeans++) .Maybe this will yield better results..

    Read the article

  • Beginner, learning as I go - how to get C#/SQLite db set up and ready for testing?

    - by ChrisC
    I've messed with Access a little bit in the past, had one class on OO theory, and one class on console c++ apps. Now, as a hobby project, I'm undertaking to write an actual app, which will be a database app using System.Data.SQLite and C#. I have the db's table structure planned. I have System.Data.SQLite installed and connected to VS Pro. I entered my tables and columns in VS, but that's where I'm stuck. I really don't know how to finish the db set up so I can start creating queries and testing the db structure. Can someone give me guidance to online resources that will help me learn how to get the db properly set up so I can proceed with testing it? I'm hoping for online resources specific to beginners using C# and System.Data.SQLite, but I'll use the closest I can get. Thanks.

    Read the article

  • How can I collapse a dataframe by some variables, taking mean across others

    - by Alex Holcombe
    I need to summarize a data frame by some variables, ignoring the others. This is sometimes referred to as collapsing. E.g. if I have a dataframe like this: Widget Type Energy egg 1 20 egg 2 30 jap 3 50 jap 1 60 Then collapsing by Widget, with Energy the dependent variable, Energy~Widget, would yield Widget Energy egg 25 jap 55 In Excel the closest functionality might be "Pivot tables" and I've worked out how to do it in python (http://alexholcombe.wordpress.com/2009/01/26/summarizing-data-by-combinations-of-variables-with-python/), and here's an example with R using doBy library to do something very related (http://www.mail-archive.com/[email protected]/msg02643.html), but is there an easy way to do the above? And even better is there anything built into the ggplot2 library to create plots that collapse across some variables?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >