Printer OKI trap signification (OID) - snmp

Someone of you know how find the signification of trap for an OKI printer (B512) ?
I check the manual, and I search on google but I found anything.
Thank you !

Here is what I could find to interpret the return of the printer status in SNMP :
okiPrinterOnline = 1,
okiPrinterOffline = 2,
okiNoPrinterAttached = 3,
okiPrinterTonerLow = 4,
okiPrinterPaperOut = 5,
okiPrinterPaperJam = 6,
okiPrinterDoorOpen = 7,
okiPrinterError = 16,

Related

Am getting error trying to predict on a single image CNN pytorch

Error message
Traceback (most recent call last):
File "pred.py", line 134, in
output = model(data)
Runtime Error: Expected 4-dimensional input for 4-dimensional weight [16, 3, 3, 3], but got 3-dimensional input of size [1, 32, 32] instead.
Prediction code
normalize = transforms.Normalize(mean=[0.4914, 0.4824, 0.4467],
std=[0.2471, 0.2435, 0.2616])
train_set = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
normalize,
])
model = models.condensenet(args)
model = nn.DataParallel(model)
PATH = "results/savedir/save_models/checkpoint_001.pth.tar"
model.load_state_dict(torch.load(PATH)['state_dict'])
device = torch.device("cpu")
model.eval()
image = Image.open("horse.jpg")
input = train_set(image)
train_loader = torch.utils.data.DataLoader(
input,
batch_size=1,shuffle=True, num_workers=1)
for i, data in enumerate(train_loader):
#input_var = torch.autograd.Variable(data, volatile=True)
#input_var = input_var.view(1, 3, 32,32)
**output = model(data)
topk=(1,5)
maxk = max(topk)
_, pred = output.topk(maxk, 1, True, True)
Am getting this error when am trying to predict on a single image
Image shape/size error message
Link to saved model
Training code repository
Plz uncomment this line #input_var = input_var.view(1, 3, 32,32) so that your input dimension is 4.
I assume that your no. of input channels are 3 if its one then use input_var = input_var.view(1, 1, 32,32) if gray scale
Instead of doing the for loop and train_loader, solved this by just passing the input directly into the model. like this
input = train_set(image)
input = input.unsqueeze(0)
model.eval()
output = model(input)
More details can be found here link

Problem with combobox, it didn't load de options (pyqt5)

I have a program that when I press a pushbutton it loads the options of my combombox, I have three, but for a unknown reason only two works. This function read a .txt file, and then put the strings in the combobox. I tried with addItem() and addItems(), made function again and it didn't work. The function read another two combobox and then loads the options.This is the function:
def cargar_combobox_flujos2(self,event):
anho = int(self.ui.combobox_anho.itemText(self.ui.combobox_anho.currentIndex()))
mes_input = self.ui.combobox_mes.itemText(self.ui.combobox_mes.currentIndex())
dic = {'Enero': 1, 'Febrero': 2, 'Marzo': 3, 'Abril': 4, 'Junio': 5, 'Julio': 7, 'Agosto': 8, 'Septiembre': 9,
'Octubre': 10, 'Noviembre': 11, 'Diciembre': 12}
mes = int(dic.get(mes_input))
lista_ssee=[]
nombre_txt='Graficos Flujos/lista_cbbx_'+str(anho)+'_'+str(mes)+'.txt'
if os.path.isfile(nombre_txt)==True:
archivo = open(nombre_txt, 'r')
c=archivo.read()
lista=c.split(',')
for i in lista:
lista_ssee.append(i)
archivo.close()
option_barras= self.ui.comboBox_barras_CMg2.count()
if option_barras > 1:
self.ui.comboBox_barras_CMg2.clear()
for barra in lista_ssee:
self.ui.comboBox_barras_CMg2.addItems(barra)

What is the syntax for constructing a list-value in ATS?

For instance, how can I construct a list consisting of all the digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
You can construct it with val xs = ($list {int} (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)).
Make sure you specify the correct memory allocation functions by passing -DATS_MEMALLOC_LIBC to the compiler when using this code.
If you compile to JavaScript via atscc2js, then you need to construct
the list in the following manner:
val ds =
0::1::2::3::4::5::6::7::8::9::nil{int}()
// end of [val]
It also works for targeting C.
There are also combinators for this sort of things. For instance,
val ds = (10).list_map(TYPE{int})(lam(i) => i)
val ds = list_tabulate_cloref<int>(10, lam i => i)
You can find special literal on emacs mode:
https://github.com/githwxi/ATS-Postiats/blob/653af81715cf6bfbd1d2cd5ece1e88c8c3912b4a/utils/emacs/ats2-mode.el#L287
(defvar ats-special-keywords
'("$arrpsz" "$arrptrsize" "$delay" "$ldelay" "$effmask" "$effmask_ntm" "$effmask_exn" "$effmask_ref"
"$effmask_wrt" "$effmask_all" "$extern" "$extkind" "$extype" "$extype_struct" "$extval" "$lst"
"$lst_t" "$lst_vt" "$list" "$list_t" "$list_vt" "$rec" "$rec_t" "$rec_vt"
"$record" "$record_t" "$record_vt" "$tup" "$tup_t" "$tup_vt" "$tuple" "$tuple_t"
"$tuple_vt" "$raise" "$showtype" "$myfilename" "$mylocation" "$myfunction" "#assert" "#define"
"#elif" "#elifdef" "#elifndef" "#else" "#endif" "#error" "#if" "#ifdef"
"#ifndef" "#print" "#then" "#undef" "#include" "#staload" "#dynload" "#require"))
If you find some keyword, you can easily know how to use it on doc/EXAMPLE/ directory:
$ git clone https://github.com/githwxi/ATS-Postiats.git
$ cd ATS-Postiats/doc/EXAMPLE
$ grep -r "\$list" . | head
./MISC/word-chain.dats: $list{word}("", "")
./MISC/word-chain.dats: $list{word}("", "")
./MISC/mysendmailist.dats:$list{string}
./MISC/monad_list.dats: $list{a}("this", "that", "a")
./MISC/monad_list.dats: $list{a}("frog", "elephant", "thing")
./MISC/monad_list.dats: $list{a}("walked", "treaded", "grows")
./MISC/monad_list.dats: $list{a}("slowly", "quickly")
./ATSLF/CoYonedaLemma.dats:val myintlist0 = g0ofg1($list{int0}(I(1), I(0), I(1), I(0), I(0)))
./ATSLF/YonedaLemma.dats: $list{bool}(True, False, True, False, False)
./ATS-QA-LIST/qa-list-2014-12-07.dats:$list{double}(0.111111, 0.222222, 0.333333)
For a list0-value, you can do
val xs = g0ofg1($list{T}(x1, ..., xn))
where T is the type for the elements in xs. For instance,
val some_int_list = g0ofg1($list{int}(0, 9, 8, 7, 3, 4))

Getting max and min from two different sets in json

I haven't found a solution with data set up quite like mine...
var marketshare = [
{"store": "store1", "share": "5.3%", "q1count": 2, "q2count": 4, "q3count": 0},
{"store": "store2","share": "1.9%", "q1count": 5, "q2count": 10, "q3count": 0},
{"store": "store3", "share": "2.5%", "q1count": 3, "q2count": 6, "q3count": 0}
];
Code so far, returning undefined...
var minDataPoint = d3.min( d3.values(marketshare.q1count) ); //Expecting 2 from store 1
var maxDataPoint = d3.max( d3.values(marketshare.q2count) ); //Expecting 10 from store 2
I'm a little overwhelmed by d3.keys, d3.values, d3.maps, converting to array, etc. Any explanations or nudges would be appreciated.
I think you're looking for something like this instead:
d3.min(marketshare, function(d){ return d.q1count; }) // => 2.
You can pass an accessor function as the second argument to d3.min/d3.max.

Modifying gstreamer debug level values

I want to modify the values in the gstreamer GstDebuglevel enumeration (You can find it in gst/gstinfo.h). Will it work if I simply change the enum values in the gstinfo.h or should I have to do any other modification? I want to give lower priority to debug related log dumps. How can I achieve the following.
I want something like this:
typedef enum {
GST_LEVEL_NONE = 0,
GST_LEVEL_ERROR = 1,
GST_LEVEL_WARNING = 2,
GST_LEVEL_FIXME = 3,
GST_LEVEL_INFO = 4,
GST_LEVEL_LOG = 6,
GST_LEVEL_TRACE = 7,
/* add more */
GST_LEVEL_MEMDUMP = 9,
/* add more */
GST_LEVEL_DEBUG = 10,
GST_LEVEL_COUNT
}GstDebugLevel;
Thanks in advance.
Changing the enum value and rebuilding gstreamer is enough.
I tested it with this enum:
typedef enum {
GST_LEVEL_NONE = 0,
GST_LEVEL_ERROR,
GST_LEVEL_WARNING,
GST_LEVEL_INFO,
GST_LEVEL_DEBUG=10,
GST_LEVEL_LOG=5,
GST_LEVEL_FIXME = 6,
GST_LEVEL_TRACE = 7,
/* add more */
GST_LEVEL_MEMDUMP = 9,
/* add more */
GST_LEVEL_COUNT
} GstDebugLevel;
And it did not output DEBUG level traces on the same GST_DEBUG value.

Resources