output

suppress scapy warning message when importing the module

拜拜、爱过 提交于 2019-12-05 13:33:56
问题 I'm writing a small script, that gathers some information using scapy and then returns some xml code, that I'll pass on to the xmlrpc interface of metasploit. I'd like it that my script only returns xml, and no additional warnings etc. I can suppress most scapy output, with adding the option verbose=0 to my sr1 command. What I still get before every output, and I assume it returns this warning when I'm loading the module, is: WARNING: No route found for IPv6 destination :: (no default route?)

C scanf() issues?

六眼飞鱼酱① 提交于 2019-12-05 13:29:34
In this simple guess-the-number game, scanf() is not working the second time in main. I would really appreciate if someone could explain why doesn't work and how to fix it. Any tips on how to clean this code up?. Thank you! #include<stdio.h> #include<stdlib.h> #include<time.h> int guessed = 0; int guesses = 0; int total_guesses = 0; int range_top = 1; int generate_random_number() { srand(time(NULL)); return (rand() % range_top); } void take_guess(int num) { int guess; printf("what is your guess: "); scanf("%i",&guess); if(guess == num) { guessed = 1; } else if(guess>num) { printf("Your guess

How to prevent inputs being flushed into output?

[亡魂溺海] 提交于 2019-12-05 13:28:55
I'm on Ubuntu. When I run ghci on Terminal and do this: Prelude Control.Monad System.IO> forever $ getChar >>= print The result is something like this: a'a' b'b' C'C' %'%' \'\\' 1'1' ''\'' "'"' ^X'\CAN' ^?'\DEL' ^CInterrupted. That is, the characters I type in my keyboard are being flushed into output. How can I prevent this and have only print as the writer? To prevent input being flushed into the output (or "echoed"), use hSetEcho stdin False . Prelude> import System.IO Prelude System.IO> import Control.Monad Prelude System.IO Control.Monad> hSetEcho stdin False Prelude System.IO Control

How to show hidden layer outputs in Tensorflow

一世执手 提交于 2019-12-05 09:39:54
I'm having differences of the outputs when comparing a model with its stored protobuf version (via this conversion script ). For debugging I'm comparing both layers respectively. For the weights and the actual layer output during a test sequence I receive the identical outputs, thus I'm not sure how to access the hidden layers. Here is how I load the layers input = graph.get_tensor_by_name("lstm_1_input_1:0") layer1 = graph.get_tensor_by_name("lstm_1_1/kernel:0") layer2 = graph.get_tensor_by_name("lstm_1_1/recurrent_kernel:0") layer3 = graph.get_tensor_by_name("time_distributed_1_1/kernel:0")

Suppress output of stationarity test that is printed to screen

守給你的承諾、 提交于 2019-12-05 09:32:43
How do I get the stationarity test from the fractal package in R to not print any output to the screen. For example, with the shapiro.wilk test when setting the result as a variable it does not give any output as follows lg.day.ret.vec <- rnorm(100, mean = 5, sd = 3) shap.p <- shapiro.test(lg.day.ret.vec)$p.value This is the case for most tests but when I do it for the stationarity test I get some output in the r console. library(fractal) stat.p <- attr(stationarity(lg.day.ret.vec),"pvals")[1] 1 2 3 4 5 6 N = 2609, nblock = 11, n_block_max = 238, dt = 1.0000 7 8 9 10 11 12 13 14 15 16 17 18 In

System.out.println where does it write to in Intellij Idea?

故事扮演 提交于 2019-12-05 08:10:27
I can't find the terminal where the message is supposed to show. How is it called? I'm guessing it should be in View->Tool Windows but nothing from there seems to work. It's a Maven project and all I can see is GlassFish log. System.out and System.err output is written to either the Run or the Debug tool window depending on whether you launch the run/debug configuration as Run or Debug. See https://www.jetbrains.com/idea/help/running-and-debugging.html and https://www.jetbrains.com/idea/help/run-tool-window.html for more information (Same information is in the Help guide of the IntelliJ IDEA

How do I putStrLn a Data.ByteString.Internal.ByteString?

做~自己de王妃 提交于 2019-12-05 06:15:18
I'm learning haskell and decided to try writing some small test programs to get use to Haskell code and using modules. Currently I'm trying to use the first argument to create a password hash using the Cypto.PasswordStore. To test out my program I'm trying to create a hash from the first argument and then print the hash to screen. import Crypto.PasswordStore import System.Environment main = do args <- getArgs putStrLn (makePassword (head args) 12) I'm getting the following error: testmakePassword.hs:8:19: Couldn't match expected type `String' with actual type `IO Data.ByteString.Internal

Is there a “null” printf code that doesn't print anything, used to skip a parameter?

微笑、不失礼 提交于 2019-12-05 05:44:14
If I want a program to have multiple text output formats, I could do something like this: const char *fmtDefault = "%u x %s ($%.2f each)\n"; const char *fmtMultiLine = "Qty: %3u\nItem: %s\nPrice per item: $%.2f\n\n"; const char *fmtCSV = "%u,%s,%.2f\n"; const char *fmt; switch (which_format) { case 1: fmt = fmtMultiLine; break; case 2: fmt = fmtCSV; break; default: fmt = fmtDefault; } printf(fmt, quantity, item_description, price); Since the price is specified last, I could also add one that doesn't list prices: const char *fmtNoPrices = "%u x %s\n"; But what if I want to omit the quantity

keeping a java socket open?

﹥>﹥吖頭↗ 提交于 2019-12-05 04:37:49
问题 i'm making a program/game that will update automatically. i have the update part down, but not the checking of the version. i would have thought that it'd be pretty easy. heres what i've done. i wrote an updater for the game, and i wrote a server. the server starts a thread every time a client/updater connects. the thread handles everything. the game updater reads a file called version.txt and that provides the version number (default 0.0.1) and sends it to the server. the server does recieve

Multiple output path (Java - Hadoop - MapReduce)

廉价感情. 提交于 2019-12-05 02:38:39
问题 I do two MapReduce job, and I want for the second job to be able to write my result into two different files, in two different directories. I would like something similar to FileInputFormat.addInputPath(.., multiple input path) in a sense, but for the output. I'm completely new to MapReduce, and I have a specificity to write my code in Hadoop 0.21.0 I use context.write(..) in my Reduce step, but I don't see how to control multiple output paths... Thanks for your time ! My reduceCode from my