Search Results

Search found 1515 results on 61 pages for 'translate'.

Page 12/61 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • How can I keep the the logic to translate a ViewModel's values to a Where clause to apply to a linq query out of My Controller?

    - by Mr. Manager
    This same problem keeps cropping up. I have a viewModel that doesn't have any persistent backing. It is just a ViewModel to generate a search input form. I want to build a large where clause from the values the user entered. If the Action Accepts as a parameter SearchViewModel How do I do this without passing my viewModel to my service layer? Service shouldn't know about ViewModels right? Oh and if I serialize it, then it would be a big string and the key/values would be strongly typed. SearchViewModel this is just a snippet. [Display(Name="Address")] public string AddressKeywords { get; set; } /// <summary> /// Gets or sets the census. /// </summary> public string Census { get; set; } /// <summary> /// Gets or sets the lot block sub. /// </summary> public string LotBlockSub { get; set; } /// <summary> /// Gets or sets the owner keywords. /// </summary> [Display(Name="Owner")] public string OwnerKeywords { get; set; } In my controller action I was thinking of something like this. but I would think all this logic doesn't belong in my Controller. ActionResult GetSearchResults(SearchViewModel model){ var query = service.GetAllParcels(); if(model.Census != null){ query = query.Where(x=>x.Census == model.Census); } if (model.OwnerKeywords != null){ query = query.Where(x=>x.Owners == model.OwnerKeywords); } return View(query.ToList()); }

    Read the article

  • Translating Documents from a Foreign Language into English on my Computer?

    - by Simon
    I am aware that websites can be translated from many languages into English thanks to Google Translate. If I receive documentation via email that is in a language other than English, how straight forward is it to translate into English on my PC or Apple Mac? (indeed is Google Translate involved or is it strictly for websites) Similarly if I receive documentation via the normal postal mail service (termed "snail mail" if I'm correct) which needs to be translated into English, what steps need to be taken for this documentation to be translated effectively & quickly on my PC or Apple Mac (I am aware of the term Optical Character Recognition (OCR) software, and is this costly, or do free alternatives exist to carry out the translation process solely online? ).

    Read the article

  • Drawing lines in 3D space

    - by DeadMG
    When attempting to draw a line in 3D space with D3DPT_LINELIST, then Direct3D gives me an error about an invalid vertex declaration, saying that it cannot be converted to an FVF. I am using the same vertex declaration and shader/stream setup as for my D3DPT_TRIANGLELIST rendering which works absolutely correctly. How can I use D3DPT_LINELIST to render some lines in 3D space? Edit: Oopsie, forgot my codeses. Here's my raw Draw call. D3DCALL(device->SetStreamSource(1, PerBoneBuffer.get(), 0, sizeof(PerInstanceData))); D3DCALL(device->SetStreamSourceFreq(1, D3DSTREAMSOURCE_INSTANCEDATA | 1)); D3DCALL(device->SetStreamSource(0, LineVerts, 0, sizeof(D3DXVECTOR3))); D3DCALL(device->SetStreamSourceFreq(0, D3DSTREAMSOURCE_INDEXEDDATA | lines.size())); D3DCALL(device->SetIndices(LineIndices)); PerInstanceData* data; std::vector<Wide::Render::Line*> lines_vec(lines.begin(), lines.end()); D3DCALL(PerBoneBuffer->Lock(0, lines.size() * sizeof(PerInstanceData), reinterpret_cast<void**>(&data), D3DLOCK_DISCARD)); std::for_each(lines.begin(), lines.end(), [&](Wide::Render::Line* ptr) { data->Color = D3DXColor(ptr->Colour); D3DXMATRIXA16 Translate, Scale, Rotate; D3DXMatrixTranslation(&Translate, ptr->Start.x, ptr->Start.y, ptr->Start.z); D3DXMatrixScaling(&Scale, ptr->Scale, 1, 1); D3DXMatrixRotationQuaternion(&Rotate, &D3DQuaternion(ptr->Rotation)); data->World = Scale * Rotate * Translate; }); D3DCALL(PerBoneBuffer->Unlock()); D3DCALL(device->DrawIndexedPrimitive(D3DPRIMITIVETYPE::D3DPT_LINELIST, 0, 0, 2, 0, 1)); Here's my vertex declaration: D3DVERTEXELEMENT9 BasicMeshVertices[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {1, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, {1, 16, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, {1, 32, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 2}, {1, 48, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 3}, {1, 64, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; The LineIndices are just 0, 1 and the LineVerts are just {0,0,0} and {1,0,0}, to represent a unit 3D line along the X axis.

    Read the article

  • Unity3d: calculate the result of a transform without modifying transform object itself

    - by Heisenbug
    I'm in the following situation: I need to move an object in some way, basically rotating it around its parent local position, or translating it in its parent local space (I know how to do this). The amount of rotation and translation is know at runtime (it depends on several factors, the speed of the object, enviroment factors, etc..). The problem is the following: I can perform this transformation only if the result position of the transformed object fit some criterias. An example could be this: the distance between the position before and after the transformation must be less than a given threshold. (Actually the conditions could be several and more complex) The problem is that if I use Transform.Rotate and Transform.Translate methods of my GameObject, I will loose the original Transform values. I think I can't copy the original Transform using instantiate for performance issues. How can I perform such a task? I think I have more or less 2 possibilities: First Don't modify the GameObject position through Transform. Calculate which will be the position after the transform. If the position is legal, modify transform through Translate and Rotate methods Second Store the original transform someway. Transform the object using Translate and Rotate. If the transformed position is illegal, restore the original one.

    Read the article

  • Slick 2d scrolling off screen

    - by Peter
    I have something scrolling in and out of the screen. Now when it goes off screen, I want it to scroll into the screen at another location. What I do is I grab the last pixels at the screens edge using g.copyArea and then g.drawImage on the edge of the screen. And then I do a g.translate to create room for the next row which is next render cycle. My problem is that I get a single pixel row, which is not copied onto the canvas. Where as I want each row to be added and then translated, so that the image that scrolled off screen is recreated on the other side of the screen. Here is my code, maybe there is a better way of doing this, open to any suggests, cause I'm totally stuck @Override public void render(GameContainer gc, Graphics g) throws SlickException { //g.setClip(0, 0, 300, gc.getHeight()); g.translate(0, y); g.drawImage(image,0,200); g.resetTransform(); //g.clearClip(); g.copyArea(rightImage, 0, gc.getHeight() - 1); g.drawImage(rightImage, 300, 0); g.translate(0, y); y=y+3; }

    Read the article

  • Launch a new page in Zend/php on button click

    - by BlueMonster
    PHP & Zend Noob here I've downloaded the skeleton project from here: https://github.com/zendframework/ZendSkeletonApplication Say i want to open a new page that simply displays "hello world" text if click on the "ZF2 Development Portal" button(bottom left green button) on the page that launches --- how do i do this? See image: I've read through this tutorial, but i'm not sure how the model, view, or controller are actually launched? See tutorial: http://blog.wilgucki.pl/2012/07/tworzenie-modulw-w-zend-framework-2.html From looking at the code, i know that i will have to change this line of code: <div class="span4"> <h2><?php echo $this->translate('Follow Development') ?></h2> <p><?php echo sprintf($this->translate('Zend Framework 2 is under active development. If you are interested in following the development of ZF2, there is a special ZF2 portal on the official Zend Framework website which provides links to the ZF2 %swiki%s, %sdev blog%s, %sissue tracker%s, and much more. This is a great resource for staying up to date with the latest developments!'), '<a href="http://framework.zend.com/wiki/display/ZFDEV2/Home">', '</a>', '<a href="http://framework.zend.com/zf2/blog">', '</a>', '<a href="http://framework.zend.com/issues/browse/ZF2">', '</a>') ?></p> <p><a class="btn btn-success" href="http://framework.zend.com/zf2" target="_blank"><?php echo $this->translate('ZF2 Development Portal') ?> &raquo;</a></p> </div> More specifically this line: <p><a class="btn btn-success" href="http://framework.zend.com/zf2" target="_blank"><?php echo $this->translate('ZF2 Development Portal') ?> &raquo;</a></p> but i'm really confused as to what i'm supposed to change it to in order to launch a new page. Any ideas? Thanks in advance!

    Read the article

  • Cisco NAT vs Bridge vs BVI

    - by cjavapro
    The only devices on this particular LAN will all have public IP addresses. Also the public IP address will be configured directly on the machine,,, so we will not translate private/public IP addresses. If we use NAT,, we would have to translate the public IP on the WAN to the public IP on the LAN. The only security feature I expect on the gateway is an access list. I don't really know much about networking, so I am sorry if this question is generic.

    Read the article

  • flex blazeds spring exception translator

    - by Shah Al
    I am using spring exception translator to wrap java exception into flex exception. eg public void testException()throws Exception{ throw new Exception("my exception"); } But for some reason, I am getting IllegalAccessError. The code sections are entering the testException and the Translator class. Question: why it trying to get log target level ? Can someone help me resolve this please. Below is the lines from the log: MyExceptionTranslatorImpl.translate()class java.lang.IllegalAccessError MyExceptionTranslatorImpl.translate()java.lang.IllegalAccessError: tried to access method flex.messaging.log.Log.getTargetLevel()S from class flex.messaging.MessageException MyExceptionTranslatorImpl.translate()tried to access method flex.messaging.log.Log.getTargetLevel()S from class flex.messaging.MessageException [BlazeDS] tried to access method flex.messaging.log.Log.getTargetLevel()S from class flex.messaging.MessageException [BlazeDS] Serializing AMF/HTTP response

    Read the article

  • Disabling compression for IE pre SP2 with Apache mod_rewrite

    - by Ra y Mon
    I am trying to replicate this fix ( http://sebduggan.com/posts/ie6-gzip-bug-solved-using-isapi-rewrite ) with Apache mod_rewrite, but with no success... Can somebody help me translate those ISAPI rules to APACHE mod_rewrite? I don't know how to 'translate' those rules... My objective is to avoid sending compressed css and js when the user has an XP version prior to SP2, since there is a bug that prevents IE6&7 under SP1 to read the gzipped CSSs of my website BuscoUnViaje.com The rules I am trying to 'translate' to Apache mod_rewrite: RewriteCond %{HTTP:User-Agent} MSIE\ [56] RewriteCond %{HTTP:User-Agent} !SV1 RewriteCond %{REQUEST_URI} \.(css|js)$ RewriteHeader Accept-Encoding: .* $1 Thanks in advance...

    Read the article

  • Linq to sql translation to sql of custom method

    - by DJPB
    hi there is there a way to translate an expression to sql to use with linq to sql? for example I have a method that compares two values example: MyComparer.Compare(value1, value2, ">") return value1 > value2 MyComparer.Compare(value1, value2, "=") return value1 == value2 MyComparer.Compare(value1, value2, "<=") return value1 <= value2 and i would like a query like var list = from i in dataContext.items where MyComparer.Compare(i.value, someValue, "some operator") select ... this won't work because, obviously, MyComparer doesn't translate to sql maybe this is a twisted question, but how can i translate this method to sql or is this possible? tks

    Read the article

  • Translating external api results in Drupal

    - by Chuck Vose
    We're building a multi-language Drupal stack and one of the concerns we have is that our payment processor is going to have to send back some information to us. We've been able to narrow this down so that the strings they're sending back look like <country code>-<number of months> so we can easily translate that into any number of languages, except English. t('FR-12') is all well and good if we want to translate that into a french description, but because there's not an English language a similar string like t('EN-12') is not translatable. Similarly for the generic string: #API_Connection_Error This sort of generic string approach seemed really compelling to me at first but it seems to not work in Drupal. Do you have any suggestions about how to translate generic strings like this into both English and other languages? Thank you, I've been looking through Google all morning.

    Read the article

  • Read Values from xml file

    - by Nimesh
    I have a function TRANSLATE which reads value from the xml file based on a key. I wanna put "http://www.google.com?search=" in the xml file and read it based on the key(SEARCHER) I am confused in framing the link when it comes in Response.Write <%Dim SearchQuery1 SearchQuery1="New" Dim SearchQuery2 SearchQuery2=30 Response.Write("<A HREF=""http://www.google.com?search="&SearchQuery1&"-"&SearchQuery2&""" TARGET=""links"">http://www.google.com?search="&SearchQuery1&"-"&SearchQuery2&"</A>") %> I was trying something like this Response.Write("<A HREF=""Translate("SEARCHER")"&SearchQuery1&"-"&SearchQuery2&""" TARGET=""links"">Translate("SEARCHER")"&SearchQuery1&"-"&SearchQuery2&"</A>") but is throwing some error: Expected)' PLs let me know how can i solve this????

    Read the article

  • How to avoid translation tools from messing up HTML tags?

    - by janoChen
    I always use Google translate and paste back the the results in Vim. But for some reason Google translate also screws up the HTML tags around the content I want to translate. Is there a solution for this? For instance, the double quotes are translated to Chinese-cased double quotes: 'pictures_h2'=>“?????????? Strong and li tags are translated too (well I kinda expected that). P S : IS there any translator which respect HTML tags? or translation plugin for Vim?

    Read the article

  • what means "not enclossing class" hier in scala

    - by echo
    Hoi ,i am learning scala and trying to translate some java code to scala. Here are some of the code below in java that I want to translate public class Note{ protected void addNote(Meeting n) { //add n to a list } } public abstract class Meeting{ public Meeting(String name,Note note){ note.addNote(this) } } when i translate them to scala class Note{ protected[Meeting] addNote(n:Meeting){ //add n to list } } abstract class Meeting(name:String,note:Note){ note.addNote(this) } then i got an error in class Note : Meeting is not a enclossing class. what does it mean? I have tried packagename instead of Meeting,like this:protected[packagename] addNote(n:Meeting) ,but i doesnt work.

    Read the article

  • How to change class name of a button

    - by stackOver Flow
    I have four buttons like this <div class="btn-group"> <button id="btn-men" class="btn btn-default active" i18n:translate="men">Men</button> <button id="btn-women" class="btn btn-default" i18n:translate="women">Women</button> <button id="btn-kids" class="btn btn-default" i18n:translate="kids">Kids</button> </div> And I have different css styles for the class "btn btn-default active" and "btn btn-default". what I want to know is if there is any way of changing the class name of the clicked button as btn btn-default active from btn btn-default and also change the unclicked button as btn btn-default during run time. I also use i18n for mulitilingual purpose.

    Read the article

  • What kinds of low level knowledge matter?

    - by Peter Smith
    I realize that this question is similar to Low level programming - what's in it for me, but the answers didn't really address my question well. Part from just an understanding, how exactly does your low level knowledge translate into faster and better programs? There's the obvious lack of garbage collection, but what else is an advantage? Do you really outperform your optimizing compiler? Do you pack your data structures in as tight as possible and be concerned about alignment? There's extra freedom naturally, but does that really translate into a faster program?

    Read the article

  • XML is case sensitive hence Xml parser (XmlDocument) too...

    - by Narendra Tiwari
    XML is case sensitive hence Xml parser (XmlDocument) too... In below example I am trying to search the <user> element node with name attibute as 'pupu'.  <user name="PuPu" fullname="Priyanka T" email="[email protected]" /> ::translate() functon esures the case insensitive comparision in Xpath expression.   XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("<xml file to load>"); XmlElement userElement = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("//user[translate(@name,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') ='pupu']");

    Read the article

  • ODI 11g - Cleaning control characters and User Functions

    - by David Allan
    In ODI user functions have a poor name really, they should be user expressions - a way of wrapping common expressions that you may wish to reuse many times - across many different technologies is an added bonus. To illustrate look at the problem of how to remove control characters from text. Users ask these types of questions over all technologies - Microsoft SQL Server, Oracle, DB2 and for many years - how do I clean a string, how do I tokenize a string and so on. After some searching around you will find a few ways of doing this, in Oracle there is a convenient way of using the TRANSLATE and REPLACE functions. So you can convert some text using the following SQL; replace( translate('This is my string'||chr(9)||' which has a control character', chr(3)||chr(4)||chr(5)||chr(9), chr(3) ), chr(3), '' ) If you had many columns to perform this kind of transformation on, in the Oracle database the natural solution you'd go to would be to code this as a PLSQL function since you don't want the code splattered everywhere. Someone tells you that there is another control character that needs added equals a maintenance headache. Coding it as a PLSQL function will incur a context switch between SQL and PLSQL which could prove costly. In ODI user functions let you capture this expression text and reference it many times across your mappings. This will protect the expression from being copy-pasted by developers and make maintenance much simpler - change the expression definition in one place. Firstly define a name and a syntax for the user function, I am calling it UF_STRIP_BAD_CHARACTERS and it has one parameter an input string;  We then can define an implementation for each technology we will use it, I will define Oracle's using the inputString parameter and the TRANSLATE and REPLACE functions with whatever control characters I want to replace; I can then use this inside mapping expressions in ODI, below I am cleaning the ENAME column - a fabricated example but you get the gist.  Note when I use the user function the function name remains in the text of the mapping, the actual expression is not substituted until I generate the scenario. If you generate the scenario and export the scenario you can have a peak at the code that is processed in the runtime - below you can see a snippet of my export scenario;  That's all for now, hopefully a useful snippet of info.

    Read the article

  • Google lance la version alpha d'un traducteur universel oral pour Android, disponible aujourd'hui pour l'Anglais et l'Espagnol

    Google lance la version alpha d'un traducteur universel oral Pour Android, disponible aujourd'hui pour l'Anglais et l'Espagnol Google vient de lancer une version expérimentale d'un nouveau produit appelé « Conversation Mode », dans la lignée de Google Translate pour les appareils sous Android. Il s'agit d'une nouvelle interface de Google Translate qui a pour ambition de permettre à deux personnes , qui ne parlent pas la même langue, d'avoir une conversation audio fluide. Chacun des deux utilisateurs entendra donc l'autre s'adresser à lui dans la langue qu'il comprend. Les geek en ont rêvé, Google l'a fait ? Oui, mais pas tout à fait. Conversation Mod...

    Read the article

  • Printer "ripping" forever (network printer)

    - by Julien Gorenflot
    Since I installed Ubuntu 11.10, printing is a disaster. I did not have the problem with Lucid Lynx (Ubuntu 10.04), but maybe it just comes from the fact that someone else had installed it for me, and possibly it configured better. When I print a pdf, even 2 pages, my printer (SHARP MX 2300N) stays in rippen for hours. "Rippen" is a German word, not really sure how to translate. Google translate says, The English equivalent is "Rib". And eventually, sometimes, the pages finally get printed. But in between my whole floor is very angry because they also need the printer. Additionally, I don't always have the whole day for waiting for my pages. I remember that when printing I used to be asked if I wanted to reduce transparency effects, which does not seem to happen anymore after I installed Ubuntu 11.10. Is there any connection? Not sure, because I don't think it was for pdf files.

    Read the article

  • Problem animating in Unity/Orthello 2D. Can't move gameObject

    - by Nelson Gregório
    I have a enemy npc that moves left and right in a corridor. It's animated with 2 sprites using Orthello 2D Framework. If I untick the animation's play on start and looping, the npc moves correctly. If I turn it on, the npc tries to move but is pulled back to his starting position again and again because of the animation loop. If I turn looping off during runtime, the npc moves correctly again. What did I do wrong? Here's the npc code if needed. using UnityEngine; using System.Collections; public class Enemies : MonoBehaviour { private Vector2 movement; public float moveSpeed = 200; public bool started = true; public bool blockedRight = false; public bool blockedLeft = false; public GameObject BorderL; public GameObject BorderR; void Update () { if (gameObject.transform.position.x < BorderL.transform.position.x) { started = false; blockedRight = false; blockedLeft = true; } if (gameObject.transform.position.x > BorderR.transform.position.x) { started = false; blockedLeft = false; blockedRight = true; } if(started) { movement = new Vector2(1, 0f); movement *= Time.deltaTime*moveSpeed; gameObject.transform.Translate(movement.x,movement.y, 0f); } if(!blockedRight && !started && blockedLeft) { movement = new Vector2(1, 0f); movement *= Time.deltaTime*moveSpeed; gameObject.transform.Translate(movement.x,movement.y, 0f); } if(!blockedLeft && !started && blockedRight) { movement = new Vector2(-1, 0f); movement *= Time.deltaTime*moveSpeed; gameObject.transform.Translate(movement.x,movement.y, 0f); } } }

    Read the article

  • Uniform not being applied to proper mesh

    - by HaMMeReD
    Ok, I got some code, and you select blocks on a grid. The selection works. I can modify the blocks to be raised when selected and the correct one shows. I set a color which I use in the shader. However, I am trying to change the color before rendering the geometry, and the last rendered geometry (in the sequence) is rendered light. However, to debug logic I decided to move the block up and make it white, in which case one block moves up and another block becomes white. I checked all my logic and it knows the correct one is selected and it is showing in, in the correct place and rendering it correctly. When there is only 1 it works properly. Video Of the bug in action, note how the highlighted and elevated blocks are not the same block, however the code for color and My Renderer is here (For the items being drawn) public void render(Renderer renderer) { mGrid.render(renderer, mGameState); for (Entity e:mGameEntities) { UnitTypes ut = UnitTypes.valueOf((String)e.getObject(D.UNIT_TYPE.ordinal())); if (ut == UnitTypes.Soldier) { renderer.testShader.begin(); renderer.testShader.setUniformMatrix("u_mvpMatrix",mEntityMatrix); renderer.texture_soldier.bind(0); Vector2 pos = (Vector2) e.getObject(D.COORDS.ordinal()); mEntityMatrix.set(renderer.mCamera.combined); if (mSelectedEntities.contains(e)) { mEntityMatrix.translate(pos.x, 1f, pos.y); renderer.testShader.setUniformf("v_color", 0.5f,0.5f,0.5f,1f); } else { mEntityMatrix.translate(pos.x, 0f, pos.y); renderer.testShader.setUniformf("v_color", 1f,1f,1f,1f); } mEntityMatrix.scale(0.2f, 0.2f, 0.2f); renderer.model_soldier.render(renderer.testShader,GL20.GL_TRIANGLES); renderer.testShader.end(); } else if (ut == UnitTypes.Enemy_Infiltrator) { renderer.testShader.begin(); renderer.testShader.setUniformMatrix("u_mvpMatrix",mEntityMatrix); renderer.testShader.setUniformf("v_color", 1.0f,1,1,1.0f); renderer.texture_enemy_infiltrator.bind(0); Vector2 pos = (Vector2) e.getObject(D.COORDS.ordinal()); mEntityMatrix.set(renderer.mCamera.combined); mEntityMatrix.translate(pos.x, 0f, pos.y); mEntityMatrix.scale(0.2f, 0.2f, 0.2f); renderer.model_enemy_infiltrator.render(renderer.testShader,GL20.GL_TRIANGLES); renderer.testShader.end(); } } }

    Read the article

  • fast java2d translucency

    - by mdriesen
    I'm trying to draw a bunch of translucent circles on a Swing JComponent. This isn't exactly fast, and I was wondering if there is a way to speed it up. My custom JComponent has the following paintComponent method: public void paintComponent(Graphics g) { Rectangle view = g.getClipBounds(); VolatileImage image = createVolatileImage(view.width, view.height); Graphics2D buffer = image.createGraphics(); // translate to camera location buffer.translate(-cx, -cy); // renderables contains all currently visible objects for(Renderable r : renderables) { r.paint(buffer); } g.drawImage(image.getSnapshot(), view.x, view.y, this); } The paint method of my circles is as follows: public void paint(Graphics2D graphics) { graphics.setPaint(paint); graphics.fillOval(x, y, radius, radius); } The paint is just an rgba color with a < 255: Color(int r, int g, int b, int a) It works fast enough for opaque objects, but is there a simple way to speed this up for translucent ones?

    Read the article

  • Reading Partition Start and End in TestDisk

    - by neanderslob
    I'm using TestDisk in an attempt to recover a partition gone terribly awry. Identifying the partition in question should simply be a matter of simply recognizing the location in the disk that it occupies. Since I know the location of the partition in question from GParted, I need to translate that over to the format that TestDisk uses, which I can't quite figure out. GParted gives the First and Last sectors as follows: First Sector: 1708032 Last Sector: 54637719 Total sector: 52929688 Test Disk gives the partitions in the following way: Start: 1691 110 20 End: 4986 39 5 Size in Sectors: 52929688 My question is: how do I translate the location specified in GParted to that in TestDisk? See the following image for any contextual clarification you might need:

    Read the article

  • Really weird GL Behaviour, uniform not "hitting" proper mesh? LibGdx

    - by HaMMeReD
    Ok, I got some code, and you select blocks on a grid. The selection works. I can modify the blocks to be raised when selected and the correct one shows. I set a color which I use in the shader. However, I am trying to change the color before rendering the geometry, and the last rendered geometry (in the sequence) is rendered light. However, to debug logic I decided to move the block up and make it white, in which case one block moves up and another block becomes white. I checked all my logic and it knows the correct one is selected and it is showing in, in the correct place and rendering it correctly. When there is only 1 it works properly. Video Of the bug in action, note how the highlighted and elevated blocks are not the same block, however the code for color and My Renderer is here (For the items being drawn) public void render(Renderer renderer) { mGrid.render(renderer, mGameState); for (Entity e:mGameEntities) { UnitTypes ut = UnitTypes.valueOf((String)e.getObject(D.UNIT_TYPE.ordinal())); if (ut == UnitTypes.Soldier) { renderer.testShader.begin(); renderer.testShader.setUniformMatrix("u_mvpMatrix",mEntityMatrix); renderer.texture_soldier.bind(0); Vector2 pos = (Vector2) e.getObject(D.COORDS.ordinal()); mEntityMatrix.set(renderer.mCamera.combined); if (mSelectedEntities.contains(e)) { mEntityMatrix.translate(pos.x, 1f, pos.y); renderer.testShader.setUniformf("v_color", 0.5f,0.5f,0.5f,1f); } else { mEntityMatrix.translate(pos.x, 0f, pos.y); renderer.testShader.setUniformf("v_color", 1f,1f,1f,1f); } mEntityMatrix.scale(0.2f, 0.2f, 0.2f); renderer.model_soldier.render(renderer.testShader,GL20.GL_TRIANGLES); renderer.testShader.end(); } else if (ut == UnitTypes.Enemy_Infiltrator) { renderer.testShader.begin(); renderer.testShader.setUniformMatrix("u_mvpMatrix",mEntityMatrix); renderer.testShader.setUniformf("v_color", 1.0f,1,1,1.0f); renderer.texture_enemy_infiltrator.bind(0); Vector2 pos = (Vector2) e.getObject(D.COORDS.ordinal()); mEntityMatrix.set(renderer.mCamera.combined); mEntityMatrix.translate(pos.x, 0f, pos.y); mEntityMatrix.scale(0.2f, 0.2f, 0.2f); renderer.model_enemy_infiltrator.render(renderer.testShader,GL20.GL_TRIANGLES); renderer.testShader.end(); } } }

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >