Steven.B

1

votes
1

answer
704

views

Collision Detection between player and tiles

I am trying to implement basic (for now) collision detection into my platformer. I have tiles that are each 16 x 16 in size. The character is 32 x 32 pixels in size and has its own bounding box. Now, in my Tile class, I have a bool, isSolid. Each of these tiles in my array also have a rect for their...
Steven B.
1

votes
1

answer
283

views

How can I tell Microsoft.AspNet.Identity.EntityFramework to use stored procedures

I just got a project that has an up and running identity model using the Microsoft.AspNet.Identity.EntityFramework 2.2.1 Everything works fine expect it's using Insert statements. Is there a way I can override something to have it call my own procs or to make it use stored procedures?
Steven B
1

votes
1

answer
175

views

OSX NSTextView becomes uneditable after showing NSAlert,NSOpenPanel

I've got a NSTextView in my view that works as it should, but when I show a NSAlert and close it, it becomes uneditable (with text still selectable). The NSAlert is a save/cancel alert that updates the textView's string when the user selects save, the string is not updated when the user presses canc...
Steven.B
1

votes
1

answer
267

views

Percentile function Python

Is there a convenient way to calculate the percentile of a column based on the values of other columns in a data frame. i.e. the 10th percentile of prices for each type of toy I have a method by which I can get my answer but it is very long winded and won't work well on larger datasets import panda...
Steven B
1

votes
1

answer
3k

views

randomize default products in opencart

I'm using OpenCart V1.5.3.1 and am trying to randomize or shuffle the products per category on page load. The other sort options should still work though (per price, rating, alphabetical,..). Anybody that can give me some pointers? Many thanks, Steven Code I've tried: In controller/catalog/product/c...
Steven_B
1

votes
2

answer
49

views

In R, Quantile based on flag/ factor value

I am trying to undertake some simple benchmarking in R. I have a dataframe with several numeric and a number of factors. What I am trying to do is find the top decile and top quartile of a variable called ALoS based on the associated factor value and then attach these values back to the original da...
Steven B
1

votes
1

answer
82

views

Form in Layout: Razor Pages

I have a select in a form in the Layout of my web app that needs to be accessible from every page. The form sets a session variable that is required to load data on every page. Select Customer Vandalay Kramerica I know I can make a base PageModel and inherit from that on every page in order to resp...
Steven B.
2

votes
3

answer
632

views

MVC - Accessing model data (Objective C)

I am currently learning Objective-C, one step at a time! Right now, my main focus is the MVC pattern. I'm not sure if I've wrapped around the concept very well yet. So, a little bit of background info: I am currently experimenting with 'entities' in my program. The model for the entities holds infor...
Steven B.
3

votes
2

answer
1.3k

views

GMSAutocompleteViewController iOS, how to change the text color in the searchBar

I'm using a GMSAutocompleteViewController and want to change the textColor in the searchBar but can't find a way to do it, I managed to change the some colors but not the searchBar text. I've tried following code but the color won't change: acController.searchBarController?.searchBar.tintColor = UIC...
Steven.B
19

votes
2

answer
31.7k

views

Using bxslider, is there some way to remove or hide the bullets at the bottom of the slide?

I am using bxslider to make a simple carousel, one jpg per slide. Because I have 8 jpg's, there are 8 bullets that are displayed at the bottom of each slide. Is there some way for me to remove or hide them.
Steven B
5

votes
1

answer
221

views

Updating .stringsdict localization files over-the-air

I'm looking for a way to update stringsdict localization files over-the-air without having to release a new version in the appStore. So ideally I want my stringdict files on a webserver, and the iOS app should download these files from the website and update the local strings. After doing some resea...
Steven.B
3

votes
3

answer
867

views

How to make a collectionview respond to pan gestures outside of it's own view

I've got a UICollectionView in my UIViewController and I want it to respond to gestures inside AND outside of the UICollectionView. By default the UICollectionView only responds to the gestures inside its own view but how can I make it respond to swipes outside of its view? Thanks.
Steven.B
1

votes
2

answer
114

views

Get a count of elements that appear once in a list with LINQ

Is it possible to get an integer count of elements that appear only once in a list with LINQ without creating a temporary list of those values and then counting that list? Obviously this doesn't work but something like: int test = list.Count(s => s.id).Where(s.id.Count() == 1);
Steven B.
6

votes
1

answer
1k

views

Making periodic network calls when iOS app is in background

I'm currently working on an app that should periodically (every minute) perform a network call while the app is backgrounded or killed. This network call will send information to our API. Is this possible on iOS? How?
Steven.B
4

votes
1

answer
656

views

How to access the Terminal's $PATH variable from within my mac app, it seems to uses a different $PATH

I'm trying to make a mac app where the user can type in commands just like they would in the mac terminal, I got most of it working however I found out that the $PATH variable of apps run from the finder or xcode is different than the $PATH variable the Terminal uses. I can run commands and also fou...
Steven.B
3

votes
1

answer
172

views

Declaration 'subscribe' cannot override more than one superclass declaration (ReSwift)

I'm having a problem when overriding a function from the ReSwift Pod. I've got the following mock class: import Foundation import Quick import Nimble import RxSwift @testable import MainProject @testable import ReSwift class MockReSwiftStore: ReSwift.Store { var dispatchDidRun: Bool = false var subs...
Steven.B
2

votes
1

answer
507

views

OSX NSMenuItem with custom NSView does not highlight swift

I'm building a menubar only app. I have a custom view for my menuItem but it is not highlight(blue) when hovering over. The custom class is working, it's detecting clicks but it's not highlighting, I tried using the enclosingMenuItem property in the menu to check for highlight status in the draw me...
Steven.B
2

votes
2

answer
166

views

Default value when Cast() fails for smalldatetime

I am trying to cast a datetime to a smalldatetime and when a row has a date value out-of-range for the smalldatetime type I want to set the date to a default value of the max date allowed and still do my comparison. SELECT Sum(Case When Cast(shph.datetoship as smalldatetime) < @day1datetoship Then s...
Steven B.
3

votes
1

answer
989

views

Eclipse - inline open declaration?

Eclipse has the handy option to hit f3 when the cursor is on a method to open the declaration. However, is there a way (via some plugin or otherwise) to do something similar, but inline the method body instead of taking you to the declaration? For example, let's say you have two classes: public cl...
Steven B
8

votes
1

answer
789

views

Circular UICollectionview, how to keep all cell angles 0°

I build a circular UICollectionview by following This guide, Everything is working as expected but I don't want the items to rotate around their own angle/anchor The top row is how my circular collectionview is working at the moment, the bottom drawing is how I would like my collectionview : I am us...
Steven.B
8

votes
1

answer
2.5k

views

iOS: `UICollectionview`, how to get a cell's `contentoffset` by it's `indexPath`

I'm using a UICollectionview with a circular layout. I'm trying to calculate the contentOffsetper item but with the circular layout the full contentsize does not seem match the content. The collectionview's total contentSize = 780 The content offset of the last item = 397(?) The content offset per i...
Steven.B
2

votes
1

answer
99

views

Service Authorization with Dependency Injection in Web API 2

I have an n-tiered web api 2 project that is structured as such: Web Layer Service/Business Layer Data/Repository Layer The web controllers have the corresponding service injected with Autofac and each service has the corresponding repository injected. This works fine. Now, I am needing to inject a...
Steven B.
2

votes
1

answer
151

views

iOS - Use/pass gesture recognizer for multiple Tableviews or Collectionviews in a View(Swift)

I've got 2 (circular) UICollectionviews in my view, both are functioning but I want to use 1 swipe gesture for both views so when I swipe on the top collectionview, the bottom view should also swipe with the same speed and vice-versa. What would be the best way to achieve this? This is my UIViewCont...
Steven.B
4

votes
4

answer
3.8k

views

Converting from Swift string to const char*

I'm trying to pass a const char * to an old C library converted from a Swift string in Swift. This is the C function I'm calling: artnet_node artnet_new(const char *ip, int verbose) { ... how can I convert a Swift string to this const char type? It works when I pass ipAddress like this: internal var...
Steven.B
2

votes
0

answer
382

views

Two way automatic model creation for django OneToOneField

Let's say I have the following class to extend the built-in django User class using a OneToOneField: class UserProfile(models.Model): django_user = models.OneToOneField(User, unique=True) extra1 = models.CharField() extra1 = models.CharField() ... My problem is: I would like UserProfile to be create...
Steven B
2

votes
1

answer
2k

views

Custom Legend in Chart.js 2.1.3

Is there a way to move and manipulate the legend in the Pie chart for Chart.js? Specifically I want to move it to the left or right of my pie chart and have it in a list-style instead of inline. I see in the documentation that the only positions are top or bottom so I tried hiding the default legen...
Steven B.
2

votes
1

answer
259

views

Image capture always returns result code of 0 and makes the Gallery stop

I am following this tutorial line for line on the android site. I am attempting to take a picture, save it, and then retrieve it later. But every time I take the picture and hit okay I get the message 'Unfortunately, Gallery has stopped.' and the result code is returning as 0, unsurprisingly. I...
Steven B.
2

votes
1

answer
96

views

Easiest way to set custom inputview to all textFields globally

I created a custom input view for the App I'm currently working on, I can assign this keyboard to a textField by doing: textField.inputView = myCustomKeyboard as! UIView Now I just want to switch out all inputViews with my custom inputView, is there a simpler way to do this without having to set the...
Steven.B
3

votes
4

answer
3.2k

views

CarbonKit CarbonTabSwipeNavigation, Viewcontrollers not aligning correctly

I'm using Carbonkit's CarbonTabSwipeNavigation by ermalkaleci , when the view loads, the viewcontrollers are aligned properly, then when switching to the second viewcontroller the alignment of the second viewcontroller is correct but when scrolling back to the first viewcontroller, it is aligned wro...
Steven.B