Search Results

Search found 5998 results on 240 pages for 'rise against'.

Page 12/240 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • MySQL GIS and Spatial Extensions - how to map regions and query against them

    - by chibineku
    I am trying to make a smartphone app which will return a list of users within a certain proximity, say 100m. It's easy to get the coordinates of my BlackBerry and write them to a database, but in order to return a list of other users within 100m, I need to pull every other record from the database and compare the distance between the two points, checking to see if it's within range, before outputting that user's information. This is going to be time consuming if there are many users involved. So I would like to map areas (countries, cities, I'm not yet sure of the resolution I'll need) so that I can first target a smaller subset of all users. This will save on processing time. I have read the basics of GIS and spatial querying on the mysql website but to be honest the query is over my head and I hate copying and pasting code without understanding it. Plus it only checks for proximity - I want to first check if a coordinate falls within a certain area. Does anyone have any experience of such matters and feel like giving me some pointers? Resources such as any preexisting databases of points describing countries as polygons would be really helpful too. Many thanks to anyone who takes the time :)

    Read the article

  • DesignTime data not showing in Blend when bound against CollectionViewSource

    - by bitbonk
    I have datatemplate for a viewmodel where an itemscontrol is bound again a CollectionViewSource (to enable sorting in xaml). <DataTemplate x:Key="equipmentDataTemplate"> <Viewbox> <Viewbox.Resources> <CollectionViewSource x:Key="viewSource" Source="{Binding Modules}"> <CollectionViewSource.SortDescriptions> <scm:SortDescription PropertyName="ID" Direction="Ascending"/> </CollectionViewSource.SortDescriptions> </CollectionViewSource> </Viewbox.Resources> <ItemsControl ItemsSource="{Binding Source={StaticResource viewSource}}" Height="{DynamicResource equipmentHeight}" ItemTemplate="{StaticResource moduleDataTemplate}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> </Viewbox> </DataTemplate> I have also setup the UserControl where all of this is defined to provide designtime data d:DataContext="{x:Static vm:DesignTimeHelper.Equipment}"> This is basically a static property that gives me an EquipmentViewModel that has a list of ModuleViewModels (Equipment.Modules). Now as long as I bind to the CollectionViewSource the designtime data does not show up in blend 3. When I bind to the ViewModel collection directly <ItemsControl ItemsSource="{Binding Modules}" I can see the designtime data. Any idea what I could do?

    Read the article

  • Programming against WSDL without access to actual webservice

    - by Frode Lillerud
    I'm going to use C# to read data from a few webservices. I've done that many times before, but those times I've had direct access to the webservices from my development machine. In this project I've just been sent a .wsdl file, and a couple of .xsd files for the webservice they have in their local intranet. I've seen that I can use "Add Web Reference", and point directly to the .wsdl file, so that a C# class is created. But how can I really test it? I'd like to return some dummy data that I can visualize while I develop. Any tips for this situation?

    Read the article

  • Making an owner-draw button transparent against its arbitrary background in WINCE

    - by EndsOfInvention
    Hi I am trying to place an owner-draw button transparently onto a background. I have no trouble doing this when the background is a solid colour but if the background is an image I cannot seem to get the correct HDC (handle to device context) to Bitblt() the area that button covers. The HDC that is passed as part of the DRAWITEMSTRUCT gives me a button-default-grey area. If I attempt to get the parent of the HWND and then the device context of that i.e pdc = GetDC(GetParent(hWnd)); then the background that gets BitBlt'd is the background of the last painted window. I hope this question makes sense. this is the code I have: pdis = (LPDRAWITEMSTRUCT)(lParam); hdc = pdis->hDC; button = pdis->CtlID - IDC_BUTOFFSET; //pdc = GetDC((hWnd)); pdc = GetDC(GetParent(hWnd)); hbm = CreateCompatibleBitmap(pdc, Buttons_[button]->bc.Size.cx, Buttons_[button]->bc.Size.cy); SelectObject(hdc, hbm); BitBlt(hdc, 0, 0, Buttons_[button]->bc.Size.cx, Buttons_[button]->bc.Size.cy, pdc, Buttons_[button]->bc.Position.x, Buttons_[button]->bc.Position.y, SRCCOPY); TIA Best regards Ends

    Read the article

  • How should I protect against hard link attacks?

    - by Thomas
    I want to append data to a file in /tmp. If the file doesn't exist I want to create it I don't care if someone else owns the file. The data is not secret. I do not want someone to be able to race-condition this into writing somewhere else, or to another file. What is the best way to do this? Here's my thought: fd = open("/tmp/some-benchmark-data.txt", O_APPEND | O_CREAT | O_NOFOLLOW | O_WRONLY, 0644); fstat(fd, &st); if (st.st_nlink != 1) { HARD LINK ATTACK! } What's the right way? Besides not using a world-writable directory.

    Read the article

  • How do I setup a Criteria in nHibernate to query against multiple values

    - by AWC
    I want to query for a set of results based on the contents of a list, I've managed to do this for a single instance of the class Foo, but I'm unsure how I would do this for a IList<Foo>. So for a single instance of the class Foo, this works: public ICriteria CreateCriteria(IList<Foo> foo) { return session .CreateCriteria<Component>() .CreateCriteria("Versions") .CreateCriteria("PublishedEvents") .Add(Restrictions.And(Restrictions.InsensitiveLike("Name", foo.Name, MatchMode.Anywhere), Restrictions.InsensitiveLike("Type", foo.Type, MatchMode.Anywhere))) .SetCacheable(true); } But how do I do this when the method parameter is a list of Foo? public ICriteria CreateCriteria(IList<Foo> foos) { return session .CreateCriteria<Component>() .CreateCriteria("Versions") .CreateCriteria("PublishedEvents") .Add(Restrictions.And(Restrictions.InsensitiveLike("Name", foo.Name, MatchMode.Anywhere), Restrictions.InsensitiveLike("Type", foo.Type, MatchMode.Anywhere))) .SetCacheable(true); }

    Read the article

  • PreparedStatement question in Java against Oracle.

    - by fardon57
    Hi everyone, I'm working on the modification of some code to use preparedStatement instead of normal Statement, for security and performance reason. Our application is currently storing information into an embedded derby database, but we are going to move soon to Oracle. I've found two things that I need your help guys about Oracle and Prepared Statement : 1- I've found this document saying that Oracle doesn't handle bind parameters into IN clauses, so we cannot supply a query like : Select pokemon from pokemonTable where capacity in (?,?,?,?) Is that true ? Is there any workaround ? ... Why ? 2- We have some fields which are of type TIMESTAMP. So with our actual Statement, the query looks like this : Select raichu from pokemonTable where evolution = TO_TIMESTAMP('2500-12-31 00:00:00.000', 'YYYY-MM-DD HH24:MI:SS.FF') What should be done for a prepared Statement ? Should I put into the array of parameters : 2500-12-31 or TO_TIMESTAMP('2500-12-31 00:00:00.000', 'YYYY-MM-DD HH24:MI:SS.FF') ? Thanks for your help, I hope my questions are clear ! Regards,

    Read the article

  • Implement user authentication against remote DB with a Web Service

    - by Juan González
    I'm just starting reasearch about the best way to implement user authentication within my soon-to-be app. This is what I have so far: A desktop (Windows) application on a remote server. That application is accessed locally with a browser (it has a web console and MS SQL Server to store everything). The application is used with local credendials stored in the DB. This is what I'd like to accompllish: Provide access to some information on that SQL Server DB from my app. That access of course must be granted once a user has id himself with valid credentials. This is what I know so far: How to create my PHP web service and query info from a DB using JSON. How to work with AFNetworking libraries to retrieve information. How to display that info on the app. What I don't know is which could be the best method to implement user authentication from iOS. Should I send username and password? Should I send some hash? Is there a way to secure the handshake? I'd for sure appreciate any advise, tip, or recommendation you have from previous experience. I don't want to just implement it but instead I want to do it as good as possible.

    Read the article

  • anyone know of a custom membership provider implementation that check password strength against in-b

    - by ronaldwidha
    I've got an Asp.net MVC app and before being able to go live, the IT have requested for us to comply with their password policy. The flexibility of AspnetSqlMembershipProvider doesn’t quite satisfy the requirement. The password strength and length rules are as follows: one lowercase one Uppercase one number and or special character 8 characters in length so far, aspnetsqlmembershipprovider is good... Not allowed to use: Dictionary words Names, real or fictional Plain language phrases Dates Telephone numbers Car registration numbers User IDs Postal codes Organization name Only the first 4 criteria are satisfied by the aspnetsqlmembershipprovider. Do you know of any third party products that offers this functionality (preferably in the form of a custom membership provider)?

    Read the article

  • mysql - filtering a list against keywords, both list and keywords > 20 million records

    - by threecheeseopera
    I have two tables, both having more than 20 million records; table1 is a list of terms, and table2 is a list of keywords that may or may not appear in those terms. I need to identify the terms that contain a keyword. My current strategy is: SELECT table1.term, table2.keyword FROM table1 INNER JOIN table2 ON table1.term LIKE CONCAT('%', table2.keyword, '%'); This is not working, it takes f o r e v e r. It's not the server (see notes). How might I rewrite this so that it runs in under a day? Notes: As for server optimization: both tables are myisam and have unique indexes on the matching fields; the myisam key buffer is greater than the sum of both index file sizes, and it is not even being fully taxed (key_blocks_unused is ... large); the server is a dual-xeon 2U beast with fast sas drives and 8G of ram, fine-tuned for the mysql workload.

    Read the article

  • The case against Maven?

    - by Asgeir S. Nilsen
    Time and time again I've read and heard people frustrated over Maven and how complicated it is. And that it's much easier to use Ant to build code. However, in order to: Compile code Run tests Package a deployable unit This is all you need from Maven: <project> <modelVersion>4.0.0</modelVersion> <groupId>type something here</groupId> <artifactId>type something here</artifactId> <version>type something here</version> </project> What would be the corresponding minimal Ant build file?

    Read the article

  • Facebook Photo Contest App Against FB's TOS ??

    - by Alex D
    What would be possible/best practice for a Photo Contest app? Saving photos to a database and refreshing the contents with an "infinite session"? Exporting photos to my site getting written consent from my user? I've gathered that it won't be possible to present users with a number of photos to vote on because the permissions for user's photos will often not allow just anyone (the public) to view them. I've looked at SnapIt! Photo Contest on Facebook and it appears they are successful with what I'm trying to do. Are they breaking the Facebook TOS? http://apps.facebook.com/snapitphoto I'm new to Facebook development and want to be sure it is possible to do what I want before I become very invested. Any advice would be much appreciated! Thanks

    Read the article

  • Modify a reference numbered group to match against

    - by StuperUser
    I want to match YYYY-YY for sequential years. I at moment I'm trying to match where all the second YY is the 3rd and 4th characters in YYYY with 1 added to it. So far I've got {19|20}(\d{2})-(\d{2}), but not sure how to use ? with reference to (1) or whether I'm going about this the right way and finding out the inevitable "unknown unknowns" (like YY99) with this approach? Edit: Matches: 2010-11,2011-12,2029-30 Not matches: 2010-12, 2010-09,2011-2,2011-2012

    Read the article

  • Little Regular Expression (against HTML) help

    - by Marcos Placona
    Hi, I have the following HTML <p>Some text <a title="link" href="http://link.com/" target="_blank">my link</a> more text <a title="link" href="http://link.com/" target="_blank">more link</a>.</p> <p>Another paragraph.</p> <p>[code:cf]</p> <p>&lt;cfset ArrFruits = ["Orange", "Apple", "Peach", "Blueberry", </p> <p>"Blackberry", "Strawberry", "Grape", "Mango", </p> <p>"Clementine", "Cherry", "Plum", "Guava", </p> <p>"Cranberry"]&gt;</p> <p>[/code]</p> <p>Another line</p> <p><img src="http://image.jpg" alt="Array" /> </p> <p>More text</p> <p>[code:cf]</p> <p>&lt;table border="1"&gt;</p> <p> &lt;cfoutput&gt;</p> <p> &lt;cfloop array="#GroupsOf(ArrFruits, 5)#" index="arrFruitsIX"&gt;</p> <p>  &lt;tr&gt;</p> <p> &lt;cfloop array="#arrFruitsIX#" index="arrFruit"&gt;</p> <p>     &lt;td&gt;#arrFruit#&lt;/td&gt;</p> <p> &lt;/cfloop&gt;</p> <p>  &lt;/tr&gt;</p> <p> &lt;/cfloop&gt;</p> <p> &lt;/cfoutput&gt;</p> <p>&lt;/table&gt;</p> <p>[/code]</p> <p>With an output that looks like:</p> <p><img src="another_image.jpg" alt="" width="342" height="85" /></p> What I'm trying to do, is write a regular expression that will remove all the or , and whenever it finds a , it will replace it with a line-break. So far, my pattern looks like this: /\<p\>(.*?)(<\/p>)/g And I'm replacing the matches with: $1\n It all looks good, but it's also replacing the contents inside the [code][/code] tags, which in this case should not replace the tags at all, so as a result, i would lkike to get rid of the tags, when the content isn't inside the [code] tags. I can't ever get negation right, I know it will be something along the lines of \<p\>^\[code*\](.*?)(<\/p>) But obviously this doesn't work :-) Could anyone please lend me a hand with this regex? BTW, I know I shouldn't be using regular expressions to parse HTML at all. I'm fully aware of that, but still, for this specific case, I'd like to use regex. Thanks in advance

    Read the article

  • EF/LINQ: Where() against a property of a subtype

    - by ladenedge
    I have a set of POCOs, all of which implement the following simple interface: interface IIdObject { int Id { get; set; } } A subset of these POCOs implement this additional interface: interface IDeletableObject : IIdObject { bool IsDeleted { get; set; } } I have a repository hierarchy that looks something like this: IRepository<T <: BasicRepository<T <: ValidatingRepository<T (where T is IIdObject) I'm trying to add a FilteringRepository to the hierarchy such that all of the POCOs that implement IDeletableObject have a Where(p => p.IsDeleted == false) filter applied before any other queries take place. My goal is to avoid duplicating the hierarchy solely for IDeletableObjects. My first attempt looked like this: public override IQueryable<T> Query() { return base.Query().Where(t => ((IDeletableObject)t).IsDeleted == false); } This works well with LINQ to Objects, but when I switch to an EF backend I get: "LINQ to Entities only supports casting Entity Data Model primitive types." I went on to try some fancier parameterized solutions, but they ultimately failed because I couldn't make T covariant in the following case for some reason I don't quite understand: interface IQueryFilter<out T> // error { Expression<Func<T, bool>> GetFilter(); } I'd be happy to go into more detail on my more complicated solutions if it would help, but I think I'll stop here for now in hope that someone might have an idea for me to try. Thanks very much in advance!

    Read the article

  • NHibernate query against the key field of a dictionary (map)

    - by Carl Raymond
    I have an object model where a Calendar object has an IDictionary<MembershipUser, Perms> called UserPermissions, where MembershipUser is an object, and Perms is a simple enumeration. This is in the mapping file for Calendar as <map name="UserPermissions" table="CalendarUserPermissions" lazy="true" cascade="all"> <key column="CalendarID"/> <index-many-to-many class="MembershipUser" column="UserGUID" /> <element column="Permissions" type="CalendarPermission" not-null="true" /> </map> Now I want to execute a query to find all calendars for which a given user has some permission defined. The permission is irrelevant; I just want a list of the calendars where a given user is present as a key in the UserPermissions dictionary. I have the username property, not a MembershipUser object. How do I build that using QBC (or HQL)? Here's what I've tried: ISession session = SessionManager.CurrentSession; ICriteria calCrit = session.CreateCriteria<Calendar>(); ICriteria userCrit = calCrit.CreateCriteria("UserPermissions.indices"); userCrit.Add(Expression.Eq("Username", username)); return calCrit.List<Calendar>(); This constructed invalid SQL -- the WHERE clause contained WHERE membership1_.Username = @p0 as expected, but the FROM clause didn't include the MemberhipUsers table. Also, I really had to struggle to learn about the .indices notation. I found it by digging through the NHibernate source code, and saw that there's also .elements and some other dotted notations. Where's a reference to the allowed syntax of an association path? I feel like what's above is very close, and just missing something simple.

    Read the article

  • Validate a XDocument against schema without the ValidationEventHandler (for use in a HTTP handler)

    - by Vaibhav Garg
    Hi everyone, (I am new to Schema validation) Regarding the following method, System.Xml.Schema.Extensions.Validate( ByVal source As System.Xml.Linq.XDocument, ByVal schemas As System.Xml.Schema.XmlSchemaSet, ByVal validationEventHandler As System.Xml.Schema.ValidationEventHandler, ByVal addSchemaInfo As Boolean) I am using it as follows inside a IHttpHandler - Try Dim xsd As XmlReader = XmlReader.Create(context.Server.MapPath("~/App_Data/MySchema.xsd")) Dim schemas As New XmlSchemaSet() : schemas.Add("myNameSpace", xsd) : xsd.Close() myXDoxumentOdj.Validate(schemas, Function(s As Object, e As ValidationEventArgs) SchemaError(s, e, context), True) Catch ex1 As Threading.ThreadAbortException 'manage schema error' Return Catch ex As Exception 'manage other errors' End Try The handler- Function SchemaError(ByVal s As Object, ByVal e As ValidationEventArgs, ByVal c As HttpContext) As Object If c Is Nothing Then c = HttpContext.Current If c IsNot Nothing Then HttpContext.Current.Response.Write(e.Message) HttpContext.Current.Response.End() End If Return New Object() End Function This is working fine for me at present but looks very weak. I do get errors when I feed it bad XML. But i want to implement it in a more elegant way. This looks like it would break for large XML etc. Is there some way to validate without the handler so that I get the document validated in one go and then deal with errors? To me it looks Async such that the call to Validate() would pass and some non deterministic time later the handler would get called with the result/errors. Is that right? Thanks and sorry for any goofy mistakes :).

    Read the article

  • Games that are still winable against the computer?

    - by roygbiv
    There's a game on my laptop called 'Chess Titans' which I've been playing one game a day for almost 90 days. With the difficulty on the hardest setting I have not been able to win one game, however, I have come close. What's the fun in playing a chess game if the computer can search all moves and win? Has (or can) anyone beat a modern computer chess AI? What games can't a computer gain an advantage in? (i.e. They would be 'fun' to play.)

    Read the article

  • Checking date against date range in Python

    - by Flowpoke
    I have a date variable: 2011-01-15 and I would like to get a boolean back if said date is within 3 days from TODAY. Im not quite sure how to construct this in Python. Im only dealing with date, not datetime. My working example is a "grace period". A user logs into my site and if the grace period is within 3 days of today, additional scripts, etc. are omitted for that user. I know you can do some fancy/complex things in Python's date module(s) but Im not sure where to look.

    Read the article

  • Using FOR XML AUTO against a synonym

    - by Rick
    We've just switched to synonyms for linked server stuff, and noticed that our FOR XML output is no longer correct. When returning XML results from a view, we could alias the view and that would be assigned as the element name. With synonyms, however, it seems to ignore the alias? We're still mostly on SQL 2005 - this bug doesn't seem to happen on our 2008 instance. Is this a known problem, and any ideas for work-arounds? For example, this is what we used to be able to do: select top 3 number from Numbers as elementname for xml auto <elementname number="0"/><elementname number="1"/><elementname number="2"/> And this is what happens with a synonym: select top 3 number from Numbers_synonym as elementname for xml auto <dbo.Numbers number="0"/><dbo.Numbers number="1"/><dbo.Numbers number="2"/> As you can see, SQL Server seems to use the name of the actual referenced object instead of the alias. This gets worse for cross server queries, because you get the four-part name instead of the nice alias. (eg: <rick_server.rick_database.dbo.Numbers number="0"/>...)

    Read the article

  • LINQ-to-SQL: Searching against a CSV

    - by Peter Bridger
    I'm using LINQtoSQL and I want to return a list of matching records for a CSV contains a list of IDs to match. The following code is my starting point, having turned a CSV string in a string array, then into a generic list (which I thought LINQ would like) - but it doesn't: Error Error 22 Operator '==' cannot be applied to operands of type 'int' and 'System.Collections.Generic.List<int>' C:\Documents and Settings\....\Search.cs 41 42 C:\...\ Code DataContext db = new DataContext(); List<int> geographyList = new List<int>( Convert.ToInt32(geography.Split(',')) ); var geographyMatches = from cg in db.ContactGeographies where cg.GeographyId == geographyList select new { cg.ContactId }; Where do I go from here?

    Read the article

  • linking against a static library

    - by ant2009
    Hello gcc Version: 4:4.4.4-1ubuntu2 GNU Make 3.81 I have the following library called net_api.a and some header files i.e. network_set.h I have include the header file in my source code in my main.c file #include <network_set.h> I have the following static library and header in the following directory ./tools/net/lib/net_api.a ./tools/net/inc/network_set.h In my Makefile I have tried to link using the following, code snippet: INC_PATH = -I tools/net/inc LIB_PATH = -L tools/net/lib LIBS = -lnet_api $(TARGET): $(OBJECT_FILES) $(CC) $(LDFLAGS) $(CFLAGS) $(INC_PATH) $(LIB_PATH) $(LIBS) $(OBJECT_FILES) -o $(TARGET) main.o: main.c $(CC) $(CFLAGS) $(INC_PATH) $(LIB_PATH) -c main.c However, when I compile I get the following errors: network_set.h error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘network_String’ Many thanks for any suggestions,

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >