Daily Archives

Articles indexed Wednesday April 14 2010

Page 30/122 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • bit ordering and endianess

    - by Neeraj
    I am reading a file byte-by-byte. Say for example i have this byte: 0x41 (0100 0001) represented in hex. Now, I want the first three bits of this byte, i.e (010). I can use bitwise logic to extract the first three bits, but my question is will the first three bits be independent of endianess of the machine.(i.e they can't be 001)? Thanks,

    Read the article

  • How is 'processing credit card data' defined (PCI)?

    - by Chris
    If i have a web application and i receive credit card data transmitted via a POST request by a web browser over HTTPS and instantly open a socket (SSL) to a remote PCI compilant card processor to forward the data and wait for a response, am i allowed to do that? or is this receiving the data with my application and forwarding it already subject of "processing credit card data"? if i create an iframe that is displayed in a client browser to enter cc data and this iframe posts the data via HTTPS to remote card processor (directly!) is this already a case of processing credit card data? even if my application code 'doesnt touch' the entered data with any event handlers? i'm interested in the definition "credit card data processing". when does it start to be a cc data processing application? can somebody maybe point me to that section in PCI-DSS standard that clearly defines when you start to 'be a processing application'? Thanks,

    Read the article

  • Classic string manipulation interview questions?

    - by user189364
    Hi, I am scheduled to have an onsite interview so I am preparing few basic questions. According to the company profile, they are big on string manipulation questions. So far I have manually coded these functions: String length, copy, concat, remove white space Reverse Anagrams Palindrome Please can some can give me a list of more classic string questions which I can practice before going there?

    Read the article

  • How to make header row of a table (with horizontal and vertical scrollers) fixed ?

    - by understack
    I've this sample table and I want to make header row of table visible all the time. Header row should scroll with horizontal scrollbar and shouldn't scroll with vertical scrollbar. table: <div style="width:800px; height:150px;overflow:scroll;margin:50px auto;"> <table style="width:1600px" border="1"> <thead style=""> <tr> <th style="width:800px">id_1</th> <th style="width:800px">id_2</th> </tr> </thead> <tbody style=""> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> </tbody> </table> </div> How can I do this with css only? Suggestions in this and this thread didn't seem to work, possibly due to presence of scrollbars.

    Read the article

  • how can I know current viewcontroller name in iphone

    - by Shikhar
    I have BaseView which implement UIViewController. Every view in project must implement this BaseView. In BaseView, I have method: -(void) checkLoginStatus { defaults = [[NSUserDefaults alloc] init]; if(![[defaults objectForKey:@"USERID"] length] > 0 ) { Login *login=[[Login alloc] initWithNibName:@"Login" bundle:nil]; [self.navigationController pushViewController:login animated:TRUE]; [login release]; } [defaults release]; } The problem is my Login view also implement BaseView, checks for login, and again open LoginView i.e. stuck in to recursive calling. Can I check in checkLoginStatus method if request is from LoginView then take no action else check login. Ex: (void) checkLoginStatus { if(SubView is NOT Login){ defaults = [[NSUserDefaults alloc] init]; if(![[defaults objectForKey:@"USERID"] length] 0 ) { Login *login=[[Login alloc] initWithNibName:@"Login" bundle:nil]; [self.navigationController pushViewController:login animated:TRUE]; [login release]; } [defaults release]; } } Please help..

    Read the article

  • how to pass an id number string to this class

    - by Phil
    I'm very much a vb person, but have had to use this id number class in c#. I got it from http://www.codingsanity.com/idnumber.htm : using System; using System.Text.RegularExpressions; namespace Utilities.SouthAfrica { /// <summary> /// Represents a South African Identity Number. /// valid number = 7707215230080 /// invalid test number = 1234567891234 /// /// </summary> [Serializable()] public class IdentityNumber { #region Enumerations /// <summary> /// Indicates a gender. /// </summary> public enum PersonGender { Female = 0, Male = 5 } public enum PersonCitizenship { SouthAfrican = 0, Foreign = 1 } #endregion #region Declarations static Regex _expression; Match _match; const string _IDExpression = @"(?<Year>[0-9][0-9])(?<Month>([0][1-9])|([1][0-2]))(?<Day>([0-2][0-9])|([3][0-1]))(?<Gender>[0-9])(?<Series>[0-9]{3})(?<Citizenship>[0-9])(?<Uniform>[0-9])(?<Control>[0-9])"; #endregion #region Constuctors /// <summary> /// Sets up the shared objects for ID validation. /// </summary> static IdentityNumber() { _expression = new Regex(_IDExpression, RegexOptions.Compiled | RegexOptions.Singleline); } /// <summary> /// Creates the ID number from a string. /// </summary> /// <param name="IDNumber">The string ID number.</param> public IdentityNumber(string IDNumber) { _match = _expression.Match(IDNumber.Trim()); } #endregion #region Properties /// <summary> /// Indicates the date of birth encoded in the ID Number. /// </summary> /// <exception cref="System.ArgumentException">Thrown if the ID Number is not usable.</exception> public DateTime DateOfBirth { get { if(IsUsable == false) { throw new ArgumentException("ID Number is unusable!", "IDNumber"); } int year = int.Parse(_match.Groups["Year"].Value); // NOTE: Do not optimize by moving these to static, otherwise the calculation may be incorrect // over year changes, especially century changes. int currentCentury = int.Parse(DateTime.Now.Year.ToString().Substring(0, 2) + "00"); int lastCentury = currentCentury - 100; int currentYear = int.Parse(DateTime.Now.Year.ToString().Substring(2, 2)); // If the year is after or at the current YY, then add last century to it, otherwise add // this century. // TODO: YY -> YYYY logic needs thinking about if(year > currentYear) { year += lastCentury; } else { year += currentCentury; } return new DateTime(year, int.Parse(_match.Groups["Month"].Value), int.Parse(_match.Groups["Day"].Value)); } } /// <summary> /// Indicates the gender for the ID number. /// </summary> /// <exception cref="System.ArgumentException">Thrown if the ID Number is not usable.</exception> public PersonGender Gender { get { if(IsUsable == false) { throw new ArgumentException("ID Number is unusable!", "IDNumber"); } int gender = int.Parse(_match.Groups["Gender"].Value); if(gender < (int) PersonGender.Male) { return PersonGender.Female; } else { return PersonGender.Male; } } } /// <summary> /// Indicates the citizenship for the ID number. /// </summary> /// <exception cref="System.ArgumentException">Thrown if the ID Number is not usable.</exception> public PersonCitizenship Citizenship { get { if(IsUsable == false) { throw new ArgumentException("ID Number is unusable!", "IDNumber"); } return (PersonCitizenship) Enum.Parse(typeof(PersonCitizenship), _match.Groups["Citizenship"].Value); } } /// <summary> /// Indicates if the IDNumber is usable or not. /// </summary> public bool IsUsable { get { return _match.Success; } } /// <summary> /// Indicates if the IDNumber is valid or not. /// </summary> public bool IsValid { get { if(IsUsable == true) { // Calculate total A by adding the figures in the odd positions i.e. the first, third, fifth, // seventh, ninth and eleventh digits. int a = int.Parse(_match.Value.Substring(0, 1)) + int.Parse(_match.Value.Substring(2, 1)) + int.Parse(_match.Value.Substring(4, 1)) + int.Parse(_match.Value.Substring(6, 1)) + int.Parse(_match.Value.Substring(8, 1)) + int.Parse(_match.Value.Substring(10, 1)); // Calculate total B by taking the even figures of the number as a whole number, and then // multiplying that number by 2, and then add the individual figures together. int b = int.Parse(_match.Value.Substring(1, 1) + _match.Value.Substring(3, 1) + _match.Value.Substring(5, 1) + _match.Value.Substring(7, 1) + _match.Value.Substring(9, 1) + _match.Value.Substring(11, 1)); b *= 2; string bString = b.ToString(); b = 0; for(int index = 0; index < bString.Length; index++) { b += int.Parse(bString.Substring(index, 1)); } // Calculate total C by adding total A to total B. int c = a + b; // The control-figure can now be determined by subtracting the ones in figure C from 10. string cString = c.ToString() ; cString = cString.Substring(cString.Length - 1, 1) ; int control = 0; // Where the total C is a multiple of 10, the control figure will be 0. if(cString != "0") { control = 10 - int.Parse(cString.Substring(cString.Length - 1, 1)); } if(_match.Groups["Control"].Value == control.ToString()) { return true; } } return false; } } #endregion } } Here is the code from my default.aspx.cs page: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Utilities.Southafrica; <- this is the one i added to public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { var someNumber = new IdentityNumber("123456"); <- gives error } } Can someone please tell the syntax for how I pass an id number to the class? Thanks

    Read the article

  • user notification while waiting

    - by user315445
    I am writing a simple win forms app in C#. There is a method call in my method which loads files but is taking a while to respond. Below is the method call Directory.GetFiles(selectedFolder, "*.xml", SearchOption.AllDirectories); I want to notify this to users. Is there a way to show them that file loading is in progress? I want a simplest way. I suppose Splash screen is too costly for my app.

    Read the article

  • accessing php javascript object in asp.net user control

    - by Khushi
    Hi, I have a website in php which is using 4 frames(top, left, middle and right). The middle frame contains the web user control coded in asp.net. Now, in the right frame( which is coded in php ) some javascript contains the id of the items selected in right frame. I need to get those ids to the middle frame on asp.net user control. How can i do this?

    Read the article

  • kill -9 doesn't work

    - by Daniel
    I have a server with 3 oracle instances on it, and the file system is nfs with netapp. After shutdown the databases, one process for each database doesn't quit for a long time. Each kill -i doesn't work. I tried to truss, pfile it, the command through error. And iostat shows there are lots of IO to the netapp server. So someone said the process was busy writing data to remote netapp server, and before the write complete, it won't quit. So what need to be done was just wait until all the IO was done. After wait for longer time (about 1.5 hours), the processes exit. So my question is: how can a process ignore the kill signal? As far as I know, if we kill -9, it will stop immediately. Do you encounter such situation kill -i doesn't kill the process right away? TEST7-stdby-phxdbnfs11$ ps -ef|grep dbw0 oracle 1469 25053 0 22:36:53 pts/1 0:00 grep dbw0 oracle 26795 1 0 21:55:23 ? 0:00 ora_dbw0_TEST7 oracle 1051 1 0 Apr 08 ? 3958:51 ora_dbw0_TEST2 oracle 471 1 0 Apr 08 ? 6391:43 ora_dbw0_TEST1 TEST7-stdby-phxdbnfs11$ kill -9 1051 TEST7-stdby-phxdbnfs11$ ps -ef|grep dbw0 oracle 1493 25053 0 22:37:07 pts/1 0:00 grep dbw0 oracle 26795 1 0 21:55:23 ? 0:00 ora_dbw0_TEST7 oracle 1051 1 0 Apr 08 ? 3958:51 ora_dbw0_TEST2 oracle 471 1 0 Apr 08 ? 6391:43 ora_dbw0_TEST1 TEST7-stdby-phxdbnfs11$ kill -9 471 TEST7-stdby-phxdbnfs11$ ps -ef|grep dbw0 oracle 26795 1 0 21:55:23 ? 0:00 ora_dbw0_TEST7 oracle 1051 1 0 Apr 08 ? 3958:51 ora_dbw0_TEST2 oracle 471 1 0 Apr 08 ? 6391:43 ora_dbw0_TEST1 oracle 1495 25053 0 22:37:22 pts/1 0:00 grep dbw0 TEST7-stdby-phxdbnfs11$ ps -ef|grep smon oracle 1524 25053 0 22:38:02 pts/1 0:00 grep smon TEST7-stdby-phxdbnfs11$ ps -ef|grep dbw0 oracle 1526 25053 0 22:38:06 pts/1 0:00 grep dbw0 oracle 26795 1 0 21:55:23 ? 0:00 ora_dbw0_TEST7 oracle 1051 1 0 Apr 08 ? 3958:51 ora_dbw0_TEST2 oracle 471 1 0 Apr 08 ? 6391:43 ora_dbw0_TEST1 TEST7-stdby-phxdbnfs11$ kill -9 1051 471 26795 TEST7-stdby-phxdbnfs11$ ps -ef|grep dbw0 oracle 1528 25053 0 22:38:19 pts/1 0:00 grep dbw0 oracle 26795 1 0 21:55:23 ? 0:00 ora_dbw0_TEST7 oracle 1051 1 0 Apr 08 ? 3958:51 ora_dbw0_TEST2 oracle 471 1 0 Apr 08 ? 6391:43 ora_dbw0_TEST1 TEST7-stdby-phxdbnfs11$ truss -p 26795 truss: unanticipated system error: 26795 TEST7-stdby-phxdbnfs11$ pfiles 26795 pfiles: unanticipated system error: 26795

    Read the article

  • Value of variable changing before function is finished running

    - by Patrick
    I have an image uploading script in which i use the following setup to assign names to uploaded images; $saltdate = date( 'U' ); $saltuser = $_SERVER[REMOTE_ADDR]; $saltname = md5($saltdate.$saltuser); // Recieve, Process, Save uploaded image // Update database with image name The problem that i encounter is that after processing/saving the image, when its time to add this file name to the database, the value of $saltdate seems to have changed and i will get a file name in the database that doesnt exist. How can i make sure that the value doesn't change once i establish it?

    Read the article

  • Was delegates static by default?

    - by Sri Kumar
    Hello All, I was just trying to understand delegates using the following code. public class delegatesEx { public delegate int Mydelegate(int first, int second); public int add(int first, int second) { return first + second; } public int sub(int first, int second) { return first - second; } } Here is my main method Console.WriteLine("******** Delegates ************"); delegatesEx.Mydelegate myAddDelegates = new delegatesEx.Mydelegate(new delegatesEx().add); int addRes = myAddDelegates(3, 2); Console.WriteLine("Add :" + addRes); delegatesEx.Mydelegate mySubDelegates = new delegatesEx.Mydelegate(new delegatesEx().sub); int subRes = mySubDelegates(3, 2); Console.WriteLine("Sub :" + subRes); I didn't declare delegate to be static but i was able to access it using the Class name. How is it possible?

    Read the article

  • Open layers multiple mouseover events for multiple markers

    - by Bren G.
    I have the following loop inside an function init(); which is executed "onload", I am having traouble attaching the mouseover event for each marker, the alert i always returns the value of the last loop/iteration? for(i=0; i<document.getElementById('departureSelect').options.length; i++){ var coords = eval(document.getElementById('departureSelect').options[i].value); if(i==0){ window['popup'+i] = new OpenLayers.Marker(new OpenLayers.LonLat(coords[0], coords[1]),icon); }else{ window['popup'+i] = new OpenLayers.Marker(new OpenLayers.LonLat(coords[0], coords[1]),icon.clone()); } window['z'+i] = new OpenLayers.Popup.Anchored(coords[2], new OpenLayers.LonLat(coords[0], coords[1]), new OpenLayers.Size(0,0), '<span class="country-label">' + coords[2] + '</span>', icon, false ); window['z'+i].autoSize = true; window['z'+i].setBorder('1px solid #888'); map.addPopup(window['z'+i]); window['z'+i].hide(); window['popup'+i].events.register('mouseover', window['popup'+i], function(e){ alert(i); // only returns loast iteration of i????? }); countries.addMarker(window['popup'+i]); }

    Read the article

  • Object reference not set to an instance of an object

    - by MBTHQ
    Can anyone help with the following code? I'm trying to get data from the database colum to the datagridview... I'm getting error over here "Dim sql_1 As String = "SELECT * FROM item where item_id = '" + DataGridView_stockout.CurrentCell.Value.ToString() + "'"" Private Sub DataGridView_stockout_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView_stockout.CellMouseClick Dim i As Integer = Stock_checkDataSet1.Tables(0).Rows.Count > 0 Dim thiscur_stok As New System.Data.SqlClient.SqlConnection("Data Source=MBTHQ\SQLEXPRESS;Initial Catalog=stock_check;Integrated Security=True") ' Sql Query Dim sql_1 As String = "SELECT * FROM item where item_id = '" + DataGridView_stockout.CurrentCell.Value.ToString() + "'" ' Create Data Adapter Dim da_1 As New SqlDataAdapter(sql_1, thiscur_stok) ' Fill Dataset and Get Data Table da_1.Fill(Stock_checkDataSet1, "item") Dim dt_1 As DataTable = Stock_checkDataSet1.Tables("item") If i >= DataGridView_stockout.Rows.Count Then 'MessageBox.Show("Sorry, DataGridView_stockout doesn't any row at index " & i.ToString()) Exit Sub End If If 1 >= Stock_checkDataSet1.Tables.Count Then 'MessageBox.Show("Sorry, Stock_checkDataSet1 doesn't any table at index 1") Exit Sub End If If i >= Stock_checkDataSet1.Tables(1).Rows.Count Then 'MessageBox.Show("Sorry, Stock_checkDataSet1.Tables(1) doesn't any row at index " & i.ToString()) Exit Sub End If If Not Stock_checkDataSet1.Tables(1).Columns.Contains("os") Then 'MessageBox.Show("Sorry, Stock_checkDataSet1.Tables(1) doesn't any column named 'os'") Exit Sub End If 'DataGridView_stockout.Item("cs_stockout", i).Value = Stock_checkDataSet1.Tables(0).Rows(i).Item("os") Dim ab As String = Stock_checkDataSet1.Tables(0).Rows(i)(0).ToString() End Sub I keep on getting the error saying "Object reference not set to an instance of an object" I dont know where I'm going wrong. Help really appreciated!!

    Read the article

  • Format & Fresh Install Mac OS X Snow Leopard on Mac mini.

    - by sagar
    Hello Every one. I have purchased a DVD of Snow Leopard (Mac OS X 10.6.2) I purchased a Mac mini with Leopard (Mac OS X 10.5.7) I tried to install Mac OS X 10.6.2 Everything went perfectly. System was installed successfully. But the problem that I faced is as follows. System was installed but my older data remained as it is. (means installation didn't format every thing - means installation was done on upgrade basis.) Now, my system works with very low speed. Previous performance of Mac mini was double as compare to current upgrade version. Now - my question are as follows. Does an upgrade installation causes the performance issues in Mac OS X? Or is Snow Leopard too demanding for the Mac mini? ( 2 Ghz Intel Core 2 Duo, 1GB RAM - is this configuration OK for Snow Leopard? ) Does a fresh install work better than an upgrade?

    Read the article

  • Css background layers and 100% height div's

    - by Znarkus
    Imagine the following code. <body id="first_bg_layer"> <div id="second_bg_layer"> <div id="third_bg_layer"> </div> </div> </div> Each layer has a different background that is static/repeated to achieve the desired effect. I need all layers to fill up the screen, otherwise the background will be broken. The background is split in layers to minimize the image sizes. Setting min-height to 100% doesn't work for various reasons. Is there any way to do this?

    Read the article

  • How to add a Tooltip to a "td" with jquery?

    - by Scott
    I need to add a tooltip/alt to a "td" element inside of my tables with jquery. Can someone help me out? I tried: var tTip ="Hello world"; $(this).attr("onmouseover", tip(tTip)); where I have verified that I am using the "td" as "this". Edit:I am able to capture the "td" element through using the "alert" command and it worked. So for some reason the "tip" function doesn't work. Anyone know why this would be?

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >