NLog:: adding source code line number to the log - nlog

I need source code line number to the log entry through NLog.
Please let me know alternate ways to do it.
<<Log entry>> Line 23
<<Log entry>> Line 391
P.S. - 23, 391 are the source code line numbers.
Thanks

You may use ${callsite:fileName=true} layout renderer - indicates whether to render the source file name and line number. Documentation.

Not sure but you should try this. Hope it will help :D
http://iosdevelopertips.com/cocoa/filename-and-line-number-with-nslog-part-ii.html
and I also found this
NSLog(#"current line: %d",__LINE__);
from this
How can I log the current line via NSLog in Cocoa / Objective C?
EDIT sry I dont know that u want C#
should try look at this
Do __LINE__ __FILE__ equivalents exist in C#?

Related

Tensorflow Object Detection API - Do something when an object is detected

Hi I'm currently searching for studies or tutorials where they used tensorflow API to do something (alarm, save video, print something, etc.) when a certain object is detected. I don't know if I'm bad at using google cause I can't seem to find what I want. Hope you guys can give me links regarding this. Thanks in advance :)
go into the visualize_utils.py in the utils folder under the current model directory and start tweaking with it.
if you want to tweak with perse print something if you detect an object whose label is already known, you may want to do the following under
def visualize_boxes_and_labels_on_image_array(.....):
Say if you want to print the current object to python command line modify the following section of above mention method as follows
else:
if not agnostic_mode:
if classes[i] in category_index.keys():
class_name = category_index[classes[i]]['name']
if (class_name == 'person'):
print(class_name + "Detected")
Please correct me / add upon to my answer ! Thanks and Welcome in advance!
The method draw_bounding_box_on_image - Line 131 which draws bounding box for each detected object. You can call another methods to manipulate the detected object etc. inside of draw_bounding_box_on_image method.
https://www.tensorflow.org/tutorials/
here you go
This will help i guess

Getting an 'ambiguous redirect' error

I'm really new to this and I'm not understanding why it's an 'ambiguous redirect'. I have the text file "employee_data". It is specifically saying it on line 29.
Image of script
Do you actually want the literal file name employee_data?
Then write >> employee_data not >> $employee_data
If you mean something else, please clarify.

neo4j and Groovy

I am trying to use a script from https://gist.github.com/jexp/0617412dcdd644fd520b. There is no authors.csv file, so I created my own test file that has 3 columns: author, title and date. Then I tried to run the groovy script and got the following error
Caught: groovy.lang.MissingPropertyException: author
groovy.lang.MissingPropertyException: author
at com.xlson.groovycsv.PropertyMapper.propertyMissing(PropertyMapper.groovy:52)
at test.run(test.groovy:55)
I don't know Java and I am wondering if someone can point what happened here.
[I was running the first script that uses only 1 input file]
Added explanation. My CSV file looks like this
author title date
Auth1 Title1 date1
... ... ...
You will need to add a header line to your CSV:
author,date,title
(Assuming that's the order in your CSV)
I faced the same issue with groovyCSV 7 years later...
The answer comes probably too late for you, but maybe it will help someone else.
In my case I was able to call every other column without any problem, but calling the first one always returned a MissingPropertyException exception.
Problem was that I created my csv file with Excel and this stupid software adds a BOM (byte order mark) at the beginning of the csv files, which prevented groovyCSV from reading correctly the header value of the first column.
Cleaning the csv file with a dos2unix command fixed the problem.

linux - running system command in R and then writing output to a file

I have R code as below. Below code resides in a file called 'iot.R'. I am executing it in Linux.
I want to print content of variable 'fileinformation' to a file mentioned by file=fileConn...
I thought that the 3rd line will solve the issue, but it is not giving the required output :(
fileinformation = system(paste("file", filenames[1]))
#print(fileinformation)
cat(print(fileinformation),"\r\n","\r\n", file=fileConn)
When I run the file, i get below result. It prints to my screen, rather than writing to the file :(
> source('iot.R')
CH7Data_20130401T135010.csv: ASCII text, with CRLF line terminators
[1] 0
--------------------update1
I also tried below command, but didnt get the expected rsult
cat(capture.output(fileinformation),"\r\n","\r\n", file=fileConn)
You need to set the intern argument to TRUE in your call to system. For instance:
fileinformation<-system("file cinzia_2.gif",intern=TRUE)
fileinformation
#[1] "cinzia_2.gif: GIF image data, version 89a, 640 x 640"
Of course I tried a file on my pc. Setting intern to TRUE the return value of system becomes the console output of the command. Then, when you call cat, you don't need to enclose fileinformation into print, but a simple cat(fileinformation,"\r\n","\r\n", file=fileConn) will suffice.
Hi Just a comment as I dont have enough rep to comment in the normal way. but cant you use
write.table
to save the output to a file? It may be easier?

C# How to find two different strings at one search in RichTextbox

I have a lot of Android log in RichTextbox loaded from file.
Lets say i search for "Fatal" word by default search method and i got this:
10-11 19:37:44.647 19525 19789 E AndroidRuntime: FATAL EXCEPTION: IntentService[ContactSaveService]
But, as I know there is possibility that there will be more than 1 exception in dumpstate.
So i thought, it would be nice to compare file name with line of Fatal in this log.
File name: dumpstate_app_201210111708___error
Error log: 10-11 19:37:44.647
It doesnt match.
So i would like to do something like this:
if(rtb.Lines[i].contains(date_of_exception))
{
rtb.Select(startPos, text.Length);
rtb.ScrollToCaret();
rtb.Focus();
}
Of course it doesnt work. I have no idea how to solve it.
I thought about getting number of line with found text and search if this line contains date_of_exception
What I am sure. Time of fatal exception must be the same with time in file name. And that's why i need to check if line in richtextbox contains "fatal" word and time of exception from file name.
I hope it is clear, if not, i will try to describe it better.
Thanks in advance

Resources