Daily Archives

Articles indexed Wednesday March 21 2012

Page 4/19 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to prevent 2D camera rotation if it would violate the bounds of the camera?

    - by Andrew Price
    I'm working on a Camera class and I have a rectangle field named Bounds that determines the bounds of the camera. I have it working for zooming and moving the camera so that the camera cannot exit its bounds. However, I'm a bit confused on how to do the same for rotation. Currently I allow rotating of the camera's Z-axis. However, if sufficiently zoomed out, upon rotating the camera, areas of the screen outside the camera's bounds can be shown. I'd like to deny the rotation assuming it meant that the newly rotated camera would expose areas outside the camera's bounds, but I'm not quite sure how. I'm still new to Matrix and Vector math and I'm not quite sure how to model if the newly rotated camera sees outside of its bounds, undo the rotation. Here's an image showing the problem: http://i.stack.imgur.com/NqprC.png The red is out of bounds and as a result, the camera should never be allowed to rotate itself like this. This seems like it would be a problem with all rotated values, but this is not the case when the camera is zoomed in enough. Here are the current member variables for the Camera class: private Vector2 _position = Vector2.Zero; private Vector2 _origin = Vector2.Zero; private Rectangle? _bounds = Rectangle.Empty; private float _rotation = 0.0f; private float _zoom = 1.0f; Is this possible to do? If so, could someone give me some guidance on how to accomplish this? Thanks. EDIT: I forgot to mention I am using a transformation matrix style camera that I input in to SpriteBatch.Begin. I am using the same transformation matrix from this tutorial.

    Read the article

  • Naudio - putting audio stream into values [-1,1]

    - by denonth
    Hi all I need to put my audio stream into values of [-1,1]. Can someone tell me a good approach. I was reading byte array and float array from stream but I don't know what to do next. Here is my code: float[] bytes=new float[stream.Length]; float biggest= 0; for (int i = 0; i < stream.Length; i++) { bytes[i] = (byte)stream.ReadByte(); if (bytes[i] > biggest) { biggest=bytes[i]; } } and I don't know how to put values into stream. Because byte is only positive values. And I need to have from [-1,1] for (int i = 0; i < bytes.Count(); i++) { bytes[i] = (byte)(bytes[i] * (1 / biggest)); }

    Read the article

  • delete everything before last comma

    - by clankill3r
    I want to delete everything before the last tab (or comma). For example, in this sentence: Hoe treedt een gevestigd instituut als het Nederlands Openluchtmuseum, alom geassocieerd met ambacht en traditie, buiten zijn grenzen op zoek naar vernieuwing? should be naar vernieuwing? Ik heb ruim 6 weken geleden een boek besteld en ik wacht nog steeds,enig idee hoe lang dit wachten nog gaat duren? should be enig idee hoe lang dit wachten nog gaat duren? I tried this, "^(.*\t+)+" but that doesn't work.

    Read the article

  • How do I add values to semi-complex JSON object?

    - by Nick Verheijen
    I'm fairly new to using JSON objects and I'm kinda stuck. I've got an JSON object that was converted from this array: Array ( [status] => success [id] => 1 [name] => Zone 1 [description] => Awesome zone deze.. [tiles] => Array ( // Column for the tile grid [0] => Array ( // Row for the tile grid [0] => Array ( [tileID] => 1 [rotation] => 0 ) [1] => Array ( [tileID] => 1 [rotation] => 0 ) // Etc.. ) [1] => Array // etc.. etc.. ) ) I use this object to render out an isometric grid for my HTML5 Canvas game. I'm building a map editor and to put more tiles on the map, i'll have to add values to this json object. This is how I would do it in PHP: mapData[column][row] = array( 'tileID' => 1, 'rotation' => 0 ); So my question is, how do I achieve this with a JSON object in javascript? Thanks in advance! Nick Update I've ran into an error: can't convert undefined to object mapDataTiles[mouseY][mouseX] = { tileID: editorSelectedTile, rotation: 0 }; This is the code i use for clicking & then saving the new tile to the JSON object. At first I though that one of my parameters was 'undefined', so i logged those to the console but they came out perfectly.. // If there is already a tile placed on these coordinates if( mapDataTiles[mouseX] && mapDataTiles[mouseX][mouseY] ) { mapDataTiles[mouseX][mouseY]['tileID'] = editorSelectedTile; } // If there is no tile placed on these coordinates else { mapDataTiles[mouseX][mouseY] = { tileID: editorSelectedTile, rotation: 0 }; } My variables have the following values: MouseX: 5 MouseY: 17 tileID: 2 Also weird fact, that for some coordinates it does actually work and save new data to the array. mapDataTiles[mouseY][mouseX] = { tileID: editorSelectedTile, rotation: 0 };

    Read the article

  • Creating a function to grab data from an Oracle database (array by ID)

    - by Nick
    I'm trying to create a function that will simply allow me to pass an SQL statement into it, and it will generate an array based on a unique ID I pass it: function oracleGetGata($query, $id="id") { global $conn; $sql = OCI_Parse($conn, $query); OCI_Execute($sql); OCI_Fetch_All($sql, $results, null, null, OCI_FETCHSTATEMENT_BY_ROW); return $results; }   For example I'd like this query $array = oracleGetData('select * from table') to return something like: [1] => Array ( [Title] => Title 1 [Description] => Description 1 ) [2] => Array ( [Title] => Title 2 [Description] => Description 2 ) [3] => Array ( [Title] => Title 3 [Description] => Description 3 )   Rather than what it's returning at the moment: [0] => Array ( [ID] => 3 [TITLE] => Title 3 [DESCRIPTION] => Description 3 ) [1] => Array ( [ID] => 1 [TITLE] => Title 1 [DESCRIPTION] => Description 1 ) [2] => Array ( [ID] => 2 [TITLE] => Title 2 [DESCRIPTION] => Description 2 )   I'd really appreciate any help with this, as the function would save me lots of time! Thank you.

    Read the article

  • mysql_affected_rows() returns 0 for UPDATE statement even when an update actually happens

    - by Alex Moore
    I am trying to get the number of rows affected in a simple mysql update query. However, when I run this code below, PHP's mysql_affected_rows() always equals 0. No matter if foo=1 already (in which case the function should correctly return 0, since no rows were changed), or if foo currently equals some other integer (in which case the function should return 1). $updateQuery = "UPDATE myTable SET foo=1 WHERE bar=2"; mysql_query($updateQuery); if (mysql_affected_rows() > 0) { echo "affected!"; } else { echo "not affected"; // always prints not affected } The UPDATE statement itself works. The INT gets changed in my database. I have also double-checked that the database connection isn't being closed beforehand or anything funky. Keep in mind, mysql_affected_rows doesn't necessarily require you to pass a connection link identifier, though I've tried that too. Details on the function: mysql_affected_rows Any ideas? SOLUTION The part I didn't mention turned out to be the cause of my woes here. This PHP file was being called ten times consecutively in an AJAX call, though I was only looking at the value returned on the last call, ie. a big fat 0. My apologies!

    Read the article

  • How use unobtrusive validation without a model

    - by Ross Cyrus
    i have simple a form wich made by htmlHelper(mvc3) then inside of it i have 2 input field 1:type=text 2:type=submit to submit the form. there is no model behind.so i need to perfom a clientside validation on the textfield before submit it to the server.but i dont know how. i tried this puting manualy the 'data-* artibute , but does not work : @using( Html.BeginForm()) { <label for="UserName" >User Name</label> <div class="editor-field"> <input type="text" data-val="true" data-val-requierd="You must provide an user Name" id="userName" name="userName" placeholder="Enter Your User Name" /> </div> <input type="submit" value="Recover" /> } the "jquery.validate.min.js" and jquery.validate.unobtrusive.min.js and jquery.validate.min.js and jquery.validate.unobtrusive.min.js are loaded to the page. It doesnt let me to answer my self ,so i put it here : I solve it my self,just made an other view wich has its own model and Required on its propertyis and then just copy the renderd html to my own,and i got this and works : <input data-val="true" data-val-required="You must provide an user Name" id="UserName" name="UserName" type="text" value="" placeholder="Enter your User Name"/> <span class="field-validation-valid" data-valmsg-for="UserName" data-valmsg-replace="true"></span> And there is no type="Required".any way thank you guys.

    Read the article

  • Android ExpandableListView From Database

    - by SterAllures
    I want to create a two level ExpandableListView from a local database. The group level I want to get the names from the database Category table category_id | name ------------------- 1 | NameOfCategory the children level I want to get the names from the List table list_id | name | foreign_category_id -------------------------------- 1 | Listname | 1 I've got a method in DatabaseDAO to get all the values from the table public List<Category> getAllCategories() { database = dbHelper.getReadableDatabase(); List<Category> categories = new ArrayList<Category>(); Cursor cursor = database.query(SQLiteHelper.TABLE_CATEGORY, null, null, null, null, null, null); cursor.moveToFirst(); while(!cursor.isAfterLast()) { Category category = cursorToCategory(cursor); categories.add(category); cursor.moveToNext(); } cursor.close(); return categories; } Now adding the names to the group level is easy I do it the following way: ArrayList<String> groups; for(Category c : databaseDao.getAllCategories()) { groups.add(c.getName()); } Now I want to add the children to the ExpandableListView in the following array ArrayList<ArrayList<ArrayList<String>>> children;. How do I get the children under the correct group name? I think it has to do somenthing with groups.indexOf() but in the list table I only have a foreign category_id and not the actual name.

    Read the article

  • ResourceManager and not supported platform

    - by wince
    I use ResourceManager for UI localization of my WinCE 5 software. I have some resource files with text strings on different languages Resourse.resx Resourse.de-DE.resx Resourse.ru-RU.resx When I want to display UI in English I call: Resourse.Culture = new CultureInfo("en-US"); label1.Text = Resourse.LabelText; in German: Resourse.Culture = new CultureInfo("de-DE"); label1.Text = Resourse.LabelText; in Russian: Resourse.Culture = new CultureInfo("ru-RU"); label1.Text = Resourse.LabelText; but here I get PlatformNotSupportedException. I know that my WinCE does not contain Russian and I cannot modify OS to appened this, so my question is how I can say to ResourceManger to use Resourse.ru-RU.resx when I set Culture = new CultureInfo("ru-RU") ?

    Read the article

  • Looking for Open-Source or Licensed Personalised Greeting Card software

    - by Mr Pablo
    Before I jump in at the very deep end and try to make my own version of Moon Pig (www.moonpig.com) I would like to know what (if any) software/platforms currently exist that allow for visitors to personalise cards with text and uploaded photos and then purchase printed versions all via a single e-Commerce style platform. I have Googled till my fingers bled and I cannot find anything that matches my needs, which are: admin can provide templates (backgrounds) for the cards users can customise the card with text (font style and colour) users can upload their own photos (minor editing e.g. crop) to insert into the cards user can purchase a printed card via credit card payment Seeing as this kind of e-Commerce has been around for a while now, I would have thought there were some systems to purchase that can provide this functionality?

    Read the article

  • INNER JOIN code calculated value with SELECT statement

    - by sp-1986
    I have the following stored procedure which will generate mon to sun and then creates a temp table with a series of 'weeks' (start and end weeks) : USE [test_staff] GO /****** Object: StoredProcedure [dbo].[sp_timesheets_all_staff_by_week_by_job_grouping_by_site] Script Date: 03/21/2012 09:04:49 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[sp_timesheets_all_staff_by_week_by_job_grouping_by_site] ( @grouping_ref int, @week_ref int ) AS CREATE TABLE #WeeklyList ( Start_Week date, End_Week date, week_ref int --month_name date ) DECLARE @REPORT_DATE DATETIME, @WEEK_BEGINING VARCHAR(10) SELECT @REPORT_DATE = '2011-01-19T00:00:00' --SELECT @REPORT_DATE = GETDATE() -- should grab the date now. SELECT @WEEK_BEGINING = 'MONDAY' IF @WEEK_BEGINING = 'MONDAY' SET DATEFIRST 1 ELSE IF @WEEK_BEGINING = 'TUESDAY' SET DATEFIRST 2 ELSE IF @WEEK_BEGINING = 'WEDNESDAY' SET DATEFIRST 3 ELSE IF @WEEK_BEGINING = 'THURSDAY' SET DATEFIRST 4 ELSE IF @WEEK_BEGINING = 'FRIDAY' SET DATEFIRST 5 ELSE IF @WEEK_BEGINING = 'SATURDAY' SET DATEFIRST 6 ELSE IF @WEEK_BEGINING = 'SUNDAY' SET DATEFIRST 7 DECLARE @WEEK_START_DATE DATETIME, @WEEK_END_DATE DATETIME --GET THE WEEK START DATE SELECT @WEEK_START_DATE = @REPORT_DATE - (DATEPART(DW, @REPORT_DATE) - 1) --GET THE WEEK END DATE SELECT @WEEK_END_DATE = @REPORT_DATE + (7 - DATEPART(DW, @REPORT_DATE)) PRINT 'Week Start: ' + CONVERT(VARCHAR, @WEEK_START_DATE) PRINT 'Week End: ' + CONVERT(VARCHAR, @WEEK_END_DATE) DECLARE @Interval int = datediff(WEEK,getdate(),@WEEK_START_DATE)+1 --SELECT Start_Week=@WEEK_START_DATE --, End_Week=@WEEK_END_DATE --INTO #WeekList INSERT INTO #WeeklyList SELECT Start_Week=@WEEK_START_DATE, End_Week=@WEEK_END_DATE WHILE @Interval <= 0 BEGIN set @WEEK_START_DATE=DATEADD(WEEK,1,@WEEK_START_DATE) set @WEEK_END_DATE=DATEADD(WEEK,1,@WEEK_END_DATE) INSERT INTO #WeeklyList values (@WEEK_START_DATE,@WEEK_END_DATE) SET @Interval += 1; END SELECT CONVERT(VARCHAR(11), Start_Week, 106) AS 'month_name', CONVERT(VARCHAR(11), End_Week, 106) AS 'End', DATEDIFF(DAY, 0, Start_Week) / 7 AS week_ref -- create the unique week reference number --'VIEW' AS month_name FROM #WeeklyList In this section i am creating the week_ref DATEDIFF(DAY, 0, Start_Week) / 7 AS week_ref -- create the unique week reference number I then need to combine it with this select code: DECLARE @YearString char(3) = CONVERT(char(3), SUBSTRING(CONVERT(char(5), @week_ref), 1, 3)) DECLARE @MonthString char(2) = CONVERT(char(2), SUBSTRING(CONVERT(char(5), @week_ref), 4, 2)) --Convert: DECLARE @Year int = CONVERT(int, @YearString) + 1200 DECLARE @Month int = CONVERT(int, @MonthString) **--THIS FILTERS THE REPORT** SELECT ts.staff_member_ref, sm.common_name, sm.department_name, DATENAME(MONTH, ts.start_dtm) + ' ' + DATENAME(YEAR, ts.start_dtm) AS month_name, ts.timesheet_cat_ref, cat.desc_long AS timesheet_cat_desc, grps.grouping_ref, grps.description AS grouping_desc, ts.task_ref, tsks.task_code, tsks.description AS task_desc, ts.site_ref, sits.description AS site_desc, ts.site_ref AS Expr1, CASE WHEN ts .status = 0 THEN 'Pending' WHEN ts .status = 1 THEN 'Booked' WHEN ts .status = 2 THEN 'Approved' ELSE 'Invalid Status' END AS site_status, ts.booked_time AS booked_time_sum, start_dtm, CONVERT(varchar(20), start_dtm, 108) + ' ' + CONVERT(varchar(20), start_dtm, 103) AS start_dtm_text, booked_time, end_dtm, CONVERT(varchar(20), end_dtm, 108) + ' ' + CONVERT(varchar(20), end_dtm, 103) AS end_dtm_text FROM timesheets AS ts INNER JOIN timesheet_categories AS cat ON ts.timesheet_cat_ref = cat.timesheet_cat_ref INNER JOIN timesheet_tasks AS tsks ON ts.task_ref = tsks.task_ref INNER JOIN timesheet_task_groupings AS grps ON tsks.grouping_ref = grps.grouping_ref INNER JOIN timesheet_sites AS sits ON ts.site_ref = sits.site_ref INNER JOIN vw_staff_members AS sm ON ts.staff_member_ref = sm.staff_member_ref WHERE (ts.status IN (1, 2)) AND (cat.is_leave_category = 0) GROUP BY ts.staff_member_ref, sm.common_name, sm.department_name, DATENAME(MONTH, ts.start_dtm), DATENAME(YEAR, ts.start_dtm), ts.timesheet_cat_ref, cat.desc_long, grps.grouping_ref, grps.description, ts.status, ts.booked_time, ts.task_ref, tsks.task_code, tsks.description, ts.site_ref, sits.description, ts.start_dtm, ts.end_dtm ORDER BY sm.common_name, timesheet_cat_desc, tsks.task_code, site_desc DROP TABLE #WeeklyList GO I want to pass the week_ref into the SELECT statement (refer to comment - THIS FILTERS THE REPORT) but the problem is week_ref isnt a valid column as its derived by code. Any ideas?

    Read the article

  • jQuery UI Draggable-Droppable overflow:visible

    - by Jeff
    Sadly, I am unable to provide any JSFiddle for this issue, as I cant seem to reproduce it outside my project. I have a container where there are some boxes, that can be arranged using drag and drop, by utilizing jQuery UI. The problem is, that the container is overflow:auto; but it needs to be overflow:visible;, but if I do that, jQuery UI malfunctions. When a box drag is initiated, it will immediatly jump up aproximately 400-500px. This is how the draggable is created: $(".draggable").draggable({ revert: 'invalid', // when not dropped, the item will revert back to its initial position containment: '#editContainer', // stick to demo-frame if present helper: 'original', cursor: 'move' }); Is this a bug with jQuery UI, or can this be fixed on my end? I apologize for the lack of source code.

    Read the article

  • Agile development; on-line free tools!

    - by BT.
    We have been looking to implement Agile methodology within our geographically distributed development team, so i need suggestions on any free on-line application that you have used and find useful. Right now we are using paper cards and wall to manage this :), but we want to shift to an on-line version preferably free. I have used TargetProcess at my previous job! My Core requirements are: Business Analyst can add user stories We can assign, prioritize different user stories to developers. QA team can add test cases around different user stories. Project Manager can track the time of all the resources and can pull reports for upper management

    Read the article

  • Advanced search engine or server for relational database [closed]

    - by Pawel
    In my current project we are storing big volume of data in relational database. One of the recent key requirements is to enrich application by adding some advanced search capabilities. In the Project, performance is one of the important factors due to very large tables (10+ milions of records) with parent-children relations (for example: multi-level parent-child relationship, where I am looking for all parents with specific children). The search engine should also be able to check these references for hits. I have found some potential engines on stack overflow, however it looks like that all of them are dedicated rather for text search than relational db and hosted on linux os: lucene Solr Sphinx As I understand some of them use documents as a source of searching, but is it possible or efficient to create programmaticaly documents based on my relational data? As I am not familiar with all of their features/capabilities can anyone please make some recommendations or propose some different solution? To summarize my requirements: framework/engine to search relational database including decendants. support for Microsoft SQL Server can be used in .NET applications preferably hosted on Windows systems Does any of mentioned above are able to solve my problem? do you know any better solution?

    Read the article

  • Python: Serial Transmission

    - by Silent Elektron
    I have an image stack of 500 images (jpeg) of 640x480. I intend to make 500 pixels (1st pixels of all images) as a list and then send that via COM1 to FPGA where I do my further processing. I have a couple of questions here: How do I import all the 500 images at a time into python and how do i store it? How do I send the 500 pixel list via COM1 to FPGA? I tried the following: Converted the jpeg image to intensity values (each pixel is denoted by a number between 0 and 255) in MATLAB, saved the intensity values in a text file, read that file using readlines(). But it became too cumbersome to make the intensity value files for all the 500 images! Used NumPy to put the read files in a matrix and then pick the first pixel of all images. But when I send it, its coming like: [56, 61, 78, ... ,71, 91]. Is there a way to eliminate the [ ] and , while sending the data serially? Thanks in Advance! :)

    Read the article

  • parse JSON . I have server response

    - by GauravBOSS
    i am new in JSON Parsing . i have a server response how i can fetch the "Device Name and Id" of 0 index. thanks in Advance { Successfully = ( { 0 = { DeviceName = Tommy; DeviceTypeId = 1; EMEI = xxxxxx; GId = xxxxx; Id = 105; Pet = "<null>"; PetImage = "352022008228784.jpg"; ProtocolId = xxxx; SimNo = xxxxx; }; } ); }

    Read the article

  • How to generate a Program template by generating an abstract class

    - by Byron-Lim Timothy Steffan
    i have the following problem. The 1st step is to implement a program, which follows a specific protocol on startup. Therefore, functions as onInit, onConfigRequest, etc. will be necessary. (These are triggered e.g. by incoming message on a TCP Port) My goal is to generate a class for example abstract one, which has abstract functions as onInit(), etc. A programmer should just inherit from this base class and should merely override these abstract functions of the base class. The rest as of the protocol e.g. should be simply handled in the background (using the code of the base class) and should not need to appear in the programmers code. What is the correct design strategy for such tasks? and how do I deal with, that the static main method is not inheritable? What are the key-tags for this problem? (I have problem searching for a solution since I lack clear statements on this problem) Goal is to create some sort of library/class, which - included in ones code - results in executables following the protocol. EDIT (new explanation): Okay let me try to explain more detailled: In this case programs should be clients within a client server architecture. We have a client server connection via TCP/IP. Each program needs to follow a specific protocol upon program start: As soon as my program starts and gets connected to the server it will receive an Init Message (TcpClient), when this happens it should trigger the function onInit(). (Should this be implemented by an event system?) After onInit() a acknowledgement message should be sent to the server. Afterwards there are some other steps as e.g. a config message from the server which triggers an onConfig and so on. Let's concentrate on the onInit function. The idea is, that onInit (and onConfig and so on) should be the only functions the programmer should edit while the overall protocol messaging is hidden for him. Therefore, I thought using an abstract class with the abstract methods onInit(), onConfig() in it should be the right thing. The static Main class I would like to hide, since within it e.g. there will be some part which connects to the tcp port, which reacts on the Init Message and which will call the onInit function. 2 problems here: 1. the static main class cant be inherited, isn it? 2. I cannot call abstract functions from the main class in the abstract master class. Let me give an Pseudo-example for my ideas: public abstract class MasterClass { static void Main(string[] args){ 1. open TCP connection 2. waiting for Init Message from server 3. onInit(); 4. Send Acknowledgement, that Init Routine has ended successfully 5. waiting for Config message from server 6..... } public abstract void onInit(); public abstract void onConfig(); } I hope you get the idea now! The programmer should afterwards inherit from this masterclass and merely need to edit the functions onInit and so on. Is this way possible? How? What else do you recommend for solving this? EDIT: The strategy ideo provided below is a good one! Check out my comment on that.

    Read the article

  • XPATH: multiple negations in for-each

    - by Peter
    I have the following simplified XML: <?xml version="1.0" encoding="UTF-8" ?> <MATMAS05> <IDOC BEGIN="1"> <E1MARAM SEGMENT="1"> <MSGFN>005</MSGFN> <MATNR>000000000000401436</MATNR> <E1MARCM SEGMENT="1"> <MSGFN>005</MSGFN> <WERKS>A120</WERKS> <MMSTA>01</MMSTA> </E1MARCM> <E1MVKEM SEGMENT="1"> <VKORG>0120</VKORG> <VMSTA>04</VMSTA> </E1MVKEM> </E1MARAM> </IDOC> </MATMAS05> If <WERKS>=A120 and <MMSTA> is NOT '01' or '02' or '03' OR if <VKORG>=0120 and <VMSTA> is NOT '01' or '02' or '03' then the <MATNR> should be mapped to the target XML. I came up with the following XSLT: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output encoding="UTF-8" method="xml" indent="yes"/> <xsl:template match="/*"> <xsl:for-each select="IDOC[(E1MARAM/E1MVKEM[VKORG='0120'][not(VMSTA='01' or VMSTA='02' or VMSTA='03')]) or (E1MARAM/E1MARCM[WERKS = 'A120'][not(MMSTA='01' or MMSTA='02' or MMSTA='03')])]"> <Item> <ITEM_CODE> <xsl:value-of select="E1MARAM/MATNR"/> </ITEM_CODE> </Item> </xsl:for-each> </xsl:template> </xsl:stylesheet> But if I apply that XSLT I get the following unwanted output (because <MMSTA>='01'): <?xml version="1.0" encoding="UTF-8"?> <Item> <ITEM_CODE>000000000000401436</ITEM_CODE> </Item> How can I solve this? I have tried around with that XPATH expression but I can't get the wanted result. What am I doing wrong in my XPATH? Thank you for any ideas with this. Best regards, Peter

    Read the article

  • on page load clone first image from collection of photos

    - by user313378
    On my page I'm getting collection of photos, and I store them as thumbs below showImage div which needs to be refreshed with cloned image onclick. Basically everything is ok except I need to populate this showImage div onpage load with first image, and then to use this onclick clone which already works. <a href="/Property/GetImage/someIntId"> <img id="someIntId" class="details" width="100" height="100" src="/Property/GetImage/7" alt=""> </a> function onPopUp() { $(".details").click(function (event) { //clone the clicked image var clone = $(this).clone(); clone.height("250px").width("280px"); //place it in the placeholder $('div#showImage').html(clone); }); }

    Read the article

  • Replace broken image with noimage icon using Jquery

    - by hmloo
    Sometimes when the image isn't available on server, the web page will show a broken image. so we can display a "no image available" image for good user experience. I will implement it using Jquery. $(document).ready(function() { $("img").error(function() { $(this).hide(); }) .attr("src", "noimage.jpg"); }); Please note that we must first hide the broken image, or else even if we set the src to noimage, it still can not show  noimage icon.

    Read the article

  • Computer Arithmetic - Binary for Decimal Numbers

    - by MarkPearl
    This may be of use to someone else doing this course… The Problem In the section on Computer Arithmetic it gives an example of converting -7.6875 to IEEE floating point format. I understand all the steps except for the first one, where it does the following... 7.6875 (base 10) = 111.1011 (base 2) I don't understand the conversion - I realize that 111 (base 2) = 7 (base 10), but how does the .6875 part relate to the .1011? Or am I totally off track with this? The Solution The fractional part of the decimal to binary conversion is done as follows: 0.6875 x 2 = 1.375 = 0.375 + 1 (Keep the 1 separate) 0.375 x 2   = 0.75   = 0.75    + 0 0.75 x 2    = 1.5      = 0.5      + 1 0.5 x 2     = 1.0       = 0.0       + 1 The bit pattern of 0s and 1s on the right-hand side gives you the fractional part. So 0.6875 (base 10) = .1011 (Base 2) See also Stallings, chapter 19.

    Read the article

  • Two virtual host one with Domain name one with internal ip#?

    - by Abhishek
    Is it possible to have two virtual host configurations for the same server - one with internal ip address and one with domain name? Something like <VirtualHost {{internal-ipaddress}}:80> ....... </VirtualHost> <VirtualHost {{domain-name}}:80> ....... </VirtualHost> Note that the internal IP address and the domain name belong to the same server or same server instance. I am asking this to restrict some URLs for external users, redirect to https all external access and allow everything for internal users(without https)..

    Read the article

  • Iptables - Open Port Only for one Server IP (allow connections from a specific range)

    - by user1015314
    My server has multiple IPs, 1.1.1.1 1.1.1.2 and i have a service which listens to a port e.g. 88 Now i want, when somebody from outside, wants to connect to the port, that he can only connect, to that port, if he connects to the ip 1.1.1.2:88 but if he tries to connect to 1.1.1.1:88 it should not react and it should look like that it dont exists and drops all connections. Ok, than i need for 1.1.1.2:88 that only allows a specific ip range outside connecters. for example only 9.*.*.* can connect to that port and ip. I'm using Centos. Thank you for your help.

    Read the article

  • How to exclude a specific URL from basic authentication in Apache?

    - by ripper234
    Two scenarios: Directory I want my entire server to be password-protected, so I included this directory config in my sites-enabled/000-default: <Directory /> Options FollowSymLinks AllowOverride None AuthType Basic AuthName "Restricted Files" AuthUserFile /etc/apache2/passwords Require user someuser </Directory> The question is how can I exclude a specific URL from this? Proxy I found that the above password protection doesn't apply to mod_proxy, so I added this to my proxy.conf: <Proxy *> Order deny,allow Allow from all AuthType Basic AuthName "Restricted Files" AuthUserFile /etc/apache2/passwords Require user someuser </Proxy> How do I exclude a specific proxied URL from the password protection? I tried adding a new segment: <Proxy http://myspecific.url/> AuthType None </Proxy> but that didn't quite do the trick.

    Read the article

  • Running Tomcat 7 and Apache 2 on the same server

    - by Thorn
    Part of my site needs to run over HTTPS and I'm creating a sub-domain for that part. I have apache httpd 2 AND Tomcat 7 running on the same server with the same IP, Apache is on port 80 of course, while Tomcat is running on port 8080. Right now I am doing domain forwarding for requests that need to run off tomcat. For example, mathteamhosting.com/mathApp can forward to mathteamhosting.com:8080/mathApp. I would like to have Tomcat handle the https requests for that subdomain. I don't think this forwarding technique can work in this case. How do I set that up so that Tomcat receives the requests on port 443 while apache handles port 80. To be more specific: http://proctinator.com == request goes to Apache web server https://private.proctinator.com == request goes to Apache web server

    Read the article

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