Search Results

Search found 2650 results on 106 pages for 'pm 77 1'.

Page 47/106 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • Offset time for DST in one specific timezone using JavaScript

    - by Shannon
    I need to offset the time by an hour if it's currently DST in the Pacific Time Zone. How can I determine the current daylight savings status of the Pacific Time Zone, regardless of the user's local timezone? Here's what I have so far. "dst" in line 4 is just a placeholder for a function that would tell me if daylight savings time is active in that zone. function checkTime() { var d = new Date(); var hour = d.getUTCHours(); var offset = dst ? 7 : 8; // is pacific time currently in daylight savings? // is it currently 6 AM, 2 PM, or 10 PM? if (hour === ((6 + offset) % 24) || hour === ((14 + offset) % 24) || hour === ((22 + offset) % 24)) { // do stuff } } checkTime();

    Read the article

  • Showing renames in hg log?

    - by Ryan Thompson
    I know that Mercurial can track renames of files, but how do I get it to show me renames instead of adds/removes when I do hg log? For instance, instead of: A bin/extract-csv-column.pl A bin/find-mirna-binding.pl A bin/xls2csv-separate-sheets.pl A lib/Text/CSV/Euclid.pm R src/extract-csv-column.pl R src/find-mirna-binding.pl R src/modules/Text/CSV/Euclid.pm R src/xls2csv-separate-sheets.pl I want some indication that four files have been moved. I think I read somewhere that the output is like this to preserve backward-compatibility with something-or-other, but I'm not worried about that.

    Read the article

  • use Ghostscript to convert pcl to postscript

    - by Bryon
    So I want to use Ghostscript to convert files that are created in pcl format to postscript. That's the gist of my problem. I am simply trying to run it on the command line, but in the final stage it will have to be run on a lp command like lp -d < gs something something GPL Ghostscript 9.00 (2010-09-14) I will be running this on a solaris 10 server but I believe any unix system should work similar. bash-3.00# /usr/local/bin/gs -sDEVICE=pswrite -dLanguageLevel=1 -dNOPAUSE -dBATCH -dSAFER -sOutputFile=output.ps cms-form.pcl GPL Ghostscript 9.00 (2010-09-14) Copyright (C) 2010 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Error: /undefined in &k2G-210z100u0l6d0e63fa0V Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop 1893 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:1154/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Current file position is 30 GPL Ghostscript 9.00: Unrecoverable error, exit code 1

    Read the article

  • camera picturecallback intent not work

    - by Simon
    After I take the photo, the program automatically goes back like onBackPressed(). When I remove the putExtra, the intent runs. When I put startActivity() after takePicture(), it transfers null data.... I just want to put the image data to another activity to have other use. How can it be achieved? private PictureCallback picture = new PictureCallback(){ @Override public void onPictureTaken(byte[] data, Camera camera) { // TODO Auto-generated method stub Intent intent = new Intent(CameraFilming.this, PhotoPreview.class); intent.putExtra("imageByte", data); //Picture data transfer to next activity startActivity(intent); } }; //take photo by pressing button private class captureBtnListener implements View.OnClickListener{ @Override public void onClick(View v){ capture.setOnClickListener(null); CountDownTimer timer = new CountDownTimer(10000, 1000){ @Override public void onTick(long millisUntilFinished) { // TODO Auto-generated method stub countdown.setText(millisUntilFinished/1000+""); } @Override public void onFinish() { // TODO Auto-generated method stub countdown.setText("0"); camera.takePicture(null, null, picture); } }; timer.start(); } } public class PhotoPreview extends Activity{ private RelativeLayout layout; private ImageView overlay, texture, face1, face2; @Override public void onCreate (Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.photo_preview); layout = (RelativeLayout)findViewById(R.id.preview_layout); byte[] data = getIntent().getByteArrayExtra("imageByte"); if (data == null){ Log.d("PhotoPreview", "no image data"); finish(); } Bitmap rawPhotoBitmap = BitmapFactory.decodeByteArray(data, 0, data.length); ImageProcess imgProcess = new ImageProcess(this); Bitmap resizedFace = imgProcess.scaleAccordingWidth(imgProcess.cropImage(rawPhotoBitmap, 840, 125, 440, 560), 77); face1 = new ImageView(this); face1.setImageBitmap(resizedFace); Log.d("testing", "testing"); } }

    Read the article

  • Trouble with ASP.NET MVC auto-scaffolder template

    - by DanM
    I'm trying to write an auto-scaffolder template for Index views. I'd like to be able to pass in a collection of models or view-models (e.g., IQueryable<MyViewModel>) and get back an HTML table that uses the DisplayName attribute for the headings (th elements) and Html.Display(propertyName) for the cells (td elements). Each row should correspond to one item in the collection. Here's what I have so far: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <% var items = (IQueryable<TestProj.ViewModels.TestViewModel>)Model; // How do I make this generic? var properties = items.First().GetMetadata().Properties .Where(pm => pm.ShowForDisplay && !ViewData.TemplateInfo.Visited(pm)); %> <table> <tr> <% foreach(var property in properties) { %> <th> <%= property.DisplayName %> </th> <% } %> </tr> <% foreach(var item in items) { HtmlHelper itemHtml = ????; // What should I put in place of "????"? %> <tr> <% foreach(var property in properties) { %> <td> <%= itemHtml.Display(property.DisplayName) %> </td> <% } %> </tr> <% } %> </table> Two problems with this: I'd like it to be generic. So, I'd like to replace var items = (IQueryable<TestProj.ViewModels.TestViewModel>)Model; with var items = (IQueryable<T>)Model; or something to that effect. A property Html is automatically created for me when the view is created, but this HtmlHelper applies to the whole collection. I need to somehow create an itemHtml object that applies just to the current item in the foreach loop. I'm not sure how to do this, however, because the constructors for HtmlHelper don't take a Model object. How do I solve these two problems?

    Read the article

  • How to match a period in Regex coming from Firefox browser?

    - by Dr. Zim
    I have the following C# code which should match a quantity / $ price string like "4/$3.99". It works all day long until we use it against a string returned from Firefox Browser. 77.77 becomes 77 (dropping the .77 cents). var matches = Regex.Match(_priceText, @"^\s?((?<qty>\d+)\s?/)?\s?[$]?\s?(?<price>[0-9]?\.?[0-9]?[0-9]?)"); if( matches.Success) { if (!Decimal.TryParse(matches.Groups["price"].Value, out this._price)) this._price = 0.0m; if (!Int32.TryParse(matches.Groups["qty"].Value, out this._qty)) this._qty = (this._price > 0 ? 1 : 0); else if (this._price > 0 && this._qty == 0) this._qty = 1; } Any idea why the period wouldn't match coming from a Firefox string, but the C# string matches? There isn't any special about the Firefox we used. It's a plain Jane 1252 code page download right off the Firefox site. The computer's local settings are unaltered North American, etc. We have two different computers showing the same effects. It's Firefox 3.6.4, nothing fancy or beta.

    Read the article

  • C#:multicolumn sorting of datagrid view

    - by Bi
    I have a datagridview in a windows form with 3 columns: Serial number, Name and Date-Time. The Name column will always have either of the two values: "name1" or "name2". I need to sort these columns such that the grid displays all the rows with name values in a specific order (first display all the "name1" rows and then all the "name2" rows). Within the "name1" rows, I want the rows to be sorted by the Date-Time. Please note programmatically, all the 3 columns are strings. For example, if I have the rows: 01 |Name1 | 2010-05-05 10:00 PM 02 |Name2 | 2010-05-02 08:00 AM 03 |Name2 | 2010-05-01 08:00 AM 04 |Name1 | 2010-05-01 11:00 AM 05 |Name1 | 2010-05-04 07:00 AM needs to be sorted as 04 |Name1 | 2010-05-01 11:00 AM 05 |Name1 | 2010-05-04 07:00 AM 01 |Name1 | 2010-05-05 10:00 PM 03 |Name2 | 2010-05-01 08:00 AM 02 |Name2 | 2010-05-02 08:00 AM I am not sure how to go about using the below: myGrid.Sort(.....,ListSortDirection.Ascending)

    Read the article

  • C#: multicolumn sorting of DataGridView

    - by Bi
    I have a DataGridView in a windows form with 3 columns: Serial number, Name, and Date-Time. The Name column will always have either of the two values: "name1" or "name2". I need to sort these columns such that the grid displays all the rows with name values in a specific order (first display all the "name1" rows and then all the "name2" rows). Within the "name1" rows, I want the rows to be sorted by the Date-Time. Please note programmatically, all the 3 columns are strings. For example, if I have the rows: 01 |Name1 | 2010-05-05 10:00 PM 02 |Name2 | 2010-05-02 08:00 AM 03 |Name2 | 2010-05-01 08:00 AM 04 |Name1 | 2010-05-01 11:00 AM 05 |Name1 | 2010-05-04 07:00 AM needs to be sorted as 04 |Name1 | 2010-05-01 11:00 AM 05 |Name1 | 2010-05-04 07:00 AM 01 |Name1 | 2010-05-05 10:00 PM 03 |Name2 | 2010-05-01 08:00 AM 02 |Name2 | 2010-05-02 08:00 AM I am not sure how to go about using the below: myGrid.Sort(.....,ListSortDirection.Ascending)

    Read the article

  • Printing saved HTML to jsp keeps getting corrupted

    - by JWL
    I have a JAVA object where I save a HTML string value I call message. The saved data looks like the below, You have received a new <a href='' onclick='return popupRentalView('5282053859835904');'>Rental Request 5282053859835904</a>. Please view your open orders. But when printed to the JSP file and displayed at runtime using <%=pm.getMessage()%> or <%out.print(pm.getMessage());%> The actual html code comes out all messed up, You have received a new <a 5282053859835904');'="" onclick="return popupRentalView(" href="">Rental Request 5282053859835904</a> . Please view your open orders. Any thoughts on why the displayed string does not match the saved string? JAVA code for saving is note.setMessage("You have received a new <a href=\"\" onclick='return popupRentalView('" + requestId + "');'> Rental Request " + requestId + "</a>. Please view your open orders.");

    Read the article

  • Best practice to hide/encrypt email adress in webpage

    - by Sebi
    I couldn't find a similar question, that's why here it is: Whats the best way to hide or encrypt an email link in a website, so that a crawler can't read it, but the user can nevertheless click it? I don't want to conufse the users by typing the email like this: john (at) mail.com or similar ways. (and i think this kind of links can nevertheless read by crawlers?) I also tried things like that: <script>// <![CDATA[eval(unescape('%76%61%72%20%73%3D%27%61%6D%6C%69%6F%74%72%3A%62%61%40%65%64%61%6E%6F%6C%2E%69%27%3B%76%61%72%20%72%3D%27%27%3B%66%6F%72%28%76%61%72%20%69%3D%30%3B%69%3C%73%2E%6C%65%6E%67%74%68%3B%69%2B%2B%2C%69%2B%2B%29%7B%72%3D%72%2B%73%2E%73%75%62%73%74%72%69%6E%67%28%69%2B%31%2C%69%2B%32%29%2B%73%2E%73%75%62%73%74%72%69%6E%67%28%69%2C%69%2B%31%29%7D%64%6F%63%75%6D%65%6E%74%2E%77%72%69%74%65%28%27%3C%61%20%68%72%65%66%3D%22%27%2B%72%2B%27%22%3E%4F%62%65%72%70%61%72%6C%65%69%74%65%72%3C%2F%61%3E%27%29%3B'))]]></script> but i heard this can also be read by crawler and it isn't really good practices are ther any common approaches?

    Read the article

  • [app-engine-java-groovy] One-to-Many relationship. Select objects from datastore.

    - by Olexandr
    Hi. I've omitted some code(package declarations, imports, other fields) for shortness. I have here simple One-to-Many relation. It worked fine till this moment. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") class Restaurant implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key id @Persistent(mappedBy = "restaurant") List<RestaurantAddress> addresses = new ArrayList<RestaurantAddress>() } //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") class RestaurantAddress implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key id @Persistent Restaurant restaurant } Now i need to get(select) all the Restaurants from DB: def getRestaurantsToExport(final String dst, final int count) { String field = restaurantExportFields[dst] return transactionExecute() { PersistenceManager pm -> Query q = pm.newQuery(Restaurant.class) q.filter = "$field == null" q.setRange(0, count) return q.execute() } } But there are on problem - query gives me 12 restaurants(as in DB) but every Restaurant has 0 Address but in Datastore every Restaurant has minimum 2 addresses. Have anyone the same problem or knows the solution ?

    Read the article

  • Subsonic 3.0 select Query using DateColumn

    - by vineth
    Hi , While selecting records using Date-Field i am facing a problem , my SQL2005 View (ViewOrders) StarDate column Have 4/23/2010 12:00:00 AM 4/23/2010 12:00:00 AM 4/23/2010 12:00:00 AM 4/23/2010 12:00:00 AM 4/23/2010 1:07:00 PM My Code using subsonic 3.0 AMDB ctx = new AMDB(); SqlQuery vwOrd = ctx.Select.From(); vwOrd = vwOrd.And("StartDate").IsGreaterThanOrEqualTo("04/22/2010");//From date vwOrd = vwOrd.And("StartDate").IsLessThanOrEqualTo("04/22/2010");// To Date List cat = vwOrd.ToList(); i can able to fetch only first four records, i can't able to fetch the final record which start date contains(4/23/2010 1:07:00 PM). I think the problem is in the time format.. How can i code in subsonic ,which compare only the date in the date-time column. I Don't need date "Between" method in subsonic, since i can get single date parameter(From date alone). how can i solve this problem. Thnks in advance

    Read the article

  • Unable to link to opengl libraries? DOS / MSVC

    - by Mark
    Is there something wrong with this link.exe command line? OpenGL32.lib and Glu32.lib are found at both of the LIBPATH directories. Is it possible the libraries are somehow incompatible? Is there a way to have the link.exe say that instead of unresolved external symbol? Googling shows that this error usually means the libraries are not found, but they are there. E:\mvs90\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:no /DEBUG /pdb:None /LIBPATH:E:\code\python\python\py26\libs /LIBPATH:E:\code\python\python\py26\PCbuild opengl32.lib glu32.lib /EXPORT:init_rabbyt build\temp.win32-2.6-pydebug\Debug\rabbyt/rabbyt._rabbyt.obj /OUT:build\lib.win32-2.6-pydebug\rabbyt\_rabbyt_d.pyd /IMPLIB:build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.lib /MANIFESTFILE:build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.pyd.manifest Creating library build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.lib and object build\temp.win32-2.6-pydebug\Debug\rabbyt\_rabbyt_d.exp rabbyt._rabbyt.obj : error LNK2019: unresolved external symbol __imp__glOrtho re ferenced in function ___pyx_f_6rabbyt_7_rabbyt_set_viewport Directory of E:\code\python\python\py26\libs 09/27/2007 02:20 PM 12,672 GlU32.Lib 09/27/2007 02:20 PM 76,924 OpenGL32.Lib

    Read the article

  • Should we be giving the client's management team direct access to our git hub repository so that the

    - by SharePoint Newbie
    Hi, We are presently working for a client who is new to working with distributed teams. We have teams spread across India and the UK. Although we have decent project tracking tools (Mingle), would it be a good idea to the give the PM at the client access to our git hub repo. Would this be make it easier for them (see what the devs are working on and an insight into what the team has been developing). I agree that noot all commit messages would make sense to them but would this be a good way to boost their confidence in what we are doing? They already can check out our fortnightly releases on our QA and UA environments, but this still is behind dev by 5-6 days. Also, is there any reporting for git hub which makes it easier for PM types to make sense of it all? Thanks

    Read the article

  • Efficient way to remove empty lists from lists without evaluating held expressions?

    - by Alexey Popkov
    In previous thread an efficient way to remove empty lists ({}) from lists was suggested: Replace[expr, x_List :> DeleteCases[x, {}], {0, Infinity}] Using the Trott-Strzebonski in-place evaluation technique this method can be generalized for working also with held expressions: f1[expr_] := Replace[expr, x_List :> With[{eval = DeleteCases[x, {}]}, eval /; True], {0, Infinity}] This solution is more efficient than the one based on ReplaceRepeated: f2[expr_] := expr //. {left___, {}, right___} :> {left, right} But it has one disadvantage: it evaluates held expressions if they are wrapped by List: In[20]:= f1[Hold[{{}, 1 + 1}]] Out[20]= Hold[{2}] So my question is: what is the most efficient way to remove all empty lists ({}) from lists without evaluating held expressions? The empty List[] object should be removed only if it is an element of another List itself. Here are some timings: In[76]:= expr = Tuples[Tuples[{{}, {}}, 3], 4]; First@Timing[#[expr]] & /@ {f1, f2, f3} pl = Plot3D[Sin[x y], {x, 0, Pi}, {y, 0, Pi}]; First@Timing[#[pl]] & /@ {f1, f2, f3} Out[77]= {0.581, 0.901, 5.027} Out[78]= {0.12, 0.21, 0.18} Definitions: Clear[f1, f2, f3]; f3[expr_] := FixedPoint[ Function[e, Replace[e, {a___, {}, b___} :> {a, b}, {0, Infinity}]], expr]; f1[expr_] := Replace[expr, x_List :> With[{eval = DeleteCases[x, {}]}, eval /; True], {0, Infinity}]; f2[expr_] := expr //. {left___, {}, right___} :> {left, right};

    Read the article

  • Sequential searching with sorted linked lists

    - by John Graveston
    struct Record_node* Sequential_search(struct Record_node *List, int target) { struct Record_node *cur; cur = List->head ; if(cur == NULL || cur->key >= target) { return NULL; } while(cur->next != NULL) { if(cur->next->key >= target) { return cur; } cur = cur->next; } return cur; } I cannot interpret this pseudocode. Can anybody explain to me how this program works and flows? Given this pseudocode that searches for a value in a linked list and a list that is in an ascending order, what would this program return? a. The largest value in the list that is smaller than target b. The largest value in the list that is smaller than or same as target c. The smallest value in the list that is larger than or same as target d. Target e. The smallest value in the list that is larger than target And say that List is [1, 2, 4, 5, 9, 20, 20, 24, 44, 69, 70, 71, 74, 77, 92] and target 15, how many comparisons are occurred? (here, comparison means comparing the value of target)

    Read the article

  • Fatal error: Allowed memory size exhausted...

    - by Nano HE
    HI, I upload my php testing script to online vps server just now. The script used to parse a big size XML file(about 4M, 7000Lines). But my IE explorer show the online error message below. Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 77 bytes) in /var/www/test/result/index.php on line 26 I am sure I already tested the php script on localhost successfully. Is there any configuration need be enable/modify on my VPS? Such as php.ini or some setting for apache server? I just verified there are about 200M memory usage are avaliable for my VPS. How can I fix this? ...... function startElementHandler ($parser,$name,$attrib){ global $usercount; global $userdata; global $state; // Line #26; //Debug //print "name is: ".$name."\n"; switch ($name) { case $name=="_ID" : { $userdata[$usercount]["first"] = $attrib["FIRST"]; $userdata[$usercount]["last"] = $attrib["LAST"]; $userdata[$usercount]["nick"] = $attrib["NICK"]; $userdata[$usercount]["title"] = $attrib["TITLE"]; break; } ...... default : {$state=$name;break;} } }

    Read the article

  • Warning ,i can not solving in PHP code

    - by user318068
    hi , in code there Warning Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in C:\xampp\htdocs\Join.php on line 69 but i can not solving where exactly can you help me where the error in this code . <?php 51. include("connect.php"); 53. $email = mysql_query("select MemberEmail from members where MemberID= '$id' "); 54. while ($row = mysql_fetch_array($email)) 55. { 57. $memEmail=$row['MemberEmail']; } 62. $sql = mysql_query("select * from ninvite where recieverMemberEmail ='$memEmail' and viwed= '0' order by RoomID desc"); 64. $num =mysql_num_rows($sql); 67. if ($sql and $num >0 ) { 69. while($row=mysql_fetch_array($sql)) { 71. $sender=$row['SenderMemberID']; 73. $room=$row['RoomID']; 77. $sql2 =mysql_query("select MemberName from members where MemberID ='$sender' "); 78. $sql1 =mysql_query("select RoomName,RoomLogo from rooms where RoomID ='$room' "); 79. while($row=mysql_fetch_array($sql2)) { $mem =$row['MemberName']; } 84. while($rows=mysql_fetch_array($sql1)) { $Ro =$rows['RoomName']; $logo = $rows['RoomLogo']; } 89. ?> Thanks alot

    Read the article

  • Spring noHandlerFound

    - by Justin
    I am trying to set up my Spring MVC testing environment. But I always get this noHandlerFound error: Aug 21, 2014 4:43:25 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/restful/firstPage] in DispatcherServlet with name 'spring' Aug 21, 2014 4:47:21 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/restful/firstPage2] in DispatcherServlet with name 'spring' Aug 21, 2014 5:10:27 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/restful/index.html] in DispatcherServlet with name 'spring' I already searched for solution, but none can fix my problem. My spring mvc version: 3.1.3.RELEASE This is my web.xml: <servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext.xml </param-value> </context-param> this is my spring-servlet.xml: <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /> this is my applicationContext.xml: <context:annotation-config /> <context:component-scan base-package="test.spring" /> <mvc:annotation-driven /> <mvc:resources mapping="/index.html" location="/index.html" /> <mvc:view-controller path="/firstPage" /> This is my Controller: package test.spring; .... @Controller @RequestMapping("/") public class FirstController { @RequestMapping(value = "firstPage2", method = RequestMethod.GET) public String showFirstPage(Map<String,Object> model){ return "firstPage"; } } My server is tomcat 7, there is no error and warning when it is deployed. I also tried this with no luck: <mvc:default-servlet-handler/> Before I start Spring MVC, I can access index.html

    Read the article

  • How can I remove rows with unique values? As in only keeping rows with duplicate values?

    - by user1456405
    Here's the conundrum, I'm a complete and utter noob when it comes to programming. I understand the basics, but am still learning javascript. I have a spreadsheet of surveys, in which I need to see how particular users have varied over time. As such, I need to disregard all rows with unique values in a particular column. The data looks like this: Response Date Response_ID Account_ID Q.1 10/20/2011 12:03:43 PM 23655956 1168161 8 10/20/2011 03:52:57 PM 23660161 1168152 0 10/21/2011 10:55:54 AM 23672903 1166121 7 10/23/2011 04:28:16 PM 23694471 1144756 9 10/25/2011 06:30:52 AM 23732674 1167449 7 10/25/2011 07:52:28 AM 23734597 1087618 5 I've found a way to do so in VBA, which sucks as I have to use excel, per below: Sub Del_Unique() Application.ScreenUpdating = False Columns("B:B").Insert Shift:=xlToRight Columns("A:A").Copy Destination:=Columns("B:B") i = Application.CountIf(Range("A:A"), "<>") + 50 If i > 65536 Then i = 65536 Do If Application.CountIf(Range("B:B"), Range("A" & i)) = 1 Then Rows(i).Delete End If i = i - 1 Loop Until i = 0 Columns("B:B").Delete Application.ScreenUpdating = True End Sub But that requires mucking about. I'd really like to do it in Google Spreadsheets with a script that won't have to be changed. Closest I can get is retrieving all duplicate user ids from the range, but can't associate that with the row. That code follows: function findDuplicatesInSelection() { var activeRange = SpreadsheetApp.getActiveRange(); var values = activeRange.getValues(); // values that appear at least once var once = {}; // values that appear at least twice var twice = {}; // values that appear at least twice, stored in a pretty fashion! var final = []; for (var i = 0; i < values.length; i++) { var inner = values[i]; for (var j = 0; j < inner.length; j++) { var cell = inner[j]; if (cell == "") continue; if (once.hasOwnProperty(cell)) { if (!twice.hasOwnProperty(cell)) { final.push(cell); } twice[cell] = 1; } else { once[cell] = 1; } } } if (final.length == 0) { Browser.msgBox("No duplicates found"); } else { Browser.msgBox("Duplicates are: " + final); } } Anyhow, sorry if this is the wrong place or format, but half of what I've found so far has been from stack, I thought it was a good place to start. Thanks!

    Read the article

  • List with items returns empty

    - by Power-Mosfet
    I have created a simple List function but if I Loop through the List it's empty. It should not be! All, thank you for the input. problem solved // List function public class process_hook { public static List<string> pro_hook = list_all_processes(); protected static List<string> list_all_processes() { var list = new List<string>(); foreach (Process i in Process.GetProcesses(".")) { try { foreach (ProcessModule pm in i.Modules) { list.Add(pm.FileName); } } catch { } } return list; } } // call private void button1_Click(object sender, EventArgs e) { foreach (String _list in process_hook.pro_hook) { Console.WriteLine(_list); } }

    Read the article

  • Convert "minutes since midnight" to time (convert to NSDate?)

    - by Canada Dev
    I am getting some open/closed times as integers since midnight. For example: "1140" = 19:00 (or 7 pm if you will) or; "570" = 9:30 (or 9.30 am) I can easily get the time in European format, just by doing doing a simple calculation and formatting: [NSString stringWithFormat:@"%d:00", (T / 60)] However, this doesn't work for half hours, such as "570 minutes since midnight". Also, I run into problems if I want to include a bit of localization, because some people may prefer AM/PM times. Does NSDate include a method for easily implementing times using the above? Or can anyone tell me how I would at least convert a time like "570 minutes since midnight" to 9:30 properly. Right now it obviously won't write the :30 part. Thank you

    Read the article

  • Convert binary unsigned vector to dec list

    - by Juan
    This code convert a unsigned long vector variable cR1 to NB_ERRORS numbers (in 'a' variable I print these numbers). for (l = 0; l < NB_ERRORS; ++l) { k = (l * EXT_DEGREE) / BIT_SIZE_OF_LONG; j = (l * EXT_DEGREE) % BIT_SIZE_OF_LONG; a = cR1[k] >> j; if(j + EXT_DEGREE > BIT_SIZE_OF_LONG) a ^= cR1[k + 1] << (BIT_SIZE_OF_LONG - j); a &= ((1 << EXT_DEGREE) - 1); printf("\na=%d\n",a); } For example I am have a cR1 with two elements that follow: 0,0,1,1,0,1,0,0,0,0,1,0,0,1,1,1,1,1,0,0,1,1,1,1,0,0,0,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1,1,1,0, executing that code I get (44), (228, (243), (24), (77), (39), (117), (121). This code convert from right to left, I want modify to convert from right to left, Where I will be able to modify this? pdta: In the example case EXT_DEGREE = 8, BIT_SIZE_OF_LONG = 32

    Read the article

  • Why does Cacti keep waiting for dead poller processes?

    - by Oliver Salzburg
    sorry for the length I am currently setting up a new Debian (6.0.5) server. I put Cacti (0.8.7g) on it yesterday and have been battling with it ever since. Initial issue The initial issue I was observing, was that my graphs weren't updating. So I checked my cacti.log and found this concerning message: POLLER: Poller[0] Maximum runtime of 298 seconds exceeded. Exiting. That can't be good, right? So I went checking and started poller.php myself (via sudo -u www-data php poller.php --force). It will pump out a lot of message (which all look like what I would expect) and then hang for a minute. After that 1 minute, it will loop the following message: Waiting on 1 of 1 pollers. This goes on for 4 more minutes until the process is forcefully ended for running longer than 300s. So far so good I went on for a good hour trying to determine what poller might still be running, until I got to the conclusion that there simply is no running poller. Debugging I checked poller.php to see how that warning is issued and why. On line 368, Cacti will retrieve the number of finished processes from the database and use that value to calculate how many processes are still running. So, let's see that value! I added the following debug code into poller.php: print "Finished: " . $finished_processes . " - Started: " . $started_processes . "\n"; Result This will print the following within seconds of starting poller.php: Finished: 0 - Started: 1 Waiting on 1 of 1 pollers. Finished: 1 - Started: 1 So the values are being read and are valid. Until we get to the part where it keeps looping: Finished: - Started: 1 Waiting on 1 of 1 pollers. Suddenly, the value is gone. Why? Putting var_dump() in there confirms the issue: NULL Finished: - Started: 1 Waiting on 1 of 1 pollers. The return value is NULL. How can that be when querying SELECT COUNT()...? (SELECT COUNT() should always return one result row, shouldn't it?) More debugging So I went into lib\database.php and had a look at that db_fetch_cell(). A bit of testing confirmed, that the result set is actually empty. So I added my own database query code in there to see what that would do: $finished_processes = db_fetch_cell("SELECT count(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'"); print "Finished: " . $finished_processes . " - Started: " . $started_processes . "\n"; $mysqli = new mysqli("localhost","cacti","cacti","cacti"); $result = $mysqli->query("SELECT COUNT(*) FROM poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00';"); $row = $result->fetch_assoc(); var_dump( $row ); This will output Finished: - Started: 1 array(1) { ["COUNT(*)"]=> string(1) "2" } Waiting on 1 of 1 pollers. So, the data is there and can be accessed without any problems, just not with the method Cacti is using? Double-check that! I enabled MySQL logging to make sure I'm not imagining things. Sure enough, when the error message is looped, the cacti.log reads as if it was querying like mad: 06/29/2012 08:44:00 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM cacti.poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'" 06/29/2012 08:44:01 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM cacti.poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'" 06/29/2012 08:44:02 PM - CMDPHP: Poller[0] DEVEL: SQL Cell: "SELECT count(*) FROM cacti.poller_time WHERE poller_id=0 AND end_time>'0000-00-00 00:00:00'" But none of these queries are logged my MySQL. Yet, when I add my own database query code, it shows up just fine. What the heck is going on here?

    Read the article

< Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >