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.