Daily Archives

Articles indexed Wednesday November 7 2012

Page 7/17 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • AS3 How to check on non transparent pixels in a bitmapdata?

    - by Opoe
    I'm still working on my window cleaning game from one of my previous questions I marked a contribution as my answer, but after all this time I can't get it to work and I have to many questions about this so I decided to ask some more about it. As a sequel on my mentioned previous question, my question to you is: How can I check whether or not a bitmapData contains non transparent pixels? Subquestion: Is this possible when the masked image is a movieclip? Shouldn't I use graphics instead? Information I have: A dirtywindow movieclip on the bottom layer and a clean window movieclip on layer 2(mc1) on the layer above. To hide the top layer(the dirty window) I assign a mask to it. Code // this creates a mask that hides the movieclip on top var mask_mc:MovieClip = new MovieClip(); addChild(mask_mc) //assign the mask to the movieclip it should 'cover' mc1.mask = mask_mc; With a brush(cursor) the player wipes of the dirt ( actualy setting the fill from the mask to transparent so the clean window appears) //add event listeners for the 'brush' brush_mc.addEventListener(MouseEvent.MOUSE_DOWN,brushDown); brush_mc.addEventListener(MouseEvent.MOUSE_UP,brushUp); //function to drag the brush over the mask function brushDown(dragging:MouseEvent):void{ dragging.currentTarget.startDrag(); MovieClip(dragging.currentTarget).addEventListener(Event.ENTER_FRAME,erase) ; mask_mc.graphics.moveTo(brush_mc.x,brush_mc.y); } //function to stop dragging the brush over the mask function brushUp(dragging:MouseEvent):void{ dragging.currentTarget.stopDrag(); MovieClip(dragging.currentTarget).removeEventListener(Event.ENTER_FRAME,erase); } //fill the mask with transparant pixels so the movieclip turns visible function erase(e:Event):void{ with(mask_mc.graphics){ beginFill(0x000000); drawRect(brush_mc.x,brush_mc.y,brush_mc.width,brush_mc.height); endFill(); } }

    Read the article

  • C# - Calling ToString() on a Reference Type

    - by nfplee
    Given two object arrays I need to compare the differences between the two (when converted to a string). I've reduced the code to the following and the problem still exists: public void Compare(object[] array1, object[] array2) { for (var i = 0; i < array1.Length; i++) { var value1 = GetStringValue(array1[i]); var value2 = GetStringValue(array2[i]); } } public string GetStringValue(object value) { return value != null && value.ToString() != string.Empty ? value.ToString() : ""; } The code executes fine no matter what object arrays I throw at it. However if one of the items in the array is a reference type then somehow the reference is updated. This causes issues later. It appears that this happens when calling ToString() against the object reference. I have updated the GetStringValue method to the following (which makes sure the object is either a value type or string) and the problem goes away. public string GetStringValue(object value) { return value != null && (value.GetType().IsValueType || value is string) && value.ToString() != string.Empty ? value.ToString() : ""; } However this is just a temporary hack as I'd like to be able to override the ToString() method on my reference types and compare them as well. I'd appreciate it if someone could explain why this is happening and offer a potential solution. Thanks

    Read the article

  • Expanding Rows for Unique Checkboxes

    - by Marc Morgan
    I was just recently given a project for my job to write a script that compares two mysql databases and print out information into an html table. Currently, I am trying to insert a checkbox by each individual's name and when selected, rows pertaining to that individual will expand underneath the person's name. I am combining javascript into my script to do this, although I really have no experience is it. The problem I am having is that when any checkbox is selected, all the rows for each individual is expanding instead of the rows pertaining only to the one individual selected. Here is the coding so far: <?php $link = mysql_connect ($server = "harris.lib.fit.edu", $username = "", $password = "") or die(mysql_error()); $db = mysql_select_db ("library-test") or die(mysql_error()); $ids = mysql_query("SELECT * FROM `ifc_studylog`") or die(mysql_error()); //not single quotes (tilda apostrophy) $x=0; $n=0; while($row = mysql_fetch_array( $ids )) { $tracksid1[$x] = $row['fitID']; $checkin[$x] = $row['checkin']; $checkout[$x] = $row['checkout']; $n++; $x++; } $names = mysql_query("SELECT * FROM `ifc_users`") or die(mysql_error()); //not single quotes (tilda apostrophy) $x=0; while($row = mysql_fetch_array( $names )) { $tracksnamefirst[$x] = $row['firstName']; $tracksnamesecond[$x] = $row['lastname']; $tracksid2[$x] = $row['fitID']; $tracksuser[$x] = $row['tracks']; $x++; } $x=0; foreach($tracksid2 as $comparename) { $chk = strval($x); ?> <script type='text/javascript' src='http://code.jquery.com/jquery-1.4.2.js'></script> <script type='text/javascript'> $(window).load(function () { $('.varx').click(function () { $('.text').toggle(this.checked); });}); </script> <?php echo '<td><input id = "<?=$chk?>" type="checkbox" class="varx" /></td>'; echo '<td align="center">'.$comparename.'</td>'; echo'<td align="center">'.$tracksnamefirst[$x].'</td>'; echo'<td align="center">'.$tracksnamesecond[$x].'</td>'; $z=0; foreach($tracksid1 as $compareid) { $HH=0; $MM =0; $SS =0; if($compareid == $comparename)// && $tracks==$tracksuser[$x]) { $SS = sprintf("%02s",(($checkout[$z]-$checkin[$z])%60)); $MM = sprintf("%02s",(($checkout[$z]-$checkin[$z])/60 %60)); $HH = sprintf("%02s",(($checkout[$z]-$checkin[$z])/3600 %24)); // echo'<td align="center">'.$HH.':'.$MM.':'.$SS.'</td>'; echo '</tr>'; echo '<tr>'; echo "<td id='txt' class='text' align='center' colspan='2' style='display:none'></td>"; echo "<td id='txt' class='text' align='center' style='display:none'>".$checkin[$z]."</td>"; echo '</tr>'; } echo '<tr>'; $z++; echo '</tr>'; } $x++; } } ?> Any Help is appreciated and sorry if I am too vague on the subject. The username and password is left off for security purposes.

    Read the article

  • Nested Resource - How to pass needed keys, and attribute to update?

    - by Jason B
    My nested resources are working for form_for updates, but I have a few toggles that I need to setup to change a status field. So I am using link_to, and accessing the url helper. link_to "toggle", edit_project_expense_path(@project[:id],expense_item[:id]) routes.rb resources :projects do resources :expenses end match '/submit_expense/:id' => 'expenses#submit_expense', :as => 'submit_expense' rake routes edit_project_expense GET /projects/:project_id/expenses/:id/edit(.:format) expenses#edit My question is: How can I also send along :approval_status = "1", with my link_to?

    Read the article

  • XNA .FBX Vertex Color Missing

    - by Alex
    When I vertex paint and export my models from Blender (or Maya) for use in my XNA 4.0 project, I somehow lose the vertex color channel for the model. I use no custom model object or content pipelines and my own shader throws me the error: The current vertex declaration does not include all the elements required by the current vertex shader. Color0 is missing. I tryed to reopen the model in other modeling tools and the vertex colors are there. What could cause the vertex color channel to not get loaded in XNA 4.0? Here's a temporary link to the FBX file(server refuses to send a fbx, so rename the .jpg file to .fbx after downloading) http://resources.gamestack.org/BananaBush.jpg

    Read the article

  • Add version control to existing SQL Server database

    - by ederbf
    I am part of a development team currently working with a database that does not have any kind of source control. We work with SQL Server 2008 R2 and have always managed the DB directly with SSMS. It now has ~340 tables and ~1600 stored procedures, plus a few triggers and views, so it is not a small DB. My goal is to have the DB under version control, so I have been reading articles, like Scott Allen's series (http://bitly.com/9cJmGR) and many old SO related questions. But I am still unable to decide on how to proceed. What I'm thinking of is to script the database schema in one file, then procedures, triggers and views in one file each. Then keep everything versioned under Mercurial. But of course, every member of the team can access SSMS and directly change the schema and procedures, with the possibility that any of us can forget to replicate those changes in the versioned files. What better options are there? And, did I forget any element worth having source control of?

    Read the article

  • Classical Round Table algorithm?

    - by user1795954
    Coins with different value are spread in circle around a round table . We can choose any coin such that for any two adjacent pair of coins , atleast one must be selected (both maybe selected too) . In such condition we have to find minimum possible value of coins selected . I have to respect time complexity so instead of using naive recursive bruteforce , i tried doing it using dynamic programming . But i get Wrong Answer - my algorithm is incorrect . If someone could suggest an algorithm to do it dynamically , i could code myself in c++ . Also maximum number of coins is 10^6 , so i think O(n) solution exists .

    Read the article

  • How can I put the results of Cursor into String[]. For more detail, please refer to the code below

    - by Hicen
    public class DisplayCustomersActivity extends Activity implements Button.OnClickListener { private SalesDB sdb; private ListView lvDCList; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.displaycustomers); lvDCList = (ListView) findViewById(R.id.lvDCList); sdb = new SalesDB(this); SQLiteDatabase db = sdb.getReadableDatabase(); Cursor results = db.query(sdb.TABLE_CUSTOMER, new String[] {sdb.CUSTOMER_ID, sdb.CUSTOMER_NAME, sdb.CUSTOMER_GENDER}, null, null, null, null, null); int resultCount = results.getCount(); String[] customers = new String[resultCount]; if (resultCount == 0 || !results.moveToFirst()) { customers = null; } else { for(int i=0; i<resultCount; i++) { //Process results to String array here ... ... results.moveToNext(); } } }

    Read the article

  • Array from HTML forms - Internal Server Error

    - by user1392411
    I try to make a requestform for our school. But if I transmit this form I get a "Internal Server Error". I searched but I found nothing like that. Also I don't get a only this error message "Internal Server Error", nothing more. Any ideas why? <!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> <meta name="description" content=""> <link rel="stylesheet" href="../css/normalize.css" /> <link rel="stylesheet" href="../css/bestellformular.css" /> <!-- HTML 5 in Internet Explorer 9 und kleiner aktivieren --> <!--[if lt IE 9]> <script type="textt/javascript" src="js/html5shiv.js"></script> <![endif]--> </head> <body> <section id="head"> </section> <form action="../php/einlesen.php" method="post"> <section id="body"> <h1>Bestellung</h1> <table> <colgroup> <col width="10%"> <col width="80%"> <col width="10%"> </colgroup> <tr> <th> Artikel-Nr. </th> <th> Artikel </th> <th> Menge </th> </tr> <tr> <td> <input type="number" placeholder="Artikel-Nr." name="articelnr[]" required /> </td> <td> <input type="text" placeholder="Name des Artikels" name="articelname[]" required /> </td> <td> <input type="number" placeholder="Menge" name="quantity[]" required /> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> <tr> <td> <input type="number" name="articelnr[]" /> </td> <td> <input type="text" name="articelname[]" /> </td> <td> <input type="number" name="quantity[]"/> </td> </tr> </table> </section> <section id="info"> <div class="left"> <hr /> <p> Kundennummer <input type="text" /> </p> </div> <div class="right"> <table> <tr> <td>Firma</td> <td><input type="text" name="company"required /></td> </tr> <tr> <td>Ort, PLZ</td> <td><input type="text" name="place" required /></td> <td><input type="number" name="plz" class="number" required /></td> </tr> <tr> <td>Straße, Nr.</td> <td><input type="text" name="street"required /></td> <td><input type="number" name="streetnr" class="number" required /></td> </tr> <tr> <td>Telefon</td> <td><input type="tel" name="tel" required /></td> </tr> <tr> <td>Fax</td> <td><input type="text" name="fax" required /></td> </tr> <tr> <td>E-Mail</td> <td><input type="email" name="email" required /></td> </tr> <tr> <td>Datum</td> <td><input type="date" name="date" required placeholder="tt.mm.jj"/></td> </tr> </table> </div> </section> <section id="submit"> <input type="checkbox" name="agb" required /> Ich habe die <a href="../docs/agb.pdf">AGB</a> gelesen und akzeptiere diese. <input type="submit" value="Bestellung Abschicken"/> </section> </form> <section id="footer"> <hr /> </section> </body> </html> Any Ideas why? The data is sent to a yet empty PHP document. The bracelets in the name tag are used to get an array. My PHP version is 5.3.8

    Read the article

  • Read a file to multiple array byte[]

    - by hankol
    I have an encryption algorithm (AES) that accepts file converted to array byte and encrypt it. Since I am going to process a very big size files, the JVM may go out of memory. I am planing to read the files in multiple array byte. each containing some part of the file. Then I teratively feed the algorithm. Finally merge them to produce encrypted file. So my question is: there any way to read a file part by part to multiple array byte? I thought I can use the following to read the file to array byte: IOUtils.toByteArray(InputStream input). And then split the array into multiple bytes using: Arrays.copyOfRange(). But I am afraid that the first code that reads file to byte will make the JVM to go out of memory. any suggestion please ? thanks

    Read the article

  • Auto Increment feature of SQL Server

    - by Rahul Tripathi
    I have created a table named as ABC. It has three columns which are as follows:- The column number_pk (int) is the primary key of my table in which I have made the auto increment feature on for that column. Now I have deleted two rows from that table say Number_pk= 5 and Number_pk =6. The table which I get now is like this:- Now if I again enter two new rows in this table with the same value I get the two new Number_pk starting from 7 and 8 i.e, My question is that what is the logic behind this since I have deleted the two rows from the table. I know that a simple answer is because I have set the auto increment on for the primary key of my table. But I want to know is there any way that I can insert the two new entries starting from the last Number_pk without changing the design of my table? And how the SQL Server manage this record since I have deleted the rows from the database??

    Read the article

  • How can I change the default GECOS fields under Ubuntu?

    - by Arkevius
    I was wondering if there was a way to change the default GECOS fields on a user. Now, I don't mean change their name, number, shell, etc. What I mean is change the field-type/name itself. Like, for example, since I never use the "Work-Phone" field, could I say, rename it to something else, like "Address" ? Also, is it possible to add completely new field entries as well? All I could really find through searching is how to change the fields that are already set.

    Read the article

  • LocalStorage storing multiple div hides

    - by Jesse Toxik
    I am using a simple code to hide multiple divs if the link to hide them is clicked. On one of them I have local storage set-up to remember of the div is hidden or not. The thing is this. How can I write a code to make local storage remember the hidden state of multiple divs WITHOUT having to put localstorage.setItem for each individual div. Is it possible to store an array with the div ids and their display set to true or false to decide if the page should show them or not? **********EDITED************ function ShowHide(id) { if(document.getElementById(id).style.display = '') { document.getElementById(id).style.display = 'none'; } else if (document.getElementById(id).style.display = 'none') { document.getElementById(id).style.display = ''; }

    Read the article

  • Cannot connect to *.dbf file through JDBC drivers

    - by leodali
    i'm trying to connect to *.dbf (dBase III) file on my Java application, running on a Windows Server 2003 system. I'm encountering this error and I cannot really understand the meaning (sources for OdbcJdbc.java seems to be unavailable): [Microsoft][ODBC dBase driver] '(unknown)' is not a valid path error Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String database = "jdbc:odbc:DRIVER={Microsoft dBase Driver(*.dbf)};DBQ=D:\\dbNeri\\CARISTAT;"; Connection conn = DriverManager.getConnection(database); Statement s = conn.createStatement(); String selTable = "SELECT * FROM CARISTAT"; Does it exists a JDBC driver able to connect to dBase files or do I have to import external libraries to do the magic? Thanks in advance for your help!

    Read the article

  • Using the HTML 'label' tag with radio buttons

    - by GlenPeterson
    Does the label tag work with radio buttons? If so, how do you use it? I have a form that displays like this: First Name: (text field) Hair Color: (color drop-down) Description: (text area) Salutation: (radio buttons for Mr., Mrs., Miss) I'd like to use the label tag for each label in the left column to define its connection to the appropriate control in the right column. But If I use a radio button, the spec seems to indicate that suddenly the actual "Salutation" label for the form control no longer belongs in the label tag, but rather the options "Mr., Mrs., etc." go in the label tag. I've always been a fan of accessibility and the semantic web, but this design doesn't make sense to me. The label tag explicitly declares labels. The option tag selection options. How do you declare a label on the actual label for a set of radio buttons? UPDATE: Here is an example with code: <tr><th><label for"sc">Status:</label></th> <td>&#160;</td> <td><select name="statusCode" id="sc"> <option value="ON_TIME">On Time</option> <option value="LATE">Late</option> </select></td></tr> This works great. But unlike other form controls, radio buttons have a separate field for each value: <tr><th align="right"><label for="???">Activity:</label></th> <td>&#160;</td> <td align="left"><input type="radio" name="es" value="" id="es0" /> Active &#160; <input type="radio" name="es" value="ON_TIME" checked="checked" id="es1" /> Completed on Time &#160; <input type="radio" name="es" value="LATE" id="es2" /> Completed Late &#160; <input type="radio" name="es" value="CANCELED" id="es3" /> Canceled</td> </tr> What to do?

    Read the article

  • Changing JTextArea to JScrollPane Causes it to not be visible

    - by user1806716
    I am having an issue with JScrollPanes and JTextArea objects and getting them to work together. If I just add a JTextArea to my JPanel, it works fine and shows up where I tell it to. However, if I change the contentPane.add(textArea) to contentPane.add(new JScrollPane(textArea)), the textArea is not longer visible and there is no sign of the textarea either. Here is my code: public docToolGUI() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 611, 487); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); textField = new JTextField(); textField.setBounds(253, 323, 86, 20); contentPane.add(textField); textField.setColumns(10); JLabel lblEnterRootDirectory = new JLabel("Enter Root Directory"); lblEnterRootDirectory.setBounds(253, 293, 127, 20); contentPane.add(lblEnterRootDirectory); JButton btnGo = new JButton("Go"); btnGo.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { new ToolWorker().execute(); } }); btnGo.setBounds(253, 361, 89, 23); contentPane.add(btnGo); textArea = new JTextArea(); textArea.setWrapStyleWord(true); textArea.setEditable(false); textArea.setBounds(25, 11, 560, 276); contentPane.add(new JScrollPane(textArea)); }

    Read the article

  • Data Structure / Hash Function to link Sets of Ints to Value

    - by Gaminic
    Given n integer id's, I wish to link all possible sets of up to k id's to a constant value. What I'm looking for is a way to translate sets (e.g. {1, 5}, {1, 3, 5} and {1, 2, 3, 4, 5, 6, 7}) to unique values. Guarantees: n < 100 and k < 10 (again: set sizes will range in [1, k]). The order of id's doesn't matter: {1, 5} == {5, 1}. All combinations are possible, but some may be excluded. All sets and values are constant and made only once. No deletes or inserts, no value updates. Once generated, the only operations taking place will be look-ups. Look-ups will be frequent and one-directional (given set, look up value). There is no need to sort (or otherwise organize) the values. Additionally, it would be nice (but not obligatory) if "neighboring" sets (drop one id, add one id, swap one id, etc) are easy to reach, as well as "all sets that include at least this set". Any ideas?

    Read the article

  • Template neglects const (why?)

    - by Gabriel
    Does somebody know, why this compiles?? template< typename TBufferTypeFront, typename TBufferTypeBack = TBufferTypeFront> class FrontBackBuffer{ public: FrontBackBuffer( const TBufferTypeFront front, const TBufferTypeBack back): ////const reference assigned to reference??? m_Front(front), m_Back(back) { }; ~FrontBackBuffer() {}; TBufferTypeFront m_Front; ///< The front buffer TBufferTypeBack m_Back; ///< The back buffer }; int main(){ int b; int a; FrontBackBuffer<int&,int&> buffer(a,b); // buffer.m_Back = 33; buffer.m_Front = 55; } I compile with GCC 4.4. Why does it even let me compile this? Shouldn't there be an error that I cannot assign a const reference to a non-const reference?

    Read the article

  • switch from glOrtho to gluPerspective

    - by Knitex
    I have a car draw at (0,0) and some obstacles set up but right now my main concern is switching from glPerspective to glOrtho and vice-versa. All that i get when i switch from perspective to ortho is a black screen. void myinit(){ glClearColor(0.0,0.0,0.0,0.0); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60,ww/wh,1,100); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(-5,5,3,backcarx,topcarx,0,0,0,1); } void menu(int id){ /*menu selects if you want to view it in ortho or perspective*/ if(id == 1){ glClear(GL_DEPTH_BUFFER_BIT); glViewport(0,0,ww,wh); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-2,100,-2,100,-1,1); glMatrixMode(GL_MODELVIEW); glutPostRedisplay(); } if(id == 2){ glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(60,ww/wh,1,100); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); viewx = backcarx - 10; viewy = backcary - 10; gluLookAt(viewx,viewy,viewz,backcarx,topcarx,0,0,0,1); } } i've tried using the clear depth buffer and still doesnt work.

    Read the article

  • Hive NR map progress inconsistent and regurlarly restart from 0%

    - by user92471
    I have a Yarn MR (with two ec2 instances to mapreduce) job on a dataset of approximately a thousand avro records, and the map phase is behaving erratically. See the progress below. Of course i checked the logs on resourcemanager and nodemanagers and saw nothing suspicious, but these logs are too verbose What is going on there ? hive> select * from nikon where qs_cs_s_aid='VIEW' limit 10; Total MapReduce jobs = 1 Launching Job 1 out of 1 Number of reduce tasks is set to 0 since there's no reduce operator Starting Job = job_1352281315350_0020, Tracking URL = http://blabla.ec2.internal:8088/proxy/application_1352281315350_0020/ Kill Command = /usr/lib/hadoop/bin/hadoop job -Dmapred.job.tracker=blabla.com:8032 -kill job_1352281315350_0020 Hadoop job information for Stage-1: number of mappers: 4; number of reducers: 0 2012-11-07 11:14:40,976 Stage-1 map = 0%, reduce = 0% 2012-11-07 11:15:06,136 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 10.38 sec 2012-11-07 11:15:07,253 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 12.18 sec 2012-11-07 11:15:08,371 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 12.18 sec 2012-11-07 11:15:09,491 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 12.18 sec 2012-11-07 11:15:10,643 Stage-1 map = 2%, reduce = 0%, Cumulative CPU 15.42 sec (...) 2012-11-07 11:15:35,441 Stage-1 map = 28%, reduce = 0%, Cumulative CPU 37.77 sec 2012-11-07 11:15:36,486 Stage-1 map = 28%, reduce = 0%, Cumulative CPU 37.77 sec here restart at 16% ? 2012-11-07 11:15:37,692 Stage-1 map = 16%, reduce = 0%, Cumulative CPU 21.15 sec 2012-11-07 11:15:38,815 Stage-1 map = 16%, reduce = 0%, Cumulative CPU 21.15 sec 2012-11-07 11:15:39,865 Stage-1 map = 16%, reduce = 0%, Cumulative CPU 21.15 sec 2012-11-07 11:15:41,064 Stage-1 map = 18%, reduce = 0%, Cumulative CPU 22.4 sec 2012-11-07 11:15:42,181 Stage-1 map = 18%, reduce = 0%, Cumulative CPU 22.4 sec 2012-11-07 11:15:43,299 Stage-1 map = 18%, reduce = 0%, Cumulative CPU 22.4 sec here restart at 0% ? 2012-11-07 11:15:44,418 Stage-1 map = 0%, reduce = 0% 2012-11-07 11:16:02,076 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 6.86 sec 2012-11-07 11:16:03,193 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 6.86 sec 2012-11-07 11:16:04,259 Stage-1 map = 2%, reduce = 0%, Cumulative CPU 8.45 sec (...) 2012-11-07 11:16:31,291 Stage-1 map = 22%, reduce = 0%, Cumulative CPU 35.34 sec 2012-11-07 11:16:32,414 Stage-1 map = 26%, reduce = 0%, Cumulative CPU 37.93 sec here restart at 11% ? 2012-11-07 11:16:33,459 Stage-1 map = 11%, reduce = 0%, Cumulative CPU 19.53 sec 2012-11-07 11:16:34,507 Stage-1 map = 11%, reduce = 0%, Cumulative CPU 19.53 sec 2012-11-07 11:16:35,731 Stage-1 map = 13%, reduce = 0%, Cumulative CPU 21.47 sec (...) 2012-11-07 11:16:46,839 Stage-1 map = 17%, reduce = 0%, Cumulative CPU 24.14 sec here restart at 0% ? 2012-11-07 11:16:47,939 Stage-1 map = 0%, reduce = 0% 2012-11-07 11:16:56,653 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 7.54 sec 2012-11-07 11:16:57,814 Stage-1 map = 1%, reduce = 0%, Cumulative CPU 7.54 sec (...) Needless to say the job crashes after some time with an Error: java.io.IOException: java.io.IOException: java.lang.ArrayIndexOutOfBoundsException: -56

    Read the article

  • Get Confirm value in vb.net

    - by user1805641
    I have a hidden asp Button in a Repeater. In the VB.NET code behind I use the Rerpeater_ItemCommand to get the click event within the Repeater. There's a check if user is already recording a project. If yes and he wants to start a new one, a confirm box should appear asking "Are you sure?" How can I access the click value from confirm? <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand"> <ItemTemplate> <div class="tile user_view user_<%# Eval("employeeName") %>"> <div class="tilesheight"></div> <div class="element"> <asp:Button ID="Button1" CssClass="hiddenbutton" runat="server" /> Index: <asp:Label ID="Label1" runat="server" Text='<%# Eval("index") %>' /><br /> <hr class="hr" /> customer: <asp:Label ID="CustomerLabel" runat="server" Text='<%# Eval("customer") %>' /><br /> <hr class ="hr" /> order: <asp:Label ID="OrderNoLabel" runat="server" Text='<%# Eval("orderNo") %>' /><br /> <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("description") %>' /><br /> <hr class="hr" /> </div> </div> </ItemTemplate> </asp:Repeater> code behind: If empRecs.Contains(projects.Item(index.Text).employeeID) Then 'Catch index of recording order i = empRecs.IndexOf(projects.Item(index.Text).employeeID) Page.ClientScript.RegisterStartupScript(Me.GetType, "confirm", "confirm('Order " & empRecs(i + 2) & " already recording. Would you like to start a new one?')",True) 'If users clicks ok insertData() End If Other solutions are using the Click Event and a hidden field. But the problem is, I don't want the confirmbox to appear every time the button is clicked. Only when empRecs conatins an employee. Thanks for helping

    Read the article

  • how to display my list with n amount on each line in Python

    - by user1786698
    im trying to display my list with 7 states on each line here is what i have so far, but it displays as one long string of all the states with quotes around each state. I forgot to mention that this is for my CS class and we havent learned iter yet so we not allowed to use it. the only hint i was given was to to turn STATE_LIST into a string then use '\n' to break it up state = str(STATE_LIST) displaystates = Text(Point(WINDOW_WIDTH/2, WINDOW_HEIGHT/2), state.split('\n')) displaystates.draw(win) and STATE_LIST looks like this STATE_VOTES = { "AL" : 9, # Alabama "AK" : 3, # Alaska "AZ" : 11, # Arizona "AR" : 6, # Arkansas "CA" : 55, # California "CO" : 9, # Colorado "CT" : 7, # Connecticut "DE" : 3, # Delaware "DC" : 3, # Washington DC "FL" : 29, # Florida "GA" : 16, # Georgia "HI" : 4, # Hawaii "ID" : 4, # Idaho "IL" : 20, # Illinois "IN" : 11, # Indiana "IA" : 6, # Iowa "KS" : 6, # Kansas "KY" : 8, # Kentucky "LA" : 8, # Louisiana "ME" : 4, # Maine "MD" : 10, # Maryland "MA" : 11, # Massachusetts "MI" : 16, # Michigan "MN" : 10, # Minnesota "MS" : 6, # Mississippi "MO" : 10, # Missouri "MT" : 3, # Montana "NE" : 5, # Nebraska "NV" : 6, # Nevada "NH" : 4, # New Hampshire "NJ" : 14, # New Jersey "NM" : 5, # New Mexico "NY" : 29, # New York "NC" : 15, # North Carolina "ND" : 3, # North Dakota "OH" : 18, # Ohio "OK" : 7, # Oklahoma "OR" : 7, # Oregon "PA" : 20, # Pennsylvania "RI" : 4, # Rhode Island "SC" : 9, # South Carolina "SD" : 3, # South Dakota "TN" : 11, # Tennessee "TX" : 38, # Texas "UT" : 6, # Utah "VT" : 3, # Vermont "VA" : 13, # Virginia "WA" : 12, # Washington "WV" : 5, # West Virginia "WI" : 10, # Wisconsin "WY" : 3 # Wyoming } STATE_LIST = sorted(list(STATE_VOTES.keys())) I am trying to get it to look somewhat like this

    Read the article

  • Winforms controls and "generic" events handlers. How can I do this?

    - by Yanko Hernández Alvarez
    In the demo of the ObjectListView control there is this code (in the "Complex Example" tab page) to allow for a custom editor (a ComboBox) (Adapted to my case and edited for clarity): EventHandler CurrentEH; private void ObjectListView_CellEditStarting(object sender, CellEditEventArgs e) { if (e.Column == SomeCol) { ISomeInterface M = (e.RowObject as ObjectListView1Row).SomeObject; //(1) ComboBox cb = new ComboBox(); cb.Bounds = e.CellBounds; cb.DropDownStyle = ComboBoxStyle.DropDownList; cb.DataSource = ISomeOtherObjectCollection; cb.DisplayMember = "propertyName"; cb.DataBindings.Add("SelectedItem", M, "ISomeOtherObject", false, DataSourceUpdateMode.Never); e.Control = cb; cb.SelectedIndexChanged += CurrentEH = (object sender2, EventArgs e2) => M.ISomeOtherObject = (ISomeOtherObject)((ComboBox)sender2).SelectedValue; //(2) } } private void ObjectListView_CellEditFinishing(object sender, CellEditEventArgs e) { if (e.Column == SomeCol) { // Stop listening for change events ((ComboBox)e.Control).SelectedIndexChanged -= CurrentEH; // Any updating will have been down in the SelectedIndexChanged // event handler. // Here we simply make the list redraw the involved ListViewItem ((ObjectListView)sender).RefreshItem(e.ListViewItem); // We have updated the model object, so we cancel the auto update e.Cancel = true; } } I have too many other columns with combo editors inside objectlistviews to use a copy& paste strategy (besides, copy&paste is a serious source of bugs), so I tried to parameterize the code to keep the code duplication to a minimum. ObjectListView_CellEditFinishing is a piece of cake: HashSet<OLVColumn> cbColumns = new HashSet<OLVColumn> (new OLVColumn[] { SomeCol, SomeCol2, ...}; private void ObjectListView_CellEditFinishing(object sender, CellEditEventArgs e) { if (cbColumns.Contains(e.Column)) ... but ObjectListView_CellEditStarting is the problematic. I guess in CellEditStarting I will have to discriminate each case separately: private void ObjectListView_CellEditStarting(object sender, CellEditEventArgs e) { if (e.Column == SomeCol) // code to create the combo, put the correct list as the datasource, etc. else if (e.Column == SomeOtherCol) // code to create the combo, put the correct list as the datasource, etc. And so on. But how can I parameterize the "code to create the combo, put the correct list as the datasource, etc."? Problem lines are (1) Get SomeObject. the property NAME varies. (2) Set ISomeOtherObject, the property name varies too. The types vary too, but I can cover those cases with a generic method combined with a not so "typesafe" API (for instance, the cb.DataBindings.Add and cb.DataSource both use an object) Reflection? more lambdas? Any ideas? Any other way to do the same? PS: I want to be able to do something like this: private void ObjectListView_CellEditStarting(object sender, CellEditEventArgs e) { if (e.Column == SomeCol) SetUpCombo<ISomeInterface>(ISomeOtherObjectCollection, "propertyName", SomeObject, ISomeOtherObject); else if (e.Column == SomeOtherCol) SetUpCombo<ISomeInterface2>(ISomeOtherObject2Collection, "propertyName2", SomeObject2 ISomeOtherObject2); and so on. Or something like that. I know, parameters SomeObject and ISomeOtherObject are not real parameters per see, but you get the idea of what I want. I want not to repeat the same code skeleton again and again and again. One solution would be "preprocessor generics" like C's DEFINE, but I don't thing c# has something like that. So, does anyone have some alternate ideas to solve this?

    Read the article

  • how do I use svn in eclipse?

    - by firesoul453
    I'm trying to create my own SVN server so I can work on my android projects everywhere. I have an VPS and I installed svn, I set up the directory and added a use to the password file. After a while I finally managed to create a project with svn import -m "initial import" . file:///home/admin/svn/reposvn/testp/trunk But I don't understand? Can I only import project that are on my server? If thats the case I could just use ftp and not worry about svn at all. What I would like to do is have a url to use in things like eclipse. my subdomain points to /home/admin/svn/ and then I typed in /reposvn So I tried the urls http://(mydomain)/reposvn and svn://(mydomain)/reposvn but neither worked Says Detected a cycle while processing the operation svn: Redirected cycle detected for URL .... I also set up daemon or whatever with svnserve -d any ideas? Thanks!

    Read the article

  • Redis version on Cloudbees is out of date?

    - by Alan Krueger
    I'm setting up an OSS build in Cloudbees with /usr/sbin/redis-server being started as one of the build tasks: + /usr/sbin/redis-server [204] 04 Nov 03:52:58 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf' [204] 04 Nov 03:52:58 * Server started, Redis version 2.0.3 The (Redis site)[http://redis.io/download] shows 2.6.2 to be the current version and 2.4.17 as "legacy". On the extended downloads page, version 2.0.3 is deprecated. Am I launching it the wrong server executable, or are there plans to support a more recent version of Redis?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >