User Profile

Collapse

Profile Sidebar

Collapse
Ciary
Ciary
Last Activity: Mar 13 '20, 06:18 PM
Joined: Apr 2 '09
Location: The outer ring of hell
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Ciary
    replied to advanced split in bash
    there is a workaround
    Code:
    workdir=`pwd`
    echo $workdir
    # /path/to/my/split/directory/i/want/
    temp=$(echo $workdir | sed "s/\/split\// /g")
    echo $temp
    # /path/to/my directory/i/want/
    arr=( $temp )
    echo ${arr[0]}
    # /path/to/my
    echo ${arr[1]}
    # directory/i/want/
    but there has to be a way to do this without the temp-variable, right?
    See more | Go to post

    Leave a comment:


  • Ciary
    started a topic advanced split in bash

    advanced split in bash

    Hi,

    i'm not an expert in bash and i have a question. is there a way to split a string on a sequence of characters rather than just one?

    the idea is the following
    Code:
    workdir=`pwd`
    echo $workdir
    # /path/to/my/split/directory/i/want/
    arr=$(echo $workdir | tr "/split/" "\n")
    echo $arr[0]
    # /path/to/my
    echo $arr[1]
    # directory/i/want/
    ...
    See more | Go to post

  • Ciary
    replied to scapy: applying an ipv6 route
    there is a workaround. you can manually add a mac source and destination. if you do this you force the packet to be send out on the right interface. that does the trick for me because i know the mac addresses and the host and destination are directly connected.

    however, i'm still curious what happened and why it won't work without this. as i sid before, i think it's a problem with ipv6 routes. for some reason it recognizes my eth1 ipv6...
    See more | Go to post

    Leave a comment:


  • Ciary
    replied to scapy: applying an ipv6 route
    if it were a problem a normal 'ping6' wouldn't have worked either. and that works fine.
    See more | Go to post

    Leave a comment:


  • Ciary
    started a topic scapy: applying an ipv6 route

    scapy: applying an ipv6 route

    Hi,

    I have a problem with scapy (obviously)
    for those who do not know, scapy is a network tool that allows you to manually craft a packet and send it, or even replay and modify a packet capture file.
    i want to do the first. i simply want to send an ipv6 icmp echo request and print the reply.

    here is the code to do that:
    Code:
    import logging
    import sys
    from scapy.all import *
    conf.iface='eth1'
    ...
    See more | Go to post

  • Ciary
    replied to reading from line X in perl
    in Perl
    forget it, searched for 3 hours, posted this, then 10 minutes later i had a solutions

    Code:
    $exitfile = '/path/to/the_exit_file';
    my $pointerPos = 0;
    while (!(-e $exitfile)) {
        print "and we read?\n";
     
        open(DAT, "/path/to/mylog.log") || die("Could not open file!");    
        seek DAT, $pointerPos, 0;
        foreach $line (<DAT>) {
            print $line;
    ...
    See more | Go to post

    Leave a comment:


  • Ciary
    started a topic reading from line X in perl
    in Perl

    reading from line X in perl

    hi all,

    i recently encountered a problem about something that should be really easy but in fact i couldn't find any information on how to do it.
    what i want to do is read a logfile in perl. i open the file, read the data, parse it, then close the file. so far so good.
    now, while the script is running, i append a few lines to the logfile. i now want perl to somehow remember at which line it last read, and when i open the file...
    See more | Go to post

  • Is it possible to write a constructorless class? if yes, how?

    hi everyone,

    the idea is actually very simple. i want to create a class like "Math" that i can use without any kind of constructor. is this possible, and how?

    thanks
    See more | Go to post

  • hi,

    i already solved the problem my own way already. i just made 4 arraylists instead of an arraylist of arrays. that way i can change the type of each arraylist separately.

    @Nepomuk: yup, that works. and it's probably better then my method. but since i'm just testing and efficiency isn't an issue i'll only change it if i get stuck.

    @Oralloy: i am writing a single thread program so there shouldn't be a difference....
    See more | Go to post

    Leave a comment:


  • please explain that a bit further. as far as i know, a vector and arraylist are the same but from a different language (but i'm probably wrong) Enlighten me
    See more | Go to post

    Leave a comment:


  • because an array is fixed size, and a string isn't. a string is more an arraylist of chars but appending to an arraylist requires more code than appending 2 strings together.
    See more | Go to post

    Leave a comment:


  • Ciary
    started a topic how can i put multiple classtypes in 1 array/arraylist
    in Java

    how can i put multiple classtypes in 1 array/arraylist

    hi,

    i have a problem i can't figure out. i'm trying to create a tree structure in a class. to do that i have a class "Knod" and a class "Leaf". the class "Tree" is an ArrayList of arrays. and these arrays contain a boolean, a Knod or Leaf-class and 2 ints (defining the next Knod or Leaf)

    Code:
    public class Tree{
        private int init;
        private ArrayList<Object[]> boom;
    ...
    See more | Go to post

  • Ciary
    started a topic bind dns problem

    bind dns problem

    hey bytes

    i have a very serious problem. i'm installing a linux (debian) network and i've run into some trouble. the problem is bind9. i installed it, copied my named.conf from a previous (working) installation, copied my zone files and edited them a bit to match the current layout of my network and started the service.

    now, when i try nslookup, bind never returns anything. it's like it can't find the zone files. can...
    See more | Go to post

  • jaistealth
    jaistealth posted a Visitor Message for Ciary
    while running https://localhost/hw/ZeroWebserviceclient.php on browseriam getting following error

    Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/WebServiceTutor ial/ZeroWebservice. wsdl' : failed to load external entity "http://localhost/WebServiceTutor ial/ZeroWebservice. wsdl" in C:\xampp\htdocs \hw\ZeroWebserv iceClient.php:3 Stack trace: #0 C:\xampp\htdocs \hw\ZeroWebserv iceClient.php(3 ):...
    See more | Go to post

  • Ciary
    replied to convert pdf to image - imagemagick - ghostscript
    in PHP
    i encountered the same. all links on google give me the same problem. just keep trying 'till it starts.
    See more | Go to post

    Leave a comment:


  • Ciary
    replied to convert pdf to image - imagemagick - ghostscript
    in PHP
    as said in a previous post, i encountered the same problem. i waited two months and then it suddenly did work. i cant explain how and why but it did

    if you wont want to wait that long i suggest using exec and a full imagemagick command. this does work.
    See more | Go to post

    Leave a comment:


  • Ciary
    replied to convert pdf to image - imagemagick - ghostscript
    in PHP
    well if you are using shared hosting, your provider will need to install it on it's server and give the posibility to its clients. it will cost you extra though. therefore, imagick isn't possible on most shared hosting servers. if you want it, you'll have to host it yourself or ask the hosting company to install it for you.

    on the comment why you just can't copy your libraries. it's because imagick will just use imagemagick.exe to transform...
    See more | Go to post

    Leave a comment:


  • correct me if i'm wrong but seems to me like all you want to do is change the image onclick.

    i dont think php is the best option since you'll have to reload the page to change it.

    you can do it using javascript, changing image source on mousedown, on mouseup and on mouseout. although even this might be a bit overpowered.

    i think your best shot is CSS. there you can change style when a link is 'active'...
    See more | Go to post

    Leave a comment:


  • Ciary
    replied to Image Display
    in PHP
    cuts of everything beyond the border of your element. you'll have to give it a specific width and height though

    also, you can position the image to eg -10px to cut of on the left and top side of the image

    (actually, this method is better then php. i just forgot the possibilities of html/css for a moment :-s)
    See more | Go to post

    Leave a comment:


  • Ciary
    replied to Image Display
    in PHP
    you will probably need to use an image library: GD is the most common, but if you need something more powerful, i should use imagemagick. you better do no use imagick cause it is way to hard to install.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...