Search Results

Search found 11 results on 1 pages for 'aaaaaaaa'.

Page 1/1 | 1 

  • How to print lines from a file that have repeated more than six times

    - by Mike
    I have a file containing the data shown below. The first comma-delimited field may be repeated any number of times, and I want to print only the lines after the sixth repetition of any value of this field For example, there are eight fields with 1111111 as the first field, and I want to print only the seventh and eighth of these records Input file: 1111111,aaaaaaaa,14 1111111,bbbbbbbb,14 1111111,cccccccc,14 1111111,dddddddd,14 1111111,eeeeeeee,14 1111111,ffffffff,14 1111111,gggggggg,14 1111111,hhhhhhhh,14 2222222,aaaaaaaa,14 2222222,bbbbbbbb,14 2222222,cccccccc,14 2222222,dddddddd,14 2222222,eeeeeeee,14 2222222,ffffffff,14 2222222,gggggggg,14 3333333,aaaaaaaa,14 3333333,bbbbbbbb,14 3333333,cccccccc,14 3333333,dddddddd,14 3333333,eeeeeeee,14 3333333,ffffffff,14 3333333,gggggggg,14 3333333,hhhhhhhh,14 Output: 1111111,gggggggg,14 1111111,hhhhhhhh,14 2222222,gggggggg,14 3333333,gggggggg,14 3333333,hhhhhhhh,14 What I have tried is to transponse the 2nd and 3rd fields with respect to 1st, so that I can use nawk on the field of $7 or $8 #!/usr/bin/ksh awk -F"," '{ a[$1]; b[$1]=b[$1]","$2 c[$1]=c[$1]","$3} END{ for(i in a){ print i","b[i]","c[i]} } ' file > output.txt

    Read the article

  • non-privileged normal user passing environment variables to /bin/login [closed]

    - by AAAAAAAA
    Suppose that in FreeBSD (or linux maybe) there is a non-privileged normal user (non-superuser). And there is a telnet standalone (I know that telnet is usually run under inetd) running under (owned by) this user. (Suppose that there was no original, root-owned telnet running.) This telnet server is programmed so that it does not check ld_* environment variables before passing it to /bin/login owned by root that has setuid set up. The question would be: 1. Will this telnet work? 2. If it does work, will it even be able to pass environment variables to /bin/login?

    Read the article

  • Mongodb querying for multiple parameters

    - by gaggina
    I've this collections { "name" : "montalto", "users" : [ { "username" : "ciccio", "email" : "aaaaaaaa", "password" : "aaaaaaaa", "money" : 0 } ], "numers" : "8", "_id" : ObjectId("5040d3fded299bf03a000002") } If I want to search for a collection with the name of montalto and a user named ciccio I'm using the following query: db.coll.find({name:'montalto', users:{username:'ciccio'}}).count() But it does not work. Where I went wrong?

    Read the article

  • Latex multicols. Can I group content so it won't split over cols and/or suggest colbreaks?

    - by valadil
    Hi. I'm trying to learn LaTeX. I've been googling this one for a couple days, but I don't speak enough LaTeX to be able to search for it effectively and what documentation I have found is either too simple or goes way over my head (http://www.uoregon.edu/~dspivak/files/multicol.pdf) I have a document using the multicol package. (I'm actually using multicols* so that the first col fills before the second begins instead of trying to balance them, but I don't think that's relevant here.) The columns output nicely, but I want to be able to indicate that some content won't be broken up into different columns. For instance, aaaaaaaa bbbbbbb aaaaaaaa bbbbbbb aaaaaaaa ccccccc bbbbbbbb ccccccc That poor attempt at ascii art columns is what's happening. I'd like to indicate that the b block is a whole unit that shouldn't be broken up into different columns. Since it doesn't fit under the a block, the entirety of the b block should be moved to the second column. Should b be wrapped in something? Is there a block/float/section/box/minipage/paragraph structure I can use? Something specific to multicol? Alternatively is there a way that I can suggest a columnbreak? I'm thinking of something like \- that suggests a hyphenated line break if its convenient, but this would go between blocks. Thanks!

    Read the article

  • Reading from txt ruins formatting

    - by Sorin Grecu
    I'm saving some values to a txt file and after that i want to be able to show it in a dialog.All good,done that but though the values in the txt file are formated nicely,like this : Aaaaaaaa 0.55 1 Bbbbb 1 2.2 CCCCCCCCC 3 0.22 When reading and setting them to a textview they get all messy like this : Aaaaaaaa 0.55 1 Bbbbb 1 2.2 CCCCCCCCC 3 0.22 My writting method : FileOutputStream f = new FileOutputStream(file); PrintWriter pw = new PrintWriter(f); for (int n = 0; n < allpret.size() - 1; n++) { if (cant[n] != Float.toString(0) && pret[n] != Float.toString(0)) { String myFormat = "%-20s %-5s %-5s%n"; pw.println(String.format(myFormat, prod[n], cant[n], pret[n])); My reading method : StringBuilder text = new StringBuilder(); try { BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { text.append(line); text.append('\n'); } } catch (IOException e) { } Why does it ruin the amount of spaces and how can i fix this ? Thanks and have a good night !

    Read the article

  • rsyslog - regex trouble

    - by benmccann
    I'm trying to setup the logentries service. If a log entry has a token in it then I would like to send it to api.logentries.com:10000. The token is a guid in the format aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee. Right now I'm doing: # If there's a logentries token then send it directly to logentries :msg, regex, ".*[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}.*" & @@api.logentries.com:10000 I checked the rsyslog debug logs and my regex is not matching, but I can't figure out why or how to fix it: 5245.961161378:7fb79b514700: Filter: check for property 'msg' (value ' fb1c507f-2ede-4d7f-a140-2bd8d56e133 - application - [play-akka.actor.default-dispatcher-1] - Found user: 4fb11ea5e4b00a1aeebe2800') regex '.*[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}.*': FALSE

    Read the article

  • How to get the size of a NSString

    - by camilo
    Hi. A "quicky": how can I get the size (width) of a NSString? I'm trying to see if the string width of a string to see if it is bigger than a given width of screen, case in which I have to "crop" it and append it with "...", getting the usual behavior of a UILabel. string.length won't do the trick since AAAAAAAA and iiiiii have the same length but different sizes (for example). I'm kind of stuck. Thanks a lot.

    Read the article

  • Restarting Haproxy Gracefully

    - by Anand Gupta
    As per various blogs, HAproxy can be gracefully restarted using the following command: sudo haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid) TO verify this, I had set up a apache bench script which contiguously sent message to haproxy. Ideally, whenever I restarted my server the script should not have an affect on the apache bunch execiton. But, it seems that whenever Haproxy is restarted apache bench scripts terminate and the connection to load balancer is lost. Here is the details of my HaProxy configuration file : global nbproc 4 log 127.0.0.1 local0 log 127.0.0.1 local1 notice #log loghost local0 info maxconn 4096 #chroot /usr/share/haproxy user haproxy group haproxy daemon pidfile /var/run/haproxy.pid stats socket /home/ubuntu/haproxy.sock #debug #quiet defaults log global mode http option httplog option dontlognull retries 3 option redispatch maxconn 2000 contimeout 5000 clitimeout 50000 srvtimeout 50000 listen webstats bind 0.0.0.0:1000 stats enable mode http stats uri /lb?stats stats auth anand:aaaaaaaa #stats refresh listen web-farm 0.0.0.0:80 mode http balance roundrobin option httpchk HEAD /index.php HTTP/1.0 server server2.com 1.1.1.1:80 server serve1.com 1.1.1.2:80 ~ Please let me know what am I missing here.

    Read the article

  • Android AlertDialog with rounded corners: rectangle seen below corners

    - by user1455909
    I want a Dialog with rounded corners, but when the Dialog is seen there's a rectangle below it that's seen below the corners, like this: I build the dialog using a custom DialogFragment: public class MyDialogFragment extends DialogFragment{ @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); builder.setView(inflater.inflate(R.layout.playdialog, null)); return builder.create(); } } The dialog layout (playdialog) has the following drawable as background: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#AAAAAAAA" /> <stroke android:width="2dp" android:color="#FF000000" /> <corners android:radius="20dp" /> </shape> As I said, I set this drawable as background: android:background="@drawable/dialog_background" I don't want that rectangle to be seen. How can I do it?? In this post the user had the same problem. I tried to use the solution that worked for him but it didn't work for me. I modified my DialogFragment like this: public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); builder.setView(inflater.inflate(R.layout.playdialog, null)); Dialog d = builder.create(); d.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); return d; } The result is exactly the same. How can I remove that rectangle? Thanks!

    Read the article

  • Problem using Hibernate Projections

    - by Lucas
    Hello! I'm using Richfaces + HibernateQuery to create a data list. I'm trying to use Hibernate Projections to group my query result. Here is the code: final DetachedCriteria criteria = DetachedCriteria .forClass(Class.class, "c") .setProjection(Projections.projectionList() .add(Projections.groupProperty("c.id"))); ... in the .xhtml file i have the following code: <rich:dataTable width="100%" id="dataTable" value="#{myBean.dataModel}" var="row"> <f:facet name="header"> <rich:columnGroup> ...... </rich:columnGroup> </f:facet> <h:column> <h:outputText value="#{row.id}"/> </h:column> <h:column> <h:outputText value="#{row.name}"/> </h:column> But when i run the page it gives me the following error: Error: value="#{row.id}": The class 'java.lang.Long' does not have the property 'id'. If i take out the Projection from the code it works correctly, but it doesn't group the result. So, which mistake could be happening here? EDIT: Here is the full criteria: final DetachedCriteria criteria = DetachedCriteria.forClass(Class.class, "c"); criteria.setFetchMode("e.zzzzz", FetchMode.JOIN); criteria.createAlias("e.aaaaaaaa", "aa"); criteria.add(Restrictions.ilike("aa.information", "informations....")); criteria.setProjection(Projections.distinct(Projections.projectionList() .add(Projections.groupProperty("e.id").as("e.id")))); getDao().findByCriteria(criteria); if i take the "setProjection" line it works fine. I don't understand why it gives that error putting that line.

    Read the article

1