Search Results

Search found 279 results on 12 pages for 'soo wei tan'.

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

  • Neural Network: Handling unavailable inputs (missing or incomplete data)

    - by Mike
    Hopefully the last NN question you'll get from me this weekend, but here goes :) Is there a way to handle an input that you "don't always know"... so it doesn't affect the weightings somehow? Soo... if I ask someone if they are male or female and they would not like to answer, is there a way to disregard this input? Perhaps by placing it squarely in the centre? (assuming 1,0 inputs at 0.5?) Thanks

    Read the article

  • AS3: how to get current calendar week

    - by msec
    How can I get the current calendar week with AS3 ? I've not found any information by using the official adobe online-reference (check: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/Date.html) or using google's web search. Thank you soo much! Kind Regards, msec

    Read the article

  • Booting from virtual machine VMWAre

    - by vikp
    Hi, I have a VMWare virtual machine (windows xp). I have just started it up through the VMWare player and it's extremely slow on my laptop (expected). Is it possible to boot from that image like in mac bootcamp so that it's not virtualised and soo slow? Thank you

    Read the article

  • What setup in .Net would most resemble Django

    - by Mingus Rude
    At work we are inte process of starting development on a new web-based product. Before doing so we need to establish what technology stack we are going to use. For this application my preference would have been to use Django but since the development- and management-team is soo heavily rooted with Microsoft the new product will have to be based on Microsoft technologies. So my question is, what setup, with Microsoft technologies, would most resemble a django setup with its MVT-design?

    Read the article

  • jquery ui drag and drop + ajax problem

    - by mobster
    I'm making board game and i'm using jquery ui draggable effect for figures. On drag start I send ajax request to other page where I generate droppable places soo the figure can be drag and droped only on those particular places, but the problem is I must move figure twice to take effect. Does anyone know how to solve this problem? I would be very grateful for help.

    Read the article

  • PHP Shared Sessions across Domain

    - by bigstylee
    Hi, I have seen a few answers to this on SOO but most of these are concerned with the use of subdomains, of which none have worked for me. The common one being that the use of session.cookie_domain, which from my understanding will only work with subdomains. I am interested in a solution that deals with deals with entirely different domains (and includes the possibility of subdomains). Unfortunately project deadlines being what they are, time is not on my side, so I turn to SOO's expertise and experience. The current project brief is to be able to log into one site which currently only stores the user_id in the session and then be able to retrieve this value while on a different domain within the same server enviroment. Session data is being stored/retrieved from a database where the session id is the primary key. I am hoping to find a "light wieght" and "easy" to implement solution. The system is utlising an in-house Model View Controller design pattern, so all requests (including different domains) are run through a single bootstrap script. Using the domain name as a variable, this determines what context to display to the user. One option that did look like to have potential is the use of a hidden image and using the alt tag to set the user id. My first impressions suggest this immediately seems "too easy" (if possible) and riddled with security flaws. Disscuss? Another option which I considered is using the IP and User Agent for authentication but again I feel this not going to be a reliable option due to shared networks and changing IP addresses. My third option (and preferred) which I considered and as yet not seen discussed is using htaccess to fool the user into thinking that they are on a different domain when infact apache is redirecting; something like www.foo.com/index.php?domain=bar.com&controller=news/categoires/1 but displays to the user as www.bar.com/news/categories/1 foo.com represents the "main site domain" which all requests are run through and bar.com is what the user thinks they are accessing. The controller request dictates the page and view being requested. Is this possible? Are there other options? Pros/Cons? Thanks in advanced!!!

    Read the article

  • Neural Network: Handling unavailable inputs

    - by Mike
    Hopefully the last NN question you'll get from me this weekend, but here goes :) Is there a way to handle an input that you "don't always know"... so it doesn't affect the weightings somehow? Soo... if I ask someone if they are male or female and they would not like to answer, is there a way to disregard this input? Perhaps by placing it squarely in the centre? (assuming 1,0 inputs at 0.5?) Thanks

    Read the article

  • Smart coding on ActionScript 2 (importing vars from a php)

    - by DomingoSL
    Hello, i have a php who when is executed it give me a couple of vars in this format: &lVar1=DATA1&&lVar2=DATA2&&lVar3=DATA3 and soo... The problem is that i dont know the quantity of lVar the php script is gonna give in any time, so i cant figure out a smart script in AS2 to import all of them into a array to my flash. Can you help me?

    Read the article

  • IIS 7 (Windows Server 2008) no entrega javascript ni css

    - by José Marcos García Espinosa
    Hace algunos días, jugando con las configuraciones del IIS, revolvíamos las opciones de compresión de contenidos. La intención era habilitar gzip para el contenido estático pero la cosa salió tan mal que el portal, en vez de reducir su tamaño por los contenidos comprimidos, lo "redujo" porque el servidor dejó de enviar los archivos javascript y las hojas de estilo al navegador. Después de estar buscando como hora y media, resultó que la explicación y la solución eran bastante sencillas (y ni siquiera las encontramos nosotros): Al estar cambiando las opciones de compresión de contenidos estáticos del IIS, se crearon unos archivos de configuración (web.config's) tanto en la carpeta de los archivos javascript como en la de las hojas de estilo, que es una estructura que el propio IIS no reconocía y dejaba la aplicación 'cortada', dejando fuera estas carpetas. Eliminar ambos archivos de configuración bastó para volver a visualizar el portal como se debía.. de la compresión, creo que ya ni seguimos buscando.

    Read the article

  • Estudio de caso: CFO de At&T le apunta a la tecnología para transformar las Finanzas Globales

    - by RED League Heroes-Oracle
    AT&T es una de las pocas multinacionales modernas que han participado de todas las etapas anteriores de la innovación de las telecomunicaciones, de Alexander Graham Bell como inventor solitario, a Bell Labs, a los lanzamientos acelerados en las fundiciones de AT&T. La tecnología es el corazón de todo lo que AT&T hace, incluyendo sus inversiones en innovaciones tecnológicas para permitir que las finanzas de AT&T trabajen más estratégicamente con los negocios para asegurar que las inversiones en las iniciativas de crecimiento sean exitosas. Según John Stephens, Vicepresidente Ejecutivo y director financiero de AT&T, la empresa ha trazado un plan de inversión de tres años para mejorar y aumentar sus redes IP de banda ancha alámbricas e inalámbricas. El plan incluye la implementación del servicio 4G LTE para 300 millones de personas en los Estados Unidos, expansión de IP de banda ancha de alta velocidad a unos 57 millones de hogares de clientes y una expansión de la fibra a 1 millón de clientes corporativos adicionales en su área de servicio de telefonía fija. "La necesidad de velocidad es mayor que nunca, y este proyecto es nuestro paso hacia la innovación para ofrecer tal velocidad," dice Stephens. Como AT&T moderniza su infraestructura global, sus procesos operacionales se hacen tan poderosos como su red. Ha sido una tarea grande y compleja, pero Stephens se complace al decir que el departamento de finanzas de AT&T ha adoptado su papel de catalizador corporativo. Empezó con un concepto simple: "Vamos a hacer que todos hablen en el mismo idioma". Esto llevó a la consolidación de sistemas financieros heredados de las empresas adquiridas. No fue una tarea sencilla, dado que la empresa pasó por más de cinco adquisiciones importantes y un sinfín de otras transacciones. En 2007, AT&T tenía 17 aplicaciones apenas en la función de cuentas por pagar. Hoy, el número se ha reducido a dos. Asimismo, hubo 50 sistemas de reportes gerenciales oficiales y ahora hay tres, con planes de excluir uno de ellos. Al tener un único lenguaje volcado a las Finanzas en toda la empresa, el equipo de finanzas de AT&T ha eliminado las varias versiones de los mismos datos, reduciendo la posible confusión en las discusiones y en las decisiones de estrategia de negocios. Estos pasos también han reducido los costos y aceleraron la toma de decisiones. "Lo lindo de los sistemas es que permiten que la gente talentosa con habilidades analíticas usen su tiempo en esa zona, en vez de gastar tiempo en recolección, agregación y organización de los datos," señala Stephens. "Tenemos un proceso eficiente y eficaz que hace que nosotros, dejemos a la gente libre para dedicarse a aquello en que son realmente buenos. Y tenemos un equipo de alta calidad y ellos están en su mejor punto cuando son capaces de hacer su función para apoyar a la unidad de negocio”AT&T es una de las pocas multinacionales modernas que han participado de todas las etapas anteriores de la innovación de las telecomunicaciones, de Alexander Graham Bell como inventor solitario, a Bell Labs, a los lanzamientos acelerados en las fundiciones de AT&T. La tecnología es el corazón de todo lo que AT&T hace, incluyendo sus inversiones en innovaciones tecnológicas para permitir que las finanzas de AT&T trabajen más estratégicamente con los negocios para asegurar que las inversiones en las iniciativas de crecimiento sean exitosas.  Según John Stephens, Vicepresidente Ejecutivo y director financiero de AT&T, la empresa ha trazado un plan de inversión de tres años para mejorar y aumentar sus redes IP de banda ancha alámbricas e inalámbricas. El plan incluye la implementación del servicio 4G LTE para 300 millones de personas en los Estados Unidos, expansión de IP de banda ancha de alta velocidad a unos 57 millones de hogares de clientes y una expansión de la fibra a 1 millón de clientes corporativos adicionales en su área de servicio de telefonía fija. "La necesidad de velocidad es mayor que nunca, y este proyecto es nuestro paso hacia la innovación para ofrecer tal velocidad," dice Stephens. Como AT&T moderniza su infraestructura global, sus procesos operacionales se hacen tan poderosos como su red. Ha sido una tarea grande y compleja, pero Stephens se complace al decir que el departamento de finanzas de AT&T ha adoptado su papel de catalizador corporativo. Empezó con un concepto simple: "Vamos a hacer que todos hablen en el mismo idioma". Esto llevó a la consolidación de sistemas financieros heredados de las empresas adquiridas. No fue una tarea sencilla, dado que la empresa pasó por más de cinco adquisiciones importantes y un sinfín de otras transacciones. En 2007, AT&T tenía 17 aplicaciones apenas en la función de cuentas por pagar. Hoy, el número se ha reducido a dos. Asimismo, hubo 50 sistemas de reportes gerenciales oficiales y ahora hay tres, con planes de excluir uno de ellos. Al tener un único lenguaje volcado a las Finanzas en toda la empresa, el equipo de finanzas de AT&T ha eliminado las varias versiones de los mismos datos, reduciendo la posible confusión en las discusiones y en las decisiones de estrategia de negocios. Estos pasos también han reducido los costos y aceleraron la toma de decisiones. "Lo lindo de los sistemas es que permiten que la gente talentosa con habilidades analíticas usen su tiempo en esa zona, en vez de gastar tiempo en recolección, agregación y organización de los datos," señala Stephens. "Tenemos un proceso eficiente y eficaz que hace que nosotros, dejemos a la gente libre para dedicarse a aquello en que son realmente buenos. Y tenemos un equipo de alta calidad y ellos están en su mejor punto cuando son capaces de hacer su función para apoyar a la unidad de negocio”

    Read the article

  • Obtener perfiles en un Gridivew

    - by jaullo
    Saber quienes forman parte de nuestra aplicación es sencial, principalmente cuando deseamos hacer una "auditoria" de nuestro sistema. Cuando utilizamos el membership provider de asp.net podemos obtener esos usuarios en una lista para su identificación. Así que, veremos como podemos obtener esos usuarios en un gridivew. Algo tan sencillo como 2 líneas de código.   Primeramente creamos una página asp.net y agregamos un gridview, <asp:GridView ID="gvprofiles" runat="server" AutoGenerateColumns="true" AllowPaging="true" GridLines="Both" > </asp:GridView> Ahora lo que a muchos les apasiciona el código, veamos como podemos llenar nuestro gridview. En el vento LOAD  de nuestra página agregamos: gvprofiles.DataSource = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.Authenticated) gvprofiles.DataBind();   Muchas de estas funcionalidades, estarán disponibles unicamente si nuestro sitio asp.net tiene las funciones en la seguridad habilitadas.

    Read the article

  • Fusion 3.1 and Parallels 6 for Win7 x64

    - by Ronnie
    I read in a recent article that Parallels Desktop 6 is faster almost everywhere than VMware Fusion. I was originally using Parallels 4 before passing to VMware due to the frequent Parallels crashes. As now I am using a lot Fusion on my Macbook on a big Win7 x64 virtualized development machine that I find too slow I am wondering if the announced speed up of Parallels V6 is justified to come back to it. As a test I converted my Fusion 3.1 to a trial of Parallels Desktop 6 and my Windows Experience Index passed from 4.7 of Fusion to 4.5 on Parallels 6 so apparently the virtualized machine is not seeing that speed benefit. Is there any optimization to set up on Parallels to increase the WEI or should I stay with Fusion (and in this case this kind of articles is just marketing stuff)?

    Read the article

  • configuring USB modem( Huawei EC156) in ubuntu 13.10

    - by user205427
    I am facing difficulty in installing my USB modem in Ubuntu 13.10. Contrary to what many have suggested,it does not get detected automatically, nor does setting a new connection help. USB Device is listed in lsusb, but not under network manager or Devices, it is detected as a CD-ROM, what I understood from the web was that usb-modeswitch can be used to switch it to a USB device. Even 'Enable Mobile Broadband' option is not shown in network manager. What was interesting is when I start laptop with windows 7 and use the USB modem and after that restart with Ubuntu, both Enable Broadband and the mobile broadband connection can be seen. Sadly, internet connection could not be installed. I tried using USB-modeswitch command as suggested somewhere, but it does not seem to work. Following is the message. Take all parameters from the command line * usb_modeswitch: handle USB devices with multiple modes * Version 2.0.1 (C) Josua Dietze 2013 * Based on libusb1/libusbx ! PLEASE REPORT NEW CONFIGURATIONS ! DefaultVendor= 0x12d1 DefaultProduct= 0x1505 HuaweiMode=1 NeedResponse=0 InquireDevice enabled (default) Look for default devices ... found USB ID 8087:0020 found USB ID 1d6b:0002 found USB ID 0461:4db6 found USB ID 12d1:1505 vendor ID matched product ID matched found USB ID 138a:0007 found USB ID 03f0:231d found USB ID 8087:0020 found USB ID 1d6b:0002 Found devices in default mode (1) Access device 005 on bus 001 Get the current device configuration ... OK, got current device configuration (1) Use interface number 0 Use endpoints 0x08 (out) and 0x87 (in) Inquire device details; driver will be detached ... Looking for active driver ... OK, driver detached INQUIRY message failed (error -9) USB description data (for identification) ------------------------- Manufacturer: HUA?WEI TECHNOLOGIES Product: HUAWEI Mobile Serial No.: ??????????????????? ------------------------- Send old Huawei control message ... -> Run lsusb to note any changes. Bye! I am stuck with this problem for 4 days now, any help would be appreciated

    Read the article

  • Rotation matrix for a 3D vector

    - by Shashwat
    I have a direction vector on which I have to apply some rotation to align it to positive z-axis. To use Matrix.CreateRotationX(angle) of XNA, I need the angle for which I'd have to compute cos or tan inverse. I think this is a complex task to do. Also, eventually those are also converted to sin(angle) and cos(angle) in the matrix. Is there any inbuilt way to create rotation matrix from a 3D vector? However, I can write the function but still asking if there is one already there.

    Read the article

  • Is a function plotter a legitimate use of eval() in JavaScript?

    - by moose
    From PHP development I know that eval is evil and I've recently read What constitutes “Proper use” of the javascript Eval feature? and Don't be eval. The only proper use of eval I've read is Ajax. I'm currently developing a visualization tool that lets users see how polynomials can interpolate functions: Example Code on GitHub I use eval for evaluation of arbitrary functions. Is this a legitimate use of eval? How could I get rid of eval? I want the user to be able to execute any function of the following forms: a x^i with a,i in R sin, cos, tan b^x with b in R any combination that you can get by adding (e.g. x^2 + x^3 + sin(x)), multiplying (e.g. sin(x)*x^2) or inserting (e.g. sin(x^2))

    Read the article

  • Missing Coordinates. Basic Trigonometry Help.

    - by TheDarkIn1978
    please refer to my quick diagram attached below. what i'm trying to do is get the coordinates of the yellow dots by using the angle from the red dots' known coordinates. assuming each yellow dot is about 20 pixels away from the x:50/y:250 red dot at a right angle (i think that's what it's called) how do i get their coordinates? i believe this is very basic trigonometry and i should use Math.tan(), but they didn't teach us much math in art school.

    Read the article

  • vim unicode bufread/bufwrite script

    - by anon
    Problem: I want my unicode characters to be stored on disk as (rather tan utf8/16 encoding) \u#### However, I want them dispalyed as unicode characters when opened up in vim. I think the easiest way to acheive this is some bufopen/bufwrite script that automatically: on opening, convert \u#### to unicode character on writing, convert unicode characters into \u#### However, I don't know what functions to call to make this happen. Can someone lend a hand? Thanks!

    Read the article

  • a value that shows in select mode disappears in edit mode from a gridview column

    - by Jbob Johan
    i have a gridview(GridView1) with a few Bound Fields first one is Date (ActivityDate) from a table named "tblTime" i have managed to add one extra colum (manually), that is not bound that shows dayInWeek value according to the "ActivityDate" field programtically in CodeBehind but when i enter into Edit Mode , all Bound fields are showing their values correctly but the one column i have added manually will not show the value as it did in "select mode"(first mode b4 trying to edit) while im not a great dibbagger i have manged to view the cell's value (GridView1.Rows[e.NewEditIndex].Cells[1].Text) which does hold on to the day in week value but it does not appear in gridview edit mode only this is some of the code protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { e.Row.Cells[0].Text = "?????"; //Activity Date (in hebrew) e.Row.Cells[1].Text = "??? ?????"; //DayinWeek e.Row.Cells[2].Text = "??????"; //ActivityType (work seek vacation) named Reason e.Row.Cells[3].Text = "??? ?????"; //time finish (to Work) e.Row.Cells[4].Text = "??? ?????"; //Time out (of work) } if (e.Row.RowType == DataControlRowType.DataRow) { if (Convert.ToBoolean(ViewState["theSubIsclckd"]) == true) //if submit button clicked { try { string twekday1 = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "ActiveDate")); twekday1 = twekday1.Remove(9, 11); //geting date only without the time- portion string[] arymd = twekday1.Split('/'); // spliting [d m y] in order to make int day = Convert.ToInt32(arymd[1]); // it into [m d y] ...also requierd int month = Convert.ToInt32(arymd[0]); // when i update the table int year = Convert.ToInt32(arymd[2]); DateTime ILDateInit = new DateTime(year, month, day); //finally extracting Day CultureInfo ILci = CultureInfo.CreateSpecificCulture("he-IL"); // in week //from the converted activity date string MyIL_DayInWeek = ILDateInit.ToString("dddd", ILci); ViewState["MyIL_DayInWeek"] = MyIL_DayInWeek; e.Row.Cells[1].Text = MyIL_DayInWeek; string displayReason = DataBinder.Eval(e.Row.DataItem, "Reason").ToString(); e.Row.Cells[2].Text = displayReason; } catch (System.Exception excep) { Js.functions.but bb = new Js.functions.but(); bb.buttonName = "rex"; bb.documentwrite = true; bb.testCsVar = excep.ToString(); bb.f1(bb); // this was supposed to throw exep in javaScript injected from code behid - alert } // just in case.. } } so that works for the non edit period of time then when i hit the edit ... no day in week shows THE aspX - after selcting date... name etc' , click on button to display gridview: <asp:Button ID="TheSubB" runat="server" Text="???" onclick="TheSubB_Click" /> <asp:GridView ID="GridView1" runat="server" OnRowDataBound="GridView1_RowDataBound" onrowediting="GridView1_RowEditing" onrowcancelingedit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" AutoGenerateColumns="False" DataKeyNames="tId" DataSourceID="SqlDataSource1" style="z-index: 1; left: 0%; top: 0%; position: relative; width: 812px; height: 59px; font-family:Arial; text-align: center;" AllowSorting="True" > <AlternatingRowStyle BackColor="PaleGoldenrod" /> <Columns> <asp:BoundField DataField="ActiveDate" HeaderText="ActiveDate" SortExpression="ActiveDate" ControlStyle-Width="70" DataFormatString="{0:dd/MM/yyyy}" > <ControlStyle Width="70px" /> </asp:BoundField> <asp:TemplateField HeaderText="???.???.??"> <EditItemTemplate> <asp:TextBox ID="dayinW_EditTB" runat="server"></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="dayInW_editLabel" runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Reason" HeaderText="???? ?????" SortExpression="Reason" ControlStyle-Width="50"> <ControlStyle Width="50px" /> </asp:BoundField> <asp:BoundField DataField="TimeOut" HeaderText="TimeOut" SortExpression="TimeOut" ControlStyle-Width="50" DataFormatString="{0:HH:mm}" > <ControlStyle Width="50px"></ControlStyle> </asp:BoundField> <asp:BoundField DataField="TimeIn" HeaderText="TimeIn" SortExpression="TimeIn" ControlStyle-Width="50" DataFormatString="{0:HH:mm}" > <ControlStyle Width="50px"></ControlStyle> </asp:BoundField> <asp:TemplateField HeaderText="????" > <EditItemTemplate> <asp:ImageButton width="15" Height="15" ImageUrl="~/images/edit.png" runat="server" CausesValidation="True" CommandName="Update" Text="Update"> </asp:ImageButton> <asp:ImageButton Width="15" Height="15" ImageUrl="images/cancel.png" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"> </asp:ImageButton> </EditItemTemplate> <ItemTemplate> <asp:ImageButton width="25" Height="15" ImageUrl="images/edit.png" ID="EditIB" runat="server" CausesValidation="False" CommandName="Edit" AlternateText="????"></asp:ImageButton> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="???"> <ItemTemplate> <asp:ImageButton width="15" Height="15" ImageUrl="images/Delete.png" ID="DeleteIB" runat="server" CommandName="Delete" AlternateText="???" /> </ItemTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="Tan" /> <HeaderStyle BackColor="Tan" Font-Bold="True" /> <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" /> <SortedAscendingCellStyle BackColor="#FAFAE7" /> <SortedAscendingHeaderStyle BackColor="#DAC09E" /> <SortedDescendingCellStyle BackColor="#E1DB9C" /> <SortedDescendingHeaderStyle BackColor="#C2A47B" /> </asp:GridView>

    Read the article

  • Point one style class to another?

    - by user246114
    Hi, I have a css class like: .foo { background-color: red; } then I have a class specified for a list: .list1 li { background-color: tan; } is it possible to set one style class to just point to another? Something like: .list1 li { .foo; } not sure how to articulate that - I just want the .list li style to be whatever I define for the .foo class. Thanks

    Read the article

  • My raycaster is putting out strange results, how do I fix it?

    - by JamesK89
    I'm working on a raycaster in ActionScript 3.0 for the fun of it, and as a learning experience. I've got it up and running and its displaying me output as expected however I'm getting this strange bug where rays go through corners of blocks and the edges of blocks appear through walls. Maybe somebody with more experience can point out what I'm doing wrong or maybe a fresh pair of eyes can spot a tiny bug I haven't noticed. Thank you so much for your help! Screenshots: http://i55.tinypic.com/25koebm.jpg http://i51.tinypic.com/zx5jq9.jpg Relevant code: function drawScene() { rays.graphics.clear(); rays.graphics.lineStyle(1, rgba(0x00,0x66,0x00)); var halfFov = (player.fov/2); var numRays:int = ( stage.stageWidth / COLUMN_SIZE ); var prjDist = ( stage.stageWidth / 2 ) / Math.tan(toRad( halfFov )); var angStep = ( player.fov / numRays ); for( var i:int = 0; i < numRays; i++ ) { var rAng = ( ( player.angle - halfFov ) + ( angStep * i ) ) % 360; if( rAng < 0 ) rAng += 360; var ray:Object = castRay(player.position, rAng); drawRaySlice(i*COLUMN_SIZE, prjDist, player.angle, ray); } } function drawRaySlice(sx:int, prjDist, angle, ray:Object) { if( ray.distance >= MAX_DIST ) return; var height:int = int(( TILE_SIZE / (ray.distance * Math.cos(toRad(angle-ray.angle))) ) * prjDist); if( !height ) return; var yTop = int(( stage.stageHeight / 2 ) - ( height / 2 )); if( yTop < 0 ) yTop = 0; var yBot = int(( stage.stageHeight / 2 ) + ( height / 2 )); if( yBot > stage.stageHeight ) yBot = stage.stageHeight; rays.graphics.moveTo( (ray.origin.x / TILE_SIZE) * MINI_SIZE, (ray.origin.y / TILE_SIZE) * MINI_SIZE ); rays.graphics.lineTo( (ray.hit.x / TILE_SIZE) * MINI_SIZE, (ray.hit.y / TILE_SIZE) * MINI_SIZE ); for( var x:int = 0; x < COLUMN_SIZE; x++ ) { for( var y:int = yTop; y < yBot; y++ ) { buffer.setPixel(sx+x, y, clrTable[ray.tile-1] >> ( ray.horz ? 1 : 0 )); } } } function castRay(origin:Point, angle):Object { // Return values var rTexel = 0; var rHorz = false; var rTile = 0; var rDist = MAX_DIST + 1; var rMap:Point = new Point(); var rHit:Point = new Point(); // Ray angle and slope var ra = toRad(angle) % ANGLE_360; if( ra < ANGLE_0 ) ra += ANGLE_360; var rs = Math.tan(ra); var rUp = ( ra > ANGLE_0 && ra < ANGLE_180 ); var rRight = ( ra < ANGLE_90 || ra > ANGLE_270 ); // Ray position var rx = 0; var ry = 0; // Ray step values var xa = 0; var ya = 0; // Ray position, in map coordinates var mx:int = 0; var my:int = 0; var mt:int = 0; // Distance var dx = 0; var dy = 0; var ds = MAX_DIST + 1; // Horizontal intersection if( ra != ANGLE_180 && ra != ANGLE_0 && ra != ANGLE_360 ) { ya = ( rUp ? TILE_SIZE : -TILE_SIZE ); xa = ya / rs; ry = int( origin.y / TILE_SIZE ) * ( TILE_SIZE ) + ( rUp ? TILE_SIZE : -1 ); rx = origin.x + ( ry - origin.y ) / rs; mx = 0; my = 0; while( mx >= 0 && my >= 0 && mx < world.size.x && my < world.size.y ) { mx = int( rx / TILE_SIZE ); my = int( ry / TILE_SIZE ); mt = getMapTile(mx,my); if( mt > 0 && mt < 9 ) { dx = rx - origin.x; dy = ry - origin.y; ds = ( dx * dx ) + ( dy * dy ); if( rDist >= MAX_DIST || ds < rDist ) { rDist = ds; rTile = mt; rMap.x = mx; rMap.y = my; rHit.x = rx; rHit.y = ry; rHorz = true; rTexel = int(rx % TILE_SIZE) } break; } rx += xa; ry += ya; } } // Vertical intersection if( ra != ANGLE_90 && ra != ANGLE_270 ) { xa = ( rRight ? TILE_SIZE : -TILE_SIZE ); ya = xa * rs; rx = int( origin.x / TILE_SIZE ) * ( TILE_SIZE ) + ( rRight ? TILE_SIZE : -1 ); ry = origin.y + ( rx - origin.x ) * rs; mx = 0; my = 0; while( mx >= 0 && my >= 0 && mx < world.size.x && my < world.size.y ) { mx = int( rx / TILE_SIZE ); my = int( ry / TILE_SIZE ); mt = getMapTile(mx,my); if( mt > 0 && mt < 9 ) { dx = rx - origin.x; dy = ry - origin.y; ds = ( dx * dx ) + ( dy * dy ); if( rDist >= MAX_DIST || ds < rDist ) { rDist = ds; rTile = mt; rMap.x = mx; rMap.y = my; rHit.x = rx; rHit.y = ry; rHorz = false; rTexel = int(ry % TILE_SIZE); } break; } rx += xa; ry += ya; } } return { angle: angle, distance: Math.sqrt(rDist), hit: rHit, map: rMap, tile: rTile, horz: rHorz, origin: origin, texel: rTexel }; }

    Read the article

  • Linux partitioning problem

    - by Claudiu
    I am using cfdisk to repartition my hdd as from OS install I only got 1 big partition a swap. I wanted to resize the big partition to 1 GB /boot and use the rest of the space for an extended partition. After I do cfdisk, I recheck the partitions with fdisk -l and I get these: Disk /dev/sda: 320 GB, 320070320640 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda3 1 38455 308881755 f Extended LBA Warning: Partition 3 does not end on cylinder boundary. /dev/sda2 38455 38698 1951897 82 Linux swap /dev/sda1 * 38699 38913 311349654 83 Linux My problem is the Warning message, I think I know the cause, I think its because of sda1 Blocks size. How could that be soo big if Start and End interval is small?

    Read the article

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