Search Results

Search found 2509 results on 101 pages for 'converting'.

Page 73/101 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • jQuery plugin and prototype class

    - by Shanison
    Hi I am converting some prototype javascript to jQuery javascript. In prototype we can do Class.create to create a class. However, jQuery doesn't provide this. So I was thinking to rewrite the class into a jQuery plugin. Is this the best practice? My concern is that if I do all for the class, then I will add a lot of things to jQuery object. The other alternative is to use some extra lines of codes I found http://ejohn.org/blog/simple-javascript-inheritance/#postcomment. Then you can do the following: var Person = Class.extend({ init: function(isDancing){ this.dancing = isDancing; }, dance: function(){ return this.dancing; } }); Which one is better, please advise. Thank you very much!

    Read the article

  • MonoTouch- 'curated' bindings?

    - by Glinkot
    I'm just converting a video player sample to MT and came to this part: self.view.layer.sublayerTransform = CATransform3DMakePerspective(1000); In Monotouch, I've started with: this.View.Layer.SublayerTransform(CATransform3D.... But no perspective option is available. There is a 'scale' and 'rotate' one - does this mean this functionality is unavailable in MT? Or that I need to start creating my own bindings even though this one has been processed by the binding creation tool Xamarin uses? If anyone could advise how I would apply that transform I'd appreciate it. Cheers

    Read the article

  • OpenGL game written in C with a Cocoa front-end I want to port to Windows

    - by Philip
    Hello, I'm wondering if someone could offer me some tips on how to go about this. I have a MacOS X OpenGL game that is written in very portable C with the exception of the non-game-play GUI. So in Cocoa I set up the window and OpenGL context, manage preferences, registration, listen for keystrokes etc. But all of the drawing and processing of input is handled in nice portable C. So I want to port to Windows. I figured the obvious way to go about was to use the Win32 api. Then I started to read a primer on Win32 and began to wonder if maybe life isn't too short. Can I do this in C# (without converting the backend to C#)? I'd rather devote the time to learning C# than Win32. Any suggestions would be most welcome. I really don't know a lick about Windows. The last version I regularly used was 3.1...

    Read the article

  • How to delete a Dictionary row that is a Double by using an Int?

    - by Richard Reddy
    Hi, I have a Dictionary object that is formed using a double as its key values. It looks like this: Dictionary<double, ClassName> VariableName = new Dictionary<double, ClassName>(); For my project I have to have the key as the double as I require values like 1.1,1.2,2.1,2.2,etc in my system. Everything in my system works great except when I want to delete all the keys in a group eg all the 1 values would be 1.1,1.2, etc. I can delete rows if I know the full value of the key eg 1.1 but in my system I will only know the whole number. I tried to do the following but get an error: DictionaryVariable.Remove(j => Convert.ToInt16(j.Key) == rowToEdit).OrderByDescending(j => j.Key); Is there anyway to remove all rows per int value by converting the key? Thanks, Rich

    Read the article

  • Is it stable to change I/O direction on microcontroller repeatedly?

    - by SS
    I'm new to microcontroller programming and I have interfaced my microcontroller board to another device that provides a status based on the command send to it but, this status is provided on the same I/O pin that is used to provide data. So basically, I have an 8-bit data line that is used as an output from the microcontroller, but for certain commands I get a status back on one of the data lines if I choose to read it. So I would be required to change the direction of this one line to read the status thus converting this line as an ouput to an input and then back to an output. Is this acceptable programming or will this changing of the I/O pin this frequently cause instability? Thanks.

    Read the article

  • SQL use comma-separated values with IN clause

    - by user342944
    I am developing an ASP.NET application and passing a string value like "1,2,3,4" into a procedure to select those values which are IN (1,2,3,4) but its saying "Conversion failed when converting the varchar value '1,2,3,4' to data type int." Here is the aspx code: private void fillRoles() { /*Read in User Profile Data from database */ Database db = DatabaseFactory.CreateDatabase(); DbCommand cmd = db.GetStoredProcCommand("sp_getUserRoles"); db.AddInParameter(cmd, "@pGroupIDs", System.Data.DbType.String); db.SetParameterValue(cmd, "@pGroupIDs", "1,2,3,4"); IDataReader reader = db.ExecuteReader(cmd); DropDownListRole.DataTextField = "Group"; DropDownListRole.DataValueField = "ID"; while (reader.Read()) { DropDownListRole.Items.Add((new ListItem(reader[1].ToString(), reader[0].ToString()))); } reader.Close(); } Here is my procedure: CREATE Procedure [dbo].[sp_getUserRoles](@pGroupIDs varchar(50)) AS BEGIN SELECT * FROM CheckList_Groups Where id in (@pGroupIDs) END

    Read the article

  • Is there an easier way to reconcile a list of files and a directory with subfolders/files to find ch

    - by rwmnau
    I have a SQL Server table with a list of files (path + filename), and a folder with multiple layers and files in each layer. I'm looking for a way to reconcile the two without having to process the list twice. Currently, I'm doing this: For Each f as FileInfo In FileListFromDatabase If f.Exists is False, mark it as deleted in the database Next For Each f as FileInfo In RecursiveListOFFilesOnDisk If Not FileExistsInDatabase, then add it Next Is there a better way to do this? I'd like to avoid converting all the matching files (of which most will be) to FileInfo objects twice. Since I'm a T-SQL developer first, I'm picturing something like an OUTER JOIN of the two lists where they don't match. Something LINQ-ish?

    Read the article

  • How can I use jQuery for messing with a particular div, but not in the current document - in a varia

    - by bisaram
    How can I use jQuery for messing with a particular div, but not in the current document - in a variable, that contains HTML? The point is that I want to show a preview of a page (a piece of it's content) in a modal window, when the link to this page is clicked. Well, onClick I load this whole HTML into a variable via JSON and then... how would I find a particular div I need in it? It's gonna be almost impossible to parse it with PHP before converting it into JSON and giving back to jQuery processor because of a deep hierarchy. Basically, is it even possible to do smth like $( 'div#some-id' ).blabla(); not for the current document, but for the document, stored in a variable? Thx everyone in advance.

    Read the article

  • Changing set_timezone does not always take effect

    - by LearneR
    I have two table table-1 id date-time ----------------------- 1 2012-12-13 15:20:13 table-2 id date-time ----------------------- 1 2012-12-13 15:20:13 Now i am selecting the record with mysql set_timezone function Case-1 SET time_zone='+00:00'; SELECT `date-time` FROM `table-1`; // 2012-12-13 09:50:13 Case-2 SET time_zone='+00:00'; SELECT `date-time` FROM `table-2`; // 2012-12-13 15:20:13 ---Not converting to specified timezone In case-1 it's giving converted date-time, but not in Case-2. What would be the issue?

    Read the article

  • Parse text of element with empty element inside

    - by Mando
    I'm trying to convert an XHTML document that uses lots of tables into a semantic XML document in Python using xml.etree. However, I'm having some trouble converting this XHTML <TD> Textline1<BR/> Textline2<BR/> Textline3 </TD> into something like this <lines> <line>Textline1</line> <line>Textline2</line> <line>Textline3</line> </lines> The problem is that I don't know how to get the text after the BR elements.

    Read the article

  • Convert char array to int array c++

    - by Yadira Suazo
    I`m having problems converting a char array read from file to an int array. Maybe someone can help me. This is my code: char vectorPatron[67]; int iPatrones[67]; archivo = fopen("1_0.txt", "r"); for(i=0;i<67;i++){ fscanf(archivo, "%c", &vectorPatron[i]); printf("%c",vectorPatron[i]); } fclose(archivo); for(i=0;i<67;i++){ iPatrones[i] = atoi(&vectorPatron[i]); printf("%d",iPatrones[i]); }

    Read the article

  • how to tell bulider to not to escape values

    - by dorelal
    ruby-1.8.7-p249 > xml = Builder::XmlMarkup.new => <inspect/> ruby-1.8.7-p249 > xml.foo '<b>wow</b>' => "<inspect/><foo>&lt;b&gt;wow&lt;/b&gt;</foo>" ruby-1.8.7-p249 > Builder is escaping the content and is converting the b tag into escaped value . How do I tell builder to no to escape it. I am using ruby 1.8.7 .

    Read the article

  • Hardcoding the resources in application

    - by HardCoder1986
    Hello! I have some code which shows a simple dialog box and handles user action (written using plain WinAPI). // Display dialog and handle user action LRESULT choice = DialogBoxParam(NULL, MAKEINTRESOURCE(AP_IDD_DIALOG), NULL, (DLGPROC)DialogCallback, NULL); Is there any way to hardcode the resource file dialog.rc, which is used to build the dialog ?(I would like to get rid of .rc files and I'm pretty sure there is a way, yet I don't know what it is :) Edit Also, does someone have any ideas on converting existing .rc files into hardcoded resources? Is this possible?

    Read the article

  • ASP.net: Efficient ways to convert DataSets to GenericCollection (Of ObjectType)

    - by jlrolin
    I currently have a function that gets some data from the database and puts it into a dataset. The return type on my function is GenericCollection (Of CustomerDetails) If I do this: Dim dataset As DataSet = Read(strSQL.ToString) 'Gets Data from DB What's the most efficient way to map the dataset results to an collection of objects. More importantly, since I'm using GenericCollection, is there a way to do this in which I can call a function from the ObjectType class (CustomerDetails) that would have a means to converting that specific object. Or is there a way in which I can use a function that would handle all types? Is there a way to do something like: Return returnedResults.TransformDataSet(dataset) In which returnedResults is an object collection Of CustomerDetails, or would it simply be easier to have TransformDataSet return an object collection Of CustomerDetails by itself? Thanks for any help.

    Read the article

  • explain this macro

    - by deostroll
    #define __T(x) L ## x Found in code from one of the MFC source header file. It is mostly used for converting strings to ........ (I don't know what). If I am correct it converts strings to LPCTSTR...don't know what that type is either... I can't seem to convert char* into LPCTSTR. While MFC file handling, the following code will always return error while trying to open the file... char* filepath = "C:\\Program Files\\Microsoft Office\\Office12\\BITMAPS\\STYLES\\GLOBE.WMF"; if( !file.Open((LPCTSTR)filepath , CFile::modeRead, &fexp) ) { fexp.ReportError(); return 1; } But instead if I wrote it this way, it doesn't give error: if( !file.Open( _T("C:\\Program Files\\Microsoft Office\\Office12\\BITMAPS\\STYLES\\GLOBE.WMF") , CFile::modeRead, &fexp) ) { fexp.ReportError(); return 1; } I am looking at passing a variable as the first argument to the CFile::Open() method.

    Read the article

  • Calculate difference in days ActiveSupport:TimeWithZone in the most "rubyish" style?

    - by Nick
    I have a feeling someone is going to point me to another question that answers this but I've been searching with no luck over this simple issue. I have a Activerecord with a datetime property. It returns as an ActiveSupport:TimeWithZone. I know I can't compare that to DateTime.now because that doesn't include a zone so I need to use Time.zone. Makes sense. What I'm wondering is stylewise is there a "cleaner" way to do this than subtracting and dividing the result by 86400? Here's what I do: ((Time.zone.now - myActiveRecord.visit_date)/86400).to_i Works but seems un-rubyish and I feel like I'm missing something. Should I be casting, comparing or converting some other route or is this really the typical way to do this in rails? Appreciate any tips or a link to a question that already covers this. Thank you

    Read the article

  • How to efficiently convert DataSet.Tables to List<DataTable>?

    - by Soenhay
    I see many posts about converting the table(s) in a DataSet to a list of DataRows or other row data but I was unable to find anything about this question. This is what I came up with using in .Net 3.0: internal static List<DataTable> DataSetToList(DataSet ds) { List<DataTable> result = new List<DataTable>(); foreach (DataTable dtbl in ds.Tables) { result.Add(dtbl); } return result; } Is there a better way, excluding an extension method? Thanks

    Read the article

  • How to handle #(hash) character in SEO friendly url?

    - by arvinsim
    How do you bypass the default behaviour if #(hash) which is to go to a specific part of a page? The problem that I have is that the # character is a part of the SEO friendly url which is a title and the #(hash) is part of the content (i.e. like with C#). I can't retrieve the whole string and I only get the characters before the #. Example: www.domain.com/C#-programming-book in this example I only get 'C' and not the '-programming-book' part. I am not using any javascript at the moment and would like to only use a PHP solution for this. Before anyone suggests that I used url encoding, the criteria for the seo friendly url is that it should be human readable and easily remembered. So converting the hash to '%23' does not pass the criteria. Is there no way around it?

    Read the article

  • how to use jquerydate picker with partial views in asp.net mvc?

    - by Renu123
    hello i am working on asp.net mvc. at staring i used the jquery which works fine but now i am converting my pages in to partial pages at this point am using ajax function to convert it in to partial view but every thing is working fine except date picker plz tell me the solution. the script that i have used: $(document).ready(function() { $("#txtTransationDate").datepicker(); }); </script> <input id="txtTransationDate" name="txtTransationDate" type="text" /> thank you......

    Read the article

  • Occasional conversion error using SUM function

    - by user153777
    My app uses sql2000 and a select statement it uses will sometimes fail. Once a week or so the select returns the error 'Error Converting data type varchar to numeric' SQL: sum(case when ISNULL(form_prsn_id, -1) = irpd_prsn_id then convert(dec(11,2), case when valu_value = '' then '0' else isnull (valu_value,'0') end)* case when fmdt_deduction_flag = 'Y' then -1 else 1 end else 0 end) as client_sum The valu_value field is a varchar and stores some numeric and some varchar. But including my join and where clause filter it will always select numeric or empty string. When it is failing I can remove the SUM, see the data and know that its numeric. So why would the SUM function sometimes (say 5% of time) fail on data that is numeric. I wonder if SQL somehow "looks ahead" to ensure it could convert to decimal on more than just the rows returned without the sum. Note I have discovered a fix where I include ( where isNumeric(valu_value) = 1 ) Thanks

    Read the article

  • Problem in removing hardcoded values using temp table...

    - by Shahsra
    Hi All, First of all Wish u all Happy New Year. I have a problem in writing query. While executing my query I am getting an error. Query: select case when S.R1 = '6' then 5 when S.R1 = '7' then 6 when S.R1 = '8' then 7 when S.R1 = '9' then 8 when S.R1 ='10' then 9 else S.R1 end as Q FROM [HelpService].[dbo].[help] s ----------------------------------------------- SELECT [Source], [Score] INTO #Temp_Q FROM [HelpDesk].[dbo].[Survey] WHERE [data_Source Name] = 'Text Data' ----------------------------------------------- select CONVERT(REAL, a.[Dell Score]) as Q FROM [HelpService].[dbo].[help] s LEFT OUTER JOIN #CE_Temp_Q a on s.[R1] = a.[Source] ERROR Msg 8114, Level 16, State 5, Line 1 Error converting data type varchar to real. What I am asked to do is I need to remove the hard coded values and need to write queries with a temp table. Thanks in Advance, Shashra

    Read the article

  • How to convert unicode character to its escaped ascii equivalent in c#

    - by Grant
    Hi, i am beginning with a string containing an encoded unicode character "& #xfc;". I pass the string to an object that performs some logic and returns another string. That string is converting the original encoded character to its unicode equivalent "ü". I need to get the original encoded character back but so far am not able. I have tried using the HttpUtility.HtmlEncode() method but that is returning "& #252;" which is not the same. Can anyone help?

    Read the article

  • SQL Convert Nvarchar(255) to DateTime problem

    - by steven
    Hi, I'm using SQL server 2008. I have 2 Tables: Table 1 and Table 2. Table 1 has 1 column called: OldDate which is nvarchar(255), null Table 2 has 1 column called: NewDate which is datetime, not null Example data in Table 1: 26/07/03 NULL NULL 23/07/2003 7/26/2003 NULL 28/07/03 When i try CAST(OldDate as datetime) I get this error: Arithmetic overflow error converting expression to data type datetime. I need to insert OldDate into NewDate with no errors. I can't skip some rows. Anyhelp would be appreciated.

    Read the article

  • Anyone know how you can get a Google dev phone to make Android apps?

    - by Bobafett
    Hi there, I am thinking about converting my web apps into Android apps to reach the Android market. I do not have an Android phone. Can someone tell me how I can possibly get a Google developer phone (other than going to Google I/O, etc)? I realize this is somewhat of a ridiculous request but I have read blogs of people being enticed by google and offered a free phone to convert their web apps into Android apps. So I figure there is no harm in asking. Any insight would be helpful. Thanks I am also wondering what the cost of the developer phone is once you pay your $25 to enter the android market place as a developer through the developer account.

    Read the article

  • How do I remove &#13 ; from my text file using VBScript Replace() or a regex?

    - by Eric Lachance
    Hi! I'm doing a conversion between two software which both use XML so the actual conversion part is fairly straightforward - adding text here, removing others here, converting a few information. I'm using VBSCript WSH. The only issue I'm still having is the darn &#13; character - that's my problem! I've tried both strText = Replace(strText, "&#13;", "") and using a regex with Regex.pattern = "&#13;" ... neither works. I also tried replacing char(13), VBCR... nothing seems to detect the actual string itself and not the character it's creating. Can anyone help me?

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >