AutoCAD script not reproducible - scripting

I wrote an AutoCAD script that is supposed to draw me two independent, spatially separated 3D polylines. After executing the script, however, I get connecions between the polylines. The funny thing is that two consecutive runs of the script may produce different connections.
AutoCAD scripts are very picky about blanks as they are sometimes interpreted as command termination indicators. There are no blanks at the end of the lines in the script below. There is, however a blank line at the end of the file.
3dpoly 396.958912852,30.8766759787,27.6970084442
392.314112161,78.0361288065,27.6970084442
383.307717991,107.726231443,27.6970084442
369.551813005,153.073372946,27.6970084442
354.926222488,180.435928247,27.6970084442
332.587844921,222.228093208,27.6970084442
312.905111301,246.211573517,27.6970084442
282.842712475,282.842712475,27.6970084442
258.859232165,302.525446095,27.6970084442
222.228093208,332.587844921,27.6970084442
194.865537907,347.213435437,27.6970084442
153.073372946,369.551813005,27.6970084442
123.383270309,378.558207175,27.6970084442
78.0361288065,392.314112161,27.6970084442
47.1594528278,395.355199309,27.6970084442
0.0,400.0,27.6970084442
-47.1594528278,395.355199309,27.6970084442
-78.0361288065,392.314112161,27.6970084442
-123.383270309,378.558207175,27.6970084442
-153.073372946,369.551813005,27.6970084442
-194.865537907,347.213435437,27.6970084442
-222.228093208,332.587844921,27.6970084442
-258.859232165,302.525446095,27.6970084442
-282.842712475,282.842712475,27.6970084442
-312.905111301,246.211573517,27.6970084442
-332.587844921,222.228093208,27.6970084442
-354.926222488,180.435928247,27.6970084442
-369.551813005,153.073372946,27.6970084442
-383.307717991,107.726231443,27.6970084442
-392.314112161,78.0361288065,27.6970084442
-396.958912852,30.8766759787,27.6970084442
-400.0,0.0,27.6970084442
-396.958912852,-30.8766759787,27.6970084442
-392.314112161,-78.0361288065,27.6970084442
-383.307717991,-107.726231443,27.6970084442
-369.551813005,-153.073372946,27.6970084442
-354.926222488,-180.435928247,27.6970084442
-332.587844921,-222.228093208,27.6970084442
-312.905111301,-246.211573517,27.6970084442
-282.842712475,-282.842712475,27.6970084442
-258.859232165,-302.525446095,27.6970084442
-222.228093208,-332.587844921,27.6970084442
-194.865537907,-347.213435437,27.6970084442
-153.073372946,-369.551813005,27.6970084442
-123.383270309,-378.558207175,27.6970084442
-78.0361288065,-392.314112161,27.6970084442
-47.1594528278,-395.355199309,27.6970084442
0.0,-400.0,27.6970084442
47.1594528278,-395.355199309,27.6970084442
78.0361288065,-392.314112161,27.6970084442
123.383270309,-378.558207175,27.6970084442
153.073372946,-369.551813005,27.6970084442
194.865537907,-347.213435437,27.6970084442
222.228093208,-332.587844921,27.6970084442
258.859232165,-302.525446095,27.6970084442
282.842712475,-282.842712475,27.6970084442
312.905111301,-246.211573517,27.6970084442
332.587844921,-222.228093208,27.6970084442
354.926222488,-180.435928247,27.6970084442
369.551813005,-153.073372946,27.6970084442
383.307717991,-107.726231443,27.6970084442
392.314112161,-78.0361288065,27.6970084442
396.958912852,-30.8766759787,27.6970084442
400.0,0.0,27.6970084442
396.958912852,30.8766759787,27.6970084442
3dpoly 392.314112161,78.0361288065,-27.6970084442
396.958912852,30.8766759787,-27.6970084442
400.0,0.0,-27.6970084442
396.958912852,-30.8766759787,-27.6970084442
392.314112161,-78.0361288065,-27.6970084442
383.307717991,-107.726231443,-27.6970084442
369.551813005,-153.073372946,-27.6970084442
354.926222488,-180.435928247,-27.6970084442
332.587844921,-222.228093208,-27.6970084442
312.905111301,-246.211573517,-27.6970084442
282.842712475,-282.842712475,-27.6970084442
258.859232165,-302.525446095,-27.6970084442
222.228093208,-332.587844921,-27.6970084442
194.865537907,-347.213435437,-27.6970084442
153.073372946,-369.551813005,-27.6970084442
123.383270309,-378.558207175,-27.6970084442
78.0361288065,-392.314112161,-27.6970084442
47.1594528278,-395.355199309,-27.6970084442
0.0,-400.0,-27.6970084442
-47.1594528278,-395.355199309,-27.6970084442
-78.0361288065,-392.314112161,-27.6970084442
-123.383270309,-378.558207175,-27.6970084442
-153.073372946,-369.551813005,-27.6970084442
-194.865537907,-347.213435437,-27.6970084442
-222.228093208,-332.587844921,-27.6970084442
-258.859232165,-302.525446095,-27.6970084442
-282.842712475,-282.842712475,-27.6970084442
-312.905111301,-246.211573517,-27.6970084442
-332.587844921,-222.228093208,-27.6970084442
-354.926222488,-180.435928247,-27.6970084442
-369.551813005,-153.073372946,-27.6970084442
-383.307717991,-107.726231443,-27.6970084442
-392.314112161,-78.0361288065,-27.6970084442
-396.958912852,-30.8766759787,-27.6970084442
-400.0,0.0,-27.6970084442
-396.958912852,30.8766759787,-27.6970084442
-392.314112161,78.0361288065,-27.6970084442
-383.307717991,107.726231443,-27.6970084442
-369.551813005,153.073372946,-27.6970084442
-354.926222488,180.435928247,-27.6970084442
-332.587844921,222.228093208,-27.6970084442
-312.905111301,246.211573517,-27.6970084442
-282.842712475,282.842712475,-27.6970084442
-258.859232165,302.525446095,-27.6970084442
-222.228093208,332.587844921,-27.6970084442
-194.865537907,347.213435437,-27.6970084442
-153.073372946,369.551813005,-27.6970084442
-123.383270309,378.558207175,-27.6970084442
-78.0361288065,392.314112161,-27.6970084442
-47.1594528278,395.355199309,-27.6970084442
0.0,400.0,-27.6970084442
47.1594528278,395.355199309,-27.6970084442
78.0361288065,392.314112161,-27.6970084442
123.383270309,378.558207175,-27.6970084442
153.073372946,369.551813005,-27.6970084442
194.865537907,347.213435437,-27.6970084442
222.228093208,332.587844921,-27.6970084442
258.859232165,302.525446095,-27.6970084442
282.842712475,282.842712475,-27.6970084442
312.905111301,246.211573517,-27.6970084442
332.587844921,222.228093208,-27.6970084442
354.926222488,180.435928247,-27.6970084442
369.551813005,153.073372946,-27.6970084442
383.307717991,107.726231443,-27.6970084442
392.314112161,78.0361288065,-27.6970084442

After some research I found out that if the object snap feature is on, AutoCAD apparently snaps during script execution. If the feature is turned off, everything's fine.

Related

GNURadio Companion and OFDM TX and RX in single Graph

I am following this github example for understanding OFDM on gnuradio-companion, I am able to execute ofdm_tx individually (64 and 512 FFT point) without any issues, but when I connect these two in single graph, I am able to get spectrum from ofdm_tx (no output from ofdm_rx or getting straight line).
My question here, each time I close my output spectrum, my tool get hanged and in background (inside gnu-companion) I observe the following message tarin (attached, printscreen). Similar thing also observed when I run ofdm_rx individually.
Error message in Console :
packet_headerparser_b :info: Detected an invalid packet at item 1448.
header_payload_demux :info :parser returned #f
Please guide me in this regard,
by selecting "NO" for vector source "Repeat" variable , issue sorted out (no hang), but not able to see spectrum anymore.

Why old nodes are visible even after deleting event files [Tensorflow]?

I have just started learning tensorflow, and wrote the following piece of code in Jupyter-Notebook :
a = tf.placeholder(tf.float32,shape=[3,3],name='X')
b = tf.constant([[5,5,5],[2,3,4],[4,5,6]],tf.float32,name='Y')
c = tf.matmul(a,b)
with tf.Session() as sess:
writer = tf.summary.FileWriter('./graphs',sess.graph)
print (sess.run(c,feed_dict={a:[[2,3,4],[4,5,6],[6,7,8]]}))
writer.close()
Running the tensorboard first time, gives a single X,Y and mult node as follows :
However, when I again compile my code (ctrl+enter), the tensorboard now makes a duplicate of the original graph.
I tried to resolve this( remove the older,dead nodes) by:
1. Deleting the event files.
2. Deleting the whole directory containing multiple event files of the same code.
3. Running fuser 6006/tcp -k before the tensorboard command line call.
But even after that, when I ran tensorboard, it would show the duplicate copies.
The only solution that worked was to reset the graph using tf.reset_default_graph() at the beginning of the code or to shut the notebook down and restart it.
My question is :
1. Why is it that even after deleting the event files, the older dead nodes keep showing up on the tensorboard ?. And yes I even restarted Tensorboard after each try, but duplicates were still there.
2. What are the ways if any, besides the two I listed above, to get rid of the dead nodes ?
The nodes you described are not dead. They are still exist and can be used.
When you run your code the first time, the nodes where created and added to the graph. When you execute the same cell for the second time, they are added one more time with the different names.
The same can be achieved if you will just copy twice the code in your .py file.
Your solution with tf.reset_default_graph() is the right one. Restarting the notebook works because all the information from the memory was removed. The same as rerunning .py file.
Your stuff with removing the even files does not work because nonetheless the files are removed, the nodes added to the graph in the memory are still there.
I was also having the same problem of tensorboard displaying duplicate graphs. I tried several measures like deleting the event files , deleting the log directory which contained the event files, but tensorboard would still remember the nodes and the graph from the previous run and show them as duplicate copies, one after another.
I noticed each time I ran the code tensorflow would create the same nodes but with different names, which means it was still keeping the old nodes in its memory. Looked something like this in the python execution window:
After first run:
After running the code 2nd and 3rd time:
This solved the problem
1) Restarting the kernel before each run solved the problem
2) As mentioned in above posts, adding tf.reset_default_graph() in the beginning of the code also solved the problem.

Generating parallel port triggers upon detection of a vocal response

I've created an experiment in psychopy builder in which participants must vocally name pictures presented onscreen (for example, if a picture of a chair appears, the participant has to respond by saying "chair"). I've set up a code component to detect each vocal response, which ends the trial and initiates the next one. This part of the experiment works well, however I'm having trouble integrating EEG recording.
Some important information:
My trial loop reads images and triggerVal's out of a .csv file. I have an image component (called english_naming) that displays images for participants to name out-loud. The component's STOP field is defined as $vpvk.event_onset - this forces the trial to end and the next one to begin upon detection of a vocal response.
So, here is my (working) code component at present:
Begin Experiment:
from psychopy import parallel
port = parallel.port(address=61432)
Begin Routine
vpvk = vk.onsetVoiceKey(
sec=10) # creates the voice key
vpvk.start() #starts recording.
port.setData(triggerVal) # tells psychopy to read trigger values from the .csv file
End Routine
vpvk.stop() # ends the recording
port.setData(0) # resets the trigger value to 0 for the start of the next trial
My problem is this
At present, parallel port events are time-locked to the start of each trial, but I need them to be time-locked to participant's vocal responses. I tried inserting if vpvk.event_onset(): above port.setData(triggerVal), but this fails to generate any trigger codes at all. I've also tried if english_naming==FINISHED but the same problem occurred. I've tried a bunch of variants on these two lines of code, but nothing I can think of seems to work.
I would really really appreciate any advice on this problem. Thanks in advance!

R2WinBugs data entry incompatible copy error for Conditional Binomial likelihood, probit link, Random Effects (Psoriasis example)

I was working on the the guide for calculating the effect size of different treatments using a NETWORK META-ANALYSIS as done in example 6.a.
Here
It works fine in winBugs, but I want to do the analysis in R using R2winugs so that I can automate the data input.
It reads the model just fine according to the log, but it gets hung up when reading the data.
E.G.
display(log)
check(C:/Users/Temp User/.../Plaque_Psoriasis_Project/RE_Psoriasis.bug.txt)
model is syntactically correct
data(C:/Users/Temp User/.../Plaque_Psoriasis_Project/data.txt)
This is where the program just hangs.
The trap screen reads
incompatible copy
BugsCmds.TextError [000003A1H]
.beg INTEGER 1699018032
.end INTEGER 34825508
.......
I've tried reading the data as:
data <- list(t=t,C=C,r=r,n=n,na=na,nc=nc, ns=ns, nt=nt, Cmax=Cmax, meanA=meanA, precA=precA)
and as
data <- list("t","C","r","n","na","nc", "ns", "nt", "Cmax", "meanA", "precA")
Neither works.
I got R2winbugs to do the toy school example in the documentation so it can work.
Any thoughts?

cocoa-applescript: running handler or command every few seconds

In normal applescript, the script is executed down the page, and so any code in loops for every 5 seconds will only run while the loop is running - there is no way to have a single function run every few second regardless of what the script is currently doing or where it is in the script (that I know of). In cocoa-applescript, however, is there a way to run a handler every 5 seconds, at all times, no matter what it is currently doing? Here is what it should be doing in my cocoa-applescript app:
on checkInternetStrength()
do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep 'agrCtlRSSI:'" -- this being the script which returns the line containing the signal strength
set SignalStrength to result
set RSSIcount to (count of characters in SignalStrength)
set SignalStrength to ((characters 18 thru RSSIcount of SignalStrength) as string) as integer -- this to turn SignalStrength into just the number and not the whole output line
set SignalStrength to (100 + SignalStrength) as integer
set SignalBar's setIntValue_(SignalStrength) -- SignalBar being the Level Indicator described below
end checkInternetStrength
Summed up, it runs the airport command to check internet connection, turns this into a number from 1 to 100 and uses this on an NSLevelIndicator (100 maximum) to show current signal strength graphically. Now, there is no point having this run once or when you hit a button - that is an option, but it would be nice if it updated itself every, say, 5 seconds with the realtime value. So is there any way to have a process which runs every 5 seconds to do this, while still enabling full functionality of the rest of the script and interface - i.e. as a background process? Comment if you need more extracts from the script.
Example
In Unity-C# scripting, the 'void Update() {code}' will run the code within it every frame while doing everything else simultaneously, so a cocoa-applescript version of this might be an answer, if anyone knows.
I Dont believe this is possible but what I had a similar problem before, what i do, I have an external applescript applicaion that is hidden the repeats the commands, the only problem is, it wont send it back to the app, you'll have to make the external applescript app do it, like
display notification, etc..., in the applescript apps "Info.plist" you can add this:
<key>LSUIElement</key>
<string>1</string>
To make the app run invisibly, but sorry i dont think you can run a handler in the app its self