Sam Sam

10548 questions
1

votes
3

answer
751

views

CSS - My border-bottom resizes when I resize my browser

I use a border-bottom on my navigation div, which is 100% wide. When I resize my browser window, the border-bottom suddenly gets cut off to te size that I just resized my browser to. Does anyone know a solution to this? my css: #nav { clear: both; height: 40px; width: 100%; text-align: center; bord...
Sam
0

votes
1

answer
36

views

Getting exact day values per month, between 2 dates

I am trying to get the amount of days in a month, between 2 dates. So this would ideally look like Month | Days Jan | 5 Feb | 28 March | 5 The dates need to come from a table that looks like this - Name | Age | Address | AddressStartDate| AddressEndDate Steve| 19 | randomAdd | 2018-01-26...
sam smith
0

votes
1

answer
53

views

SDK DJI download photo in swift

I am simply attempting to download the latest access the feed from my DJI drone and convert the feed into a UIImage. The easiest way i thought this could be done is take a photo, then promptly afterwards download the latest photo from the storage. I will add the download from storage code below. Is...
Sam
1

votes
4

answer
4k

views

How can my flash app fit correctly in all Android devices?

I am making a Flash game for Android devices. I made my game to fit the dimensions of an HTC EVO 4G, but when I play it on a different device such as a Motorola Droid 2 with different dimensions; it does not fill up the whole screen. How do I make it so that my flash game fits the screen correctly o...
Sam
1

votes
1

answer
475

views

SMS utility on Android 4.4 KitKat

Before KitKat was released I had developed an app which uses pre-defined short codes to perform transactions over SMS. For example, sending " BAL " would get you a reply with your credit balance. The user doesn't see the short codes, but instead picks the required function from a list, inserts his...
Sam
1

votes
1

answer
1.7k

views

Yii Datefield default value

How can I set a default date(today) value for datefield object in Yii? I have the following in my view. I have tried array('placeholder'=>'today') as suggested here but it did not work. Thanks.
Sam D
1

votes
1

answer
25

views

iOS - expecting unreasonable character

I am getting a weird error in my Xcode compiler when doing app for iPhone. The error I get is: Expected ']' - (IBAction)backButton:(id)sender { NSUserDefaults* standardUserDefaults = [NSUserDefaults standardUserDefaults]; if(standardUserDefaults) { NSString* isNewNote = [standardUserDefaults object...
Sam
1

votes
3

answer
1.4k

views

Itterate through an array in batches using php

Ive got an API im working with that accepts a call every 5 seconds, any more than that it wont respond. In each call it will accept 5 records in a batch. Ive got a list of 1000s of records that i need to check using the api, so what im trying to do is send it my list of records in broken up into bat...
sam
1

votes
1

answer
1.1k

views

How to get the fetchedResultsController.objectAtIndexPath() from within pickerView: titleForRow

I have a UIPickerView and it's datasource is a fetchedResultsController. My delegate func: func pickerView(pickerView: UIPickerView!, titleForRow row: Int, forComponent component: Int) -> String { let task: Task = self.fetchedResultsController.objectAtIndexPath(row) as Task return task.name } resul...
Sam Luther
1

votes
1

answer
440

views

Where to store private keys for a continuous integration (CI) deployment?

I'm building a continuous integration deployment that is based off a private git repository. My project contains an un-versioned PK file in the resources directory. This works fine when I deploy manually, I ensure a copy of the private key is on the path from whatever workstation. Now that I'm deplo...
Sam
1

votes
3

answer
712

views

Animating UVs in SceneKit

I'm looking for a way to animate sprite sheets in SceneKit. After some research I found the Core Animation way to do this, which would be perfect as I need as much control over the animation as possible. I've prepared a simple plane mesh, with its UVs limited to one spritesheet frame's size. That wa...
sam_vh
1

votes
1

answer
1.9k

views

In Azure Logic App, how do I pass parameters in a http request?

I am trying to download a file from a website that requires me to pass parameters while making the HTTP request. The request is as follows https:/wwww.xxx.com/download/exportdata.go?pid=3276439&startdate=2015-01-01&enddate=2015-01-02 Though when I hard code the request it works perfectly, but now th...
Sam
1

votes
1

answer
991

views

How to use url encoded string in Firebase REST Query using startAT

In our database we have URLs that are used as FireBase keys. These keys are url encoded strings of the form: http%3A%2F%2Fblog%ZZexample%ZZcom%2F_Test_Blog_2015_06 A GET request returns empty: curl 'https://mydb.firebaseio.com/publishers/0000014d45a67fa3_4e93b3f/sites/0000014d45b0dc08_20173d1/pages....
Sam
1

votes
2

answer
804

views

How to keep a menuflyout open after clicking on togglemenuflyout item?

I have found no examples that contain a property to manipulate a menuflyout so it stays open if user clicks on togglemenuitem but will still close if focus is lost or esc button is clicked. The functionality I would prefer is that it stay open so user can click up to 24 toggleMenuFlyoutItems if pref...
Sam
1

votes
2

answer
350

views

How to assert that a Rails method will not throw a NoMethodError

In my Rails application I am doing a unit test where I expect an error when calling a certain method. test "sending a logout request while not logged should not return an error" do assert_nothing_raised do do_a_logout end end Problem is that the test keeps reporting as Error instead as of Failure w...
Sam Hax
-1

votes
1

answer
15

views

How to use sed to delete lines contain pattern?

I trying delete lines contain the matching pattern (only on that line) using sed. For example, my file like this Blood Mountain, (summit),4458,feet,Union County Wolfpen Ridge, (ridge high point),4561,feet,Towns and Union Counties Slaughter Mountain, (summit),4338,feet,Union County I would like t...
Sam Luong
0

votes
0

answer
25

views

Encoded URL by html and javascript

The output of the code is to make a Form and prompts Enter the URL and the result that the link is urlencoded; converting / to %2F and : to %3A ...etc How can I modify the code so that it can be installed on a blogger and encrypt all links coming out of the blogger? function urlencode() { var txt=do...
Has G Sam
1

votes
2

answer
693

views

How to get the size of database in KB/MB

I am developing an Android application in Ionic where I put a pre-populated database in apk. User can insert and delete records and initially the size of DB file is 217kb . I want to track after some time what is the current DB file size on user's device. Thanks in Advance!
sam
0

votes
1

answer
17

views

How to make tappable NSAttributedString Move To Another ViewController Swift

I'm working on a simple app and add programatically NSAttributedString. I am really confused how to move present viewcontroller to another viewcontroller. This is not duplicate question because my question for how move to view controller and duplicatie question how to open link on click How can I...
Sam
1

votes
1

answer
1k

views

How does asyncio.as_completed work

Reading this answer, I ran across asyncio.tasks.as_completed. I don't understand how that function actually works. It is documented as being a non-async routine that returns futures in the order they complete. It creates a queue associated with the event loop, adds a completion callback to each fu...
Sam Hartman
-1

votes
0

answer
29

views

How can I make variable noticed as a string in str.replace()

I am making a hangman game and I am trying to replace the blank position with the guessed letter if its correct. I have been look everywhere on stackoverflow and nothing people have been saying is working for me. I am using str.replace() as you can see in the title. The code is below: # Hangman impo...
Sam
-3

votes
1

answer
39

views

I need help writing newton's method by creating R functions

I'm trying to create a function, called newton. The inputs include the function f for which I want to find the root, the first derivative of f called df, the starting value x0, and the threshold in the stopping criterion called stop; equal to 0.0001. The output is a list that has three objects: the...
Sam
1

votes
1

answer
773

views

How to UNNest multiple arrays in BigQuery?

I have this json that is stored in a BigQuery table in 3 fields token, questions, answers token:STRING, questions:STRING, answers:STRING Questions and answers are STRING because they are dynamic fields. token field has single value. questions field has dictionary object with "fields" being list obje...
sam
0

votes
0

answer
14

views

Can not set java.util.List field to java.lang.String

I am getting below error Can not set java.util.List field com.packageName......ABCmode to java.lang.String com.packageName......ABCmode : I am not typing complete package name but the format is here to understand what I am doing. I get the error when below lines of code is being executed B1.hotRes...
Sam.jordan
0

votes
2

answer
19

views

Regex find and replace inbetween Latex enviroment

I'm trying to come up with a regex to use in find and replace so I can find all '(' characters used inside of the align environment. Example text: Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum (Lorem Ipsum Lorem Ipsum ) Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum \begin{align} \...
Sam Palmer
1

votes
1

answer
22

views

-bash: import: command not found : command not found Java Compilation Mac Terminal

I am new to programming in Java and have been working on university computers with Windows. I am a Mac user and having trouble trying to compile in terminal. These are the errors I am presented with: Last login: Wed Feb 13 11:48:22 on ttys000 Sams-MacBook-Air:~ samsmac$ cd /Users/samsmac/Desktop/Wee...
Sam Walker
-1

votes
0

answer
12

views

How can I make a recommendation engine for my wordpress site?

It is a project I have to do for my university.I have to build my own recommendation engine and recommend posts to users based on likes or favorites. I don't have very good PHP skills so I don't want to create a plugin. Is it a good solution to implement it with a code snippet? What I've done so far...
Sam.d93
0

votes
0

answer
2

views

Parallax image does not work on ion-slider for ionic 4

I'm not able to get parallax effect to work with ionic4 ion-slider. I've tried examples from the original source code of idangero but none seem to work. import { Component } from '@angular/core'; @Component({ selector: 'slides-example', template: ` Slide 2 Slide 3 ` }) export class SlideExample { sl...
Sam van beastlo
1

votes
1

answer
1.5k

views

Angular routerLinkActive for multiple paths

In my Angular 5 project I've got a bootstrap nav-bar menu. routerLinkActive does work nicely when the start of the path matches the routerlink of the menu, like: Teacher the Code above activates the menu item nicely for `/entity/teacher/add' and more Problem is, I've got a Kind of 'catch-all' naviga...
Sam
1

votes
2

answer
504

views

AWS API Gateway Access Private Subnet

I have Public and Pvt Subnets in my VPC. I have some services running on EC2 in Pvt subnet, that needs to be accessed by external/mobile resources. How do I do this- is VPCLink and NLB the way to do it, or any other way, create some access point in Public subnet (??). Lambda seems to be the answer (...
Sam-T
1

votes
1

answer
37

views

How can I make a text transition with innerHTML smooth, with a fade in/out when it changes?

This is my first post so if I'm a bit off on the format of posting or something, please forgive me. So I'm coding a website for a gaming team, and they want their roster (there are boxes that have the player names in them) to expand and give some info when you hover over a name. I've gotten it to ex...
Sam
1

votes
2

answer
38

views

Loop through row multiplying by one row VBA

I have a set of weights in rows BA40:BZ40 and I want each row starting from BA60:BZ60 to sum (BA40*BA60 + BB40*BB60 + ... + BZ40*BZ60). Then paste this in CA60 then move onto row 61. However I still need to reference BA40:BZ40. I don't know if its my simplistic mind getting confused or its not possi...
Sam Harper
1

votes
2

answer
43

views

Multiple asynchronous HTTP requests using Resttemplate

I have a service which uses springs RestTemplate to call out to multiple urls. To improve performance I'd like to perform these requests in parallel. Two options available to me are: java 8 parallel streams leveraging the fork-join common pool completable future using isolated thread pool Just wond...
Sam
0

votes
1

answer
19

views

Calling local files from C++ executable in PATH

Lets say I have a folder called /folder that looks like this: folder |--test.txt |--test.cpp All test.cpp does is print the contents of the (relatively) local ./test.txt. So if I compile test.cpp to get test.exe. Then I can call: C:/.../folder>test and the content of test.txt will be printed to the...
Sam McC
1

votes
0

answer
7

views

LUA - Unable to make the game restart after the timer finishes

I have to make a small game for my college work and at the end of the game I would like it so if you click the game over button it restarts it, however every time I have tried to do this it hasn't worked with either errors or just the game restarting and the game over image not being removed. I know...
Sam Shanks
1

votes
2

answer
4.1k

views

Gerrit submit change after abandoning its parent

I have a situation where I have pushed changeA and changeB to Gerrit. changeA is the parent of changeB. changeA was abandoned. Will changeB will automatically be merged if its approved? If yes, what would its parent be? If changeB will not automatically be merged, what do I need to do to have it mer...
sam
1

votes
2

answer
3.6k

views

Best way to get address components from Google Places API response

I'm implementing Google Places in a form where the user will enter his/her location. The location can be a full address or just a city. I want to get each individual component of the address the user has provided. What's the best way to get each component i.e. address, city, state, zip code and coun...
Sam
1

votes
5

answer
1.5k

views

addClass to div on change of dropdown selection

I have the following dropdown: Toni Jack James Below this I have the following divs: ... ... ... These are set to display:none using css I'm trying to make it so when I select the name from the dropdown, the class "visible" is added to the corresponding div - and then removed again if the se...
Sam Skirrow
1

votes
1

answer
7.5k

views

How to automatically set height of slick carousel

I'm using the slick caurousel for test. I am currently hard coding the height of the slides: slide a slide b slide c CSS: .slides { height: 200px; } What I would like, though, is for the carousel to automatically be the hight of the tallest slide. Is there a way to do this?
Sam Lee
1

votes
3

answer
272

views

Big O with 2 variables which multiply together

If I take the function: def nested_multiplier(a, b): """ returns a*b """ count = 0 for i in range(a): for j in range(b): count += 1 return count It is fairly clear here that the complexity in terms of number of asignments is going to be a * b. Fine so far so good. So if I want to work out the Big O...
Sam Redway

View additional