Need help with finding a phrase in a string in python Ask Programming |
- Need help with finding a phrase in a string in python
- Prevent navigation from overlapping with the logo
- How to make universal keyboard shortcuts to control pc?
- C# weird vector problems.
- C#/SQL Server - Comparing one string from C# to three columns from the same table in an SQL database?
- I want to create a REST API for the purpose of serving up configuration data to various applications (and possibly updating data in the future). How do I implement authentication?
- Opaque Data Types And Pointers
- Is coding boot camp worth it? Which is one is better? Why?
- Creating a unsorted array with randomised numbers (no duplicates)
- How does renting a server work? I need to use software that's very very ram intensive.
- How to move between frames/classes after clicking a button in java gui?
- SQL Help
- Is OOP inherently bad?
- Question for ambitious people: How can I create multiple background in Unity?
- How to divide between exception source?
- Where can I learn how to write functions that cut branches, add children, look up ancestors and otherwise interact with trees?
- What language for PostgreSQL backed web service/api running under Linux?
- How to check time conflicts in this situation
- I’m looking for a simple script to scour 2 websites for information. Can someone write it for $? PM for details.
Need help with finding a phrase in a string in python Posted: 25 Feb 2018 02:58 PM PST I want to open a text file and see if a word or phrase is in a text file that belongs to a list and return it. The procedure here works for a word. How do I make it work for a phrase? for example, if have ['great expectations'] and if the text contains "I have great expectations from you", this would return -1 as 'great' and 'expectations' are two different words while 'great expectations' is considered a single string rather than a phrase, [link] [comments] |
Prevent navigation from overlapping with the logo Posted: 25 Feb 2018 04:11 PM PST When I change the size of my browser window, the navbar overlaps with the logo: https://i.imgur.com/YcxTFlk.png Live example: http://crds.co/ Any ideas how I can prevent this from happening? [link] [comments] |
How to make universal keyboard shortcuts to control pc? Posted: 25 Feb 2018 09:39 PM PST Is there a way to make keyboard shortcuts that give me complete control? For example, I can end a specific process or launch specific web pages? If not, are there any similar tools out there? My goal is to map my own keyboard shortcuts to do very specific tasks (i.e. ctrl+7 to open a specific file or url). Does anyone know any tools to do this? My goal is to get complete control, but if that's not possible I'll take anything else too (like shortcuts for windows or firefox only). This sounds like something that would work better on Linux but ideally I would like to do this on Windows 10. Thanks. [link] [comments] |
Posted: 25 Feb 2018 05:39 PM PST I made my own Vector class in C# for a game I'm making. It contains a normalize() method that shrinks the vector to a length of 1 and a scale() method that multiplies the x & y values by a scalar. For some reason this works: But this doesn't: Obviously normalize() and scale() both work because they work in the first example, but for some reason, not in the second. They don't produce the same result. Is there a quirk with C# that I'm missing? I've been staring at this for the last 30 minutes with no clue what's going on, so any help is appreciated. I'm fairly new to the language so that's probably why it's not working for me. EDIT: After some experimenting, I've confirmed that normalize() definitely isn't the issue. The above code works but this does not: scale() is essentially: So I have no idea why it won't work. I suspect there's something about creating a new object that fixes the problem. But I'd like to not do that because that's a lot of objects per second. I'd rather just modify an existing object instead. [link] [comments] |
Posted: 25 Feb 2018 04:38 PM PST The title explains most of it. I have three identification devices, I get a similar but unique string from each one, if one of the strings matches a field in the table then set the labels in the C# form to the data in the SQL table I want to create one method to compare the received string to all three columns in the DB table, instead of making three separate methods or forms. Here's my C#/SQL Command: So if I had CardID and FingerprintID fields in the table, how would I add them in the command string to be compared to the idValue? Sorry for the bad english, it's not my first language. I know doing each identification process in a different method or form might be better or more secure but I want to see if this is possible and apply it. [link] [comments] |
Posted: 25 Feb 2018 12:39 PM PST I want to limit access to expected client hosts (request.client.hostname?), and to expected clients on those hosts (secret key?). I want to avoid authenticating via a username/password. What is the recommended approach? Not to influence people, but I've been leaning toward OAuth. [link] [comments] |
Opaque Data Types And Pointers Posted: 25 Feb 2018 08:10 PM PST Sometimes in C headers I see something like Why would anyone use a typedef like that over a typedef like [link] [comments] |
Is coding boot camp worth it? Which is one is better? Why? Posted: 25 Feb 2018 03:05 PM PST |
Creating a unsorted array with randomised numbers (no duplicates) Posted: 25 Feb 2018 05:45 PM PST I'm trying to create a int array where all the numbers are unique, but in no particular order. The highest number is whatever the length of the array is. In this example, i have an array with a length of 100 000. I want the numbers 0 to 99 999 in a random order. However, the array is still producing duplicates. Note: I need to do this without arraylists or sets [link] [comments] |
How does renting a server work? I need to use software that's very very ram intensive. Posted: 25 Feb 2018 10:09 AM PST I'm not familiar at all with renting and using virtual servers. How does it work? Do I simply rent one, install my software on it and run it in browser (or desktop app)? The software I need to use runs complex simulations and it needs a ton of ram to work well. Ideally, I would like a server with 256gb ram, but that might be too costly. edit: I think 128gb may be enough. [link] [comments] |
How to move between frames/classes after clicking a button in java gui? Posted: 25 Feb 2018 11:37 AM PST (AdminLogin is my second class which i want to move to after clicking a button from WelcomePage class). When i try to run there's an error at "admin.setVisible(true)". What did i do wrong? public class WelcomePage { private JFrame frame; } [link] [comments] |
Posted: 25 Feb 2018 09:14 AM PST Hey Reddit! Having trouble with this SQL query i've made. I have two tables, one with transaction data and one with categories. The categories table holds an id and name. The id being a primary key. The transaction table some columns about name, amount etc and three columns are primary_category, secondary_category and tertiary_category which are foreign keys from the category table. I'm trying to join them to resolve the category ids to their respective names. I have this which works for one... [link] [comments] |
Posted: 25 Feb 2018 06:02 AM PST Originally was going to post this in /r/changemyview but I wasn't sure whether a non-programming sub would be appropriate. I'm a developer who mainly works with .NET desktop applications and I love OOP. Recently I've been reading a lot of "opinion pieces" where the author states object-oriented programming is a bad paradigm that should just disappear. In all of these pieces the author seems to simply have bad experience with bad code bases - I can't see anything negative specific to OOP or object-oriented design. Are there any real reasons OOP should be specifically avoided or are these writers just ignorant of their situation? [link] [comments] |
Question for ambitious people: How can I create multiple background in Unity? Posted: 25 Feb 2018 02:12 PM PST Hi I'm noob in this place, hope I don't make a mistake posting. First of all apologise my English writing. :) I can't find anything about it, or at least not as accurate . How can I manage multiple backgrounds? I'm trying to make a running game. In that game i want to change the background after every 120 seconds or 30 points, like in game like "Jetpack joyride" or "Flappy bird"(day and night) . How can i do that? Any ideas..?? Generally, I have 6 backgrounds images. [link] [comments] |
How to divide between exception source? Posted: 25 Feb 2018 06:28 AM PST What is better programming practice? or should I put every open() function inside there own try blocks to better determine which exactly triggered my exception like:
[link] [comments] |
Posted: 25 Feb 2018 02:14 AM PST I am some way towards writing a chess AI and I want to include the three-fold repetition rule. This means that the children of a node (available moves) will now be a function of all its direct ancestors. I can also rewrite the playMove(str) function to just do some big branch deletes (saving computation time on the next move). The problem is I don't really know how to work with trees: delete branches, look up ancestors, write children. What is a good resources for improving my understanding of trees (and practical manipulation of data types in general)? [link] [comments] |
What language for PostgreSQL backed web service/api running under Linux? Posted: 25 Feb 2018 04:43 AM PST I am planning to write my own automated central heating system, mainly as a learning experience. I have an ESP2866 and a Pi3 which I will use for development purposes. I plan to start by getting the ESP2866 to submit temperature readings to a service running on the Pi at regular intervals, rather than have a service on the Pi polling the ESP2866. I want to get the latter to last for weeks if not months when running off a battery as there isn't a power source in the optimum place for a temp sensor in the main part of the house. The service on the Pi would store the received values in the PostgreSQL DB and I would probably build a web app to display them. Evolving the idea over time, I would add another ESP2866 with a relay to turn the heating on and off and add the facility to create schedules to the web app on the Pi, which are then used with the most recent temperature data to determine whether the heating should be off or on. The only thing I am fixed on is using PostgreSQL as I could do with gaining some more experience of it for work. I would like to use REST APIs where appropriate for the same reasons. The web app for instance, should use the REST API and at a later date I will probably look at building a web app too. Thanks in advance for your thoughts .bs [link] [comments] |
How to check time conflicts in this situation Posted: 25 Feb 2018 12:29 AM PST I have a sqlite database of classes that contains the courseID, days they occur (ex: Mon, Fri) and Time (11-12:30). I also have a ArrayList of currently enrolled classes (courses). Now here is my issue, I am trying to see if a time conflict will occur if you enroll in a specific course. I am not sure how to go about this in Java as the dates and times are in text so I am stuck. If you need anymore information please let me know. [link] [comments] |
Posted: 24 Feb 2018 10:41 PM PST |
You are subscribed to email updates from AskProgramming. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment