Coding Problem 6 Now Defined in Scripting Languages/Bioinformatics WIKI

In the "Scripting Languages and Bioinformatics" WIKI, I have completed a new page here:
https://wiki.sdn.sap.com/wiki/display/EmTech/Bio-InformaticBasicsPartII-AlignmentToolsforRelatingProteinGenestoProteinPrimaryStructures
and also defined Coding Problem 6 at the end of this page.
This problem involves scripting an interactive session with a web site and parsing what the web site returns at various points duing the session.
Am looking foward to a script that solves this problem, if anyone feels like spending the time to do it.

<?
// sequence to search ---------------------------------------------
$bquery      = "MTQIIKIDPLNPEIDKIKIAADVIRNGGTVAFPTETVYGLGANAFDG";
$bquery     .= "NACLKIFQAKNRPVDNPLIVHIADFNQLFEVAKDIPDKVLEIAQIVW";
$bquery     .= "PGPLTFVLKKTERVPKEVTAGLDTVAVRMPAHPIALQLIRESGVPIA";
$bquery     .= "APSANLATRPSPTKAEDVIVDLNGRVDVIIDGGHTFFGVESTIINVT";
$bquery     .= "VEPPVLLRPGPFTIEELKKLFGEIVIPEFAQGKKEAEIALAPGMKYK";
$bquery     .= "HYAPNTRLLLVENRNIFKDVVSLLSKKYKVALLIPKELSKEFEGLQQ";
$bquery     .= "IILGSDENLYEVARNLFDSFRELDKLNVDLGIMIGFPERGIGFAIMN";
$bquery     .= "RARKASGFSIIKAISDVYKYVNI";
// url for form1 --------------------------------------------------
$url = "http://blast.ncbi.nlm.nih.gov:80/Blast.cgi";
// parameters for form1 -------------------------------------------
$bdb         = "protein";
$bgeneticcode= "1";
$bquery_from = "";
$bquery_to   = "";
$bjobtitle   = "ACW-" . time();
$bdatabase   = "nr";
$bblastprog  = "tblastn";
$bpagetype   = "BlastSearch";
$pf  = "";
$pf .= "QUERY=" . $bquery;
$pf .= "&db=" . $bdb;
$pf .= "&QUERY_FROM=" . $bquery_from;
$pf .= "&QUERY_TO=" . $bquery_to;
$pf .= "&JOB_TITLE=" . $bjobtitle;
$pf .= "&DATABASE=" . $bdatabase;
$pf .= "&BLAST_PROGRAMS=" . $bblastprog;
$pf .= "&PAGE_TYPE=" . $bpagetype;
$pf .= "&GENETIC_CODE=1";
$pf .= "&DBTYPE=";
$pf .= "&EQ_MENU=";
$pf .= "&EQ_TEXT=";
$pf .= "&NEWWIN=";
$pf .= "&MATCH_SCORES=";
$pf .= "&MAX_NUM_SEQ=100";
$pf .= "&EXPECT=10";
$pf .= "&WORD_SIZE=3";
$pf .= "&MATRIX_NAME=BLOSUM62";
$pf .= "&GAPCOSTS=11 1";
$pf .= "&COMPOSITION_BASED_STATISTICS=2";
$pf .= "&REPEATS=";
$pf .= "&FILTER=";
$pf .= "&LCASE_MASK=";
$pf .= "&TEMPLATE_LENGTH=";
$pf .= "&TEMPLATE_TYPE=";
$pf .= "&I_THRESH=0.005";
$pf .= "&CLIENT=web";
$pf .= "&SERVICE=plain";
$pf .= "&CMD=request";
$pf .= "&PAGE=Translations";
$pf .= "&PROGRAM=tblastn";
$pf .= "&MEGABLAST=";
$pf .= "&RUN_PSIBLAST=";
$pf .= "&SELECTED_PROG_TYPE=tblastn";
$pf .= "&SAVED_SEARCH=true";
$pf .= "&BLAST_SPEC=";
$pf .= "&QUERY_BELIEVE_DEFLINE=";
$pf .= "&DB_DIR_PREFIX=";
$pf .= "&SHOW_OVERVIEW=true";
$pf .= "&SHOW_LINKOUT=true";
$pf .= "&GET_SEQUENCE=true";
$pf .= "&FORMAT_OBJECT=Alignment";
$pf .= "&FORMAT_TYPE=HTML";
$pf .= "&ALIGNMENT_VIEW=Pairwise";
$pf .= "&MASK_CHAR=2";
$pf .= "&MASK_COLOR=1";
$pf .= "&DESCRIPTIONS=100";
$pf .= "&ALIGNMENTS=100";
$pf .= "&NEW_VIEW=true";
$pf .= "&OLD_BLAST=true";
$pf .= "&NCBI_GI=false";
$pf .= "&SHOW_CDS_FEATURE=false";
$pf .= "&NUM_OVERVIEW=100";
$pf .= "&FORMAT_EQ_TEXT=";
$pf .= "&FORMAT_ORGANISM=";
$pf .= "&EXPECT_LOW=";
$pf .= "&EXPECT_HIGH=true";
$pf .= "&QUERY_INDEX=0";
// define the HTTP connection -----------------------------
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS, $pf);
curl_setopt($ch,CURLOPT_COOKIEJAR,
dirname(__FILE__).'/cookie.txt');
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_HEADER , 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
// call it ------------------------------------------------
$my_result = curl_exec($ch);
// get the request ID; the query takes some time and this ID
// allows to identify the original request
$query = "/<tr><td>Request ID<\/td><td> <b>([0-9A-Z]*)<\/b><\/td><\/tr>/";
preg_match($query, $my_result, $request_id);
// query for the result page every 2 seconds...when the result
// is ready, we recognize it by its signature
$not_ready = true;
$result_url = "http://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Get&VIEW_RESULTS=FromRes&RID=" . $request_id[1];
while($not_ready){
  $temp_page = null;
  curl_setopt($ch,CURLOPT_URL,$result_url);
  curl_setopt($ch, CURLOPT_POST, 0);
  $my_result = curl_exec($ch);
  $query = "/This page will be automatically updated in <b>(\d*)<\/b> seconds/";
  preg_match($query, $my_result, $temp_page);
  if(isset($temp_page[1])) {  sleep(2); }
  else { $not_ready = false; }
// parse the results page; split it into result fragments first --------
$pat = "/";
$pat .= "><input type=\"checkbox\" name=\"getSeqGi\"([^\n]*)\n";
$pat .= "Length=\d*\n\n";
$pat .= "[\w\s]*:\n";
$pat .= "(\s*<a[^>]*>[^<]*<\/a>\n)*\n";
$pat .= "([^\n]*\n){3}\n";
$pat .= "(([^\n]*\n){3}\n[^n])*";
$pat .= "/";
preg_match_all($pat, $my_result, $fragments);
// 'fine parse the result fragments and get some important parameters -----
foreach($fragments[0] as $fragment){
  $query = "/<a href=\"http:\/\/(www\.ncbi\.nlm\.nih\.gov\/entrez\/query\.fcgi\?";
  $query .= "[^>]*)>([^<]*)<\/a><a[^>]*>[^<]*<\/a>\s*<a[^>]*><img[^>]*><\/a>([^\n]*)/";
  preg_match($query, $fragment, $u);
  $query  = "/\s*Score\s*=\s*(\d*) bits\s*\(\d*\),\s*Expect\s*=\s*([^,]*),";
  $query .= "[^\n]*\n\s*Identities\s*=\s*\d*\/\d*\s*\((\d*%)\)[^\n]*\n\s*Frame\s*=\s*([^\n]*)\n/";
  preg_match($query, $fragment, $u1);
  preg_match_all("/Sbjct\s*(\d*)\s*[A-Z\-]*\s*(\d*)\n/", $fragment, $positions);
  $fr["url"]        = $u[1];
  $fr["shname"]     = $u[2];
  $fr["name"]       = $u[3];
  $fr["score"]      = $u1[1];
  $fr["expect"]     = $u1[2];
  $fr["identities"] = $u1[3];
  $fr["frame"]      = $u1[4];
// find out if we have to reverse the strand direction or not; adjust
// lower and upper limit
  if ($fr["frame"] >= 0) {
    $fr["high"] =  $positions[2][count($positions)-1]; $fr["low"] = $positions[1][0]; $fr["reverse"] = ""; }
  else {
    $fr["high"] =  $positions[1][0]; $fr["low"] = $positions[2][count($positions)-1]; $fr["reverse"] = true;}
  $frx[] = $fr;
// we call the final details form for the top ranked result
// here we could loop over several results
curl_setopt($ch,CURLOPT_URL,$frx[0]["url"]);
curl_setopt($ch, CURLOPT_POST, 0);
$my_result = curl_exec($ch);
// parse the final details form to get the necessary parameters to execute
// the final details form
preg_match("/<input name=\"WebEnv\" type=\"hidden\" value=\"([^\"]*)\"/",
           $my_result, $u5);
preg_match("/<input name=\"query_key\" type=\"hidden\" value=\"([^\"]*)\"/",
           $my_result, $u6);
preg_match("/<input name=\"db\" type=\"hidden\" value=\"([^\"]*)\"/",
           $my_result, $u7);
preg_match("/<input name=\"qty\" type=\"hidden\" value=\"([^\"]*)\"/",
           $my_result, $u8);
preg_match("/<input name=\"c_start\" type=\"hidden\" value=\"([^\"]*)\"/",
           $my_result, $u9);
preg_match(
  "/<select name=\"dopt\".*<option value=\"([^\"]*)\" selected=\"1\">/",
  $my_result, $u10);
preg_match(
  "/<select name=\"dispmax\".*<option value=\"([^\"]*)\" selected=\"1\">/",
  $my_result, $u11);
preg_match(
  "/<select name=\"sendto\".*<option value=\"([^\"]*)\" selected=\"1\">/",
  $my_result, $u12);
preg_match(
  "/<input type=\"hidden\" id=\"([^\"]*)\" name=\"fmt_mask\".*value=\"([^\"]*)\"/",
  $my_result, $u13);
preg_match(
  "/<input type=\"checkbox\" id=\"truncate\" name=\"truncate\" value=\"([^\"]*)\"\/>/",
  $my_result, $u14);
// fill in the necessary parameters parsed out now and earlier
$of  = "WebEnv=" . $u5[1];
$of .= "&query_key=" . $u6[1];
$of .= "&db=" . $u7[1];
$of .= "&qty=" . $u8[1];
$of .= "&c_start=" . $u9[1];
$of .= "&dopt=" . $u10[1];
$of .= "&dispmax=" . $u11[1];
$of .= "&sendto=" . $u12[1];
$of .= "&fmt_mask=" . $u13[1];
$of .= "&truncate=" . $u14[1];
$of .= "&less_feat=";
$of .= "&from=" . $fr["low"];
$of .= "&to=" . $fr["high"];
$of .= "&strand=" . $fr["reverse"];
$of .= "&extrafeatpresent=1";
$of .= "&ef_SNP=1";
$of .= "&ef_CDD=8";
$of .= "&ef_MGC=16";
$of .= "&ef_HPRD=32";
$of .= "&ef_STS=64";
$of .= "&ef_tRNA=128";
$of .= "&ef_microRNA=256";
$of .= "&ef_Exon=512";
$of .= "&submit=Refresh";
$ourl = "http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?" . $of;
// execute the final details form
curl_setopt($ch,CURLOPT_URL,$ourl);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch,CURLOPT_POSTFIELDS, $of);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_HEADER , 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$my_result = curl_exec($ch);
// parse the result page and get the final ORIGIN snippet
preg_match("/ORIGIN\s*\n\s*<a name=\"[^\"]*\"><\/a>\s*([^\/]*)\//", $my_result, $u99);
// output the final result ----------------------------------
echo "\n" . preg_replace("/\s{2,}/", "\n", preg_replace("/\d+\s/", "", $u99[1]));
?>
Edited by: Anton Wenzelhuemer on Aug 6, 2008 8:08 PM (Re-Formatted)

Similar Messages

  • Three new bioinformatic coding problems now in WIKI (all require regex)

    At the bottom of this page:
    https://wiki.sdn.sap.com/wiki/display/EmTech/Bio-InformaticBasicsInRelationtoScriptingLanguages
    I've defined three new bioinformatic coding problems (Problems 3a-c).
    These all involve regex parsing in one way or another and are therefore a lot more interesting than the first two problems I've presented.
    I'm hoping that Anton will continue to knock out solutions, and that others will feel challenged enough to join him.
    djh

    Anton -
    I am way impressed - not just by your code and how fast you produced it, but also by the speed with which you grasped the STRIDE documentation and put it to very good use.
    Regarding the question you ask at the very end - this question goes to the heart of why protein tertiary structure (the actual 3-dimensional shape of one chain of a protein) is so hard to predict, and why governments, universities, and pharma are throwing so much money at it.
    If protein primary and secondary structure were many-to-one, prediction of protein tertiary strructure would be a lot lot simpler.  (For example, if "VVAY" and all "similar" primary structure subsequences mapped to the same secondary structure.)
    But the mapping is, unfortunately, many-to-many because the amino acids (AAs) in a primary structure chain always bond the same way - the COOH (carboxy) of one  AA bonds to the HN (amino) of the next one to produce C-N with the OH and H going away to make a water moleculre ... COOH - HN ---> C-N + H20.
    And as pointed out by Linus Pauling (the discoverer of protein secondary structure), the C-N bond can take two forms:
    a) one that is llkely to force the two amino acids to become HH (part of a helix)
    b) one that is likely to force the two amino acids to become EE (part of a "stand")
    You may be surprised to find out that even primary structure subsequences of six amino acids can wind up as different secondary structures - not always "H" vs "E", the variants might be
    E TT H
    H TT E
    EEE HH
    HH EEE
    etc.
    Anyway, thanks a lot for what you've done here.
    If you decide to stay involved a little longer, you will very soon be able to understand why there may be real promise in the approach to protein structure that is being taken here:
    http://strucclue.ornl.gov
    (This is why I want to get SAP interested in the vertical bioinformatic sector - you can see why an integrated IDE with a robust DB is so important.)
    BTW, the site mentions Dr. Arthur Lesk as a team member.  Arthur is considered one of the fathers of what is called "structural alignment" (as opposed to pure sequence alignment.)
    If you Google him, you'll see that he has written many many books on bioinformatics - all worth purchasing if you're going to become involved in this area.  Arthur was at Cambridge (MRC) until recently, when he reached mandatory EU retirement age and took a position at Penn State here in the US.
    Best
    djh

  • New java-like scripting language w/ powerful regex

    Hi,
    Just wanted to let you know that there's now a new scripting language called P~ with the following important aspects:
    1) matches and exceeds Perl regex solveability -- e.g. offers full regex-based boolean query on non-indexed corpus, offers completely general side-effects, more accurate than Perl code assertions
    2) basic grammar is very Java like
    3) regex grammar is algebraic, not metacharacter-based, leads to more readable and maintainable solutions to hard problems
    4) offers an easy tool to debug matching behavior of your regexes (rules)
    5) though a full featured scripting language, you can write scriptlets and call them from Java classes, with arguments. Allows you to use your regex solutions in Java applications.
    6) the language is offered as a Java library, as well as a standalone application that runs the library. This means that your scripts can import java classes available in the classpath, you can leverage existing Java libraries.
    Check out the website and try it out: http://ptilde.pbwiki.com
    Andy

    True to an extent. We don't yet have lookaround assertions and won't have backreferencing any time soon. But there are same-time assertions which offer much of the same, and allow for boolean query.
    More accurate general statement insertion side-effects (than Perl code assertions) means that your statements are executed if and only they wrap a subpattern that is part of the ultimate best match -- Perl code assertions execute when the automata encounters them, even if where they are in the regex is ultimately not part of the match, or even if there is no match at all. This aspect is a huge part of the solveability advantage.
    As to the regex test cases, there are about 1000, and we will post them soon.

  • Coding Problem

    I have only been programming in Java for two weeks now and I am having problems. Frankly, I do not know Javascript either, but I am trying.
    I am using a Stringbuffer to dynamically generate my webpage using a servlet and I am all mixed up.
    I would like to update my database when the user leaves an input box
    meaning it automatically updates the database when the input box no longer has focus.
    I set a function called change_it to execute in the onblur in HTML.
    The ResultSet behaves as if it is closed within the change_it function on the page.
    The ResultSet is Updateable and is scrollable.
    Please look at my code and let me know what I should do and give me a code example if possible.
    import java.io.*;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.net.*;
    public class HtmlImportType extends HttpServlet {
    Connection theConnection;
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException,
    IOException
    getHTML(request, response);
    public void doPost(HttpServletRequest request,
    HttpServletResponse response) throws ServletException,
    IOException
    getHTML(request, response);
    public String getHTML(HttpServletRequest request,
    HttpServletResponse res) throws ServletException,
    IOException
    String strName;
    StringBuffer sbHtmlText = new StringBuffer();
    HttpSession session = request.getSession(true);
    sbHtmlText.append("<html>");
    sbHtmlText.append("<HEAD>");
    sbHtmlText.append("<title>Import Type Code</title>");
    res.setContentType("text/html");
    sbHtmlText.append("<script language=\"JavaScript\">");
    sbHtmlText.append("<!-- hide from non-JavaScript browsers ");
    sbHtmlText.append("function change_it(int intPrimaryKey) { ");
    sbHtmlText.append("theConnection = DriverManager.getConnection(\"jdbc:odbc:dcs_dialysis;UID=dcs_dialysis;PWD=dcs_dialysis\"); ");
    sbHtmlText.append("Statement theStatement=theConnection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); ");
    sbHtmlText.append("ResultSet rs=theStatement.executeQuery(\"Update DESCRIPTION from REF_IMPORT_TYPE WHERE IMPORT_TYPE_CODE = \" + intPrimaryKey); ");
    sbHtmlText.append("rs.absolute(intPrimaryKey); ");
    sbHtmlText.append("rs.updateString(\"DESCRIPTION\", txt\" + intPrimaryKey + \".value); ");
    sbHtmlText.append("rs.updateRow(); ");
    sbHtmlText.append("rs.close(); ");//Close the result set
    sbHtmlText.append("theStatement.close(); ");//Close statement
    sbHtmlText.append("theConnection.close(); "); //Close database
    Connection sbHtmlText.append("}");
    sbHtmlText.append("// end hide -->");
    sbHtmlText.append("</script>");
    sbHtmlText.append("</HEAD>");
    sbHtmlText.append("<BODY text=#008000 topMargin=0>");
    sbHtmlText.append("<FONT face=Helvetica><BIG>Import Data Types</BIG>");
    sbHtmlText.append("");
    sbHtmlText.append("<TABLE align=center border=1 cellPadding=1 cellSpacing=1 width=\"40%\">");
    sbHtmlText.append("<TR>");
    sbHtmlText.append("<TH>Import Type Code</TH>");
    sbHtmlText.append("<TH>Description</TH>");
    sbHtmlText.append("</TR>");
    try{ //Loading Sun's JDBC ODBC Driver Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //Connect to Data source
    theConnection = DriverManager.getConnection("jdbc:odbc:dcs_dialysis;UID=dcs_dialysis;PWD=dcs_dialysis");
    Statement theStatement=theConnection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    ResultSet rs=theStatement.executeQuery("select IMPORT_TYPE_CODE, DESCRIPTION from REF_IMPORT_TYPE");
    int intCounter = 1;
    //Fetch all the records and print in table
    while(rs.next())
    sbHtmlText.append("<TR>");
    sbHtmlText.append("<TD><CENTER>");
    sbHtmlText.append(rs.getString(1) + "</TD></CENTER>");
    sbHtmlText.append("<TD>");
    sbHtmlText.append("<input type=\"text\" size=\"30\" style=\"font-family: Verdana; font-size: 10pt\"");
    sbHtmlText.append("name=\"");
    sbHtmlText.append("txt" + intCounter + "\"");
    sbHtmlText.append("value =\"");
    sbHtmlText.append(rs.getString(2));
    sbHtmlText.append("\" onBlur=\"change_it(" + rs.getString(1) + ")\">"); //PUTS PRIMARY KEY IN TO ASSIST WITH QUERIES
    sbHtmlText.append("</TD>");
    sbHtmlText.append("</TR>");
    intCounter = intCounter + 1; }
    rs.close();//Close the result set
    theStatement.close();//Close statement
    theConnection.close(); //Close database Connection
    catch(Exception e)
    sbHtmlText.append(e.getMessage()); //Print trapped error.
    sbHtmlText.append("</TABLE>");
    sbHtmlText.append("</FONT></BODY></HTML>");
    return (sbHtmlText.toString());
    }

    Basically I am flying by the seat of my pants and I do not know Java very well at all and I do not have anyone to ask. I am trying to do this in the only way that I can think of which is updating the record after an onblur. I know it is fascinating to those who have read this, because I do not have one solution listed. However, I still do not know how to update the database. AJAX is nothing more than a bleaching agent to me, can you provide any coding example of how to do an update?

  • Using context variable in formcalc scripting language.

    Hi all,
             I wanted to know if it is possible to use context variables in formcalc. I wanted to use those variables in "if else" condition in formcalc scripting language. Please post the sample code also as i am new to adobe forms.
    Regards,
    Vinod

    Hi ,
    Each variable define in the context can be used on the layout of the form and/or in script linked to fields.
    This can be done in formcalc or in javascript language , without any problem . You have only to acess the correct variable in the script.
    For getting variable in a script you must define the complete name of the variable, example "Myform.Header.Data.Myvariable" get access to variable MyVariable define in the context under nodes Header/Data .
    Hope it's help you
    regards.

  • High-level/scripting languages learning thread

    Hi all,
    In recent weeks i have looked into many of the high-level/scripting languages.  All of them easy enough to get into quickly. My problem though is not learning them actually, but that i don't actually have much use now. Sure, from time to time i need a little script for something (and sometimes i then translate that script to lots of languages just for the heck of it like here), but that doesn't amount to much. However on the other hand i'm neither in some job regarding IT/programming nor do i study anything with respect to programming, and i also am not interested in more programming as in compiled languages, system programming or things like that. (At the very least not yet). So i'm doing this just for fun and learning (two of my lifegoals). I am aware of for example Project Euler, however i'm not mathematically interested enough for that.
    So, the purpose of this thread are two things.
    a) I'm asking for suggestions for interesting things i could do with high-level/scripting languages, maybe someone knows of something Project Euler like but for more mundane things and not maths.
    b) So as to give this thread another purpose and not make it only about me, maybe people who have some problem writing a script for something can ask for help. I know of the other thread (the long one, "commandline utilites/scripts"), but that one seems to be more of the sort where someone posts a script he/she uses and then maybe someone posts an answer to that. So for this thread here people should be able to ask for help while creating the script, or even "Where to start". This could serve both the people with the problem and the people wanting to learn more about some language but not finding a way to apply the learning.
    Ogion

    a) I'm asking for suggestions for interesting things i could do with high-level/scripting languages, maybe someone knows of something Project Euler like but for more mundane things and not maths.
    To me, this sounds like the Python Challenge: http://www.pythonchallenge.com/
    Also, if you're not interested in math, maybe you might still find yourself engaged by something like natural language processing, games, or simulations? I personally find the "Natural Language Toolkit" for Python to be a lot of fun.

  • Scripting language

    Can sombody tell me something about a scripting language for j2me. I'm looking for something realy simple make it easy to update and customize the business logic of my app without updating the whole thing.
    Any thoughts welcome!

    Hmm, problem is that the expression uses strings that represent data object's. I look them up in a hashtable. I can't change that, since it is a fundamental design thing the rest of the app is building on.
    Right now, I'm profiling what makes it this slow.. ATM, it is my string split function, still don't know what part though. Any sugestions on how to do that fast would be great ;)
    My current code:
    public final static String[] split( String str, char separatorChar, char strt, char nd )      
          if ( str == null ) {
             return null;
          int       len     = str.length();
          if ( len == 0 ) {
             return null;
          Vector    list    = new Vector();
          int       i       = 0;
          int       start   = 0;
          int       indent  = 0;
          boolean   match   = false;
          while ( i < len ) {
             if ( str.charAt( i ) == strt ) {
                indent++;
             } else if ( str.charAt( i ) == nd ) {
                indent--;
             if ( indent == 0 ) {
                if ( str.charAt( i ) == separatorChar ) {
                   if ( match ) {
                      list.addElement( str.substring( start, i ).trim() );
                      match = false;
                   start = ++i;
                   continue;
             match = true;
             i++;
          if ( match ) {
             list.addElement( str.substring( start, i ).trim() );
          String[]  arr     = new String[list.size()];
          list.copyInto( arr );
          return arr;
       }As you can see, I must not split if a split char is between two other chars. I tried working with byte array's and not strings, but that doesn't speed things up.
    Also notices somthing strage while decompiling the Vector class:
        public synchronized void copyInto(Object[] anArray) {
         int i = elementCount;
         while (i-- > 0)
             anArray[i] = elementData;
    Why did they not use an arraycopy... I guess that would be much faster. But as it turns out, this part is not slow. The implementation in my device is probably better :)

  • Problem: ()[]{} invisible inside the script-tag

    Hi there,
    This morning I realised I had some strange problem with my Dreamweaver CS4. The brackets ()[]{} are somehow invisible inside the script-tag. I know they are still there, because they execute correctly and when I copy a codefragment with some (of the now invisible) brackets to another text-editor, they are there again.
    Let me give a short example:
    // Brackets are visible in DW   ()[]{} These are visible, tooI can see the "bla", but NOT the brackets before and after it. ()[]{} These here are visible again. 
    So you see, brackets are somehow made invisible inside the script-tag, and I'd like to know how to make them visible again.
    Here's what I tried so far (everything without success):
    - restart Dreamweaver
    - restart PC
    - check the options menu (didn't find anything for this problem)
    - hide/show the script-tag using dreaweaver's feature for this.
      Intresting point here: when the part where the brackets are, are collapsed it shows me "()[]{}[..." as a preview. So even Dreamweaver "knows" the brackets are there, but still refuses to show them -_-
    - set the gui setting from "coder" to "classic" and back.
    Any help is appreciated!
    Thanks in advance, really need to solve this, since I am using alot of hardcoded 2-dimensional javascript arrays and therefore alot of []
    Best regards
    Michael

    Sorry for doubleposting, I should have read the manual for posting code :|
    here's the code I was giving as an example:
    <title>brackets work fine here: ()[]{}</title>
    <style type="text/css">
    .someclass {background:url(theseBracketsAreVisible.png)}
    </style>
    </head>
    <body>
    <div>()[]{} these are visible as well</div>
    <script language="javascript">()[]{}[bla]</script> I can see the "bla", but NOT the brackets before and after it.
    ()[]{} These here are visible again.
    </body>
    Sorry again..
    edit:
    I realised it hides words like "function" aswell o_O
    <script language="javascript">
    function test() {ar = new Array;ar = ["a","b","c"];alert(ar);};
    </script>
    The code above is visible for me in Dreamweaver like this:
    <script language="javascript">
    test ar =  Array;ar = "a","b","c";alertar;;
    </script>
    really strange..

  • Script language for LAN, WAN, wireless?

    which scripting language are used for LAN, WAN, wireless to automate things etc? python, shell scripting? is there a tutorial available to i can refer to?

    It depends on what you are trying to do.
    Shell scripting is quite limited in what it can do when compared to a more general purpose scripting language such as Perl or Python. Nothing wrong with that and I have used shell scripts a lot when I was a Unix admin but for networking most of what I have seen in terms of script languages has been TCL, Perl and Python.
    You can use scripts to automate logging on to devices and executing commands, basically the script does what you would type in. To do this you can use Expect and Perl, Python and TCL all have Expect functionality (Expect was originally an extension to TCL).
    But you are still just basically automating what you yourself would type and you would run these scripts from a server, PC etc although if you have a lot of devices you need to update with the same details it can save a considerable amount of time and just as importantly if the script works it removes the human error element of configuring multiple devices and perhaps getting a few wrong.
    The next step is EEM where the device has an inbuilt TCL interpreter which means you can write applets or scripts that are stored on the device and can respond to specific things happening eg. if an interface goes up or down or the routing table is changed you can execute a set of commands.
    There is an EEM forum on here.
    I believe also that Nexus switches have an inbuilt Python interpreter which allows pretty much the same thing.
    The advantages of the interpreter being on the device is that it saves a lot of extra coding and you can get more information because Cisco have added libraries to those interpreters which are specific to the device and which provide you with a standard set of APIs which your script can use.
    As I said scripting can save a lot of time and there is an argument that all network engineers should at least now some scripting and this has become more of a hot topic with the promise of what SDN can achieve in the future although it has to be said there are already configuration management tools out there which make use of the above languages.
    It really depends on what you are trying to do and how much you want to automate things.
    In terms of tutorials etc. for all the major scripting languages there are a lot of online tutorials and books you can use.
    In addition there are sites where you can run your scripts online but to be honest it is easier to simply download the interpreter to your PC, laptop etc. and you should be able to find a compiled version of the interpreter for whatever OS you are running.
    Jon

  • Multiple constructor definitions found. Constructor may not be defined in Script/ code.

    I copied from one folder to another folder my course. I am making a Spanish versio
    n and want to keep everything spereated. All goes well but I am getting over 100
    errors -> Multiple constructor definitions found. Constructor may not be defined in <Script/> code. Doesn't effect the program but it does
    get anoying. I first thought it was the linking so I went in and im
    ported from the current folder the images so it was pointing right... no go still does it.
    Created a brand new fla and copied all my frames into it... no go still
    does it. Does anyone have any thoughts on this problem?
    THANKS

    Found out nothing was wrong with my coding. Sometimes when watching the AIR app playing in Flash I go back to my code to make a fix then that is when all the errors appear. Read the adl.exe is not releasing and is causing the problem?

  • SAP Scripting Languages on the SDN Day - Amsterdam

    I would like to give a short summary of what happened on the SDN Day in Amsterdam, the 17-th Oct. 2006.
    After the breakfast Craig Cmehil gave us a welcome to the event and presented the schedule. We started with a power networking session: Four 20-minute Sessions with Six SDNers per Table. As I was sitting at the Scripting Languages table, I would like to share some impressions of the atmosphere there. We talked much about the emmerging SAP Scripting Tool and how much value it will bring to all scripting projects that plan to utilize SAP backend systems. We discussed Gregor Wolf's contest and he was so kind to inform us that his test system is also available inside the SAP corporate network, so all SAP employees now can participate too. Gregor works for Siteco Beleuchtungstechnik GmbH and the award they offer for the contest is a Siteco Vistosa task light. More information about the contest can be found at https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/4588. [original link is broken] [original link is broken] Another key discussion was held with Björn Schotte, the chief editor of PHP Magazine, Germany, presenting also his company Mayflower Gmbh. He shared some visions on business applications of PHP and stated that PHP is definitely enterprise ready.
    Then after a very short pause we started the SDN breakout sessions (3-5 in parallel). I visited the sessions of Gregor Wolf, André Labahn, Björn Schotte and after this I cooperated for the breakout session of Frank Mittag.
    Session 1:
    Connecting Typo3 to R/3 Enterprise via Web Services with Gregor Wolf from Siteco Beleuchtungstechnik GmbH
    Siteco Beleuchtungstechnik GmbH currently implements a customer service centre into it's Typo3 based website. Typo3 is an Open Source Web Content Management system based on the Scripting Language PHP. The application will allow Siteco's customers to directly check price & availability of products from the backend R/3 Enterprise system, quotations, orders and delivery status. The backend connectivity uses Web Services utilise the PEAR SOAP Package.
    Session 2:
    SAP supports Scripting Languages with Andre Labahn from SAP.
    This session will provide you with more insights on how SAP is supporting scripting languages.
    Session 3:
    Scripting Languages PHP and Enterprise Software with Björn Schotte (Chief Editor from PHP Magazine).
    This session showed us a brief history of PHP and PHP in Germany. Some enterprise applications of PHP were discussed. Björn Schotte was the opinion that PHP is definitely enterprise ready and he proved it with an example of a system that his company has created for Siemens.
    Session 4:
    Scripting Languages Tool with Frank Mittag and Vasil Bachvarov (me) from SAP
    SAP will provide a open source tool to the scripting development community that is supporting the access to SAP Backend Systems via RFC/BAPIs and Webservices. See the concept and demo of the tool and discuss this with SAP Development.
    There was a pretty interesting discussion about the tool. Since the time for the last session shrinked with some minutes we had to be very quick, but Frank Mittag did a great job and succeeded to explain the basic concept of the SAP Scripting Tool and show it in action for the tough time constraint.
    There were a lot of questions from the audience but it was already 18:30 and we stopped at this point. There would be a second chance for questions on thursday when Frank had the opportunity to make a more complete and comprehensive walk-through of the project.
    Then we gathered in the meeting hall and Shai Agassi held a speech and made a summary of the event.
    The evening finished in the BoomChicago theater where everybody received a delicious meal, drinks and a great amount of fun with the ChicagoBoom comic crew.
    I would like to thank all people that made this event come true! See you soon in Bangalore.
    Best Regards,
    Vasil Bachvarov
    SAP AG

    I'm be there in Amsterdam as well.  In fact I am leaving the US on Sunday and arriving early Monday morning in Amsterdam. 
    I was planning to do a little site seeing on Monday Afternoon.  If anyone else is arriving a bit early as well, they are welcome to join me.  It is always more fun to site see in groups.  My email address is public in my SDN business card (also not too difficult to figure out ) if anyone is interested in meeting up.

  • With TSM adware removal tool I was able to remove unknown software that was making ads pop up when using Safari. So the y don't pop up anymore. The problem now is that when I open safari It is still downloading websites and after awhile it

    With TSM adware removal tool I was able to remove unknown software that was making ads pop up when using Safari. So the y don't pop up anymore. The problem now is that when I open safari It is still downloading websites and after awhile it freezes the browser. I have to constantly go to Safari Preferences to remove them and then the browser will start working again. What can I do to stop this?

    1. This procedure is a diagnostic test. It changes nothing, for better or worse, and therefore will not, in itself, solve the problem. But with the aid of the test results, the solution may take a few minutes, instead of hours or days.
    Don't be put off merely by the seeming complexity of these instructions. The process is much less complicated than the description. You do harder tasks with the computer all the time.
    2. If you don't already have a current backup, back up all data before doing anything else. The backup is necessary on general principle, not because of anything in the test procedure. Backup is always a must, and when you're having any kind of trouble with the computer, you may be at higher than usual risk of losing data, whether you follow these instructions or not.
    There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    3. Below are instructions to run a UNIX shell script, a type of program. All it does is to collect information about the state of the computer. That information goes nowhere unless you choose to share it. However, you should be cautious about running any kind of program (not just a shell script) at the behest of a stranger. If you have doubts, search this site for other discussions in which this procedure has been followed without any report of ill effects. If you can't satisfy yourself that the instructions are safe, don't follow them. Ask for other options.
    Here's a summary of what you need to do, if you choose to proceed:
    ☞ Copy a line of text in this window to the Clipboard.
    ☞ Paste into the window of another application.
    ☞ Wait for the test to run. It usually takes a few minutes.
    ☞ Paste the results, which will have been copied automatically, back into a reply on this page.
    The sequence is: copy, paste, wait, paste again. You don't need to copy a second time. Details follow.
    4. You may have started the computer in "safe" mode. Preferably, these steps should be taken in “normal” mode, under the conditions in which the problem is reproduced. If the system is now in safe mode and works well enough in normal mode to run the test, restart as usual. If you can only test in safe mode, do that.
    5. If you have more than one user, and the one affected by the problem is not an administrator, then please run the test twice: once while logged in as the affected user, and once as an administrator. The results may be different. The user that is created automatically on a new computer when you start it for the first time is an administrator. If you can't log in as an administrator, test as the affected user. Most personal Macs have only one user, and in that case this section doesn’t apply. Don't log in as root.
    6. The script is a single long line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, though you may not see all of it in the browser window, and you can then copy it. If you try to select the line by dragging across the part you can see, you won't get all of it.
    Triple-click anywhere in the line of text below on this page to select it:
    PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/libexec;clear;cd;p=(Software Hardware Memory Diagnostics Power FireWire Thunderbolt USB Fonts SerialATA 4 1000 25 5120 KiB/s 1024 85 \\b%% 20480 1 MB/s 25000 ports ' com.clark.\* \*dropbox \*GoogleDr\* \*k.AutoCAD\* \*k.Maya\* vidinst\* ' DYLD_INSERT_LIBRARIES\ DYLD_LIBRARY_PATH -86 ` route -n get default|awk '/e:/{print $2}' ` 25 N\\/A down up 102400 25600 recvfrom sendto CFBundleIdentifier 25 25 25 1000 MB com.apple.AirPortBaseStationAgent 464843899 51 );N5=${#p[@]};p[N5]=` networksetup -listnetworkserviceorder|awk ' NR>1 { sub(/^\([0-9]+\) /,"");n=$0;getline;} $NF=="'${p[26]}')" { sub(/.$/,"",$NF);print n;exit;} ' `;f=('\n%s: %s\n' '\n%s\n\n%s\n' '\nRAM details\n%s\n' %s\ %s '%s\n-\t%s\n' );S0() { echo ' { q=$NF+0;$NF="";u=$(NF-1);$(NF-1)="";gsub(/^ +| +$/,"");if(q>='${p[$1]}') printf("%s (UID %s) is using %s '${p[$2]}'",$0,u,q);} ';};s=(' /^ *$|CSConfigDot/d;s/^ */   /;s/[-0-9A-Fa-f]{22,}/UUID/g;s/(ochat)\.[^.]+(\..+)/\1\2/;/Shared/!s/\/Users\/[^/]+/~/g ' ' s/^ +//;5p;6p;8p;12p;' ' {sub(/^ +/,"")};NR==6;NR==13&&$2<'${p[10]} ' 1s/://;3,6d;/[my].+:/d;s/^ {4}//;H;${ g;s/\n$//;/s: [^EO]|x([^08]|02[^F]|8[^0])/p;} ' ' 5h;6{ H;g;/P/!p;} ' ' ($1~/^Cy/&&$3>'${p[11]}')||($1~/^Cond/&&$2!~/^N/) ' ' /:$/{ N;/:.+:/d;s/ *://;b0'$'\n'' };/^ *(V.+ [0N]|Man).+ /{ s/ 0x.... //;s/[()]//g;s/(.+: )(.+)/ (\2)/;H;};$b0'$'\n'' d;:0'$'\n'' x;s/\n\n//;/Apple[ ,]|Intel|SMSC/d;s/\n.*//;/\)$/p;' ' s/^.*C/C/;H;${ g;/No th|pms/!p;} ' '/= [^GO]/p' '{$1=""};1' ' /Of/!{ s/^.+is |\.//g;p;} ' ' $0&&!/ / { n++;print;} END { if(n<200) print "com.apple.";} ' ' $3~/[0-9]:[0-9]{2}$/ { gsub(/:[0-9:a-f]{14}/,"");} { print|"tail -n'${p[12]}'";} ' ' NR==2&&$4<='${p[13]}' { print $4;} ' ' END { $2/=256;if($2>='${p[15]}') print int($2) } ' ' NR!=13{next};{sub(/[+-]$/,"",$NF)};'"`S0 21 22`" 'NR!=2{next}'"`S0 37 17`" ' NR!=5||$8!~/[RW]/{next};{ $(NF-1)=$1;$NF=int($NF/10000000);for(i=1;i<=3;i++){$i="";$(NF-1-i)="";};};'"`S0 19 20`" 's:^:/:p' '/\.kext\/(Contents\/)?Info\.plist$/p' 's/^.{52}(.+) <.+/\1/p' ' /Launch[AD].+\.plist$/ { n++;print;} END { print "'${p[41]}'";if(n<200) print "/System/";} ' '/\.xpc\/(Contents\/)?Info\.plist$/p' ' NR>1&&!/0x|\.[0-9]+$|com\.apple\.launchctl\.(Aqua|Background|System)$|'${p[41]}'/ { print $3;} ' ' /\.(framew|lproj)|\):/d;/plist:|:.+(Mach|scrip)/s/:[^:]+//p ' '/root/p' ' !/\/Contents\/.+\/Contents|Applic|Autom|Frameworks/&&/Lib.+\/Info.plist$/ { n++;print;} END { if(n<1100) print "/System/";} ' '/^\/usr\/lib\/.+dylib$/p' ' /Temp|emac/ { next;} /(etc|Preferences|Launch[AD].+)\// { sub(".(/private)?","");n++;print;} END { print "'${p[41]}'.plist\t'${p[42]}'";if(n<500) print "Launch";} ' ' /\/(Contents\/.+\/Contents|Frameworks)\/|\.wdgt\/.+\.([bw]|plu)/d;p;' 's/\/(Contents\/)?Info.plist$//;p' ' { gsub("^| |\n","\\|\\|kMDItem'${p[35]}'=");sub("^...."," ") };1 ' p '{print $3"\t"$1}' 's/\'$'\t''.+//p' 's/1/On/p' '/Prox.+: [^0]/p' '$2>'${p[43]}'{$2=$2-1;print}' ' BEGIN { i="'${p[26]}'";M1='${p[16]}';M2='${p[18]}';M3='${p[31]}';M4='${p[32]}';} !/^A/ { next;} /%/ { getline;if($5<M1) a="user "$2"%, system "$4"%";} /disk0/&&$4>M2 { b=$3" ops/s, "$4" blocks/s";} $2==i { if(c) { d=$3+$4+$5+$6;next;};if($4>M3||$6>M4) c=int($4/1024)" in, "int($6/1024)" out";} END { if(a) print "CPU: "a;if(b) print "I/O: "b;if(c) print "Net: "c" (KiB/s)";if(d) print "Net errors: "d" packets/s";} ' ' /r\[0\] /&&$NF!~/^1(0|72\.(1[6-9]|2[0-9]|3[0-1])|92\.168)\./ { print $NF;exit;} ' ' !/^T/ { printf "(static)";exit;} ' '/apsd|BKAg|OpenD/!s/:.+//p' ' (/k:/&&$3!~/(255\.){3}0/ )||(/v6:/&&$2!~/A/ ) ' ' $1~"lR"&&$2<='${p[25]}';$1~"li"&&$3!~"wpa2";' ' BEGIN { FS=":";} { n=split($3,a,".");sub(/_2[01].+/,"",$3);print $2" "$3" "a[n]" "$1;b=b$1;} END { if(b) print("\n\t* Code injection");} ' ' NR!=4{next} {$NF/=10240} '"`S0 27 14`" ' END { if($3~/[0-9]/)print$3;} ' ' BEGIN { L='${p[36]}';} !/^[[:space:]]*(#.*)?$/ { l++;if(l<=L) f=f"\n   "$0;} END { F=FILENAME;if(!F) exit;if(!f) f="\n   [N/A]";"file -b "F|getline T;if(T!~/^(AS.+ (En.+ )?text$|POSIX sh.+ text ex)/) F=F" ("T")";printf("\nContents of %s\n%s\n",F,f);if(l>L) printf("\n   ...and %s more line(s)\n",l-L);} ' ' /^ +[NP].+ =/h;/^( +D.+[{]|[}])/{ g;s/.+= //p;};' 's/0/Off/p' ' END{print NR} ' ' /id: N|te: Y/{i++} END{print i} ' ' / / { print "'"${p[28]}"'";exit;};1;' '/ en/!s/\.//p' ' NR!=13{next};{sub(/[+-M]$/,"",$NF)};'"`S0 39 40`" ' $10~/\(L/&&$9!~"localhost" { sub(/.+:/,"",$9);print $1": "$9;} ' '/^ +r/s/.+"(.+)".+/\1/p' 's/(.+\.wdgt)\/(Contents\/)?Info\.plist$/\1/p' 's/^.+\/(.+)\.wdgt$/\1/p' ' /l: /{ /DVD/d;s/.+: //;b0'$'\n'' };/s: /{ /V/d;s/^ */- /;H;};$b0'$'\n'' d;:0'$'\n'' x;/APPLE [^:]+$/d;p;' ' /^find: /d;p;' );c1=(system_profiler pmset\ -g nvram fdesetup find syslog df vm_stat sar ps sudo\ crontab sudo\ iotop top pkgutil 'PlistBuddy 2>&1 -c "Print' whoami cksum kextstat launchctl sudo\ launchctl crontab 'sudo defaults read' stat lsbom mdfind ' for i in ${p[24]};do ${c1[18]} ${c2[27]} $i;done;' defaults\ read scutil sudo\ dtrace sudo\ profiles sed\ -En awk /S*/*/P*/*/*/C*/*/airport networksetup mdutil sudo\ lsof test );c2=(com.apple.loginwindow\ LoginHook '" /L*/P*/loginw*' '" L*/P*/*loginit*' 'L*/Ca*/com.ap*.Saf*/E*/* -d 1 -name In*t -exec '"${c1[14]}"' :CFBundleDisplayName" {} \;|sort|uniq' '~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \)' '.??* -path .Trash -prune -o -type d -name *.app -print -prune' :${p[35]}\" :Label\" '{/,}L*/{Con,Pref}* -type f ! -size 0 -name *.plist -exec plutil -s {} \;' "-f'%N: %l' Desktop L*/Keyc*" therm sysload boot-args status " -F '\$Time \$Message' -k Sender kernel -k Message Req 'bad |Beac|caug|dead[^bl]|FAIL|fail|GPU |hfs: Ru|inval|jnl:|last value [1-9]|n Cause: -|NVDA\(|pagin|proc: t|Roamed|rror|ssert|Thrott|tim(ed? ?|ing )o|WARN' -k Message Rne 'Goog|ksadm|SMC:' -o -k Sender fseventsd -k Message Req 'SL' " '-du -n DEV -n EDEV 1 10' 'acrx -o comm,ruid,%cpu' '-t1 10 1' '-f -pfc /var/db/r*/com.apple.*.{BS,Bas,Es,J,OSXU,Rem,up}*.bom' '{/,}L*/Lo*/Diag* -type f -regex .\*[cgh] ! -name *ag \( -exec grep -lq "^Thread c" {} \; -exec printf \* \; -o -true \) -execdir stat -f:%Sc:%N -t%F {} \;|sort -t: -k2 |tail -n'${p[38]} '-L {/{S*/,},}L*/Lau* -type f' '-L /{S*/,}L*/StartupItems -type f -exec file {} +' '-L /S*/L*/{C*/Sec*A,E}* {/,}L*/{A*d,Ca*/*/Ex,Compon,Ex,In,iTu,Keyb,Mail/B,P*P,Qu*T,Scripti,Sec,Servi,Spo,Widg}* -type f -name Info.plist' '/usr/lib -type f -name *.dylib' `awk "${s[31]}"<<<${p[23]}` "/e*/{auto,{cron,fs}tab,hosts,{[lp],sy}*.conf,pam.d/*,ssh{,d}_config,*.local} {,/usr/local}/etc/periodic/*/* /L*/P*{,/*}/com.a*.{Bo,sec*.ap}*t /S*/L*/Lau*/*t .launchd.conf" list getenv /Library/Preferences/com.apple.alf\ globalstate --proxy '-n get default' -I --dns -getdnsservers\ "${p[N5]}" -getinfo\ "${p[N5]}" -P -m\ / '' -n1 '-R -l1 -n1 -o prt -stats command,uid,prt' '--regexp --only-files --files com.apple.pkg.*|sort|uniq' -kl -l -s\ / '-R -l1 -n1 -o mem -stats command,uid,mem' -i4TCP:0-1023 com.apple.dashboard\ layer-gadgets '-d /L*/Mana*/$USER&&echo On' '-app Safari WebKitDNSPrefetchingEnabled' );N1=${#c2[@]};for j in {0..9};do c2[N1+j]=SP${p[j]}DataType;done;N2=${#c2[@]};for j in 0 1;do c2[N2+j]="-n ' syscall::'${p[33+j]}':return { @out[execname,uid]=sum(arg0) } tick-10sec { trunc(@out,1);exit(0);} '";done;l=(Restricted\ files Hidden\ apps 'Elapsed time (s)' POST Battery Safari\ extensions Bad\ plists 'High file counts' User Heat System\ load boot\ args FileVault Diagnostic\ reports Log 'Free space (MiB)' 'Swap (MiB)' Activity 'CPU per process' Login\ hook 'I/O per process' Mach\ ports kexts Daemons Agents launchd Startup\ items Admin\ access Root\ access Bundles dylibs Apps Font\ issues Inserted\ dylibs Firewall Proxies DNS TCP/IP Wi-Fi Profiles Root\ crontab User\ crontab 'Global login items' 'User login items' Spotlight Memory Listeners Widgets Parental\ Controls Prefetching SATA );N3=${#l[@]};for i in 0 1 2;do l[N3+i]=${p[5+i]};done;N4=${#l[@]};for j in 0 1;do l[N4+j]="Current ${p[29+j]}stream data";done;A0() { id -G|grep -qw 80;v[1]=$?;((v[1]==0))&&sudo true;v[2]=$?;v[3]=`date +%s`;clear >&-;date '+Start time: %T %D%n';};for i in 0 1;do eval ' A'$((1+i))'() { v=` eval "${c1[$1]} ${c2[$2]}"|'${c1[30+i]}' "${s[$3]}" `;[[ "$v" ]];};A'$((3+i))'() { v=` while read i;do [[ "$i" ]]&&eval "${c1[$1]} ${c2[$2]}" \"$i\"|'${c1[30+i]}' "${s[$3]}";done<<<"${v[$4]}" `;[[ "$v" ]];};A'$((5+i))'() { v=` while read i;do '${c1[30+i]}' "${s[$1]}" "$i";done<<<"${v[$2]}" `;[[ "$v" ]];};';done;A7(){ v=$((`date +%s`-v[3]));};B2(){ v[$1]="$v";};for i in 0 1;do eval ' B'$i'() { v=;((v['$((i+1))']==0))||{ v=No;false;};};B'$((3+i))'() { v[$2]=`'${c1[30+i]}' "${s[$3]}"<<<"${v[$1]}"`;} ';done;B5(){ v[$1]="${v[$1]}"$'\n'"${v[$2]}";};B6() { v=` paste -d: <(printf "${v[$1]}") <(printf "${v[$2]}")|awk -F: ' {printf("'"${f[$3]}"'",$1,$2)} ' `;};B7(){ v=`grep -Fv "${v[$1]}"<<<"$v"`;};C0(){ [[ "$v" ]]&&echo "$v";};C1() { [[ "$v" ]]&&printf "${f[$1]}" "${l[$2]}" "$v";};C2() { v=`echo $v`;[[ "$v" != 0 ]]&&C1 0 $1;};C3() { v=`sed -E "$s"<<<"$v"`&&C1 1 $1;};for i in 1 2;do for j in 2 3;do eval D$i$j'(){ A'$i' $1 $2 $3; C'$j' $4;};';done;done;{ A0;A2 0 $((N1+1)) 2;C0;A1 0 $N1 1;C0;B0;C2 27;B0&&! B1&&C2 28;D12 15 37 25 8;A1 0 $((N1+2)) 3;C0;D13 0 $((N1+3)) 4 3;D23 0 $((N1+4)) 5 4;D13 0 $((N1+9)) 59 50;for i in 0 1 2;do D13 0 $((N1+5+i)) 6 $((N3+i));done;D13 1 10 7 9;D13 1 11 8 10;D22 2 12 9 11;D12 3 13 10 12;D23 4 19 44 13;D23 5 14 12 14;D22 6 36 13 15;D22 7 37 14 16;D23 8 15 38 17;D22 9 16 16 18;B1&&{ D22 11 17 17 20;for i in 0 1;do D22 28 $((N2+i)) 45 $((N4+i));done;};D22 12 44 54 45;D22 12 39 15 21;A1 13 40 18;B2 4;B3 4 0 19;A3 14 6 32 0;B4 0 5 11;A1 17 41 20;B7 5;C3 22;B4 4 6 21;A3 14 7 32 6;B4 0 7 11;B3 4 0 22;A3 14 6 32 0;B4 0 8 11;B5 7 8;B1&&{ A2 19 26 23;B7 7;C3 23;};A2 18 26 23;B7 7;C3 24;A2 4 20 21;B7 6;B2 9;A4 14 7 52 9;B2 10;B6 9 10 4;C3 25;D13 4 21 24 26;B4 4 12 26;B3 4 13 27;A1 4 22 29;B7 12;B2 14;A4 14 6 52 14;B2 15;B6 14 15 4;B3 0 0 30;C3 29;A1 4 23 27;B7 13;C3 30;D13 24 24 32 31;D13 25 37 32 33;A2 23 18 28;B2 16;A2 16 25 33;B7 16;B3 0 0 34;B2 21;A6 47 21&&C0;B1&&{ D13 21 0 32 19;D13 10 42 32 40;D22 29 35 46 39;};D13 14 1 48 42;D12 34 43 53 44;D22 0 $((N1+8)) 51 32;D13 4 8 41 6;D12 26 28 35 34;D13 27 29 36 35;A2 27 32 39&&{ B2 19;A2 33 33 40;B2 20;B6 19 20 3;};C2 36;D23 33 34 42 37;B1&&D23 35 45 55 46;D23 32 31 43 38;D12 36 47 32 48;D13 20 42 32 41;D13 14 2 48 43;D13 4 5 32 1;D13 4 3 60 5;D12 26 48 49 49;B3 4 22 57;A1 26 46 56;B7 22;B3 0 0 58;C3 47;D22 4 4 50 0;D23 22 9 37 7;A7;C2 2;} 2>/dev/null|pbcopy;exit 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    7. Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Click anywhere in the Terminal window and paste by pressing command-V. The text you pasted should vanish immediately. If it doesn't, press the return key.
    8. If you see an error message in the Terminal window such as "Syntax error" or "Event not found," enter
    exec bash
    and press return. Then paste the script again.
    9. If you're logged in as an administrator, you'll be prompted for your login password. Nothing will be displayed when you type it. You will not see the usual dots in place of typed characters. Make sure caps lock is off. Type carefully and then press return. You may get a one-time warning to be careful. If you make three failed attempts to enter the password, the test will run anyway, but it will produce less information. In most cases, the difference is not important. If you don't know the password, or if you prefer not to enter it, press the key combination control-C or just press return three times at the password prompt. Again, the script will still run.
    If you're not logged in as an administrator, you won't be prompted for a password. The test will still run. It just won't do anything that requires administrator privileges.
    10. The test may take a few minutes to run, depending on how many files you have and the speed of the computer. A computer that's abnormally slow may take longer to run the test. While it's running, there will be nothing in the Terminal window and no indication of progress. Wait for the line
    [Process completed]
    to appear. If you don't see it within half an hour or so, the test probably won't complete in a reasonable time. In that case, close the Terminal window and report the results. No harm will be done.
    11. When the test is complete, quit Terminal. The results will have been copied to the Clipboard automatically. They are not shown in the Terminal window. Please don't copy anything from there. All you have to do is start a reply to this comment and then paste by pressing command-V again.
    At the top of the results, there will be a line that begins with the words "Start Time." If you don't see that, but instead see a mass of gibberish, you didn't wait for the "Process completed" message to appear in the Terminal window. Please wait for it and try again.
    If any private information, such as your name or email address, appears in the results, anonymize it before posting. Usually that won't be necessary.
    12. When you post the results, you might see the message, "You have included content in your post that is not permitted." It means that the forum software has misidentified something in the post as a violation of the rules. If that happens, please post the test results on Pastebin, then post a link here to the page you created.
    Note: This is a public forum, and others may give you advice based on the results of the test. They speak only for themselves, and I don't necessarily agree with them.
    Copyright © 2014 by Linc Davis. As the sole author of this work, I reserve all rights to it except as provided in the Use Agreement for the Apple Support Communities website ("ASC"). Readers of ASC may copy it for their own personal use. Neither the whole nor any part may be redistributed.

  • HOW to define the default language in the portal

    Normally the portal take the language of the internet explorer for user.
    I want to define a default language for all portal users in our portal, so that every user get the same default language.
    Can anyone tell me how to do this?
    We are on EP6 SP2.
    Thanks Sybille

    Hi Olivier,
    thank you for the response.
    I added
    request.mandatorylanguage=de
    request.mandatorycountry=de
    to
    request.defaultlanguage=de
    request.defaultcountry=de
    Now, I get the default language german, but when I want to changed the portal language over personalize to English, the result is nevertheless the german language.
    Can you help me again? Where can I get a documentation about this?
    I want a default language: German. Also when the Internet Explorer has a different language. But when the user select manual one of the permitted languages (English and German) over the personalize button, the language should change to the selected language. Is it possible?
    Bye Sybille

  • Looking for a more universal scripting language than AppleScript or Automator

    I want to learn a cross-platform/web scripting language to automate tasks, write scripts and with the potential to create programs and web apps.
    I am looking for something that:
    - is not a program with a GUI like Automator, iKey, Quickeys, Maestro... 
    - is more "universal" than Applescript, cross-platform
    - can be used to automate simple tasks in a simple way
    - can also be used to create more complex scripts, web apps and maybe, eventually, programs (with GUI)
    I've read about Javascript, Python, Ruby, PHP, Perl, C+, C++, Java and others, but I really don't know.
    - Java sounds pretty cool, Python too.
    - I'm not crazy about PHP or Perl, with Javascript, but some people swear by it
    - I don't know anything about C+, C++
    Does anyone have any suggestion(s)?  Please let me know if you need any more details.  Thank you.

    C, C++, Objective-C are nor scripting languages and will not help you do web pages. (Don;t know what C+ is).
    Forget Java it has lots of security problems and more and more users are disabling Java in their web browsers because of this. Developing in Java would be, in my opinion, a mistake.
    If you are doing any web works at all you will need to know some Javascript, no way around that.  But Javascript is actually not a bad language
    Note Java and Javascript are two totally separate languages that have nothing in common  but the first 4 letters of their names.
    So you are left with PHP, Perl, Python and Ruby.
    Dismissing PHP and Perl out of hand is a big mistake, They are both major players and you will run into them just about everywhere. If you are looking to do this for possible employment you will need to be familiar with them at least.
    Python and Ruby are both strong languages as well. I don't have a lot of experience with either so I can;t speak to their strengths  but  learnign either would not be a mistake.
    Knowing what your reasons are for asking this, personal use or for employment, might help refine the list some.
    regards
    Message was edited by: Frank Caggiano - Perl is also included in OS X by default. Not sure about PHP but I believe it also is. I agree TextWrangler would be a good editor for this type of work.

  • How to create a scripting language in java?

    Hello,
    All that I want to do is to create a scripting language in java. I�m familiar with javacc, jsr223 and other things but don�t know how to start. The language syntax is java 5 syntax with some change and I want to generate java source code from small scripts. In fact I don�t know how other languages (like groovy) are created.
    I hope you can show me the required steps.
    Looking forward to hear from you.
    Thanks.

    That's all, huh?
    For a start, generally when I hear "scripting language" I'm thinking interpretter, not a system which creates compiled (or compilable) code.
    I get the impression that what you're talking about is what I'd call a "preprocessor" language, some extra syntax added to java which the preprocessor renders into ordinary java.
    As far as complexity is concerned, much depends on how deeply involved the extra syntax is with the embedded ordinary Java. Does you preprocessor need to understand the java, or is it just embedded as text? How easilly identified are your preprocesor statments? It's a lot easier to do this if preprocessor lines are instantly identifiable from Java code (e.g. start with a #).
    Basically the stages are always the same;
    1) Lexical analysis i.e. picking out words, operators, numbers, quoted strings.
    2) Construct a syntax tree.
    3) Generate code (in this case Java).
    Now, in this case, some of the nodes in the syntax tree may simply be chunks of undigested Java.

Maybe you are looking for

  • Imac g4 blue screen need help!!

    hello, i have an imac g4 1,250, 20" flatpanel, it power's up i hear a chime the screen lights up but seems dark blue, there is no operating system on it i have a cd mac osx 10.1.3 first of all will this install on the imac, and if so can you please t

  • Clear RAM/temp files on system SSD disk

    Hi! 6 months ago I installed OS X 10.8.5 on a faster SSD disk on my Mac Pro from 2008. PhotoShop and other heavy applications became much faster with the new flash drive, initially. Now, it's even slower than before, for some reason. Can I clear RAM

  • IOS 6 now can't get past Terms and Conditions

    I downloaded ios 6 for my iphone 4, it had an error and deleted everything on my iphone. I reloaded all my music, apps, etc. but my contacts were also deleted. I tried Verizon ZV Contact Transfer which apparently needed an update to work. I tried to

  • Integration of SQL database with XI

    Dear All, I have a req in that I have to connect to SQL Server database to XI system then from XI to ECC. To do this what are Connection should done from DatabaseXI-ECC. I have JDBC adapter in XI.Do I need install again in XI . how we will connect SQ

  • Oracle Projects Certification

    Hi All, I am currently working as a Project Accountant, and I want to become Oracle Functional Consultant in Oracle Projects, Can please someone suggest me what is the best Certification Path to my goal, I couldn't find any direct Certification on Or