Search Results

Search found 996 results on 40 pages for 'compound eye'.

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

  • Create custom component based on LinearLayout, declaring layout in XML

    - by pheelicks
    I've been trying to create a Compound Control in Android 1.5 (as described here) but havn't been able to find any good examples on how to do this using an XML file to specify a layout. I'm fine with creating an Activity and then loading an xml file using the following in the constructor: setContentView(R.layout.main); However, I want to do this in subclass of LinearLayout - so I can use this compound component in other XML layouts. Something along the lines of: public class CustomView extends LinearLayout { public CustomView(Context context) { super(context); setupView(); } public CustomView(Context context, AttributeSet attrs) { super(context, attrs); setupView(); } public void setupView() { setContentView(R.layout.custom); // Not possible } } What is the correct way of going about doing this?

    Read the article

  • How to generate JSON object on client side and send it to server?

    - by EugeneS
    I have ExtJS based application. I have compound object on the server side, and have ExtJS window with few tabs for editing different parts of this one object. For example: I Have Compound object "Car" public class Car { public string Name; public string Color; public List Wheels; public List Doors; } And on my ExtJS window i have tabs ("General Info", "Wheels", "Doors") for editing different parts of this object. So what i want: When i want to create a new car i want to generate JSON configuration for my class "Car" like {Name:null; Color:null; Wheels:[]; Doors:[]} then sent it to the client, fill it on the client (without callbacks to server) and after user finishes creating his Car object (he added wheels, doors, set name and color) and press save, I want to sent this filled(generated) JSON object to server and save it to DB. Is it possible? Thanks

    Read the article

  • jquery .hide() bug in safari

    - by phil crowe
    ive been having issues with this hide bug thats only affecting safari. This is a simple vertical scroller that hides the first element in the list then shows the last. and works in everything apart from safari. the problem seems to be that the divs im working with here share the same class but have unique ids like #mycollectioncomment1, #mycollectioncomment2, #mycollectioncomment3 etc... however hiding just one of these divs hides all the other divs that share the same class. Ive tried .fadeOut(0) that everyone suggests as the work around but it just doesnt work here. var commentListCount = $(".myCollectionLatest").size(); var mycollclickCount = 0; var showingcomments = 5; if ($('.licomment').size() > 0) { showingcomments = 4; //alert("this"); } if ($('.lookInSeasonList').size() > 0) { showingcomments = 5; } if ($('.lookDescMiddle').size() > 0) { showingcomments = 8; } if ($('.MyCollectionsCollectionHolder').size() > 0) { showingcomments = 5; } // if (commentListCount > 5) { $(".myCollectionLatest").hide(); for (i = 0; i < showingcomments; i++) { $("#mycollectioncomment" + i).show(); } $('#mycolldown').click(function () { var element1, element2; if (showingcomments <= commentListCount) { mycollclickCount++; element1 = $("#mycollectioncomment" + mycollclickCount.toString()); element2 = $("#mycollectioncomment" + showingcomments.toString()); element1.closest('.licomment').hide(); element2.closest('.licomment').show(); showingcomments++; } }); $('#mycollup').click(function () { if (showingcomments <= 5) { } else { $("#mycollectioncomment" + mycollclickCount.toString()).show(); $("#mycollectioncomment" + mycollclickCount.toString()).closest('.licomment').show(); mycollclickCount--; showingcomments--; $("#mycollectioncomment" + showingcomments.toString()).hide(); $("#mycollectioncomment" + showingcomments.toString()).closest('.licomment').show(); } }); ---html markup --- <div style="width:260px; height:975px; float:left; border-right:solid 1px #e70079; border-bottom:solid 1px #e70079; border-left:solid 1px #e70079; margin-top:180px;"> <h2 align="center"> <br /> COLLECTION LATEST </h2> <img src="/images/my-collection/black-up.jpg" id="mycollup" /><ul><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment1"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=6855"><img src="/media/6855/makeuo_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=6855" class="usernamelinkdiv">CHARLOTTE</a> SAID ABOUT <span class="pinkTxt"><br /><a href="/products/face/powder/pressed-powder.aspx">PRESSED POWDER</a></span></b><p>put this on after foundation. its the best cover powder + re... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=6855"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment2"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=6331"><img src="/media/6331/26462_1267423081357_1103204986_2592317_7875205_n_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=6331" class="usernamelinkdiv">ANN</a> SAID ABOUT <span class="pinkTxt"><br /><a href="/products/eyes/eyeshadow/brilliant-shimmer-duo-eye-wands.aspx">BRILLIANT SHIMMER DUO EYE WANDS</a></span></b><p>Likewise Natasha, i thought it would be a great product as i... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=6331"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment3"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=5168"><img src="/media/5168/P03-09-09_11.36_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=5168">SINYEE</a> SAID </b><p>i used to use this. but now it doesnt seem to go on my skin... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=5168"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment4"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=6941"><img src="/media/6941/purple 2_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=6941">MARIA</a> SAID </b><p>I love this product, not used creme blush for years so just ... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=6941"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment5"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=6329"><img src="/media/6329/snapshot_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=6329" class="usernamelinkdiv">ALICE</a> SAID ABOUT <span class="pinkTxt"><br /><a href="/products/eyes/mascara/collagen-curl-mascara.aspx">COLLAGEN CURL MASCARA</a></span></b><p> if you put a few drops of water in it, you will be stunne... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=6329"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment6"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=4466"><img src="/media/4466/DSC00260_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=4466" class="usernamelinkdiv">KATE</a> SAID ABOUT <span class="pinkTxt"><br /><a href="/products/eyes/eyeshadow/eye-palettes.aspx">EYE PALETTES</a></span></b><p>Went to Superdrug and saw these, i bought the pop-tastic pal... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=4466"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment7"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=4756"><img src="/media/4756/dfgdf_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=4756">JULIE</a> SAID </b><p>They are great and look amazing on thier own with some masca... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=4756"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment8"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=7006"><img src="/media/7006/IMG_1441_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=7006" class="usernamelinkdiv">ABIR</a> SAID ABOUT <span class="pinkTxt"><br /><a href="/products/eyes/mascara/big-fake-false-lash-effect-mascara.aspx">BIG FAKE FALSE LASH EFFECT MASCARA</a></span></b><p>It's no good. since the time i started using it i have had m... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=7006"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment9"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=5242"><img src="/media/5242/me_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=5242" class="usernamelinkdiv">REIKO</a> SAID ABOUT <span class="pinkTxt"><br /><a href="/products/eyes/eyeshadow/dazzle-me!-eye-dust.aspx">DAZZLE ME! EYE DUST</a></span></b><p>Brilliant Pigment Eye shadow dusts, stop wasting your money ... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=5242"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li><li class="licomment"><div class="myCollectionLatest" id="mycollectioncomment10"><div style="float:left;"><div class="colltoppic"><a href="/my-collection.aspx?memberId=5048"><img src="/media/5048/Melissa x_main.jpg" width="74" height="74" onerror="ImgError(this);" /></a></div><div class="collbottompic" /><div style="float:left; position:absolute; margin-left:83px; margin-top:-84px;" class="mycolllatestlinks"><b><a href="/my-collection.aspx?memberId=5048">MELISSA</a> SAID </b><p>I have the whole collection and wear it everyday :D I absolu... </p></div><div class="randomCommentsSeeMore"><span class="pinkTxt"><a href="/my-collection.aspx?memberId=5048"> See more <img src="/images/navControls/more-arrow.jpg" alt="see more" /></a></span></div></div></div></li></ul><img src="/images/my-collection/black-down.jpg" id="mycolldown" /><script> if (BrowserDetect.browser == "Safari") { if ($('#myCollectionFeaturedCollection').size() == 1) { $('#mycolldown').css({ "margin-top": "580px !important" }); } else { $('#mycolldown').css({ "margin-top": "380px !important" }); } } </script> <!--<img src="/images/my-collection/black-up.jpg" id="mycollup" /><ul /><img src="/images/my-collection/black-down.jpg" id="mycolldown" /> --> </div>

    Read the article

  • Crop, Edit, and Print Photos in Windows 7 Media Center

    - by DigitalGeekery
    Windows Media Center is a nice application for managing and displaying your personal photos, but you may occasionally need to make some basic edits to your pictures. Today we’ll take a look at how to crop, edit, and print photos right from Windows 7 Media Center. From within the Picture Library in Windows Media Center, choose a photo to work with, right-click and select Picture Details. You can also access this option with a Media Center remote by clicking the “i” button. Note: You’ll notice you have the option to rotate the picture from this menu. It is also available on the next screen.  Rotate a picture Now you’ll see more options on the Picture Details screen. From here you can rotate, Print, or Touch Up, Delete, or Burn a CD/DVD. To rotate the picture, simple select Rotate. Note: If you want your photo saved with the new orientation, you’ll need to select Save from the Touch Up screen that we will look at later in the article.   Each click will rotate the picture 90 degrees clockwise. You’ll see the new orientation of the picture displayed on the Picture Details screen after you have clicked Rotate. Print a picture From the Picture Details screen, select Print. Click Print again. Media Center automatically prints to your default printer, so make sure your desired target printer is set as default. Crop and Edit Photos To edit or crop your photo, select Touch Up. Touch Up options includes, Crop, Contrast, and Red Eye removal. First, we’ll select the Crop button to crop our photo.   You will see a cropping area overlay appear on your photo. Select one of the buttons below to adjust the location, size, and orientation of the area to be cropped. When you’re happy with your selection, click Save. You’ll be prompted to confirm your save. Click Yes to permanently save your edits. You can also apply Contrast or Red Eye adjustments to your photos. There aren’t any advanced settings for these options. You merely toggle the Contrast or Red Eye on or off by selecting the option. Be sure to click Save before exiting to if you’ve made any changes you wish to permanently apply to the photos. This includes rotating the images. While this method is not likely to be replace your favorite image editing software, it does give you the ability to make basic edits and print photos directly from Windows Media Center. With a Media Center remote, you can even do all your edits from the comfort of your recliner. Similar Articles Productive Geek Tips Using Netflix Watchnow in Windows Vista Media Center (Gmedia)Schedule Updates for Windows Media CenterIntegrate Hulu Desktop and Windows Media Center in Windows 7Add Color Coding to Windows 7 Media Center Program GuideIntegrate Boxee with Media Center in Windows 7 TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Outlook Connector Upgrade Error Gadfly is a cool Twitter/Silverlight app Enable DreamScene in Windows 7 Microsoft’s “How Do I ?” Videos Home Networks – How do they look like & the problems they cause Check Your IMAP Mail Offline In Thunderbird

    Read the article

  • List of Upcoming Appearances

    - by Chris Gardner
    Greetings. I know I have been in work sponsored hiding lately. We are working furiously on a beta project to secure a contract, and I can't really talk about it yet. Hopefully, the contracts will be soon signed. Not only will we then have money, but I can talk about all this really cool tech with which I have been playing. However, since the contract is not signed, I need to bring you people up to date with where I will be during the summer. Let's face it, you can't be a speaker / blogger without pandering to shameless self-promotion. First, I will, once again, be staffing the Hands-on-Labs at TechEd North America. Unfortunately, TechEd North America is already sold out for this year. However, if you're already going, drop by the labs and say Hi. Also, keep an eye on Twitter to track me throughout the event. Also, look for a post in a few hours with my specific picks for what content I'm looking forward to seeing this year. Immediately following TechEd North America, I will be flying into Knoxville to speak at CodeStock. I will be presenting my introduction and intermediate Xbox 360 development talks. There are a TON of great content at CodeStock this year, but there are only about 50 tickets left. After that whirlwind of work, things settle for awhile. That means I'm available to speak at your User Group, luncheon, bowling league, birthday party, anniversary, or bat mitzvah. Mid August brings us to That Conference. This one is going to be a blast. If you haven't heard of That Conference yet, you should really check it out. This will also be my introduction and intermediate Xbox 360 development talks. This is a new conference, and it looks like it will be a great one. Finally, we will turn our attention to DevLink. DevLink has the distinction of picking up my newest talk, Creating Stereoscopic 3D Graphics in XNA. On top of that, I'm giving an general Xbox 360 and Windows Phone 7 talk. DevLink has added an new "XNA and Kinect" track, so there will me a ton of great game content. That should bring us through the summer. As I solidify the Stereoscopic talk, look for some content on that to creep up on here. I will say it's the first topic I've played around with that is easier in 3D than 2D. Also, the organizers of Alabama Code Camp are still trying to reschedule the event. When that happens, I'll get that information out. Also, we are looking to expand our development team. If you are interested in working for / with me, keep an eye on the T & W Operations website. I know we're immediately looking for a junior level developer, but I think a few higher level position may come up soon. You MUST apply through the website, but drop me a personal line if you do apply. I'll keep an eye out for the application.

    Read the article

  • How to play an MKV 3D side-by-side video?

    - by djechelon
    I have a video in Matroska format (MKV, file extension .mkv), 3D half-SBS, where the 1280x720 frame shows the left-eye frame on the left and the right-eye frame on the right. I don't have a 3DTV, but I have NVidia 3D Vision: I tried to open it with PowerDVD 10 with no result (program hangs). With the same PowerDVD, I tried to play the Avatar 3D trailer downloaded from YouTube (MP4 format), but it now shows it the two frames. PowerDVD 10 is advertised to support 3D and 3D Vision. Why can't I play these videos? NVidia Stereoscopic player plays the Avatar trailer fine, but it doesn't support MKV.

    Read the article

  • Never Bet Against the Impossible

    - by BuckWoody
    My uncle used to say “If a man tells you that his car squirts milk in his eye when you lift the hood, don’t bet against that. You’ll end up with milk in your eye.” My friend Allen White tells me this is taken from a play (and was said about playing cards), but I think the sentiment holds, even in database work. I mentioned the other day that you should allow the other person to talk and actively listen before you propose a solution. Well, I saw a consultant “bet against the impossible”  the other day – and it bit her. She explained to the person telling her the problem that the situation simply couldn’t exist that way, and he proceeded to show her that it did. She got silent, typed a few things, muttered a little, and then said “well, must be something else.” She just couldn’t admit she was wrong. So don’t go there. If someone explains a problem to you with their database, listen with purpose, and then explore the troubleshooting steps you know to find the problem. But keep your absolutes to yourself. In fact, I have a friend that has recently sent me one of those. He connects to a system with SQL Server Management Studio (SSMS) version 2008 (if I recall correctly) and it shows a certain version number of the target system in the connection tab. Then he connects to it using SSMS 2008 R2 and gets a different number. Now, as far as I know, we didn’t change the connection string information, and that’s provided by the target system, so this is impossible. But I won’t tell him that. Not until I look a little more. :) Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!

    Read the article

  • Coordinate spaces and transformation matrices

    - by Belgin
    I'm trying to get an object from object space, into projected space using these intermediate matrices: The first matrix (I) is the one that transforms from object space into inertial space, but since my object is not rotated or translated in any way inside the object space, this matrix is the 4x4 identity matrix. The second matrix (W) is the one that transforms from inertial space into world space, which is just a scale transform matrix of factor a = 14.1 on all coordinates, since the inertial space origin coincides with the world space origin. /a 0 0 0\ W = |0 a 0 0| |0 0 a 0| \0 0 0 1/ The third matrix (C) is the one that transforms from world space, into camera space. This matrix is a translation matrix with a translation of (0, 0, 10), because I want the camera to be located behind the object, so the object must be positioned 10 units into the z axis. /1 0 0 0\ C = |0 1 0 0| |0 0 1 10| \0 0 0 1/ And finally, the fourth matrix is the projection matrix (P). Bearing in mind that the eye is at the origin of the world space and the projection plane is defined by z = 1, the projection matrix is: /1 0 0 0\ P = |0 1 0 0| |0 0 1 0| \0 0 1/d 0/ where d is the distance from the eye to the projection plane, so d = 1. I'm multiplying them like this: (((P x C) x W) x I) x V, where V is the vertex' coordinates in column vector form: /x\ V = |y| |z| \1/ After I get the result, I divide x and y coordinates by w to get the actual screen coordinates. Apparenly, I'm doing something wrong or missing something completely here, because it's not rendering properly. Here's a picture of what is supposed to be the bottom side of the Stanford Dragon: Also, I should add that this is a software renderer so no DirectX or OpenGL stuff here.

    Read the article

  • Never Bet Against the Impossible

    - by BuckWoody
    My uncle used to say “If a man tells you that his car squirts milk in his eye when you lift the hood, don’t bet against that. You’ll end up with milk in your eye.” My friend Allen White tells me this is taken from a play (and was said about playing cards), but I think the sentiment holds, even in database work. I mentioned the other day that you should allow the other person to talk and actively listen before you propose a solution. Well, I saw a consultant “bet against the impossible”  the other day – and it bit her. She explained to the person telling her the problem that the situation simply couldn’t exist that way, and he proceeded to show her that it did. She got silent, typed a few things, muttered a little, and then said “well, must be something else.” She just couldn’t admit she was wrong. So don’t go there. If someone explains a problem to you with their database, listen with purpose, and then explore the troubleshooting steps you know to find the problem. But keep your absolutes to yourself. In fact, I have a friend that has recently sent me one of those. He connects to a system with SQL Server Management Studio (SSMS) version 2008 (if I recall correctly) and it shows a certain version number of the target system in the connection tab. Then he connects to it using SSMS 2008 R2 and gets a different number. Now, as far as I know, we didn’t change the connection string information, and that’s provided by the target system, so this is impossible. But I won’t tell him that. Not until I look a little more. :) Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!

    Read the article

  • T-SQL Improvements And Data Types in ms sql 2008

    - by Aamir Hasan
     Microsoft SQL Server 2008 is a new version released in the first half of 2008 introducing new properties and capabilities to SQL Server product family. All these new and enhanced capabilities can be defined as the classic words like secure, reliable, scalable and manageable. SQL Server 2008 is secure. It is reliable. SQL2008 is scalable and is more manageable when compared to previous releases. Now we will have a look at the features that are making MS SQL Server 2008 more secure, more reliable, more scalable, etc. in details.Microsoft SQL Server 2008 provides T-SQL enhancements that improve performance and reliability. Itzik discusses composable DML, the ability to declare and initialize variables in the same statement, compound assignment operators, and more reliable object dependency information. Table-Valued ParametersInserts into structures with 1-N cardinality problematicOne order -> N order line items"N" is variable and can be largeDon't want to force a new order for every 20 line itemsOne database round-trip / line item slows things downNo ARRAY data type in SQL ServerXML composition/decomposition used as an alternativeTable-valued parameters solve this problemTable-Valued ParametersSQL Server has table variablesDECLARE @t TABLE (id int);SQL Server 2008 adds strongly typed table variablesCREATE TYPE mytab AS TABLE (id int);DECLARE @t mytab;Parameters must use strongly typed table variables Table Variables are Input OnlyDeclare and initialize TABLE variable  DECLARE @t mytab;  INSERT @t VALUES (1), (2), (3);  EXEC myproc @t;Procedure must declare variable READONLY  CREATE PROCEDURE usetable (    @t mytab READONLY ...)  AS    INSERT INTO lineitems SELECT * FROM @t;    UPDATE @t SET... -- no!T-SQL Syntax EnhancementsSingle statement declare and initialize  DECLARE @iint = 4;Compound Assignment Operators  SET @i += 1;Row constructors  DECLARE @t TABLE (id int, name varchar(20));  INSERT INTO @t VALUES    (1, 'Fred'), (2, 'Jim'), (3, 'Sue');Grouping SetsGrouping Sets allow multiple GROUP BY clauses in a single SQL statementMultiple, arbitrary, sets of subtotalsSingle read pass for performanceNested subtotals provide ever better performanceGrouping Sets are an ANSI-standardCOMPUTE BY is deprecatedGROUPING SETS, ROLLUP, CUBESQL Server 2008 - ANSI-syntax ROLLUP and CUBEPre-2008 non-ANSI syntax is deprecatedWITH ROLLUP produces n+1 different groupings of datawhere n is the number of columns in GROUP BYWITH CUBE produces 2^n different groupingswhere n is the number of columns in GROUP BYGROUPING SETS provide a "halfway measure"Just the number of different groupings you needGrouping Sets are visible in query planGROUPING_ID and GROUPINGGrouping Sets can produce non-homogeneous setsGrouping set includes NULL values for group membersNeed to distinguish by grouping and NULL valuesGROUPING (column expression) returns 0 or 1Is this a group based on column expr. or NULL value?GROUPING_ID (a,b,c) is a bitmaskGROUPING_ID bits are set based on column expressions a, b, and cMERGE StatementMultiple set operations in a single SQL statementUses multiple sets as inputMERGE target USING source ON ...Operations can be INSERT, UPDATE, DELETEOperations based onWHEN MATCHEDWHEN NOT MATCHED [BY TARGET] WHEN NOT MATCHED [BY SOURCE]More on MERGEMERGE statement can reference a $action columnUsed when MERGE used with OUTPUT clauseMultiple WHEN clauses possible For MATCHED and NOT MATCHED BY SOURCEOnly one WHEN clause for NOT MATCHED BY TARGETMERGE can be used with any table sourceA MERGE statement causes triggers to be fired onceRows affected includes total rows affected by all clausesMERGE PerformanceMERGE statement is transactionalNo explicit transaction requiredOne Pass Through TablesAt most a full outer joinMatching rows = when matchedLeft-outer join rows = when not matched by targetRight-outer join rows = when not matched by sourceMERGE and DeterminismUPDATE using a JOIN is non-deterministicIf more than one row in source matches ON clause, either/any row can be used for the UPDATEMERGE is deterministicIf more than one row in source matches ON clause, its an errorKeeping Track of DependenciesNew dependency views replace sp_dependsViews are kept in sync as changes occursys.dm_sql_referenced_entitiesLists all named entities that an object referencesExample: which objects does this stored procedure use?sys.dm_sql_referencing_entities 

    Read the article

  • XNA Notes 011

    - by George Clingerman
    Even with a lot of the XNA community working on Dream Build Play entries ( I swear I’m going to finish mine this year!) people are still finding time to do side projects and be amazingly active in the XNA and XBLIG community. With my one eye on my code and one eye on the community, here’s what I noticed these over achievers doing this past week! Time Critical XNA News: Xbox LIVE Indie Games sales data will be delayed March 17-20th due to some schedule maintenance http://create.msdn.com/en-us/news/indie_games_data_delay_march2011 GameMarx is releasing a series of videos to help raise donations for victims of the earthquakes and tsunami in Japan. Help out if you can! http://www.gamemarx.com/video/special/29/help-japan-sushido.aspx XNA MVPs: Catalin Zima shares his thoughts on the MVP summit and my book! http://www.catalinzima.com/2011/03/mvp-summit-2011/ Glenn Wilson (@mykre) helps the XNA team announce some new educational content that you don’t want to miss if you’re porting your app or game to Windows Phone 7 http://www.virtualrealm.com.au/Blog/tabid/62/EntryId/653/Porting-your-App-or-Game-to-Windows-Phone-7.aspx and Windows Phone 7 from scratch http://www.virtualrealm.com.au/Blog/tabid/62/EntryId/654/Windows-Phone-from-Scratch.aspx and shares a link to some free architectural models and textures http://twitter.com/#!/Mykre/status/46410160784158720 George (that’s me!) shares his MVP Summit 2011 summary and XBLIG thoughts http://geekswithblogs.net/clingermangw/archive/2011/03/15/144366.aspx XNA Developers: @SmallCaveGames shares a Code of Ethics for Xbox LIVE Indie Game Developers http://smallcavegames.blogspot.com/2011/03/unofficial-xblig-developers-code-of.html Derek S adds more Xbox LIVE Indie Game studios to his master list of XBLIG links http://twitter.com/#!/Mr_Deeke/status/46140996056125440 http://xbl-indieverse.blogspot.com/p/xblig-links.html Making games and want to help kids? Then share your story with GameFace: America! http://gameitupinitiative.com/about-the-initiative/programs/gameface-america/ Xbox LIVE Indie Games (XBLIG): XonaGames shares some video footage of their booth from GDC 2011 Video 1: http://youtu.be/lxIV9nk3Gq4 Video 2: http://youtu.be/GgfrjqkxR_o Video 3: http://youtu.be/yVcpXrTX7SQ Joystiq on Mommy’s Best Games Serious Sam Double D http://www.joystiq.com/2011/03/16/the-most-important-thing-about-serious-sam-double-d/ And The Escapist recommends that gamers start learning to avoid cleavage now http://www.escapistmagazine.com/news/view/108543-Boobie-Bomber-Makes-First-Appearance-in-Serious-Sam-Double-D Magiko Gaming started a blog on the XBLIG dashboard daily Top 10 games in the US. Good way to go back in time and look at the history of which games were in the the Top 10. http://dailytop10indiegames.wordpress.com/ Where are they going now? XBLIG developers at a crossroads.. http://www.gamesetwatch.com/2011/03/where_are_they_going_now_xblig.php http://www.gamasutra.com/view/news/33527/InDepth_Where_Are_They_Going_Now_XBLIG_Developers_At_A_Crossroads_.php BinaryTweed’s Clover: A Curious Tail is Xbox LIVE’s Deal of the Week! http://www.armlessoctopus.com/2011/03/15/what-luck-clover-a-curious-tale-is-half-price-this-week/ Looking for an Xbox LIVE Indie Game to buy? Writings of Mass Deduction has over 125 suggestions at this point! http://writingsofmassdeduction.com/ SkaStudios shares Vampire Smile Achievements AND their PAX East 2011 Both Setup video http://www.ska-studios.com/2011/03/14/vampire-smile-achievement/ http://www.ska-studios.com/2011/03/15/pax-booth-setup-time-lapse/ MasterBlud and VVGTV starts a new community for XBLIG developers and gamers to join http://vvgtv.forumotion.com/ Raymond Matthews (@DrakstarMatryx) covers Mommy’s Best Games getting Serious http://www.darkstarmatryx.com/?p=286 XNA Development: Dave Henry (@mort8088) posts the 4th tutorial in his series XNA 4.0 SpriteBatch extended http://mort8088.com/2011/03/11/xna-4-0-tutorial-4-spritebatch-extended/ Tutorial 5 - Creating a manual blank texture http://mort8088.com/2011/03/13/xna-4-tutorial-5-manual-blank-texture/ XNA 4.0 Tutorial 6 - Spritesheet Object http://mort8088.com/2011/03/18/xna-4-0-tutorial-6-spritesheet-object/ Jason Mitchell shares a tutorial on setting the alpha value for spritebatch in XNA 4.0 http://www.jason-mitchell.com/index.php/2011/03/13/setting-alpha-value-for-spritebatch-draw-in-xna-4/ XNA for Silverlight Developers: Part 7 - Collision Detection http://www.silverlightshow.net/items/XNA-for-Silverlight-developers-Part-7-Collision-detection.aspx Markus Ewald (@Cygon4) shares the full Ninject 2.0 binding for XNA and Sunburn http://twitter.com/#!/Cygon4/status/48330203826622464 Michael B. McLaughlin shares an AccelerometerInput XNA GameComponent he created (which I’m probably going to snag for a game I’m working on...) http://geekswithblogs.net/mikebmcl/archive/2011/03/17/accelerometerinput-xna-gamecomponent.aspx Extra Credit tackles the building of a good tutorial. Must watch for all Indie game devs (thanks for pointing it out Evan Johnson!) http://twitter.com/#!/johnsonevan/status/48452115680604160 http://www.escapistmagazine.com/videos/view/extra-credits/2921-Tutorials-101 ExEn is fully funded at this point so definitely something for XBLIG developers to keep an eye on as they consider releasing their games on other platforms http://rockethub.com/projects/752-exen-xna-for-iphone-android-and-silverlight Channel 9 and Greg Duncan post Mixing the Game State Management and Platformer XNA Recipes http://channel9.msdn.com/coding4fun/blog/Mixing-the-Game-State-Management-and-Platformer-XNA-Recipes Sgt. Conker has noticed Mike McLaughlin has been crazy productive and has done a recap of his recent posts http://www.sgtconker.com/2011/03/recap-of-mikebmcls-posts/

    Read the article

  • Backpacks and Booth Paint: TechEd 2012

    - by The Un-T Guy
    Arriving in the parking lot of the Orange County Convention Center, I immediately knew I was in the right place. As far as the eye could see, the acres of asphalt were awash in backpacks, quirky (to be kind) outfits, and bad haircuts. This was the place. This was Microsoft Mecca v2012 for geeks and nerds, the Central Florida event of the year, a gathering of high tech professionals whose skills I both greatly respect and, frankly, fear a little. I was wholly and completely out of element, a dork in a vast sea of geek jumbo. It like was wearing dockers and a golf shirt walking into a RenFaire, but one with really crappy costumes and no turkey legs...save those attached to some of the attendees. Of course the corporate whores...errrr, vendors were in place, ready to parlay the convention's fre-nerd-ic energy into millions of dollars by convincing the big-brained and under-sexed in the crowd (i.e., virtually all of them...present company excluded, of course) that their product or service was the only thing standing between them and professional success, industry fame, and clear skin. "With KramTech 2012," they seemed to scream, "you will be THE ROCK STAR of your company's IT department!" As car shows and tattoo parlors learned long ago, Tech companies seem to believe that the best way to attract the attention of this crowd is through the hint of the promise of sex. They recruit and deploy an army of "sales reps" whose primary qualifications appear to be long hair, short skirts, high heels, and a vagina. Unlike their distant cousins in the car and body art industries, however, this sub-species of booth paint (semi-gloss decoration that adds nothing to the substance of the product) seems torn between committing to being all-out sex objects and recognition that they are in the presence of intelligent, discerning people. People who are smart enough to know exactly what these vendors are doing. Also unlike their distant car show and tattoo shop cousins, these young women (what…are there no gay tech professionals who could use some eye candy?) seem to realize that while IT remains a male-dominated field, there are ever-increasing numbers of intelligent, capable, strong professional women – women who’ve battled to make it in this field through hard work and work performance rather than a hard body and performing after work. This is not to say that all of the young female sales reps are there only because of their physical attributes. Many are competent, intelligent, and driven -- not to mention attractive. They're working hard on the front lines of delivering the next generation of technology. The distinction is pretty clear, however, between these young professionals and the booth paint. The former enthusiastically deliver credible information about the products they’re hawking. The latter are positioned in the aisles, uncomfortably avoiding eye contact as they struggle to operate the badge readers. Surprisingly, not all of the women in attendance seemed to object to the objectification of their younger sisters. One IT professional woman who came of age in the industry (mostly in IT marketing) said, “I have no problem with it. I was a ‘booth babe’ for years and it doesn’t bother me at all.” Others, however, weren’t quite so gracious. One woman I spoke with, an IT manager from Cheyenne, Wyoming, said it was demeaning and frankly, as more and more women grow into IT management positions, not a great marketing idea. “Using these young women is, to me, no different than vendors giving out t-shirts to attract attention. It’s sad because it’s still hard for a woman to be respected in the IT field and this just perpetuates the outdated notion that IT is a male-dominated field.” She went on to say that decisions by vendors to employ these young women in this “inappropriate way” could impact her purchasing decisions. “I might be swayed toward a vendor who has women on staff who are intelligent and dynamic rather than the vendors who use the ‘decoration’ girls.” So in many ways, the IT industry is no different than most other industries as it struggles to maximize performance by finding and developing talent – all of the talent, not just the 50% with a penis. Women in IT, like their brethren, struggle to find their niche in the field, to grow professionally, and reach for the brass ring, struggling to overcome obstacles as they climb the mountain of professional success in a never-ending cycle of economic uncertainty. But as (generally) well-educated and highly-trained professionals, they are probably better positioned than those in many other industries. Beside, they’ve got one other advantage over their non-IT counterparts as they attempt their ascent to the summit: They’ve already got the backpacks.

    Read the article

  • Off center projection

    - by N0xus
    I'm trying to implement the code that was freely given by a very kind developer at the following link: http://forum.unity3d.com/threads/142383-Code-sample-Off-Center-Projection-Code-for-VR-CAVE-or-just-for-fun Right now, all I'm trying to do is bring it in on one camera, but I have a few issues. My class, looks as follows: using UnityEngine; using System.Collections; public class PerspectiveOffCenter : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } public static Matrix4x4 GeneralizedPerspectiveProjection(Vector3 pa, Vector3 pb, Vector3 pc, Vector3 pe, float near, float far) { Vector3 va, vb, vc; Vector3 vr, vu, vn; float left, right, bottom, top, eyedistance; Matrix4x4 transformMatrix; Matrix4x4 projectionM; Matrix4x4 eyeTranslateM; Matrix4x4 finalProjection; ///Calculate the orthonormal for the screen (the screen coordinate system vr = pb - pa; vr.Normalize(); vu = pc - pa; vu.Normalize(); vn = Vector3.Cross(vr, vu); vn.Normalize(); //Calculate the vector from eye (pe) to screen corners (pa, pb, pc) va = pa-pe; vb = pb-pe; vc = pc-pe; //Get the distance;; from the eye to the screen plane eyedistance = -(Vector3.Dot(va, vn)); //Get the varaibles for the off center projection left = (Vector3.Dot(vr, va)*near)/eyedistance; right = (Vector3.Dot(vr, vb)*near)/eyedistance; bottom = (Vector3.Dot(vu, va)*near)/eyedistance; top = (Vector3.Dot(vu, vc)*near)/eyedistance; //Get this projection projectionM = PerspectiveOffCenter(left, right, bottom, top, near, far); //Fill in the transform matrix transformMatrix = new Matrix4x4(); transformMatrix[0, 0] = vr.x; transformMatrix[0, 1] = vr.y; transformMatrix[0, 2] = vr.z; transformMatrix[0, 3] = 0; transformMatrix[1, 0] = vu.x; transformMatrix[1, 1] = vu.y; transformMatrix[1, 2] = vu.z; transformMatrix[1, 3] = 0; transformMatrix[2, 0] = vn.x; transformMatrix[2, 1] = vn.y; transformMatrix[2, 2] = vn.z; transformMatrix[2, 3] = 0; transformMatrix[3, 0] = 0; transformMatrix[3, 1] = 0; transformMatrix[3, 2] = 0; transformMatrix[3, 3] = 1; //Now for the eye transform eyeTranslateM = new Matrix4x4(); eyeTranslateM[0, 0] = 1; eyeTranslateM[0, 1] = 0; eyeTranslateM[0, 2] = 0; eyeTranslateM[0, 3] = -pe.x; eyeTranslateM[1, 0] = 0; eyeTranslateM[1, 1] = 1; eyeTranslateM[1, 2] = 0; eyeTranslateM[1, 3] = -pe.y; eyeTranslateM[2, 0] = 0; eyeTranslateM[2, 1] = 0; eyeTranslateM[2, 2] = 1; eyeTranslateM[2, 3] = -pe.z; eyeTranslateM[3, 0] = 0; eyeTranslateM[3, 1] = 0; eyeTranslateM[3, 2] = 0; eyeTranslateM[3, 3] = 1f; //Multiply all together finalProjection = new Matrix4x4(); finalProjection = Matrix4x4.identity * projectionM*transformMatrix*eyeTranslateM; //finally return return finalProjection; } // Update is called once per frame public void FixedUpdate () { Camera cam = camera; //calculate projection Matrix4x4 genProjection = GeneralizedPerspectiveProjection( new Vector3(0,1,0), new Vector3(1,1,0), new Vector3(0,0,0), new Vector3(0,0,0), cam.nearClipPlane, cam.farClipPlane); //(BottomLeftCorner, BottomRightCorner, TopLeftCorner, trackerPosition, cam.nearClipPlane, cam.farClipPlane); cam.projectionMatrix = genProjection; } } My error lies in projectionM = PerspectiveOffCenter(left, right, bottom, top, near, far); The debugger states: Expression denotes a `type', where a 'variable', 'value' or 'method group' was expected. Thus, I changed the line to read: projectionM = new PerspectiveOffCenter(left, right, bottom, top, near, far); But then the error is changed to: The type 'PerspectiveOffCenter' does not contain a constructor that takes '6' arguments. For reasons that are obvious. So, finally, I changed the line to read: projectionM = new GeneralizedPerspectiveProjection(left, right, bottom, top, near, far); And the error I get is: is a 'method' but a 'type' was expected. With this last error, I'm not sure what it is I should do / missing. Can anyone see what it is that I'm missing to fix this error?

    Read the article

  • Black Screen: How to set Projection/View Matrix

    - by Lisa
    I have a Windows Phone 8 C#/XAML with DirectX component project. I'm rendering some particles, but each particle is a rectangle versus a square (as I've set the vertices to be positions equally offset from each other). I used an Identity matrix in the view and projection matrix. I decided to add the windows aspect ratio to prevent the rectangles. But now I get a black screen. None of the particles are rendered now. I don't know what's wrong with my matrices. Can anyone see the problem? These are the default matrices in Microsoft's project example. View Matrix: XMVECTOR eye = XMVectorSet(0.0f, 0.7f, 1.5f, 0.0f); XMVECTOR at = XMVectorSet(0.0f, -0.1f, 0.0f, 0.0f); XMVECTOR up = XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); XMStoreFloat4x4(&m_constantBufferData.view, XMMatrixTranspose(XMMatrixLookAtRH(eye, at, up))); Projection Matrix: void CubeRenderer::CreateWindowSizeDependentResources() { Direct3DBase::CreateWindowSizeDependentResources(); float aspectRatio = m_windowBounds.Width / m_windowBounds.Height; float fovAngleY = 70.0f * XM_PI / 180.0f; if (aspectRatio < 1.0f) { fovAngleY /= aspectRatio; } XMStoreFloat4x4(&m_constantBufferData.projection, XMMatrixTranspose(XMMatrixPerspectiveFovRH(fovAngleY, aspectRatio, 0.01f, 100.0f))); } I've tried modifying them to use cocos2dx's WP8 example. XMMATRIX identityMatrix = XMMatrixIdentity(); float fovy = 60.0f; float aspect = m_windowBounds.Width / m_windowBounds.Height; float zNear = 0.1f; float zFar = 100.0f; float xmin, xmax, ymin, ymax; ymax = zNear * tanf(fovy * XM_PI / 360); ymin = -ymax; xmin = ymin * aspect; xmax = ymax * aspect; XMMATRIX tmpMatrix = XMMatrixPerspectiveOffCenterRH(xmin, xmax, ymin, ymax, zNear, zFar); XMMATRIX projectionMatrix = XMMatrixMultiply(tmpMatrix, identityMatrix); // View Matrix float fEyeX = m_windowBounds.Width * 0.5f; float fEyeY = m_windowBounds.Height * 0.5f; float fEyeZ = m_windowBounds.Height / 1.1566f; float fLookAtX = m_windowBounds.Width * 0.5f; float fLookAtY = m_windowBounds.Height * 0.5f; float fLookAtZ = 0.0f; float fUpX = 0.0f; float fUpY = 1.0f; float fUpZ = 0.0f; XMMATRIX tmpMatrix2 = XMMatrixLookAtRH(XMVectorSet(fEyeX,fEyeY,fEyeZ,0.f), XMVectorSet(fLookAtX,fLookAtY,fLookAtZ,0.f), XMVectorSet(fUpX,fUpY,fUpZ,0.f)); XMMATRIX viewMatrix = XMMatrixMultiply(tmpMatrix2, identityMatrix); XMStoreFloat4x4(&m_constantBufferData.view, viewMatrix); Vertex Shader cbuffer ModelViewProjectionConstantBuffer : register(b0) { //matrix model; matrix view; matrix projection; }; struct VertexInputType { float4 position : POSITION; float2 tex : TEXCOORD0; float4 color : COLOR; }; struct PixelInputType { float4 position : SV_POSITION; float2 tex : TEXCOORD0; float4 color : COLOR; }; PixelInputType main(VertexInputType input) { PixelInputType output; // Change the position vector to be 4 units for proper matrix calculations. input.position.w = 1.0f; //===================================== // TODO: ADDED for testing input.position.z = 0.0f; //===================================== // Calculate the position of the vertex against the world, view, and projection matrices. //output.position = mul(input.position, model); output.position = mul(input.position, view); output.position = mul(output.position, projection); // Store the texture coordinates for the pixel shader. output.tex = input.tex; // Store the particle color for the pixel shader. output.color = input.color; return output; } Before I render the shader, I set the view/projection matrices into the constant buffer void ParticleRenderer::SetShaderParameters() { ViewProjectionConstantBuffer* dataPtr; D3D11_MAPPED_SUBRESOURCE mappedResource; DX::ThrowIfFailed(m_d3dContext->Map(m_constantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)); dataPtr = (ViewProjectionConstantBuffer*)mappedResource.pData; dataPtr->view = m_constantBufferData.view; dataPtr->projection = m_constantBufferData.projection; m_d3dContext->Unmap(m_constantBuffer.Get(), 0); // Now set the constant buffer in the vertex shader with the updated values. m_d3dContext->VSSetConstantBuffers(0, 1, m_constantBuffer.GetAddressOf() ); // Set shader texture resource in the pixel shader. m_d3dContext->PSSetShaderResources(0, 1, &m_textureView); } Nothing, black screen... I tried so many different look at, eye, and up vectors. I tried transposing the matrices. I've set the particle center position to always be (0, 0, 0), I tried different positions too, just to make sure they're not being rendered offscreen.

    Read the article

  • OpenGL 3 and the Radeon HD 4850x2

    - by rotard
    A while ago, I picked up a copy of the OpenGL SuperBible fifth edition and slowly and painfully started teaching myself OpenGL the 3.3 way, after having been used to the 1.0 way from school way back when. Making things more challenging, I am primarily a .NET developer, so I was working in Mono with the OpenTK OpenGL wrapper. On my laptop, I put together a program that let the user walk around a simple landscape using a couple shaders that implemented per-vertex coloring and lighting and texture mapping. Everything was working brilliantly until I ran the same program on my desktop. Disaster! Nothing would render! I have chopped my program down to the point where the camera sits near the origin, pointing at the origin, and renders a square (technically, a triangle fan). The quad renders perfectly on my laptop, coloring, lighting, texturing and all, but the desktop renders a small distorted non-square quadrilateral that is colored incorrectly, not affected by the lights, and not textured. I suspect the graphics card is at fault, because I get the same result whether I am booted into Ubuntu 10.10 or Win XP. I did find that if I pare the vertex shader down to ONLY outputting the positional data and the fragment shader to ONLY outputting a solid color (white) the quad renders correctly. But as SOON as I start passing in color data (whether or not I use it in the fragment shader) the output from the vertex shader is distorted again. The shaders follow. I left the pre-existing code in, but commented out so you can get an idea what I was trying to do. I'm a noob at glsl so the code could probably be a lot better. My laptop is an old lenovo T61p with a Centrino (Core 2) Duo and an nVidia Quadro graphics card running Ubuntu 10.10 My desktop has an i7 with a Radeon HD 4850 x2 (single card, dual GPU) from Saphire dual booting into Ubuntu 10.10 and Windows XP. The problem occurs in both XP and Ubuntu. Can anyone see something wrong that I am missing? What is "special" about my HD 4850x2? string vertexShaderSource = @" #version 330 precision highp float; uniform mat4 projection_matrix; uniform mat4 modelview_matrix; //uniform mat4 normal_matrix; //uniform mat4 cmv_matrix; //Camera modelview. Light sources are transformed by this matrix. //uniform vec3 ambient_color; //uniform vec3 diffuse_color; //uniform vec3 diffuse_direction; in vec4 in_position; in vec4 in_color; //in vec3 in_normal; //in vec3 in_tex_coords; out vec4 varyingColor; //out vec3 varyingTexCoords; void main(void) { //Get surface normal in eye coordinates //vec4 vEyeNormal = normal_matrix * vec4(in_normal, 0); //Get vertex position in eye coordinates //vec4 vPosition4 = modelview_matrix * vec4(in_position, 0); //vec3 vPosition3 = vPosition4.xyz / vPosition4.w; //Get vector to light source in eye coordinates //vec3 lightVecNormalized = normalize(diffuse_direction); //vec3 vLightDir = normalize((cmv_matrix * vec4(lightVecNormalized, 0)).xyz); //Dot product gives us diffuse intensity //float diff = max(0.0, dot(vEyeNormal.xyz, vLightDir.xyz)); //Multiply intensity by diffuse color, force alpha to 1.0 //varyingColor.xyz = in_color * diff * diffuse_color.xyz; varyingColor = in_color; //varyingTexCoords = in_tex_coords; gl_Position = projection_matrix * modelview_matrix * in_position; }"; string fragmentShaderSource = @" #version 330 //#extension GL_EXT_gpu_shader4 : enable precision highp float; //uniform sampler2DArray colorMap; //in vec4 varyingColor; //in vec3 varyingTexCoords; out vec4 out_frag_color; void main(void) { out_frag_color = vec4(1,1,1,1); //out_frag_color = varyingColor; //out_frag_color = vec4(varyingColor, 1) * texture(colorMap, varyingTexCoords.st); //out_frag_color = vec4(varyingColor, 1) * texture(colorMap, vec3(varyingTexCoords.st, 0)); //out_frag_color = vec4(varyingColor, 1) * texture2DArray(colorMap, varyingTexCoords); }"; Note that in this code the color data is accepted but not actually used. The geometry is outputted the same (wrong) whether the fragment shader uses varyingColor or not. Only if I comment out the line varyingColor = in_color; does the geometry output correctly. Originally the shaders took in vec3 inputs, I only modified them to take vec4s while troubleshooting.

    Read the article

  • Help Me With This Access Query

    - by yae
    I have 2 tables: "products" and "pieces" PRODUCTS idProd product price PIECES id idProdMain idProdChild quant idProdMain and idProdChild are related with the table: "products". Other considerations is that 1 product can have some pieces and 1 product can be a piece. Price product equal a sum of quantity * price of all their pieces. "Products" table contains all products (p EXAMPLE: TABLE PRODUCTS (idProd - product - price) 1 - Computer - 300€ 2 - Hard Disk - 100€ 3 - Memory - 50€ 4 - Main Board - 100€ 5 - Software - 50€ 6 - CDroms 100 un. - 30€ TABLE PIECES (id - idProdMain - idProdChild - Quant.) 1 - 1 - 2 - 1 2 - 1 - 3 - 2 3 - 1 - 4 - 1 WHAT I NEED? I need update the price of the main product when the price of the product child (piece) is changed. Following the previous example, if I change the price of this product "memory" (is a piece too) to 60€, then product "Computer" will must change his price to 320€ How I can do it using queries? Already I have tried this to obatin the price of the main product, but not runs. This query not returns any value: SELECT Sum(products.price*pieces.quant) AS Expr1 FROM products LEFT JOIN pieces ON (products.idProd = pieces.idProdChild) AND (products.idProd = pieces.idProdChild) AND (products.idProd = pieces.idProdMain) WHERE (((pieces.idProdMain)=5)); MORE INFO The table "products" contains all the products to sell that it is in the shop. The table "pieces" is to take a control of the compound products. To know those who are the products children. For example of compound product: computers. This product is composed by other products (motherboard, hard disk, memory, cpu, etc.)

    Read the article

  • Database localization

    - by Don
    Hi, I have a number of database tables that contain name and description columns which need to be localized. My initial attempt at designing a DB schema that would support this was something like: product ------- id name description local_product ------- id product_id local_name local_description locale_id locale ------ id locale However, this solution requires a new local_ table for every table that contains name and description columns that require localization. In an attempt to avoid this overhead I redesigned the schema so that only a single localization table is needed product ------- id localization_id localization ------- id local_name local_description locale_id locale ------ id locale Here's an example of the data which would be stored in this schema when there are 2 tables (product and country) requiring localization: country id, localization_id ----------------------- 1, 5 product id, localization_id ----------------------- 1, 2 localization id, local_name, local_description, locale_id ------------------------------------------------------ 2, apple, a delicious fruit, 2 2, pomme, un fruit délicieux, 3 2, apfel, ein köstliches Obst, 4 5, ireland, a small country, 2 5, irlande, un petite pay, 3 locale id, locale -------------- 2, en 3, fr 4, de Notice that the compound primary key of the localization table is (id, locale_id), but the foreign key in the product table only refers to the first element of this compound PK. This seems like 'a bad thing' from the POV of normalization. Is there any way I can fix this problem, or alternatively, is there a completely different schema that supports localization without creating a separate table for each localizable table? Update: A number of respondents have proposed a solution that requires creating a separate table for each localizable table. However, this is precisely what I'm trying to avoid. The schema I've proposed above almost solves the problem to my satisfaction, but I'm unhappy about the fact that the localization_id foreign keys only refer to part of the corresponding primary key in the localization table. Thanks, Don

    Read the article

  • How to make placeholder varablies in jquery validate 1.7?

    - by chobo2
    Hi I am using jquery 1.4.2 and jquery validate 1.7(http://bassistance.de/jquery-plugins/jquery-plugin-validation/) Say I have this example that I just grabbed off some random site(http://www.webreference.com/programming/javascript/jquery/form_validation/) 8 <script type="text/javascript"> 9 $(document).ready(function() { 10 $("#form1").validate({ 11 rules: { 12 name: "required",// simple rule, converted to {required:true} 13 email: {// compound rule 14 required: true, 15 email: true 16 }, 17 url: { 18 url: true 19 }, 20 comment: { 21 required: true 22 } 23 }, 24 messages: { 25 comment: "Please enter a comment." 26 } 27 }); 28 }); 29 </script> now is it possible to do something like this 10 $("#form1").validate({ var NameHolder = "name" 11 rules: { 12 NameHolder: "required",// simple rule, converted to {required:true} 13 email: {// compound rule 14 required: true, 15 email: true So basically I want to make sort of a global variable to hold theses rule names( what correspond to the names on that html control). My concern is the names of html controls can change and it kinda sucks that I will have to go around and change it in many places of my code to make it work again. So basically I am wondering is there away to make a global variable to store this name. So if I need to change the name I only have to change it in one spot in my javascript file sort of the way stopping magic numbers ?

    Read the article

  • Symfony2 Theming form generated by embedded controller action

    - by user1112057
    I am generating the form in embedded controller action. And now i have faced the following problem. The Form Theming is not working in that case. So what i have: The tempalte "page.html.twig" {% block content %} {% render 'MyBundle:Widget:index' %} {% endblock %} The indexAction() creates the form and rendering another template "form.html.twig" which is normally renders a form using form_row, form_rest and so on. So, now i am trying to customize form theming, and here is my problem. When i put the code {% form_theme form _self %} in the page.html.twig, i got an error the the form variable does not exists. And its correct, the form var is created later in the embedded controller. But when i put the theming code in embedded template "form.html.twig", i got another error "Variable "compound" does not exist" {% block form_label %} {% spaceless %} {% if not compound %} {% set label_attr = label_attr|merge({'for': id}) %} {% endif %} {% if required %} {% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ ' required')|trim}) %} {% endif %} {% if label is empty %} {% set label = name|humanize %} {% endif %} <label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %} {% if attr.tooltip is defined %}title="{{ attr.tooltip }}"{% endif %}>{{ label|trans({}, translation_domain) }}{% if required %}<span>*</span>{% endif %}</label> {% endspaceless %} {% endblock form_label %} This part of code was copied from this file https://github.com/symfony/symfony/blob/2.1/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig So tried someone to do something like this?

    Read the article

  • Help Me With This MS-Access Query

    - by yae
    I have 2 tables: "products" and "pieces" PRODUCTS idProd product price PIECES id idProdMain idProdChild quant idProdMain and idProdChild are related with the table: "products". Other considerations is that 1 product can have some pieces and 1 product can be a piece. Price product equal a sum of quantity * price of all their pieces. "Products" table contains all products (p EXAMPLE: TABLE PRODUCTS (idProd - product - price) 1 - Computer - 300€ 2 - Hard Disk - 100€ 3 - Memory - 50€ 4 - Main Board - 100€ 5 - Software - 50€ 6 - CDroms 100 un. - 30€ TABLE PIECES (id - idProdMain - idProdChild - Quant.) 1 - 1 - 2 - 1 2 - 1 - 3 - 2 3 - 1 - 4 - 1 WHAT I NEED? I need update the price of the main product when the price of the product child (piece) is changed. Following the previous example, if I change the price of this product "memory" (is a piece too) to 60€, then product "Computer" will must change his price to 320€ How I can do it using queries? Already I have tried this to obtain the price of the main product, but not runs. This query not returns any value: SELECT Sum(products.price*pieces.quant) AS Expr1 FROM products LEFT JOIN pieces ON (products.idProd = pieces.idProdChild) AND (products.idProd = pieces.idProdChild) AND (products.idProd = pieces.idProdMain) WHERE (((pieces.idProdMain)=5)); MORE INFO The table "products" contains all the products to sell that it is in the shop. The table "pieces" is to take a control of the compound products. To know those who are the products children. For example of compound product: computers. This product is composed by other products (motherboard, hard disk, memory, cpu, etc.)

    Read the article

  • CPU fan making noise. plz suggest

    - by user32185
    CPU fan is making noise ...i figured out reasons: Cable coming out of fan is vibrating ... And may be also CPU fan is loose causing vibration... suggest options... i cleaned the fan ...but found that there is no heatsink compound /paste between processor and the fan..is it ok . My processor is p4 2.4 ghz motherboard intel 845 gvsr

    Read the article

  • White (Light) vs. Black (Dark) Backgrounds: Health Effects

    - by Hosam Aly
    I am adding a bounty to this question, hoping for some scientific research results. Thank you everybody! I have recently tried working on dark backgrounds, and it seemed (to me) to be easier on the eye. However, today I read Gerrie Schenck's comment on this answer, in which he said that mainframe developers were advised to use white backgrounds instead of black, as it is said that white is easier on the eye. So which one is actually better for the eyes in the long run? I would be thankful for any (scientific) references about the subject, as my eyes really need some relaxation. I wanted to make this question a community wiki, but I think that the least I can do to thank people is to reward their answers, so I'm leaving it as a normal question. Many, many thanks for your help. P.S. I don't know which tags would be appropriate for this question, so I'd be grateful if you could tag it in a better way than I did.

    Read the article

  • Using image resource in XAML markup?

    - by Jeff Dahmer
    I'm trying to add little icons to my tabs in WPF but having trouble with how to set up the binding. <TabItem.Header> <StackPanel Orientation="Horizontal"> <Image Source="{Binding Source=prop:Resources.eye}" /> <Label VerticalAlignment="Center">Header</Label> </StackPanel> </TabItem.Header> The xmlns:prop is set up for the local project's Properties, I am pulling other values from it elsewhere so I know that the namespace works. The markup above compiles fine BUT I don't see the eye image in the tab. Also, is there any way to set this up into a template? I'm fairly new to XAML/WPF and each tab will have its own image...

    Read the article

  • Want to know about the best framework available for my app

    - by vamyip
    Hello, I am trying to design a new application which basically aims at providing biometric authentication services. What I want to do is that the app will present the user with an interface where the user can get his eye scanned for authentication. The most important feature I want to incorporate is that the user need not have a webcam, the app must be able to read the eye from the display device i.e. CRT or LCD screen itself. I want info about the best framework available for this. Once successfully tested, I am planning to provide it as a webservice. Any one who will help me will get a royalty from my income.

    Read the article

  • Daily tech links for .net and related technologies - Apr 5-7, 2010

    - by SanjeevAgarwal
    Daily tech links for .net and related technologies - Apr 5-7, 2010 Web Development HTML 5 is Born Old - Quake in HTML 5 Example Image Preview in ASP.NET MVC - Imran Advanced ASP.NET MVC 2 - Brad Wilson How to Serialize/Deserialize Complex XML in ASP.Net / C# - Impact Works Ban HTML comments from your pages and views - Bertrand Le Roy Measuring ASP.NET and SharePoint output cache - Gunnar Peipman Web Design Eye Candy vs. Bare-Bones in UI Design - Max Steenbergen Empathizing Color Psychology in Web...(read more)

    Read the article

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