Steve Steve
9130 questions
1
votes
4
answer
1k
views
Check if a Point is between two Points
I just recognized my math is a bit rusty.. I wanna check if Point C is between Point A and Point B. C can be on the line segment of A and B, or not. There can be three cases and I have to identify all of them:
C is between A and B
C
/ \
A---B
C is in front of A and B
C
\ \
A--B
C is in the b...
1
votes
1
answer
657
views
Clang - “symbol not found” when linking
I'm trying to compile this source in clang:
extern "C" void __declspec(dllexport) TEST(int num)
{
return;
}
Problem is that on link, clang reports "Cannot export _TEST: symbol not found"
I can't find a way, however, to prevent clang from mangling names
I've been reading that this is a bug in clang,...
0
votes
0
answer
12
views
Add boolean array as a field to Firestore document
I am looking to add a integar array field to all users in my user collection.
I found out to do this it is better to use a List than an array. (Writing array in Firebase android).
Upon Adding this integar array to my already working User Registration activity,it uploads to the database perfectly wel...
0
votes
0
answer
51
views
Can a shell namespace extension displaying a form receive/pass files to IFileDialogs?
I'd like to show a shell namespace extension in the new (since Windows Vista) IFileOpenDialog and IFileSaveDialog.
These dialogs can apparently display a custom form like the built-in Homegroup screen:
On this form I'd like to show internal files stored in a database (with various other options).
My...
1
votes
2
answer
7.2k
views
Android Extends Button - Accessing Members from Java to XML
I'm new to android programming and would like to extend a button class so that I can add a custom field to the button, and then change the way the button is displayed dependent on the field. I've done a few tutorials, had a good bash around and have something that compiles, but doesn't work - so I'm...
0
votes
0
answer
9
views
dplyr & gracefully dealing with SQL NULL values
I'm trying to use dplyr to work with SQL databases using R and I'd like to gracefully handle SQL's NULL values--either by simply filtering them out or treating them as zeros when the come up, depending on the scenario--without making any changes to the underlying database itself. (In other words, I'...
0
votes
0
answer
4
views
Google 72.0.3626.109 cannot upload images using a URL
On that last update, I have lost the ability to use a website uploader function and instead of browsing to a local file, use a URL. It is defaulting to the chrome program location which it doesn't usually and saying I can't open a file in that location despite opening without issue.
If I try to ope...
1
votes
2
answer
97
views
How to compare Django Querysets
I have been struggling all morning trying to figure out how to compare two different querysets. I have two manytomanyfields in my model, and I'm trying to figure out if they are identical.
I research this by viewing this particular issue: How do I test Django QuerySets are equal?
I am using class...
1
votes
1
answer
1.1k
views
How to detect that an axis belong to a window that has been closed in matplotlib
In matplotlib, I keep a reference on an axis. I want to open a new figure if the window that contain the axis have been closed. The idea is to keep adding plots on the figure, until it is closed, then I open a new figure.
Note that the creation of new plots is triggered by an event in another figur...
-1
votes
0
answer
18
views
UnsatisfiedLinkError when overloading JNI method
I am trying to work with JNI using Java and C++. It works for the most part, but when I try overloading a method, I get an UnsatisfiedLinkError and I don't understand why. This is the error I get:
Exception in thread "main" java.lang.UnsatisfiedLinkError: test.HelloJNI.function(I)D
at test.HelloJNI....
1
votes
3
answer
266
views
Delphi - can a property read from a property?
So I just joined this forum because I could not find an answer to my simple question.
I want to declare a read-only property, and it should read from a private members read-only property. It seems like that won't work. Can I work myself around that blockade?
Here is the code snippet:
property Mine:...
0
votes
0
answer
3
views
How To Download HTML Data As Doc File From Django DetailView
I am trying to figure out if there is a way to natively download data from my Django DetailView. I have been reading SO and getting ideas for the last day or so and I almost have it working....
Here is my code...
class AuthorDetailView(LoginRequiredMixin,DetailView):
model = Author
context_object_n...
1
votes
1
answer
318
views
Scaling SCNNode and its children
I am making a simple measuring app. Currently I place spheres as SCNNodes around the place and between nodes appears a label that displays the length of the line from node 1 to node 2.
This is how the labels are created:
func addLabel() {
let plane = SCNPlane(width: 0.07, height: 0.02)
plane.cornerR...
1
votes
1
answer
31
views
How to query for _id that's not of type ObjectId
(I'm new to mongo)
How do I query for an _id that's not of type ObjectId?
I mongorestore'd a mongodump and can't get any results based on the id field. I noticed after a while that the records in the collection didn't adhere to the ObjectID type.
"_id": "7409a2ab-322e-40f3-b991-c3ebeda78f61",
If I...
1
votes
1
answer
22
views
Password saving for API usage (php and mysql)
I am using Instagram API by mgp25.
Here, you can gain access to the IG api via "logging in": the API (in php) requires a password and account id to be in plain text format when gaining the access.
Here is the setup that I have:
I have a site where there are users and the site has IG API integration....
0
votes
0
answer
13
views
Make a fragment replacement animate like it's being added
For performance reasons, I want to replace the fragment and not add it, but I want the animation to appear as if the fragment is being added on top of the old one. The problem I am facing is the previous fragment disappears from view when the animation starts, leaving the content behind it momentari...
0
votes
3
answer
14
views
How to get rid of the hardcoded sleep()?
def textfield(boxid,textadded):
project = driver.find_element_by_id(boxid)
project.send_keys(textadded)
sleep(3)
def dropdown(dropdownid, dropdownvalue):
select = Select(driver.find_element_by_id(dropdownid))
select.select_by_visible_text(dropdownvalue)
sleep(5)
These 2 functions are functional howe...
1
votes
2
answer
47
views
jquery :: Why does hover trigger instantly?
Why does the hover event trigger as soon as the page is loaded?
function showSelector(position) {
alert(position);
}
function hideSelector() {
}
$("#1").hover(showSelector(17), hideSelector);
sup
-1
votes
4
answer
28
views
get key and value from HashMap within ArrayList
I have a file that i get all the data and separate it into a HashMap.
The file looks something like this below.
Before the : is the key and after is the value
key1: 1
key2: 2
key3: 3
this is the code that puts the file data into the map ArrayList:
protected List yaml_parse(BufferedReader filename) t...
1
votes
1
answer
316
views
How do I get a java.reflect.Field value for a property inherited from a Groovy trait?
I'm using Groovy 2.4.3 inside of a Grails web application. I have the following Trait/Class hierarchy declared in it:
trait GuidData {
String Guid
}
class Enrollment implements GuidData {
String email
}
When I execute the following code I get the expected results:
Enrollment enrollment = new Enrollm...
1
votes
3
answer
20.2k
views
Python: Append a list with a newline
In the following code I am updating a list with two items by appending to it from within a for loop. I need a newline to be added after appending each string but I can't seem to be able to do it.
I thought it would have been:
lines = []
for i in range(10):
line = ser.readline()
if line:
lines.append...
3
votes
1
answer
16
views
Getting Permission Denied Error When I push to remote ( Please make sure you have the correct access rights and the repository exists)
I cloned another person's repository. I was able to add and commit a file in my local copy of the repository. When I try to execute a "git push" command however I am getting an error message.
My git hub username is Nikola901. The user that I am getting the repository from is mqttbroker
here are th...
0
votes
0
answer
5
views
Update Single Sheet in All Files in Folder and Subfolders
So, I've been tasked with the writing of code that will go through all files within current folder of Google Drive and update a specific sheet called "Artifacts and Evidence," located in the fourth tab, with the contents on the sheet which the script runs. This all worked really well and I was able...
1
votes
2
answer
61
views
How many people can connect to ServerSocket?
I'm working with sockets. I'd like to know how many people can connect to my SocketServer using Sockets?
According to Cameron it is 2^16 different connection. So, as much as 2^16 people can actually use my chat at the same time(resources for handling so much users and other factors are not considere...
1
votes
1
answer
439
views
sqlalchemy bulk_insert_mappings generates a large number of insert batches, is this avoidable?
I have a large number of objects that need to be inserted into an Oracle database via sqlalchemy.
Using individual inserts took quite a while to execute. After searching around it became obvious that there are more efficient bulk insert methods, bulk_insert_mappings, bulk_save_objects, etc. These me...
1
votes
3
answer
2.8k
views
Free, hosted, issue tracker with github integration
The Github issue tracker is not quite cutting the mustard for our (open-source, but professionally developed) project: it has the bizarre and crippling* restriction that non-owners can't assign labels or users to issues.
So we need a new issue tracker. We don't need a lot, but labels (for components...
16
votes
2
answer
178
views
How to make Maven automatically retry (resume from failed module)?
I'm working on a large Maven project consisting of a number of different modules. The Maven build intermittently fails on certain modules but if all is well, a simple manually invoked --resume-from (sometimes on a couple of different modules) will allow it to continue to success.
Am deliberately omi...
1
votes
2
answer
2.5k
views
Does every belongs_to has_many association need nested routes?
This is a fairly basic question but I haven't been able to find concrete answers online. Every has_many belongs_to does not need nested routes correct? Should you only use nested routes when you're looking for URLs of the form class/:id/class/:id?
For example, let's say I have two classes Profile...
1
votes
1
answer
2k
views
How do you get the next page of twitter results using the Twitter OAuth API?
I am using the twitter oath API and I get the first page of results for my search query. But I want to get all pages, so how do I iterate using the API to get the next page?
1
votes
2
answer
58
views
How do I trigger jQuery .click() after replacing content?
My HTML looks like this
Some Text
Click to replace div
My JQuery/javascript is like this
$(document).ready(function() {
$('.foo').click(function() {
alert('worked');
})
})
function replace() {
$('#current').html($('.data1').html());
}
The alert triggers fine on the .foo class within the .data1 di...
1
votes
3
answer
1.1k
views
Why do I get `Procedure or function expects parameter`?
I'm inserting a row into a SQL Server 2005 database table from Classic ASP.
I get the following error:
Procedure or function 'replace_matl_form_insert' expects parameter '@matl_no', which was not supplied.
I am supplying the parameter. The types match, and I'm still getting that error. Here is th...
1
votes
1
answer
81
views
namespaces - to 'use' or not to 'use'?
I've been looking at a lot of frameworks lately, specifically Slim. Now, I don't plan on using it, but had a question anyway. In Slim, it makes use of namespaces. However, it doesn't actually 'use' any of them. You'll see namespace Slim; and then in the main index file it requires that class and t...
1
votes
1
answer
2.2k
views
Stacked Negative/Positive Time Series Using ggplot2 and geom_area
I'm trying to reproduce a stacked time-series graph which shows how the composition and size of a bank's balance sheet changes over time. It should look something like this:
Where assets go above the x-axis and liabilities go below it.
So far I've been able to reproduce each half of the graph succe...
1
votes
5
answer
192
views
Is it bad design to pass reference of collections in constructor?
I encounter many times of similar code:
class AClass{
private Iterable list;
public AClass(Iterable list){ this.list = list; }
...
}
In this code, a reference of Iterable is passed to AClass directly. The end result is equivalent to directly expose list reference to outside. Even if you make AClass....
1
votes
3
answer
411
views
how to display span tag values separated by a break
I have a span tag,
and getting the span text by $("#display").html();
for (var i = 0; i < arr.length; i++) {
var val = $("#display").html();
if (val == "") {
$("#display").html(arr[i].name);
$("display").html('')
}
else {
$("#display").html(val +" " + arr[i].name);
$("display").html('')
}
}
I want...
1
votes
2
answer
2.6k
views
Unity3d object still moveable on pause
I have a simple pong game and when I pause the game by hitting the escape key, the user can still move the paddle left and right. The game is a mobile game that involves touch. How would I go about ensuring the paddle is not moveable when the game is paused as well?
Here is the code for my paddle i...
1
votes
1
answer
934
views
SKLearn Cross-validation:
I'm doing text classification and will be dealing with words that are not captured in my training data, meaning the word should be treated as unknown.
Does anyone know if scikit's cross validation will treat a particular word as unseen if it does not exist in the training data?
Or will scikit treat...
1
votes
1
answer
1k
views
jQuery Mobile changePage failed
I'm having issues making the simple script below to work but it's not:
Add Target
Choose a Target
test 1
test 2
Apply
Cancel
$(document).undelegate("#targetPage", "pageinit").delegate("#targetPage", "pageinit", function() {
$('form[name="targetForm"] #bt-addTarget').off('click').on('click',...
1
votes
1
answer
371
views
Oracle OpenScript - Link Cannot Be Clicked
I am using Oracle OpenScript to test a website.
A particular link cannot be clicked during playback, but it was caught during recording.
In some cases, during playback the link is highlighted and playback stops.
In other cases, instead of following the link, playback is directed back to the previous...
1
votes
1
answer
2.2k
views
Using NSLayoutConstraints when adding a subview with simple animation
I'm trying to add a view (messageView) to my menu item (messageViewMenu) so that when the menu item is tapped, this new view is added just above it and they both slide down the screen together one behind the other - Evernote 5.1.2 has something similar.
I'm using an NSLayoutConstraint to attach the...