Daily Archives

Articles indexed Sunday December 2 2012

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

  • i need ur help [closed]

    - by aisha khan
    Write a program that prompts the user to enter the size of the array, allocate memory using malloc(), ask the user to enter elements of the array and displays if the puzzle is solvable. As part of this program, write a recursive function int Solvable(int start, int squares[]) that takes a starting position of the marker along with the array of squares. The function should return 1 if it is possible to solve the puzzle from the starting configuration and 0 if it is impossible

    Read the article

  • Concurrency checking with Last Change Time

    - by Lijo
    I have a following three tables Email (emailNumber, Address) Recipients (reportNumber, emailNumber, lastChangeTime) Report (reportNumber, reportName) I have a C# application that uses inline queries for data selection. I have a select query that selects all reports and their Recipients. Recipients are selected as comma separacted string. During updating, I need to check concurrency. Currently I am using MAX(lastChangeTime) for each reportNumber. This is selected as maxTime. Before update, it checks that the lastChangeTime <= maxTime. --//It works fine One of my co-developers asked why not use GETDATE() as “maxTime” rather than using a MAX operation. That is also working. Here what we are checking is the records are not updated after the record selection time. Is there any pitfalls in using GETDATE() for this purpose?

    Read the article

  • Save Windows 8 Files and Install Ubuntu

    - by Nika
    I would like to install Ubuntu on my laptop. I am new to Ubuntu and therefore have some questions: 1.My hardware is Acer Emachines Intel Celeron T3000 1.8 3 Gig of Ram and Native Intel Intergrated graphics card. Can I run Ubuntu on this machine without any problems? 2.I am windows user and currently have windows 8. I want to install ubuntu but want to save all my directories on C:\ D:\ disks so that I can open my files in ubuntu. Is it possible to save my current directory system and save all my files after installing ubuntu? Can I open all my files? I have very important data in files so I dont want to lose them at all :) Thank You

    Read the article

  • BCM4313 partially working on Toshiba Satellite R630 (Ubuntu 12.10)

    - by Denis
    New to Ubuntu. During installation, the computer identified the wifi card and asked me to connect to the network. I did. After the first restart the wifi was working and I could see networks and connect to them. After the second restart the wireless has VANISHED. Still, the Broadcom STA drivers are enabled in system settings/additional drivers. Tried to restart 5 more times- no effect. I have studied very many topics on askubuntu but none of them work.

    Read the article

  • Will Xubuntu 12.10 also have amazon ads?

    - by Miguel Guasch
    and thanks in advance for your comments: I'm currently using Ubuntu 12.04, and quite happy with it. I'm using the Unity desktop, and I've got no major complaints. My problem/question is: I've been reading on the news, forums, and different websites that the new version in 12.10, which i'll eventually have to upgrade to if I plan on using Ubuntu, has a lens/amazon function on the dash that sends queries to amazon. Now, this disturbs me a bit, since I don't want to see "shopping recommendations" everytime I look for something, be they from amazon or from "future partners". Does this new "function" only apply to the Unity desktop? If I switch to the Xfce desktop, will I be able to "save myself" from sending search data to amazon and/or shopping recommendations from them? Or will I have to entirely switch distributions, in order to evade this? Again, many thanks in advance for your comments and/or help. Regards, Miguel.

    Read the article

  • Numbers on the launcher

    - by pete of ebor
    Using 12.04 LTS - few days ago, I left my machine on while I went out. On my return, the launcher was showing (it is set to be hidden) and there were small numbers 1-9 on the icons and letters s on the bottom-most icon and t on the rubbish bin. System still worked fine, although the launcher remained visible, and would not hide. After about 20 mins work, they suddenly vanished and the launcher hid itself.. is this a normal action ? It hasn't happened since..

    Read the article

  • kismet on BCM43227

    - by Uttam Baroi
    I am trying to monitor wireless on Broadcom BCM43227, I used sudo airmon-ng to run the monitoring, i get command not found. I installed kismet, when i run, i get this *uttam@UT:~$ sudo kismet Launching kismet_server: //usr/bin/kismet_server Suid priv-dropping disabled. This may not be secure. No specific sources given to be enabled, all will be enabled. Non-RFMon VAPs will be destroyed on multi-vap interfaces (ie, madwifi-ng) Enabling channel hopping. Enabling channel splitting. NOTICE: Disabling channel hopping, no enabled sources are able to change channel. Source 0 (addme): Opening none source interface none... FATAL: Please configure at least one packet source. Kismet will not function if no packet sources are defined in kismet.conf or on the command line. Please read the README for more information about configuring Kismet. Kismet exiting. Done. uttam@UT:~$* I did check a blog about kismet on Broadcom that says about some binary drivers not allowing to do it... I used iwconfig and it says no extension : what is that well I need to give a hand on air monitoring............ help, how to do it

    Read the article

  • Gnome 2 style user account settings (how to edit user accounts in Unity)

    - by user104140
    Back in Gnome 2 there was a very useful user account editing gui tool whereby I could easily add or edit a user to a group. For example, I could give a standard user access to something that they hadn't installed or don't have default access too, such as Me-TV. How do I do this in Gnome 3 / Unity? I am not allowed to create the tag "edit user accounts" or similar and there isn't anything similar existing, strangely. I'm guessing there is a totally different way to edit user accounts or no one bothers - perhaps no one shares PCs anymore.

    Read the article

  • Home folder icons dont change

    - by ALdaperan
    I just installed my-humanity icon theme on my Ubuntu 12.10 but i have an issue : I extracted the archive to /usr/share/icons or/and to ~/.icons but when i apply the icon theme from gnome twek tool home folders icons dont update but stay to Ubuntu mono dark default icons. Only Launcher/tray icons change I attach screenshots in order to understand whats my issue : My folder icons on home : How they should be : Any ideas on how can i fix it ? Note : On nautilus as root (gksudo nautilus) they appear how they should be .. Only on user do not appear !

    Read the article

  • Install build-essentials in ubuntu 12.04

    - by Mukul Shukla
    After I install a fresh copy of ubuntu and I need to install build-essentials, I have to type: sudo apt-get update and sudo apt-get upgrade before installing build-essentials These two commands take a LOOTTT of time and install many things. Is there a way to install build-essentials without running these two commands, or a way that these two commands don't install all the updates and hence will take less time.

    Read the article

  • Error:couldn't read file-Kernel panic

    - by Thanos
    I have just installed ubuntu 12.04.1. To be honest I had to run installation several times until it was finished fine. When I finally managed to install it properly, I power on the laptop and the grub shoed up! I selected ubuntu generic. It takes some time to load and when it does I get an error message stating that error: couldn't read file Press any key to continue If I press any button nothing happens. If a leave it there, in a short while there is a black screen loading which gives some weird messages [0.946710] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (0,0) [0.946755] Pid: 1, comm: swapper/0 Not tainted 3.2.0-29-generic #46-Ubuntu [0.946792] Call Trace: [0.946831] [<ffffffff81640ec8>] panic+0x91/0x1a4 [0.946869] [<ffffffff81cfc01e>] mount_block_root+0xdc/0x18e [0.946909] [<ffffffff81002930>] ? populate_rootfs_wait+0x300/0x9d0 [0.946947] [<ffffffff81cfc257>] mount_root+0x54/0x59 [0.946982] [<ffffffff81cfcec9>] prepare_namespace+0x16d/0x1a6 [0.947019] [<ffffffff81cfbd63>] kernel_init+0x153/0x158 [0.947094] [<ffffffff81cfbc10>] ? start_kernel+0x3bd/0x3bd [0.947129] [<ffffffff81664030>] ? gs_change+0x13/0x13 The thing is that the laptop isn't mine. A friend tried to dual boot ubuntu alongside windows 7 but he didn't succeed. Ubuntu option was in grub, but when you tried to boot it rebooted from the start. So from a Live CD I erased ubuntu, started windows to check if something went wrong, and fortunately everything was OK. Windows started normally! So I tried to install ubuntu. Before installation was completed the installer crashed! I was afraid that he would lost windows, something that was true... At that point I tried to install windows but whichever distro(XP, 7{home, proffessional, ultimate},8) I tried it could never reach the end. So I tried to reinstall ubuntu but I was facing those weird messages. What can I do to move on? ______________________________________________________________________ EDIT1: I tried to check and fix(if possible) with GParted it took a lot of hours,although gparted displays only 01:14, I restarted the system and now I get not exactly the same messages. Numbers in braces [ ] are different [0.818189] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block (0,0) [0.818235] Pid: 1, comm: swapper/0 Not tainted 3.2.0-29-generic #46-Ubuntu [0.818272] Call Trace: [0.818312] [<ffffffff81640ec8>] panic+0x91/0x1a4 [0.818351] [<ffffffff81cfc01e>] mount_block_root+0xdc/0x18e [0.818391] [<ffffffff81002930>] ? populate_rootfs_wait+0x300/0x9d0 [0.818428] [<ffffffff81cfc257>] mount_root+0x54/0x59 [0.818464] [<ffffffff81cfcec9>] prepare_namespace+0x16d/0x1a6 [0.818501] [<ffffffff81cfbd63>] kernel_init+0x153/0x158 [0.818574] [<ffffffff81cfbc10>] ? start_kernel+0x3bd/0x3bd [0.818610] [<ffffffff81664030>] ? gs_change+0x13/0x13 What on earth is going on? ______________________________________________________________________ EDIT2: I forgot to mention that my friend gave a punch to his laptop during a game. After that his cooler became to make a weird noise so I checked and it is a bit tortuous but it is working. What I beleive must be wrong is that his HDD makes a weird noise while trying to load ubuntu, which means he might need a new HDD. Could that be true?

    Read the article

  • Error while trying to dual boot Ubuntu alongside Windows 8

    - by Brian
    I recently purchased a new Toshiba Ultrabook that comes pre-installed with Windows 8. I'm trying to dual boot 12.10 with it and I have run into a problem with the installer. When I get to the page to pick the partitions I get this: No drives are listed and the only thing in that device drop down is /dev/sda. If I click Install Now or +/-/change I get an "Ubuntu has stopped working" error message. I'm trying to install off a 12.10 64-bit USB drive in UEFI mode, and I have tried it with secure boot both enabled and disabled with the same results. The hard drive set up is as follows: 500 GB main drive windows recovery (primary) EFI boot section (primary) Windows' partion (280 GB I believe) (primary) unallocated space I created for Ubuntu partition (200ish GB) another Windows recovery partition (primary) 12 GB solid state drive all unallocated space Could it be a problem with the number of primary partitions? I think I read somewhere about a max of 4.

    Read the article

  • C# on ubuntu 12.04

    - by Deus Deceit
    Is C# a good choice for ubuntu programming? E.g unity, or applications that will run on ubuntu? Am I doing good wanting to learn C# when I'm determined to stick with ubuntu and develop on it or for it? If not, can you give me reasons why? And which languages would be better than c# for ubuntu development? I already know c, c++, java(basics), php, mysql, python(basics). I like to learn new stuff, but stuff that worth my time. Does C# worth my time? If c# worth my time, here's what I have done and what I need: I installed all mono packages I could find on the ubuntu standard repositories. Now I want a good tutorial to get me started. I'm a complete noob with c# so a basic tutorial and how to compile run under ubuntu 12.04 would be great.

    Read the article

  • apt-mirror - Changing source mirror creates new folder for downloads

    - by I Kazi
    I have a local Ubuntu mirror running on ubuntu 10.04 in my office which uses archive.ubuntu.com to download updates and releases. I have been running this mirror since Ubuntu's Hardy Heron release. It downloads everything under /export/ubuntu-repo1/apt-mirror/mirror/archive.ubuntu.com/ folder. Recently I came to know that the mirror in India i.e. in.archive.ubuntu.com is a lot faster for me than http://archive.ubuntu.com which is based in UK. Therefore to download latest release QUANTAL QUETZAL I configured Indian mirror in /etc/apt/mirror.list After making this change and leaving apt-mirror to run overnight I found that it downloaded everything to a new folder called "in.archive.ubuntu.com" so now I have two folders where apt-mirror downloads updates. /export/ubuntu-repo1/apt-mirror/mirror/archive.ubuntu.com/ /export/ubuntu-repo1/apt-mirror/mirror/in.archive.ubuntu.com/ Now, since apache does not have "in.archive.ubuntu.com" configured, Ubuntu clients are unable to access QUANTAL QUETZAL release and its updates. My question is: Is there a way I could copy everything downloaded under "in.archive.ubuntu.com" to "archive.ubuntu.com" so all new updates of the latest release become accessible to Ubuntu clients? Secondly, Can I configure apt-mirror to download everything to archive.ubuntu.com even using Indian mirror? Thanks a lot for your help in advance. I Kazi

    Read the article

  • How to reduce noise in Skype?

    - by tkc
    According to Alsamixer I do have a HDA Intel soundcard with Nvidia MCP77/78 HDMI chip (Realtek sound card on MSI notebook). When I use Skype under Ubuntu 12.04 for video calls, the other side hears background noise such as in Windows when you have your microphone boosted. In fact they can hear everything, even the fans turning on. There is nothing tweaked on Ubuntu's fresh installation. Also tried this site: https://code.launchpad.net/~ubuntu-audio-dev/+archive/alsa-daily/+packages , but there are no *.deb files that I can test if any fix the problem. The question is if there is a way to add/tweak something to enable on software level the noise cancellation like the Windows sound drivers have that option. I use my build in mic.

    Read the article

  • Gnome-Shell 3.4 Themes not working in 12.04?

    - by CGriffitt
    Even themes advertised as Gnome-shell 3.4 compatible have graphical issues on Gnome-Shell 3.4. The main thing is that the text is black and nearly invisible, and the icons in the applications screen are crowded and in some cases overlapping. The themes did not do this before upgrade, and the default doesn't do it now. I am using user theme extension, and the themes I have tried are the Ambiance-Color set and London Smoke (both of which are advertised as 3.4 compatible).

    Read the article

  • Webpage redirection time

    - by Abhijeet Ashok Muneshwar
    I want to calculate time consumed in redirecting from 1 webpage to another webpage. For Example: 1) I am using Facebook in Google Chrome browser. I have shared 1 link on my Facebook profile like below: http://www.webdeveloper.com/ (It's not only Facebook. It can be any domain having link to another domain). 2) When I click on this link from my Facebook profile, then this website will open in new tab. 3) I want to calculate time difference in miliseconds or microseconds between below two events: First Event: Time of clicking link "http://www.webdeveloper.com/" from my Facebook profile. Second Event: Time of completely loading webpage of "http://www.webdeveloper.com/". Thank you in advance.

    Read the article

  • My application's bounce rate jumped from 30% to 80% overnight

    - by davidrac
    My application is provided as a service that is embedded in other sites. I have google analytics installed on the login popup dialog which is a page of my application, which is opened from the host site (OAuth). About a week ago, I've noticed a sharp decrease in the number of new users registrations and a jump in the bounce rate (from ~30% to ~80%). This happened without any change in the application. I looked into technical parameters like page load time and error rates, but could not see any change in there. Any ideas what can cause this behavior?

    Read the article

  • Where can I find SPF record information for Network Solution hosted email?

    - by Steve Brown
    I have a client who has their e-mail hosted with Network Solutions and some of the e-mails they are sending are going to spam. I've searched Google for information on network solutions and SPF records but all the results have to do with "how to set up an SPF record" - which I understand how to do. The problem is that I can't find any information about what SPF records to use for network solutions hosted e-mail. I even tried lookup up spf records on networksolutions.com but it appears there are none. Where can I find SPF record information for Network Solution hosted email?

    Read the article

  • Minecraft Style Chunk building problem

    - by David Torrey
    I'm having some problems with speed in my chunk engine. I timed it out, and in its current state it takes a total ~5 seconds per chunk to fill each face's list. I have a check to see if each face of a block is visible and if it is not visible, it skips it and moves on. I'm using a dictionary (unordered map) because it makes sense memorywise to just not have an entry if there is no block. I've tracked my problem down to testing if there is an entry, and accessing an entry if it does exist. If I remove the tests to see if there is an entry in the dictionary for an adjacent block, or if the block type itself is seethrough, it runs within about 2-4 milliseconds. so here's my question: Is there a faster way to check for an entry in a dictionary than .ContainsKey()? As an aside, I tried TryGetValue() and it doesn't really help with the speed that much. If I remove the ContainsKey() and keep the test where it does the IsSeeThrough for each block, it halves the time, but it's still about 2-3 seconds. It only drops to 2-4ms if I remove BOTH checks. Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; using OpenTK; using OpenTK.Graphics.OpenGL; using System.Drawing; namespace Anabelle_Lee { public enum BlockEnum { air = 0, dirt = 1, } [StructLayout(LayoutKind.Sequential,Pack=1)] public struct Coordinates<T1> { public T1 x; public T1 y; public T1 z; public override string ToString() { return "(" + x + "," + y + "," + z + ") : " + typeof(T1); } } public struct Sides<T1> { public T1 left; public T1 right; public T1 top; public T1 bottom; public T1 front; public T1 back; } public class Block { public int blockType; public bool SeeThrough() { switch (blockType) { case 0: return true; } return false ; } public override string ToString() { return ((BlockEnum)(blockType)).ToString(); } } class Chunk { private Dictionary<Coordinates<byte>, Block> mChunkData; //stores the block data private Sides<List<Coordinates<byte>>> mVBOVertexBuffer; private Sides<int> mVBOHandle; //private bool mIsChanged; private const byte mCHUNKSIZE = 16; public Chunk() { } public void InitializeChunk() { //create VBO references #if DEBUG Console.WriteLine ("Initializing Chunk"); #endif mChunkData = new Dictionary<Coordinates<byte> , Block>(); //mIsChanged = true; GL.GenBuffers(1, out mVBOHandle.left); GL.GenBuffers(1, out mVBOHandle.right); GL.GenBuffers(1, out mVBOHandle.top); GL.GenBuffers(1, out mVBOHandle.bottom); GL.GenBuffers(1, out mVBOHandle.front); GL.GenBuffers(1, out mVBOHandle.back); //make new list of vertexes for each face mVBOVertexBuffer.top = new List<Coordinates<byte>>(); mVBOVertexBuffer.bottom = new List<Coordinates<byte>>(); mVBOVertexBuffer.left = new List<Coordinates<byte>>(); mVBOVertexBuffer.right = new List<Coordinates<byte>>(); mVBOVertexBuffer.front = new List<Coordinates<byte>>(); mVBOVertexBuffer.back = new List<Coordinates<byte>>(); #if DEBUG Console.WriteLine("Chunk Initialized"); #endif } public void GenerateChunk() { #if DEBUG Console.WriteLine("Generating Chunk"); #endif for (byte i = 0; i < mCHUNKSIZE; i++) { for (byte j = 0; j < mCHUNKSIZE; j++) { for (byte k = 0; k < mCHUNKSIZE; k++) { Random blockLoc = new Random(); Coordinates<byte> randChunk = new Coordinates<byte> { x = i, y = j, z = k }; mChunkData.Add(randChunk, new Block()); mChunkData[randChunk].blockType = blockLoc.Next(0, 1); } } } #if DEBUG Console.WriteLine("Chunk Generated"); #endif } public void DeleteChunk() { //delete VBO references #if DEBUG Console.WriteLine("Deleting Chunk"); #endif GL.DeleteBuffers(1, ref mVBOHandle.left); GL.DeleteBuffers(1, ref mVBOHandle.right); GL.DeleteBuffers(1, ref mVBOHandle.top); GL.DeleteBuffers(1, ref mVBOHandle.bottom); GL.DeleteBuffers(1, ref mVBOHandle.front); GL.DeleteBuffers(1, ref mVBOHandle.back); //clear all vertex buffers ClearPolyLists(); #if DEBUG Console.WriteLine("Chunk Deleted"); #endif } public void UpdateChunk() { #if DEBUG Console.WriteLine("Updating Chunk"); #endif ClearPolyLists(); //prepare buffers //for every entry in mChunkData map foreach(KeyValuePair<Coordinates<byte>,Block> feBlockData in mChunkData) { Coordinates<byte> checkBlock = new Coordinates<byte> { x = feBlockData.Key.x, y = feBlockData.Key.y, z = feBlockData.Key.z }; //check for polygonson the left side of the cube if (checkBlock.x > 0) { //check to see if there is a key for current x - 1. if not, add the vector if (!IsVisible(checkBlock.x - 1, checkBlock.y, checkBlock.z)) { //add polygon AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.left); } } else { //polygon is far left and should be added AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.left); } //check for polygons on the right side of the cube if (checkBlock.x < mCHUNKSIZE - 1) { if (!IsVisible(checkBlock.x + 1, checkBlock.y, checkBlock.z)) { //add poly AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.right); } } else { //poly for right add AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.right); } if (checkBlock.y > 0) { //check to see if there is a key for current x - 1. if not, add the vector if (!IsVisible(checkBlock.x, checkBlock.y - 1, checkBlock.z)) { //add polygon AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.bottom); } } else { //polygon is far left and should be added AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.bottom); } //check for polygons on the right side of the cube if (checkBlock.y < mCHUNKSIZE - 1) { if (!IsVisible(checkBlock.x, checkBlock.y + 1, checkBlock.z)) { //add poly AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.top); } } else { //poly for right add AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.top); } if (checkBlock.z > 0) { //check to see if there is a key for current x - 1. if not, add the vector if (!IsVisible(checkBlock.x, checkBlock.y, checkBlock.z - 1)) { //add polygon AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.back); } } else { //polygon is far left and should be added AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.back); } //check for polygons on the right side of the cube if (checkBlock.z < mCHUNKSIZE - 1) { if (!IsVisible(checkBlock.x, checkBlock.y, checkBlock.z + 1)) { //add poly AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.front); } } else { //poly for right add AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.front); } } BuildBuffers(); #if DEBUG Console.WriteLine("Chunk Updated"); #endif } public void RenderChunk() { } public void LoadChunk() { #if DEBUG Console.WriteLine("Loading Chunk"); #endif #if DEBUG Console.WriteLine("Chunk Deleted"); #endif } public void SaveChunk() { #if DEBUG Console.WriteLine("Saving Chunk"); #endif #if DEBUG Console.WriteLine("Chunk Saved"); #endif } private bool IsVisible(int pX,int pY,int pZ) { Block testBlock; Coordinates<byte> checkBlock = new Coordinates<byte> { x = Convert.ToByte(pX), y = Convert.ToByte(pY), z = Convert.ToByte(pZ) }; if (mChunkData.TryGetValue(checkBlock,out testBlock )) //if data exists { if (testBlock.SeeThrough() == true) //if existing data is not seethrough { return true; } } return true; } private void AddPoly(byte pX, byte pY, byte pZ, int BufferSide) { //create temp array GL.BindBuffer(BufferTarget.ArrayBuffer, BufferSide); if (BufferSide == mVBOHandle.front) { //front face mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ + 1) }); } else if (BufferSide == mVBOHandle.right) { //back face mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ) }); } else if (BufferSide == mVBOHandle.top) { //left face mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY + 1), z = (byte)(pZ) }); } else if (BufferSide == mVBOHandle.bottom) { //right face mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); } else if (BufferSide == mVBOHandle.front) { //top face mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ) }); } else if (BufferSide == mVBOHandle.back) { //bottom face mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY), z = (byte)(pZ + 1) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY), z = (byte)(pZ) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY), z = (byte)(pZ) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY), z = (byte)(pZ) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY), z = (byte)(pZ + 1) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY), z = (byte)(pZ + 1) }); } } private void BuildBuffers() { #if DEBUG Console.WriteLine("Building Chunk Buffers"); #endif GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.front); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.front.Count), mVBOVertexBuffer.front.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.back); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.back.Count), mVBOVertexBuffer.back.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.left); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.left.Count), mVBOVertexBuffer.left.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.right); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.right.Count), mVBOVertexBuffer.right.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.top); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.top.Count), mVBOVertexBuffer.top.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.bottom); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.bottom.Count), mVBOVertexBuffer.bottom.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer,0); #if DEBUG Console.WriteLine("Chunk Buffers Built"); #endif } private void ClearPolyLists() { #if DEBUG Console.WriteLine("Clearing Polygon Lists"); #endif mVBOVertexBuffer.top.Clear(); mVBOVertexBuffer.bottom.Clear(); mVBOVertexBuffer.left.Clear(); mVBOVertexBuffer.right.Clear(); mVBOVertexBuffer.front.Clear(); mVBOVertexBuffer.back.Clear(); #if DEBUG Console.WriteLine("Polygon Lists Cleared"); #endif } }//END CLASS }//END NAMESPACE

    Read the article

  • backface culling error

    - by acrilige
    I write simple software renderer. In my pipeline i have stage of backface culling. But looks like it has some error (see picture). I perform culling right after world transformation. (i can't insert picture in post coz i don't have enough points, so i just upload it (cube model): http://imageshack.us/photo/my-images/705/bcerror.png/) Vector3F view_dir(0.0f, 0.0f, 1.0f); std::vector<Triangle> to_remove; for (Triangle &t : m_triangles) { Vector4F e1 = t.v2 - t.v1; Vector4F e2 = t.v3 - t.v1; Vector3F normal( e1.y * e2.z - e1.z * e2.y, e1.z * e2.x - e1.x * e2.z, e1.x * e2.y - e1.y * e2.x ); normal.Normalize(); float dot = Dot(view_dir, normal); if (dot <= 0) to_remove.push_back(t); } for (Triangle& t : to_remove) m_triangles.erase(std::remove(m_triangles.begin(), m_triangles.end(), t), m_triangles.end()); Camera sits in origin and points in screen (RH). What is the reason?

    Read the article

  • Map format for 3d open world

    - by Pacha
    I am making an open world 3d platformer in Ogre3D, and I have no idea on what kind of 3d map file format I should use for it. I want to make low-polygon blocky-style objects. Probably rectangles and other geometrical figures that don't have circular edges. Some of those blocks will have properties, like climbable or they might move. I was wondering what would be the best thing to do to make the map (just one level, as it is open).

    Read the article

  • Choosing http status code for unknown command reply

    - by w0rldart
    So, I'm writing a small test that I have been required to complete and I just want to give it some final touches by adding some header status code responses and some other stuff. Right now, my dilemma is what HTTP status code to choose for my "Unknown command" response after the $_GET['cmd'] has been compared to the existing commands list. case 404: $text = 'Not Found'; break; case 405: $text = 'Method Not Allowed'; break; case 406: $text = 'Not Acceptable'; break; For which one of the above should I go? And if none, which other?

    Read the article

  • how to build an accumulator array in matlab

    - by schwiz
    I'm very new to matlab so sorry if this is a dumb question. I have to following matrices: im = imread('image.jpg'); %<370x366 double> [y,x] = find(im); %x & y both <1280x1 double> theta; %<370x366 double> computed from gradient of image I can currently plot points one at a time like this: plot(x(502) + 120*cos(theta(y(502),x(502))),y(502) + 120*sin(theta(y(502),x(502))),'*b'); But what I want to do is some how increment an accumulator array, something like this: acc = zeros(size(im)); acc(y,x) = acc(x + 120*cos(theta(y,x)),y + 120*sin(theta(y,x)),'*b')) + 1; It would be nice if the 120 could actually be another matrix containing different radius values as well.

    Read the article

  • Save result of for loop in a vector

    - by hendrik
    i think I'm just too tired to see the mistake. i wrote a function to get the maximal value for two data sets from a for loop plot_zu <- function(x) {for (i in 1:x){ z=data_raw[grep(a[i], data_raw$Gene.names),] b=data_raw_ace[grep(a[i], data_raw_ace$Gene.names),] p<-vector("numeric", length(1:length(a))) p[i]<-max(z$t_test_diff) return(p)} } so picture: a is a vector of names and the data set (data_raw(_ace)) are filtered by it. In the end i would like to have all maxima values of column t_test_diff in a vector. After that i want to add the t_test_diff column values from data_raw_ace also. So the problem is, that i get this: [1] 1.210213 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 [8] 0.000000 0.000000 So there is a problem with brackets or something but i cannot see it ( first value fits). Sorry for no good example but i think it is understandable and an easy to solve question. If im to dumb to explain my problem right, i will add an example. !! Thx a lot !! grateful Hendrik

    Read the article

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