I have an array...n i want to display it as a popup window ...the array elements...as buttons that are clickable...
so can i pass an array to the window as argument..i know we can pass parameter values..but array?and is so how can the individual array elements be accessed inside the window?
passing a wild card array to cp, I know it can be done but cant figure it out, ive got 3 files all start with the word somefile but have 3 different extensions
somefile.conf somefile.dat somefile.py
there in a folder with a bunch of other files and I just want to copy them to a different location. I remember is being something like cp somefile.[py conf dat] /somewhere but this isn't working Ive searched the net and can't find it with the keywords i'm using.
I'm writing a PHP program. I've encountered a problem; in the following code I try to pass $_POST['delete'] which is an array as the value of a hidden input to some form, but it doesn't do so.there's something wrong with converting PHP array into HTML array. I'm sure that $_POST['delete'] is not null and is a real array.
I'm using ssh key based authentication and I was pleased to find that when I set it up out of the box when I connected to my ssh server it prompted me with a password window rather than typing into the terminal and it remembered the pass phrase from one connection to the next.
For some reason it's stopped showing me the window, instead I'm logging in through the terminal, and it's stopped remembering my pass phrase between connections. since I don't know what the program was called that gave me the login box it's rather hard to search for.
(I am using vector() and matrix() functions from "Numerical recipes in C".)There are 100 numbers to be stored in 2D array of 10 rows and 10 columns.100 numbers are stored in a 1D array.I get "segmentation fault" at the line indicated in the segment of my code below:
I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.
#!/bin/bash addelementtoarray() { local arrayname=$1
I installed today debian wheezy from OpenSUSE system via bootstrap. I have some strange behaviour with kde. At first kde worked fine and the only problem was that if I tried to logout from kde session, instead of kdm shows up, a black screen appear with mouse cursor working. I first ignore this error(because I had some problems with audio) and just reboot from vt console or sometimes restart kdm service. After I solved the audio problem I've searched to find some solution about kdm black screen problem. I found on kde forums a solution about terminate xserver option on kdmrc file, which didn't work in my case, but create another problem.
The problem is that now when I pass the mouse cursor from windows topbars I have glitches on window decorations. So I disable the above option again, reboot but the graphics problems was still there. I tried to uncheck vsync from desktom effects and the resault was all desktop effects to be disabled. Now I cannot re-enable desktop effects any more. But now I can logout and relogin. 3D works fine(glxgears works) but I cannot enable desktop effects. And I think that some effects work, because I see some smooth movements and fade outs when I pass the mouse cursor on kmenu items. My card is ATI radeon HD 4650, and I have the xorg-video-ati driver installed.
I have a strange problem with a simple program. I have a container class that holds a pointer. I did this so I could use another container class that does several pass by value calls. I didn't want to be copying the object over and over again, so decided to build this simple container that simply copied the pointer in the copy constructor.
However, the pass by value call seems to be failing in a strange way. When the pass-by-value function is called, the program jumps into the copy constructor just fine and performs the pointer assignment operation. The program will copy the pointer value 0x20 (for argument sake) to the "this->base" location. Within the copy constructor, this has the address 0x28. Then when it jumps into the function, instead of pass by value argument being at 0x28 (as expected), it is at 0x36. Then 0x36->base has the address 0x28. Thus the base is now pointing at what was the new pointer container. At this point the data is corrupted and random things happen.
It seems that there is some strange assignment and double nesting going on. I really do not understand what is going on.
Below is some code. I have stripped away all the other code trying to isolate the problem. I have added comments explaining what my debugger is telling me.
Code: using namespace std; class paramPnt // Need to determine how order is tracked { private: long order;
I hace some code C/C++ STL, which i need to use for android, using SDK-NDK-JNI.my problem is that i need to pass some STL structures across JNI, I can't pack/unpack data into basic types or arrays of basic types, doing my own simple streaming between the two layers.My application need to pass a pointer to a STL structure which is updated by eachuser interaction wonder if it is possible using NDK-JNI ?Other option is "native activity" but it also needs JNI in some way ... and passing the STL structures wille a requirement, yet.I only can package data into an own streaming if there is a second (concurrent) application running (implementing the STLfunctionality). Is it possible ?
I need to pass variable from sc1.sh to sc2.sh and update the value of the passed variable in sc2.sh and then return the updated value of the variable from sc2.sh to sc1.sh.
I'm trying to pass a path as a string to an array, but its evaluating it as a command instead. I want to take the literal string "/mnt/accounts/user/temp/*.jpg" and assign it to an array{1}, but when i echo the array variable, it displays it as
pic1.jpg pic2.jpg pic3.jpg
[code]....
I just want it to be the actual text "/mnt/accounts/user/temp/*.jpg" which i will be combining with other text to create a longer path elsewhere in the code.
I need to pass a large number of arguments to a function which takes variable number of arguments, such as gtk_list_store_new. But it doesn't look nice if i write something like gtk_list_store_new(NUM,TYPE_A,TYPE_B,TYPE_C,...,TYPE_OMEGA); because of large number of arguments. And, it will be a trouble to change number of columns because of need to manually change arguments to large number of such functions. So, how can i pass all the arguments to a function using a loop? Something like
My hosting server does not allow exec() or system() calls, for security reasons. I can call a cgi process in two ways. From a .shtml page, i can issue a directive like code...
I am building a pipeline for image processing. I would like to be able to take the png images in a folder and pass them to clusterImage.pl once that is done I would like to then pass the outputted file to seperateObjects.pl the outputted file is of the same name but has kmeansOutput.all.matrix attached to the end. Below is what I have so far, but it is not working.
#!/bin/bash #This script will take in an image and a matrix file. #The output will be an image and a matrix file. list=`ls *.png` for i in $list
I have some messy code that I wrote a while back and I am trying to organize it. The program opens xpaint and uses xwit and xte to draw packman and so on. I want to split it all up I am going to add more to it. Basically like i would want drawing packman in one function i guess you could call it and then coloring him or the background in another
#xwit -id $paintersMom -focus -raise #sleep 1 #xwit -id $paintersMom -warp 30 390 #// fill in command on tool bar #sleep 1 #xte 'mouseclick 1' #sleep 1 #xwit -id $canvasWin -warp 221 40 #// color selection #sleep 1 #xte 'mouseclick 1' #sleep 1 #xwit -id $canvasWin -warp "$(($X-150))" "$Y" #//location on pac man #sleep 1 #xte 'mouseclick 1' #sleep 1
#xwit -id $canvasWin -warp 62 44 #// selecting color black #sleep 1 #xte 'mouseclick 1' #sleep 1 #xwit -root -warp 62 120 #// selecting back to canvas #sleep 1 #xte 'mouseclick 1' #// color canvas black #sleep 1 #xwit -id $paintersMom -focus -raise #xwit -id $paintersMom -warp 27 108 #//click back to pencil #sleep 1 #xte 'mouseclick 1' #sleep 1 </code>
Here for example $paintersmom is would be in the drawing of pacman but I would also want to use it when I colored him in.. but I would want both processes in a different shell script.
Page.php -- has a special division thats empty and on Link Click calls Javascript to change inner.html to an IFRAME call So the user clicks the link and then it shows the division and loads the IFRAME The IFRAME Source is iframe.php in IFRAME.PHP I need to take the Session Variables that were set already in Page.php all sessions work fine when not using Iframe (open iframe.php in its own window) but doesnt work when its Iframed and sadly I have to use Iframe on this page NOW the CATCH is -- I CANNOT use any POST or GET Values the iframe src MUST be straight url to the page [URL] cannot use variables in the url [URL] etc..
IS it possible to do what I need Without passing variables via the url? Page1 has all session variables set, calls the iframe command when users presses a button, Iframe loads but DOES not have the Session data that was saved on Page1 -- and IFRAME cannot pass variables via the URL it must be a direct url to the page only Page1.php java used to set the HTML / IFRAME into its Div
Code:
<script> function changeText(){ document.getElementById('iframediv').innerHTML = "<iframe scrolling='no' frameborder='0' margin='0' src='http://mypage.blah/iframe.php'></iframe>";
I have a problem passing a file descriptor from one process to another.
I have two processes A and B. Both are running in different network and filesystem namespaces, so it is impossible to use unix domain sockets or net sockets to pass a file descriptor from process A to process B.
The usage of STREAMS is also impossible, as you can see in fixunix.com/unix/84093-streams-pipes-ioctl-i_sendfd.html
[quotation begin] Linux doesn't have STREAMS, which are the System V way of doing this task. ... [quotation end]
Are there additional possibilities for file descriptor passing like using named pipes or something like that or does anybody know a good workaround for this problem ?
I am attempting to script some tasks I have to do, but I have no control over one of the scripts I have to use... and they output all kinds of useless things on the screen. My goal is simple: Capture all output from their scripts, and create a progress line that only shows the most recent output from their stuff. So, here was my first solution; a file I called "spin":
To use it, you pass it a process ID and a file that contains the output from that process. As the process continues, a kurby dances on the screen (To let you know that the process has not hanged), and the tail of the output is shown (To let you know what it is doing). When the process ends, the kurby stops dancing and the time it took is displayed.
And here is the file I call "noise": Code: #!/bin/bash while [ i -lt 100 ];do i=1 echo "Look at me count!$" sleep 1 let "i=$i+1" done
This does nothing but create random output, for testing. It counts from 1 to 99 on the screen. To run my test, I do the following: Code: (noise) &>tmp.txt & spin $! tmp.txt
It works relatively well, but it is messy. I don't like creating a temp file, and I don't like the messy syntax for calling my program. I decided that I would rather move everything into the spin program, to make using it less messy: Code: #Spin Psuedo code #$1 = command I am about to run (exec $1) &>tmp.txt & spinX $! tmp.txt
By executing the process inside of the spin code, I can get rid of the tmp file later on without changing a lot of scripts (Or move it, or whatever). I can also call it by passing the command to the script, which I find more elegant.
So here is what I would like to know: 1) If possible, I would love to get rid of the tmp file all together, and store the most recent line of output from script 1 into a variable that script 2 can print out instead... is it possible? 2) How can I run a random command that is passed as an argument? Basic ones work fine, but anything with a pipe fails me.
Example of a script: Code: #!/bin/bash #myEcho.sh echo;echo "Recieved command: ";echo $1;echo; echo "Attempting to run command: ";echo exec $1
Example code for passing commands to script: > myEcho.sh "ls -al" #works > myEcho.sh 'ls -al' #works > myEcho.sh "ls -al|grep *.sh" #fail # Output: #ls: invalid option -- | #Try 'ls --help' for more information. > myEcho.sh "ls -al|grep "*.sh"" #fail # Output: #ls: invalid option -- | #Try ls --help' for more information. > myEcho.sh 'ls -al|grep *.sh' #fail # Output: #ls: invalid option -- | #Try 'ls --help' for more information.
I'm trying to create a program that would locate the oldest file of a certain type on a server. Here's the commands:
OLDEST_PATH=`find -L / -depth -maxdepth 6 -mindepth 6 -type d | sort -f | head -1` OLDEST_FILE=`find -L $OLDEST_PATH | grep .mp3 | sort -f | head -1` ls -al $OLDEST_FILE
I'm writing this all in expect but I'm having problems. The main problem I have is whenever I try to run the first command, I can't seem to isolate the result of the OLDEST_PATH so that the 2nd command will work. There always seems to be a newline in the variable and the result is only "find -L" command running and it bypasses the variable. If I can just figure out how to get the 1st and 2nd command to work, then I can figure out the 3rd. Here's some code:
I know there is a better way to write this. I've tried multiple ways and this just happens to be the last way I've tried it. If you try running this, you'll notice that there is still carriage returns after the result of OLDEST_PATH and it prevents the 2nd "find" command from working properly.
How can I pass carriage return to a command in the shell script. I am writing a shell script whcih generates ssh key pair. It ask for input from user three times. I want to pass carriage return (i.e., press Enter button) to this command.