Search Results

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

Page 23/101 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Converting ASP.NET MVC to n-Tiered Architecture

    - by Jeff
    I just built an application using ASP.NET MVC. The programmers at my company want to build all future modules using n-Tiered (Presentation Layer, Business Logic Layer, Data Access Layer) architecture. I am not the programmer and need to know why this makes sense? Do I have to completely rewrite the entire code or can it be converted? We are building an HRIS system with Business Intelligence. Somebody please explain why or why not this approach does or does not make sense.

    Read the article

  • Converting switch statements to more elegant solution.

    - by masfenix
    I have a 9 x 9 matrix. (think of suduko). 4 2 1 6 8 1 8 5 8 3 1 5 8 1 1 7 5 8 1 1 4 0 5 6 7 0 4 6 2 5 5 4 4 8 1 2 6 8 8 2 8 1 6 3 5 8 4 2 6 4 7 4 1 1 1 3 5 3 8 8 5 2 2 2 6 6 0 8 8 8 0 6 8 7 2 3 3 1 1 7 4 now I wanna be able to get a "quadrant". for example (according to my code) the quadrant 2 , 2 returns the following: 5 4 4 2 8 1 6 4 7 If you've noticed, this is the matrix from the very center of the 9 x 9. I've split everything up in to pairs of "3" if you know what i mean. the first "ROW" is from 0 - 3, the second from 3 - 6, the third for 6 - 9.. I hope this makes sense ( I am open to alternate ways to go about this) anyways, heres my code. I dont really like this way, even though it works. I do want speed though beccause i am making a suduko solver. //a quadrant returns the mini 3 x 3 //row 1 has three quads,"1", "2", 3" //row 2 has three quads "1", "2", "3" etc public int[,] GetQuadrant(int rnum, int qnum) { int[,] returnMatrix = new int[3, 3]; int colBegin, colEnd, rowBegin, rowEnd, row, column; //this is so we can keep track of the new matrix row = 0; column = 0; switch (qnum) { case 1: colBegin = 0; colEnd = 3; break; case 2: colBegin = 3; colEnd = 6; break; case 3: colBegin = 6; colEnd = 9; break; default: colBegin = 0; colEnd = 0; break; } switch (rnum) { case 1: rowBegin = 0; rowEnd = 3; break; case 2: rowBegin = 3; rowEnd = 6; break; case 3: rowBegin = 6; rowEnd = 9; break; default: rowBegin = 0; rowEnd = 0; break; } for (int i = rowBegin ; i < rowEnd; i++) { for (int j = colBegin; j < colEnd; j++) { returnMatrix[row, column] = _matrix[i, j]; column++; } column = 0; row++; } return returnMatrix; }

    Read the article

  • Converting a list into a select with jquery

    - by Davemof
    I'm trying to convert the following list into a select list so it can be submitted via a form - the element within the lists will become the value of each option: <ul class="selected connected-list ui-sortable" style="height: 279px;"> <li class="ui-helper-hidden-accessible" style=""></li> <li title="Owner Name 1 - " class="ui-state-default ui-element ui-draggable" style="display: block; position: relative; top: 0px; left: 0px;"><span class="ui-icon-arrowthick-2-n-s ui-icon"></span>Owner Name 1 - <em class="thenumber">4.4796E+11</em><a class="action" href="#"><span class="ui-corner-all ui-icon ui-icon-minus"></span></a></li> <li title="David Moffat - " class="ui-state-default ui-element" style="display: block; position: relative; top: 0px; left: 0px;"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>David Moffat - <em class="thenumber">07730423005</em><a class="action" href="#"><span class="ui-corner-all ui-icon ui-icon-minus"></span></a></li> </ul> This should convert to the following format: <select style="display:none" class="selectoption" name="p_num[]" multiple="multiple"> <option value="">4.4796E+11</option> <option value="">07730423007</option> </select> I have tried the following jquery code, but after many hours I'm pulling my hair out: $('a.sendform').click(function(){ $('ul.selected').each(function() { var $select = $('<select />'); $(this).find('li').each(function() { var $option = $('<option />'); $option.attr('value', $(this).('em')).html($(this).html()); $select.append($option); }); $(this).replaceWith($select); }); }); Any help might save my remaining hair. Many thanks David

    Read the article

  • Need help helping in converting jquery, ajax, json and asp.net

    - by Haja Mohaideen
    I am tying out this tutorial, http://www.ezzylearning.com/tutorial.aspx?tid=5869127. It works perfectly. What I am now trying to do is to host the aspx contents as html file. This html file is hosted on my wampserver which is on my laptop. The asp.net code hosted on my test server. When I try to access, I get the following error, Resource interpreted as Script but transferred with MIME type text/html: "http://201.x.x.x/testAjax/Default.aspx/AddProductToCart?callback=jQuery17103264484549872577_1346923699990&{%20pID:%20%226765%22,%20qty:%20%22100%22,%20lblType:%20%2220%22%20}&_=1346923704482". jquery.min.js:4 Uncaught SyntaxError: Unexpected token < I am not sure how to solve this problem. index.html code $(function () { $('#btnAddToCart').click(function () { var result = $.ajax({ type: "POST", url: "http://202.161.45.124/testAjax/Default.aspx/AddProductToCart", crossDomain: true, data: '{ pID: "6765", qty: "100", lblType: "20" }', contentType: "application/json; charset=utf-8", dataType: "jsonp", success: succeeded, failure: function (msg) { alert(msg); }, error: function (xhr, err) { alert(err); } }); }); }); function succeeded(msg) { alert(msg.d); } function btnAddToCart_onclick() { } </script> </head> <body> <form name="form1" method="post"> <div> <input type="button" id="btnAddToCart" onclick="return btnAddToCart_onclick()" value="Button" /> </div> </form> aspx.vb Imports System.Web.Services Imports System.Web.Script.Services <ScriptService()> Public Class WebForm1 Inherits Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Session("test") = "" End Sub <WebMethod()> <ScriptMethod(UseHttpGet:=False, ResponseFormat:=ResponseFormat.Json)> Public Shared Function AddProductToCart(pID As String, qty As String, lblType As String) As String Dim selectedProduct As String = String.Format("+ {0} - {1} - {2}", pID, qty, lblType) HttpContext.Current.Session("test") += selectedProduct Return HttpContext.Current.Session("test").ToString() End Function End Class

    Read the article

  • (Python) Converting a dictionary to a list?

    - by Daria Egelhoff
    So I have this dictionary: ScoreDict = {"Blue": {'R1': 89, 'R2': 80}, "Brown": {'R1': 61, 'R2': 77}, "Purple": {'R1': 60, 'R2': 98}, "Green": {'R1': 74, 'R2': 91}, "Red": {'R1': 87, 'Lon': 74}} Is there any way how I can convert this dictionary into a list like this: ScoreList = [['Blue', 89, 80], ['Brown', 61, 77], ['Purple', 60, 98], ['Green', 74, 91], ['Red', 87, 74]] I'm not too familiar with dictionaries, so I really need some help here. Thanks in advance!

    Read the article

  • R: Converting a list of data frames into one data frame

    - by JD Long
    I have code that at one place ends up with a list of data frames which I really want to convert to a single big data frame. I got some pointers from an earlier question which was trying to do something similar but more complex. Here's an example of what I am starting with (this is grossly simplified for illustration): listOfDataFrames <- NULL for (i in 1:100) { listOfDataFrames[[i]] <- data.frame(a=sample(letters, 500, rep=T), b=rnorm(500), c=rnorm(500)) } I am currently using this: df <- do.call("rbind", listOfDataFrames) *EDIT* whoops. In my haste to implement what I had "learned" in a previous question I totally screwed up. Yes, the unlist() is just plain wrong. I'm editing that out of the question above.

    Read the article

  • Converting text to bits (1's and 0's)

    - by Morano88
    I'm implementing an MD-5 Hashing algorithm and I want to convert the text I have to bits so I can start manipulating them. As you know Hashing require taking block of bits and then manipulating them. There are many ways to do that but I can't determine the best/easiest way to just convert the text (string) into array of bits. Any clue ? In C#

    Read the article

  • Coldfusion - taking a Serialized String and converting it to a Structure

    - by nobosh
    I have the following serialized string from a nested sortable list: ul[0][id]=main1&ul[0][children][0][id]=child2&ul[0][children][0][class]=&ul[1][id]=main3&ul[2][id]=main4&ul[3][id]=main5 I want to be able to record this in the database, and think I need a structure to do this. What's the best way to turn this into a structure, so I can sort it in the database, and easily render the list on the page in the future. Thanks,B

    Read the article

  • Converting generic type to it's base and vice-versa

    - by Pajci
    Can someone help me with the conversion I am facing in enclosed code ... I commented the lines of code, where I am having problem. Is this even the right way to achieve this ... what I am trying to do, is forward responses of specified type to provided callback. public class MessageBinder { private class Subscriber<T> : IEquatable<Subscriber<T>> where T : Response { ... } private readonly Dictionary<Type, List<Subscriber<Response>>> bindings; public MessageBinder() { this.bindings = new Dictionary<Type, List<Subscriber<Response>>>(); } public void Bind<TResponse>(short shortAddress, Action<ZigbeeAsyncResponse<TResponse>> callback) where TResponse : Response { List<Subscriber<TResponse>> subscribers = this.GetSubscribers<TResponse>(); if (subscribers != null) { subscribers.Add(new Subscriber<TResponse>(shortAddress, callback)); } else { var subscriber = new Subscriber<TResponse>(shortAddress, callback); // ERROR: cannot convert from 'List<Subscriber<TResponse>>' to 'List<Subscriber<Response>>' ... tried LINQ Cast operator - does not work either this.bindings.Add(typeof(TResponse), new List<Subscriber<TResponse>> { subscriber }); } } public void Forward<TResponse>(TResponse response) where TResponse : Response { var subscribers = this.GetSubscribers<TResponse>(); if (subscribers != null) { Subscriber<TResponse> subscriber; Type responseType = typeof (TResponse); if (responseType.IsSubclassOf(typeof (AFResponse))) { // ERROR: Cannot convert type 'TResponse' to 'AFResponse' ... tried cast to object first, works, but is this the right way? var afResponse = (AFResponse)response; subscriber = subscribers.SingleOrDefault(s => s.ShortAddress == afResponse.ShortAddress); } else { subscriber = subscribers.First(); } if (subscriber != null) { subscriber.Forward(response); } } } private List<Subscriber<TResponse>> GetSubscribers<TResponse>() where TResponse : Response { List<Subscriber<Response>> subscribers; this.bindings.TryGetValue(typeof(TResponse), out subscribers); // ERROR: How can I cast List<Subscriber<Response>> to List<Subscriber<TResponse>>? return subscribers; } } Thank you for any help :)

    Read the article

  • converting compressed Rich text (C#)

    - by Code Smack
    Hello, I have a string with CompressedRichText in it. I want to uncompressed it to standard RTF and then to plain Text. I am using VS 2008 C# Windows Application. I found references to C++ code to do it, but nothing directly in C#. here is a sample of what I am thinking... not much code though... private string _CompressedRichText = "5A46751234E1234A3214C12D34213412346F4"; private void button1_Click(object sender, EventArgs e) { //Convert to Uncompressed RTF richTextBox1.Text = //Some action //Convert to text textBox1.Text = //some action } This will at least give you an example of what I am thinking.

    Read the article

  • Converting "A* Search" code from C++ to Java [on hold]

    - by mr5
    Updated! I get this code from this site It's A* Search Algorithm(finding shortest path with heuristics) I modify most of variable names and some if conditions from the original version to satisfy my syntactic taste. It works in C++ (as I can't see any trouble with it) but fails in Java version. Java Code: String findPath(int startX, int startY, int finishX, int finishY) { @SuppressWarnings("unchecked") LinkedList<Node>[] nodeList = (LinkedList<Node>[]) new LinkedList<?>[2]; nodeList[0] = new LinkedList<Node>(); nodeList[1] = new LinkedList<Node>(); Node n0; Node m0; int nlIndex = 0; // queueList index // reset the node maps for(int y = 0;y < ROW_COUNT; ++y) { for(int x = 0;x < COL_COUNT; ++x) { close_nodes_map[y][x] = 0; open_nodes_map[y][x] = 0; } } // create the start node and push into list of open nodes n0 = new Node( startX, startY, 0, 0 ); n0.updatePriority( finishX, finishY ); nodeList[nlIndex].push( n0 ); open_nodes_map[startY][startX] = n0.getPriority(); // mark it on the open nodes map // A* search while( !nodeList[nlIndex].isEmpty() ) { LinkedList<Node> pq = nodeList[nlIndex]; // get the current node w/ the highest priority // from the list of open nodes n0 = new Node( pq.peek().getX(), pq.peek().getY(), pq.peek().getIterCount(), pq.peek().getPriority()); int x = n0.getX(); int y = n0.getY(); nodeList[nlIndex].pop(); // remove the node from the open list open_nodes_map[y][x] = 0; // mark it on the closed nodes map close_nodes_map[y][x] = 1; // quit searching when the goal state is reached //if((*n0).estimate(finishX, finishY) == 0) if( x == finishX && y == finishY ) { // generate the path from finish to start // by following the directions String path = ""; while( !( x == startX && y == startY) ) { int j = dir_map[y][x]; int c = '0' + ( j + Node.DIRECTION_COUNT / 2 ) % Node.DIRECTION_COUNT; path = (char)c + path; x += DIR_X[j]; y += DIR_Y[j]; } return path; } // generate moves (child nodes) in all possible directions for(int i = 0; i < Node.DIRECTION_COUNT; ++i) { int xdx = x + DIR_X[i]; int ydy = y + DIR_Y[i]; // boundary check if (!(xdx >= 0 && xdx < COL_COUNT && ydy >= 0 && ydy < ROW_COUNT)) continue; if ( ( gridMap.getData( ydy, xdx ) == GridMap.WALKABLE || gridMap.getData( ydy, xdx ) == GridMap.FINISH) && close_nodes_map[ydy][xdx] != 1 ) { // generate a child node m0 = new Node( xdx, ydy, n0.getIterCount(), n0.getPriority() ); m0.nextLevel( i ); m0.updatePriority( finishX, finishY ); // if it is not in the open list then add into that if( open_nodes_map[ydy][xdx] == 0 ) { open_nodes_map[ydy][xdx] = m0.getPriority(); nodeList[nlIndex].push( m0 ); // mark its parent node direction dir_map[ydy][xdx] = ( i + Node.DIRECTION_COUNT / 2 ) % Node.DIRECTION_COUNT; } else if( open_nodes_map[ydy][xdx] > m0.getPriority() ) { // update the priority info open_nodes_map[ydy][xdx] = m0.getPriority(); // update the parent direction info dir_map[ydy][xdx] = ( i + Node.DIRECTION_COUNT / 2 ) % Node.DIRECTION_COUNT; // replace the node // by emptying one queueList to the other one // except the node to be replaced will be ignored // and the new node will be pushed in instead while( !(nodeList[nlIndex].peek().getX() == xdx && nodeList[nlIndex].peek().getY() == ydy ) ) { nodeList[1 - nlIndex].push( nodeList[nlIndex].pop() ); } nodeList[nlIndex].pop(); // remove the wanted node // empty the larger size queueList to the smaller one if( nodeList[nlIndex].size() > nodeList[ 1 - nlIndex ].size() ) nlIndex = 1 - nlIndex; while( !nodeList[nlIndex].isEmpty() ) { nodeList[1 - nlIndex].push( nodeList[nlIndex].pop() ); } nlIndex = 1 - nlIndex; nodeList[nlIndex].push( m0 ); // add the better node instead } } } } return ""; // no route found } Output1: Legends . = PATH ? = START X = FINISH 3,2,1 = OBSTACLES (Misleading path) Output2: Changing these lines: n0 = new Node( a, b, c, d ); m0 = new Node( e, f, g, h ); to n0.set( a, b, c, d ); m0.set( e, f, g, h ); I get (I'm really confused) C++ Code: std::string A_Star::findPath(int startX, int startY, int finishX, int finishY) { typedef std::queue<Node> List_Container; List_Container nodeList[2]; // list of open (not-yet-tried) nodes Node n0; Node m0; int pqIndex = 0; // nodeList index // reset the node maps for(int y = 0;y < ROW_COUNT; ++y) { for(int x = 0;x < COL_COUNT; ++x) { close_nodes_map[y][x] = 0; open_nodes_map[y][x] = 0; } } // create the start node and push into list of open nodes n0 = Node( startX, startY, 0, 0 ); n0.updatePriority( finishX, finishY ); nodeList[pqIndex].push( n0 ); open_nodes_map[startY][startX] = n0.getPriority(); // mark it on the open nodes map // A* search while( !nodeList[pqIndex].empty() ) { List_Container &pq = nodeList[pqIndex]; // get the current node w/ the highest priority // from the list of open nodes n0 = Node( pq.front().getX(), pq.front().getY(), pq.front().getIterCount(), pq.front().getPriority()); int x = n0.getX(); int y = n0.getY(); nodeList[pqIndex].pop(); // remove the node from the open list open_nodes_map[y][x] = 0; // mark it on the closed nodes map close_nodes_map[y][x] = 1; // quit searching when the goal state is reached //if((*n0).estimate(finishX, finishY) == 0) if( x == finishX && y == finishY ) { // generate the path from finish to start // by following the directions std::string path = ""; while( !( x == startX && y == startY) ) { int j = dir_map[y][x]; char c = '0' + ( j + DIRECTION_COUNT / 2 ) % DIRECTION_COUNT; path = c + path; x += DIR_X[j]; y += DIR_Y[j]; } return path; } // generate moves (child nodes) in all possible directions for(int i = 0; i < DIRECTION_COUNT; ++i) { int xdx = x + DIR_X[i]; int ydy = y + DIR_Y[i]; // boundary check if (!( xdx >= 0 && xdx < COL_COUNT && ydy >= 0 && ydy < ROW_COUNT)) continue; if ( ( pGrid->getData(ydy,xdx) == WALKABLE || pGrid->getData(ydy, xdx) == FINISH) && close_nodes_map[ydy][xdx] != 1 ) { // generate a child node m0 = Node( xdx, ydy, n0.getIterCount(), n0.getPriority() ); m0.nextLevel( i ); m0.updatePriority( finishX, finishY ); // if it is not in the open list then add into that if( open_nodes_map[ydy][xdx] == 0 ) { open_nodes_map[ydy][xdx] = m0.getPriority(); nodeList[pqIndex].push( m0 ); // mark its parent node direction dir_map[ydy][xdx] = ( i + DIRECTION_COUNT / 2 ) % DIRECTION_COUNT; } else if( open_nodes_map[ydy][xdx] > m0.getPriority() ) { // update the priority info open_nodes_map[ydy][xdx] = m0.getPriority(); // update the parent direction info dir_map[ydy][xdx] = ( i + DIRECTION_COUNT / 2 ) % DIRECTION_COUNT; // replace the node // by emptying one nodeList to the other one // except the node to be replaced will be ignored // and the new node will be pushed in instead while ( !( nodeList[pqIndex].front().getX() == xdx && nodeList[pqIndex].front().getY() == ydy ) ) { nodeList[1 - pqIndex].push( nodeList[pqIndex].front() ); nodeList[pqIndex].pop(); } nodeList[pqIndex].pop(); // remove the wanted node // empty the larger size nodeList to the smaller one if( nodeList[pqIndex].size() > nodeList[ 1 - pqIndex ].size() ) pqIndex = 1 - pqIndex; while( !nodeList[pqIndex].empty() ) { nodeList[1-pqIndex].push(nodeList[pqIndex].front()); nodeList[pqIndex].pop(); } pqIndex = 1 - pqIndex; nodeList[pqIndex].push( m0 ); // add the better node instead } } } } return ""; // no route found } Output: Legends . = PATH ? = START X = FINISH 3,2,1 = OBSTACLES (Just right) From what I read about Java's documentation, I came up with the conclusion: C++'s std::queue<T>::front() == Java's LinkedList<T>.peek() Java's LinkedList<T>.pop() == C++'s std::queue<T>::front() + std::queue<T>::pop() What might I be missing in my Java version? In what way does it became different algorithmically from the C++ version?

    Read the article

  • Converting PDF to PCL5 on Windows?

    - by Hein du Plessis
    In my application, I need to convert PDF docs to PCL5 generic files to send to FTP PCL capable printers. Printing to file would be a last resort, I would prefer a small-footprint command line tool or API that will do the job. I've seen some mention of doing this on Linux using Ghostscript, but I've got no idea how to replicate this on windows. Many thanks

    Read the article

  • Converting PHP pagination to jQuery?

    - by ClarkSKent
    Hey, I have been trying to get this pagination class that I am using to be more ajaxy - meaning when I click on the page number like page [2] the data loads, but I want to load in the data without going to a different page (HTTP request in the background, with no page reloads). Being new to both php and jquery, I am a little unsure on how to achieve this result, especially while using a php class. This is what the main page looks like by the way: <?php $categoryId=$_GET['category']; echo $categoryId; ?> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript" src="jquery_page.js"></script> <?php //Include the PS_Pagination class include('ps_pagination.php'); //Connect to mysql db $conn = mysql_connect('localhost', 'root', 'root'); mysql_select_db('ajax_demo',$conn); $sql = "select * from explore where category='$categoryId'"; //Create a PS_Pagination object $pager = new PS_Pagination($conn, $sql, 3, 11, 'param1=value1&param2=value2'); //The paginate() function returns a mysql //result set for the current page $rs = $pager->paginate(); //Loop through the result set echo "<table width='800px'>"; while($row = mysql_fetch_assoc($rs)) { echo "<tr>"; echo"<td>"; echo $row['id']; echo"</td>"; echo"<td>"; echo $row['site_description']; echo"</td>"; echo"<td>"; echo $row['site_price']; echo"</td>"; echo "</tr>"; } echo "</table>"; echo "<ul id='pagination'>"; echo "<li>"; //Display the navigation echo $pager->renderFullNav(); echo "</li>"; echo "</ul>"; ?> <div id="loading" ></div> <div id="content" ></div> Would I need to do something with this part of the class?, as seen above: $pager = new PS_Pagination($conn, $sql, 3, 11, 'param1=value1&param2=value2'); Or this?: echo $pager->renderFullNav(); I don't no much about jquery,but i guess I would start it like: $("#pagination li").click(function() { Then load something maybe... I don't no. Any help on this would be great. Thanks.

    Read the article

  • converting code from non-(C)ontinuation (P)assing (S)tyle to CPS

    - by Delirium tremens
    before: function sc_startSiteCompare(){ var visitinguri; var validateduri; var downloaduris; var compareuris; var tryinguri; sc_setstatus('started'); visitinguri = sc_getvisitinguri(); validateduri = sc_getvalidateduri(visitinguri); downloaduris = new Array(); downloaduris = sc_generatedownloaduris(validateduri); compareuris = new Array(); compareuris = sc_generatecompareuris(validateduri); tryinguri = 0; sc_finishSiteCompare(downloaduris, compareuris, tryinguri); } function sc_getvisitinguri() { var visitinguri; visitinguri = content.location.href; return visitinguri; } after (I'm trying): function sc_startSiteCompare(){ var visitinguri; sc_setstatus('started'); visitinguri = sc_getvisitinguri(sc_startSiteComparec1); } function sc_startSiteComparec1 (visitinguri) { var validateduri; validateduri = sc_getvalidateduri(visitinguri, sc_startSiteComparec2); } function sc_startSiteComparec2 (visitinguri, c) { var downloaduris; downloaduris = sc_generatedownloaduris(validateduri, sc_startSiteComparec3); } function sc_startSiteComparec3 (validateduri, c) { var compareuris; compareuris = sc_generatecompareuris(downloaduris, validateduri, sc_startSiteComparec4); } function sc_startSiteComparec4 (downloaduris, compareuris, validateduri, c) { var tryinguri; tryinguri = 0; sc_finishSiteCompare(downloaduris, compareuris, tryinguri); } function sc_getvisitinguri(c) { var visitinguri; visitinguri = content.location.href; c(visitinguri); } I'm having to pass lots of arguments to functions now. global in procedural code look like this / self in modular code. Any difference? Will I really have to use OO now? As a last resort, does CPS have an alternative?

    Read the article

  • Java converting to Jython-Getting a class object within itself

    - by Bggreen
    I am attempting to convert Java code to Jython and am using the apache Log and LogFactory imports. I am attempting to emulate Foo.class in Jython The chunk of code is as follows: in Java import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class MyClass { private static final Log log = LogFactory.getLog(MyClass.class); public MyClass(Document dom) { //code } How can I emulate this same behavior of MyClass.class in Jython/Python?

    Read the article

  • converting char array into one int

    - by user1762517
    I can't use atoi, need to do it digit by digit.. How do I save it in a int.. given a char* temp put it all in one int.. #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> int main () { char* temp = "798654564654564654"; int i = 0; for (i = 0; i < strlen(temp); i++) { printf("%d", temp[i] - 48); } printf("\n"); }

    Read the article

  • Converting the DOM element in a String

    - by Hsm Sharique Hasan
    I am working on svg. I made some shapes in svg using my javascript code. Now what i have to do is to get that code of svg which has been made as i draw some thing. i want to get that code in a form of string so for the sake of reuse or if can put that code in a .svg file it outputs the same what i made by myself using my javascript code. Like My code made this <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500" height="500" id="one"> <g id="container"> <rect id ="rect" x="0" y="0" width="0" height="0" fill="pink" stroke="blue" stroke-width="2" /> </g> Now what should i do to get all the code from to in a form of string and i can print that.

    Read the article

  • converting result set to list

    - by akshay
    how can i conver result set to list? i am using following code but its not working properly private List<User> convertToList(ResultSet rs) { List<User> userList = new ArrayList(); User user = new User(); try { while (rs.next()) { user.setId(rs.getInt("id")); user.setUsername(rs.getString("username")); user.setFname(rs.getString("fname")); user.setLname(rs.getString("lname")); user.setUsertype(rs.getInt("usertype")); user.setPasswd(rs.getString("passwd")); user.setEmail(rs.getString("email")); userList.add(user); } } catch (SQLException ex) { Logger.getLogger(UserDAO.class.getName()).log(Level.SEVERE, null, ex); } finally { closeConnection(); } return userList; }

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >