I'm using Virtual Box running Windows 7 on one iMac 10.11.6
and I'm trying to open "RUN" with Command + R but every time I passed Command + R to the keyboard the VM turned off and on, that was fixed when I went to INPUT > Keyboard Settings >
and deleted the command that I was shutting down the computer every time I typed Command + R. Now it doesn't do anything but I want to know can I open RUN by doing Command + R
, CTRL + Z or C
it works fine. Any kind of help will be appreciated.
Katz's questions
Hello I am trying to create a new log file but it is not working for me. \t arch.txt
It gives me the error Outfile disabled. Does anyone know about this error I can't find information about this error.
Hello, I'm trying to make a temporary row in mysql but I can't do it, if I can do it how to create a column but I don't know how to make a row. Can somebody help me?
This is the original column
_________________ ______________
| Salario | | AVERAGE |
_________________ |____________ |
| 200.000 | |85585.714286 |
| ________________| |______________|
^------- This is the original result
what i tried
This is the desired result --------------------------^
What I tried was:select "Average Salary", avg(salary) from EMP_DATA;
and create this
+----------------+--------------+
| Average Salary | avg(salary) |
+----------------+--------------+
| Average Salary | 85585.714286 |
+----------------+--------------+
I was able to do the column but that's not what I want to do. I want the value of avg(salary)
this below Average Salary like so:
+----------------+
| Average Salary |
+----------------+
| 85585.714286 |
+----------------+
My program tries to look for web page links And when the page is valid the application writes [+] Found [+] and if the link is not valid it writes [+] Error [+] but each link does not have the same length. Here is an example of how the app looks when I run it foobar.com/test [+] Found [+]
foobar.com/test21 [+] Error [+]
foobar.com/test333 [+] Error [+]
As you can see the position of the message moves because the link is longer. I want the message from Found
o Error
to appear in the same vertical row like this:
foobar.com/test [+] Found [+]
foobar.com/test21 [+] Error [+]
foobar.com/test333 [+] Error [+]
But not so close to the link because there may be an error that would be if a link is longer than the length between the link and the message Error
or Found
Here is my code
for i in array:
try:
adminpanel = urllib2.urlopen(website+i)
checkurl = adminpanel.code
if checkurl == 200:
print Fore.GREEN+ website+i," "" " +"[+] Found [+] "
continue
except urllib2.URLError, checkurl:
if checkurl == 404:
print website+i," "" Not Found :/"
else:
print Fore.RED+ website+i," "" " +"[+] Error [+] " + Style.RESET_ALL
I want to read an array from a file, and add each word in the array to the user input. Imagine that the user input is wwww.google.com/
the application adds each word in the array behind the link until the list is finished.
google.com/
google.com/test.html
google.com/test1.html
I can do this if I make an array in the program and it works fine but when I want to read from a file, instead of reading the whole word it only reads letter by letter.
google.com/
google.com/t
google.com/e
google.com/s
google.com/t
and continue like this. How can I make it read the whole word when it reads the file instead of letter by letter.
Here is my code if you need it to reference an example of the array:
['test/','test1/','test2/']
website = raw_input(Fore.MAGENTA +"> SITIO PARA SCANEAR: ")
if "http://" not in website:
website ="http://"+ website
with open("test.txt", "r") as ins:
array=[]
for line in ins:
print line
for i in line:
try:
adminpanel = urllib2.urlopen(website+i)
checkurl = adminpanel.code
if checkurl == 200:
print Fore.GREEN+ website+i," "" [+] Encontrado [+]"
continue
else:
print Fore.RED+ website+i," "" [-]Error[-]"
What would be the best way to return specific letters but at the same time those random letters, for example from the distance a to f [a,b,c,d,e,f]. I know how to do it with the whole alphabet using the random
and function string.ascii_letters
, but I don't understand how to make it specific.
def gen():
return random.choice(string.ascii_letters + string.digits)
# prints the first digits until %s, and starts printing random generation.
def printme():
combo1 = '999999991468%s111%s1%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s' % (
gen().upper(), gen().upper(), gen().upper(),
gen().upper(), gen().upper(), gen().upper(),
gen().upper(), gen().upper(), gen().upper(),
gen().upper(), gen().upper(), gen().upper(),
gen().upper(), gen().upper(), gen().upper(),
gen().upper(), gen().upper()
)
I made my application with python but I want to convert it to .exe, I can achieve the conversion from .py to exe but not with the image. The image works fine if I run the application in its original format which is .py but when I convert it to .exe it doesn't work. If you have used pyinstaller, can you give me any recommendations, thanks? I am using pyinstaller 3.2 with python 3.4.1 installeddo.
photo = PhotoImage(file="pirate.png")
label = Label(window, image=photo)
label.pack()
The error message.
File "lukcid3.py", line 49, in <module>
File "tkinter\__init__.py", line 3384, in __init__
File "tkinter\__init__.py", line 3340, in __init__
_tkinter.TclError: couldn't open "image.png": no such file or directory
.spec
a = Analysis(['C:\\Users\\Francesc\\Desktop\\PyInstaller-3.2'],
pathex=['C:\\Users\\Francesc\\Desktop\\PyInstaller-3.2\\lukcid3'],
binaries=None,
datas=None,
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='PyInstaller-3',
debug=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='PyInstaller-3')
How can I animate one StackView
so that it slides up starting from x=0
to y=500
? I have the following method viewDidLoad()
that does an effect that grows the StackView
:
StackView.transform = CGAffineTransformMakeScale(0.0, 0.0)
and then I added a growing effect in the method viewDidAppear()
:
UIView.animateWithDuration(0.4, delay: 0.0, options: [], animations: {
self.StackView.transform = CGAffineTransformIdentity
}, completion: nil)
Then the method executes the viewDidLoad
and the StackView
is reduced to the minimum size. When the method of viewDidLoad
completes, the method viewDidAppear
is invoked, and the animation begins and the method StackView
begins to grow. The animation stops when the StackView
reaches its original size.
Although it's a nice effect, it's not what I want to achieve. I want the animation to slide from x= 0
and stop at y=500
. I tried to add the following code in viewDidLoad
it to achieve it, but I still get the same growing effect:
StackView.transform = CGAffineTransformMakeTranslation(0, 500)
Any suggestions on how to achieve this?
In the coding the below checks if the condition is true
, shows a check mark in cell
it, if not, shows nothing. How can I make it so that the user can deselect the cell
by clicking on the device?
// Boolean Array
var esVisitado = [Bool] (count: 21, repeatedValues: false)
if Visitado[indexPath.row] {
cell.accessoryType = .Checkmark
} else {
cell.accessoryType = .None
}
return cell
let esVisitadoAction = UIAlertAction(title: "Que quieres decir?", style: .Default, handler: { (action:UIAlertAction!) -> Void in
let cell = tableView.cellForRowAtIndexPath(indexPath)
cell?.accessoryType = .Checkmark
self.Visitado[indexPath.row] = true
})
optionMenu.addAction(esVisitadoAction)
tableView.deselectRowAtIndexPath(indexPath, animated: false)
In the code below, initialize the images in an array with a list of names. I want the order of the images to be aligned with the order of the array of names. This is what I tried and got an error saying:
Thread 1: EXC_BAD_INSTRUCTION ( code=EXC_I386_INVOP, subcode = 0x0)
The console says: fatal error: Array index out of range (lldb) Code
class NonameTableViewController: UITableViewController {
var Names = [" Ferro", "Korean", "HUH?","CatCafe", "UINITY", "FAKESTORE" ,"IRANOUTOFNAMES", "OKAY", "KEEP CODING"]
var Images = ["cafedeadend.jpg", "homei.jpg", "teakha.jpg", "cafelois1.jpg"," petiteoyster.jpg", "forkeerestaurant.jpg"]
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cellIndentifier = "Cell"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIndentifier, forIndexPath: indexPath)
//configure cell
cell.textLabel?.text = Names[indexPath.row]
cell.imageView?.image = UIImage(named: Images[indexPath.row])
return cell
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return Names.count
}
I have a very simple application. Which draws lines when you touch the screen with two fingers, when they lift their fingers I want to erase the drawing, and when they draw again show new lines.
However, when I delete the lines the first time, the next press causes an error with no error message. I figure I'm doing something small wrong, but I can't figure it out. Here is my code:
var prevX: CGFloat!
var prevY: CGFloat!
var startX: CGFloat = 150
var startY : CGFloat = 450
var reset: Bool = true
override func viewDidLoad() {
super.viewDidLoad()
var pan = UIPanGestureRecognizer(target: self, action: "pan:")
pan.cancelsTouchesInView = false
pan.delegate = self
self.view.addGestureRecognizer(pan)
}
func pan(recognizer:UIPanGestureRecognizer) {
print(self.view.layer)
var state = recognizer.state
if (state == UIGestureRecognizerState.Ended) {
reset = true
var sublayers = self.view.layer.sublayers
for layer in sublayers {
layer.removeFromSuperlayer()
}
} else {
var interval = recognizer.translationInView(self.view)
if (reset) {
reset = false
prevX = CGFloat(startX + interval.x)
prevY = CGFloat(startY + interval.y)
}
var newPointX = startX + interval.x
var newPointY = startY + interval.y
var path = UIBezierPath().bezierPathByReversingPath()
path.moveToPoint(CGPoint(x: prevX, y: prevY))
path.addLineToPoint(CGPoint(x:newPointX, y:newPointY))
var shapeLayer = CAShapeLayer()
shapeLayer.path = path.CGPath
shapeLayer.strokeColor = UIColor.blueColor().CGColor
shapeLayer.lineWidth = 1.0
shapeLayer.fillColor = UIColor.clearColor().CGColor
self.view.layer.addSublayer(shapeLayer)
prevX = newPointX
prevY = newPointY
}
}
A little more information about the error
Thread 1: EXC_BAD_ACCESS code=1, address=0x499e....
___UIApplicationExtensionGetAccurateShareServicesExtensionForIdentifier_block_invoke_2
0x18c00e3c0: adrp x8, 54568
0x18c00e3c4: ldr x8, [x8, #2248]
0x18c00e3c8: ldr x8, [x8]
0x18c00e3cc: ldr x9, [sp, #56]
0x18c00e3d0: sub x8, x8, x9
0x18c00e3d4: cbnz x8, 0x18c00e3fc ; UIApplicationMain + 1548
0x18c00e3d8: movz w0, #0
I think it is this line that is causing the error.
for layer in sublayers {
layer.removeFromSuperlayer()
}
because if I remove it the program works without any problem ( but it doesn't delete the lines )