ben-r

1

votes
2

answer
104

views

Is there a way to include a particular version of a Git submodule in a project tag?

I have a project, SubProj, which I want to include as a submodule in MainProj. However, I want to make sure that any releases I do of MainProj also include a particular version of SubProj to ensure all dependencies are satisfied. In other words, when I tag a particular commit of MainProj as a new ve...
Ben R.
1

votes
1

answer
72

views

Database Design: force a child table to populate with predefined data when the parent record is created

I hope this isn't going to be too broad a question or too subjective (and please correct me if it is) but what are the best practices or most ideal way of populating the rows of a child table with data that MUST exist when a parent record is created? I have come across something like this Database s...
Ben.R.Wadd
1

votes
1

answer
57

views

What is the best way to store pairs of data that may contain duplicate values?

Im looking to hold pairs of data that I can recall and change at points in time within my code. The two pieces of data are strings, one being a name and one being a time (formatted hh:MM:ss). The times are triggers that scripts will run, the name being the script name in question. Both of these valu...
Ben R
0

votes
3

answer
63

views

One specific variable reference is being skipped

It seems like the %s in the final printf is entirely being skipped. This is the entire code: #include int main(void){ char address[100]; char city[100]; char state[2]; char zip[15]; printf('Enter street address: '); scanf(' %[^\n]',&address); printf('Enter city: '); scanf(' %[^\n]',&city); printf('...
Ben R.
13

votes
1

answer
3.6k

views

Getting the id of the object when inside form_for or fields_for

I have the following code that is generating fields for an invoice THis is in the edit.html.erb for the invoice class 'invoice_items/fields', :locals => {:f => f} %> and I generate the invoice_items as part of the invoice object @invoice = Invoice.find(params[:id], :include => :invoice_items, :order...
Ben R
2

votes
1

answer
440

views

How to compute gradients to fool an image classifier?

I am trying to get the standard trick-an-image-classifier example working in TensorFlow. (That is, adjust the input image by following the gradient so it is misclassified, e.g., https://codewords.recurse.com/issues/five/why-do-neural-networks-think-a-panda-is-a-vulture .) I have downloaded the i...
Ben R
1

votes
1

answer
94

views

C# Path.Combine is not using AppData location

I'm trying to access the AppData folder to create/delete directories as needed but using Path.Combine is yielding only half the desired path. Here's what I have: string sPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); string test = Path.Combine(sPath, @'\Microsoft\Window...
Ben R
3

votes
1

answer
1k

views

GC overhead while running pig job, after hadoop job ends

I'm running a very simple pig script (pig 0.14, Hadoop 2.4) : customers = load '/some/hdfs/path' using SomeUDFLoader(); customers2 = foreach (group customers by customer_id) generate FLATTEN(group) as customer_id, MIN(dw_customer.date) as date; store customers2 into '/hdfs/output' using PigStorage(...
Ben R
2

votes
1

answer
109

views

Prometheus Timer Callback

I'm currently switching our Java backend from DropWizard to Prometheus and I'm having trouble finding a good substitute for DropWizards Timer while instrumenting a library which has a metrics callback looking like this: new ImageUploader( new MetricsCallback() { @Override public void timer(long aLon...
ben-r
2

votes
0

answer
33

views

C# MSAccess parametrized SELECT query raises IndexOutOfRange exception

Im trying to re-work my SQL queries into safe alternatives to prevent SQL injection attacks but having difficulty pulling from the database using these parameters. This is C#, using an MS Access database and OleDB connections. I have the following query: OleDbCommand cmd = new OleDbCommand('Select ?...
Ben R
2

votes
3

answer
2.6k

views

css background images not always displayed

I am loading background images with css: background:#000000 url(site/logo.jpg) no-repeat This works fine. However, using Firefox, when reloading the site with forced cache refresh the images sometimes do not show up. In these cases I need to take some clicking action (e.g. switching tabs, marking te...
Ben R.