Daily Archives

Articles indexed Friday August 22 2014

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

  • Nvidia Driver versions?

    - by Patrick Krenz
    I've looked all over and can't find any reason as to why or how Nvidia names their drivers. for example they have a 330.xxx/340.xxx series that are current but also a 300.xxx and i've found that they aren't always release in order by number. Here's an example on there site with version and release date 331.38 - January 13 334.16 - Feb 7 331.49 - Feb 18 I'm really confused about what driver to actually go with, a few different series versions seem to work adequately and I just want to have an understanding of it and what the best option to work from would be. I really appreciate any information

    Read the article

  • Proper way to remove an active / inactive LVM snapshot

    - by user2622247
    I have created a sample ruby script file for removing extra LVM snapshots from the system. For removing LVM snapshot, we are using lvremove command. This command is working fine and we can remove snapshots from the system. # sudo lvremove /dev/ops/dbbackup lvremove -- do you really want to remove "/dev/ops/dbbackup"? [y/n]: y Sometimes while removing snapshots we are getting following errors. Unable to deactivate open rootfs_12.10_20140812_00-cow (252:8) Failed to resume rootfs_12.10_20140812_00. libdevmapper exiting with 7 device(s) still suspended. The system gets frozen. We cannot fire any command or can not perform any action on it. After restarting the system, it is functioning fine. We can perform all the operations even we can delete that snapshot also. I searched about it I found these threads https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659762 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=674682 Solution from this thread is after getting the error but I have to avoid this type of error. I have a question, Is there any better way removing LVM snapshots? So that we can avoid this type of error. If anyone needs more info feel free to ask me.

    Read the article

  • Bluez Installation - configuration error for DBUS 1.6

    - by padma_uma
    I am trying to install bluez 5.2 libraries on Ubuntu 12.04. while running ./configure, I received error for GLib2.0, I was able to resolve by using sudo apt get-install for GLib2. Now I am receiving the error "configure: error: D-Bus = 1.6 is required". I have downloaded DBUS 1.8.6 and installed. but still I am receiving the same error. when checked in /etc folder i still find dbus-1. is there any installation error? Regards, Padma

    Read the article

  • Run Blustacks or Android to play clash of clans on ubuntu 13.4+

    - by Joe Hanus
    I am trying to get rid of the need to dual boot Ubuntu and windows and one thing I can do with windows I can not do with Linux is to run Bluestacks to play android games my favourite one ow is clash of clans. I have tried different VM's to run android emulators and virtual box but nothing works for clash of clans I can download the game to the VM from Google Play Store but it fails to open If Ubuntu can fix this by making a way to successfully install Bluestacks on Ubuntu or Android with Virtual box with out loading errors of all apps/games it would help the Linux community to become less dependant of Windows. Thanks in advance! go Ubuntu!

    Read the article

  • Ubuntu 12.04 nomodeset fixes boot problem but causes screen resolution to get stuck

    - by Thunder
    I've been searching the askubuntu forum for the past 3 days trying to figure out what's going on with my system and I have tried a lot of things but to no avail. So, I will explain my situation and tell you what I have tried and I hope someone can help me :) I have an: HP Workstation xw4100 Pentium(R) 4 3.00 GHz 1.5 GB RAM NVIDIA Quadro4 380 XGL graphics card It came with Windows XP and I set it up (with WUBI) to dual boot with Ubuntu 12.04 After installation I had the problem that so many people had with it booting to a black screen (mine was actually booting to the terminal basic shell) that is fixed by adding nomodeset into the grub. When I do that, MY screen resolution becomes stuck in 1280x768 (as opposed to 1366x768 before adding nomodeset) (and also, when running XP the best resolution is 1280x720) When I go to "additional drivers" it doesn't show any proprietary drivers, so I manually downloaded them using this command: sudo apt-add-repository ppa:ubuntu-x-swat/x-updates sudo apt-get update sudo apt-get install nvidia-current but after rebooting, that made the graphics even worse (now stuck as 800x600) SO I tried to configure the drivers with sudo nvidia-xconfig but that simply created an empty xorg.config file. I found one place where a guy gave information to manually input into the xorg.config file but that had no effect at all. Lastly I tried to install previous versions of the NVIDIA drivers, but they wouldn't even fully install. So now I have just re-installed Ubuntu 12.04 and I either need to find a better solution to the first problem (nomodeset) or get the nouveau driver to correctly configure to work with my nvidia graphics. Thanks for your help ahead of time!

    Read the article

  • Pagination and duplicate content

    - by jazz090
    I have an archive page that displays the number of articles published. Because there were so many, I ran a pagination script: for 127.0.0.1/archive/2/?p=x&pp=y where p is the page number and pp is number of articles to display per page. The pagination looks like this: Prev 1 2 3 4 ... 12 NEXT with each item linking to p like <a href="?p=x">x</a>. I also have the items per page setter: 25 | 50 | 100 (<a href="?pp=y">y</a>). Now I have a PHP script that fixes pp into a session variable. But I am worried about duplicate content (since incrementing pp values will be inclusive) and also content not getting indexed because its not in the pagination link. so in the example above, pages 5-11 will not be indexed. Any ideas on how to fix this?

    Read the article

  • Bad search result due to strange linked domains

    - by VDesign
    I have a website which is not scoring good in Google's search results. I use Majestic SEO and Open Site Explorer in order to have a view about my link profile. I now see different backlink domains, some of them already removed, that contains sexual content or other non relative content linking to my domain. How much influence does these strange linked domains have on my search result? Even if some of them are already removed for a couple of months. I have already disavow open sexual domains using the tool that Google provides.

    Read the article

  • When Google gives up recrawling 301 that led to 404?

    - by Easy Life
    I've transferred a domain and made a mistake in the redirects (the URL structure is identical). Even though they went to the new domain, the error caused a 404 when crawled by Google bot. 10 days after I saw and corrected my redirect mistake, and now the site should (hopefully) redirect to proper pages. Q1: The URLs of the 404 pages in the Webmaster Tools all bear the mistake and will never be available at the new site. I marked them as fixed in the tools. Do I need to do something about that, like 301 rewrite them with a condition to fix the error? Q2: Does Google bot attempt to recrawl 301 pages that pointed to a 404?

    Read the article

  • Webmasters hentry error and authorless pages

    - by Ben Racicot
    Within Google Webmasters Search Appearance-Structured data I'm getting a series of errors: Error: Missing required hCard "author". And most of my 44 errors have: Missing: Author Missing: entry-title Missing: updated There seems to be no CLEAR explanation of these errors. It is either because these classes exist without their nested classes, or they are expected to exist because of something else, possibly itemscope or itemtype='' The Question: How do you specify with richsnippets that the page is about a location and there is no human author?

    Read the article

  • which one is the safe site to buy cheap wildstar gold?

    - by user50866
    Wsoplat.com is a professional online shop which provide the cheapest wildstar gold, the fastest delivery, the best 24/7 online service for the players. Secure Guarantee cheap wildstar gold offered by wsoplat.com are reliable sourced, safe and honored. Lowest Price We are constantly trying to offer the lowest prices on Wildstar Gold for our loyal customers. Covenient shopping procedure & secure delivery method We are very experienced in this business. Every order is processed both smoothly and efficiently. Friendly Service and Instant Delivery Wsoplat 's delivery department work 24/7/365, We have professional and friendly customer service operators, they can help you buy wildstar gold, accounts, items and more. 5% discount code to buy WildStar gold in wsoplat - WSOPLAT http://www.wsoplat.com/

    Read the article

  • how to define a field of view for the entire map for shadow?

    - by Mehdi Bugnard
    I recently added "Shadow Mapping" in my XNA games to include shadows. I followed the nice and famous tutorial from "Riemers" : http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series3/Shadow_map.php . This code work nice and I can see my source of light and shadow. But the problem is that my light source does not match the field of view that I created. I want the light covers the entire map of my game. I don't know why , but the light only affect 2-3 cubes of my map. ScreenShot: (the emission of light illuminates only 2-3 blocks and not the full map) Here is my code i create the fieldOfView for LightviewProjection Matrix: Vector3 lightDir = new Vector3(10, 52, 10); lightPos = new Vector3(10, 52, 10); Matrix lightsView = Matrix.CreateLookAt(lightPos, new Vector3(105, 50, 105), new Vector3(0, 1, 0)); Matrix lightsProjection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver2, 1f, 20f, 1000f); lightsViewProjectionMatrix = lightsView * lightsProjection; As you can see , my nearPlane and FarPlane are set to 20f and 100f . So i don't know why the light stop after 2 cubes. it's should be bigger Here is set the value to my custom effect HLSL in the shader file /* SHADOW VALUE */ effectWorld.Parameters["LightDirection"].SetValue(lightDir); effectWorld.Parameters["xLightsWorldViewProjection"].SetValue(Matrix.Identity * .lightsViewProjectionMatrix); effectWorld.Parameters["xWorldViewProjection"].SetValue(Matrix.Identity * arcadia.camera.View * arcadia.camera.Projection); effectWorld.Parameters["xLightPower"].SetValue(1f); effectWorld.Parameters["xAmbient"].SetValue(0.3f); Here is my custom HLSL shader effect file "*.fx" // This sample uses a simple Lambert lighting model. float3 LightDirection = normalize(float3(-1, -1, -1)); float3 DiffuseLight = 1.25; float3 AmbientLight = 0.25; uniform const float3 DiffuseColor = 1; uniform const float Alpha = 1; uniform const float3 EmissiveColor = 0; uniform const float3 SpecularColor = 1; uniform const float SpecularPower = 16; uniform const float3 EyePosition; // FOG attribut uniform const float FogEnabled ; uniform const float FogStart ; uniform const float FogEnd ; uniform const float3 FogColor ; float3 cameraPos : CAMERAPOS; texture Texture; sampler Sampler = sampler_state { Texture = (Texture); magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = mirror; AddressV = mirror; }; texture xShadowMap; sampler ShadowMapSampler = sampler_state { Texture = <xShadowMap>; magfilter = LINEAR; minfilter = LINEAR; mipfilter = LINEAR; AddressU = clamp; AddressV = clamp; }; /* *************** */ /* SHADOW MAP CODE */ /* *************** */ struct SMapVertexToPixel { float4 Position : POSITION; float4 Position2D : TEXCOORD0; }; struct SMapPixelToFrame { float4 Color : COLOR0; }; struct SSceneVertexToPixel { float4 Position : POSITION; float4 Pos2DAsSeenByLight : TEXCOORD0; float2 TexCoords : TEXCOORD1; float3 Normal : TEXCOORD2; float4 Position3D : TEXCOORD3; }; struct SScenePixelToFrame { float4 Color : COLOR0; }; float DotProduct(float3 lightPos, float3 pos3D, float3 normal) { float3 lightDir = normalize(pos3D - lightPos); return dot(-lightDir, normal); } SSceneVertexToPixel ShadowedSceneVertexShader(float4 inPos : POSITION, float2 inTexCoords : TEXCOORD0, float3 inNormal : NORMAL) { SSceneVertexToPixel Output = (SSceneVertexToPixel)0; Output.Position = mul(inPos, xWorldViewProjection); Output.Pos2DAsSeenByLight = mul(inPos, xLightsWorldViewProjection); Output.Normal = normalize(mul(inNormal, (float3x3)World)); Output.Position3D = mul(inPos, World); Output.TexCoords = inTexCoords; return Output; } SScenePixelToFrame ShadowedScenePixelShader(SSceneVertexToPixel PSIn) { SScenePixelToFrame Output = (SScenePixelToFrame)0; float2 ProjectedTexCoords; ProjectedTexCoords[0] = PSIn.Pos2DAsSeenByLight.x / PSIn.Pos2DAsSeenByLight.w / 2.0f + 0.5f; ProjectedTexCoords[1] = -PSIn.Pos2DAsSeenByLight.y / PSIn.Pos2DAsSeenByLight.w / 2.0f + 0.5f; float diffuseLightingFactor = 0; if ((saturate(ProjectedTexCoords).x == ProjectedTexCoords.x) && (saturate(ProjectedTexCoords).y == ProjectedTexCoords.y)) { float depthStoredInShadowMap = tex2D(ShadowMapSampler, ProjectedTexCoords).r; float realDistance = PSIn.Pos2DAsSeenByLight.z / PSIn.Pos2DAsSeenByLight.w; if ((realDistance - 1.0f / 100.0f) <= depthStoredInShadowMap) { diffuseLightingFactor = DotProduct(xLightPos, PSIn.Position3D, PSIn.Normal); diffuseLightingFactor = saturate(diffuseLightingFactor); diffuseLightingFactor *= xLightPower; } } float4 baseColor = tex2D(Sampler, PSIn.TexCoords); Output.Color = baseColor*(diffuseLightingFactor + xAmbient); return Output; } SMapVertexToPixel ShadowMapVertexShader(float4 inPos : POSITION) { SMapVertexToPixel Output = (SMapVertexToPixel)0; Output.Position = mul(inPos, xLightsWorldViewProjection); Output.Position2D = Output.Position; return Output; } SMapPixelToFrame ShadowMapPixelShader(SMapVertexToPixel PSIn) { SMapPixelToFrame Output = (SMapPixelToFrame)0; Output.Color = PSIn.Position2D.z / PSIn.Position2D.w; return Output; } /* ******************* */ /* END SHADOW MAP CODE */ /* ******************* */ / For rendering without instancing. technique ShadowMap { pass Pass0 { VertexShader = compile vs_2_0 ShadowMapVertexShader(); PixelShader = compile ps_2_0 ShadowMapPixelShader(); } } technique ShadowedScene { /* pass Pass0 { VertexShader = compile vs_2_0 VSBasicTx(); PixelShader = compile ps_2_0 PSBasicTx(); } */ pass Pass1 { VertexShader = compile vs_2_0 ShadowedSceneVertexShader(); PixelShader = compile ps_2_0 ShadowedScenePixelShader(); } } technique SimpleFog { pass Pass0 { VertexShader = compile vs_2_0 VSBasicTx(); PixelShader = compile ps_2_0 PSBasicTx(); } } I edited my fx file , for show you only information and functions about the shadow ;-)

    Read the article

  • HTML5-Canvas: worth using ImpactJS or other framework?

    - by John
    I've been making an HTML5 game without any type of external framework. I haven't found a reason to use one so far. However, there is one thing I'm wondering about. On my Galaxy Nexus, I get about ~40fps. While that would usually be a decent framerate, my game is a rather fast paced game with a gamepad. Because of this, it feels very unsatisfying to play when not capped at 60fps. Are there frameworks out there that can improve performance without toning down on graphics? Or is there something I could do myself without necessarily having to use a framework? I've looked over the basic things such as sticking to integer coordinates, but I didn't see an increase in performance whatsoever? I did some testing with jsperf and results were virtually identical. Does this depend more on the browser?

    Read the article

  • Level design - Are games development degrees worth it? [on hold]

    - by Tristan
    I want to go into Level design or Environment design and wondering if degrees are at all worth it for this area, as long as you have a good portfolio. I'm currently on a "Computing and Games Development" course and I feel like dropping out because I am not enjoying it. It's mostly computer based, which I'm not doing that great at, and little games Dev. But I don't know what do to... I do already have some high level education with a "Level 3 extended diploma". Thanks.

    Read the article

  • update(100) behaves slightly different than 10 times update(10) - is that a problem? [on hold]

    - by futlib
    While looking into some test failures, I've identified an curious issue with my update logic. This: game.update(100); Behaves slightly different from: for (int i = 0; i < 10; i++) game.update(10); The concrete example here is a rotating entity. It rotates by exactly 360 degrees in the first case, but only by about 352 in the second. This leads to slight variations in how things move, depending on the frame rate. Not enough to be noticeable in practice, but I did notice it when writing tests. Now my question is: Should this be fully deterministic, i.e. the outcome of update(1) * n should equal update(n) exactly? Or is it normal to have some variance and I should make my test assertions more generous?

    Read the article

  • Help finding time of collision

    - by WannaBe
    I am making a simple game right now and am struggling with collision response. My goal is to someday be able to turn it into a 2D platformer but I have a long way to go. I am currently making this in JavaScript and using the canvas element so (0,0) is in the top left and positive X is to the right and positive Y is down. I read a helpful post on StackExchange that got me started on this but I can't seem to get the algorithm 100% correct. How to deal with corner collisions in 2D? I can detect the collision fine but I can't seem to get the response right. The goal is to detect which side the player hit first since minimum displacement doesn't always work. The X response seems to work fine but the Y only works when I am far from the corners. Here is a picture showing what happens Here is the code var bx = box.x; var by = box.y; var bw = box.width; var bh = box.height; var boxCenterX = bx + (bw/2); var boxCenterY = by + (bh/2); var playerCenterX = player.x + player.xvel + (player.width/2); var playerCenterY = player.y + player.yvel + (player.height/2); //left = negative and right = positve, 0 = middle var distanceXin = playerCenterX - boxCenterX; var distanceYin = playerCenterY - boxCenterY; var distanceWidth = Math.abs(distanceXin); var distanceHeight = Math.abs(distanceYin); var halfWidths = (bw/2) + (player.width/2); var halfHeights = (bh/2) + (player.height/2); if(distanceWidth < halfWidths){ //xcollision if(distanceHeight < halfHeights){ //ycollision if(player.xvel == 0){ //adjust y if(distanceYin > 0){ //bottom player.y = by + bh; player.yvel = 0; }else{ player.y = by - player.height; player.yvel = 0; } }else if(player.yvel == 0){ //adjust x if(distanceXin > 0){ //right player.x = bx + bw; player.xvel = 0; }else{ //left player.x = bx - player.width; player.xvel = 0; } }else{ var yTime = distanceYin / player.yvel; var xTime = distanceXin / player.xvel; if(xTime < yTime){ //adjust the x it collided first if(distanceXin > 0){ //right player.x = bx + bw; player.xvel = 0; }else{ //left player.x = bx - player.width; player.xvel = 0; } }else{ //adjust the y it collided first if(distanceYin > 0){ //bottom player.y = by + bh; player.yvel = 0; }else{ player.y = by - player.height; player.yvel = 0; } } } } } And here is a JSFiddle if you would like to see the problem yourself. http://jsfiddle.net/dMumU/ To recreate this move the player to here And press up and left at the same time. The player will jump to the right for some reason. Any advice? I know I am close but I can't seem to get xTime and yTime to equal what I want every time.

    Read the article

  • Problem to match font size to the screen resolution in libgdx

    - by Iñaki Bedoya
    I'm having problems to show text on my game at same size on different screens, and I did a simple test. This test consists to show a text fitting at the screen, I want the text has the same size independently from the screen and from DPI. I've found this and this answer that I think should solve my problem but don't. In desktop the size is ok, but in my phone is too big. This is the result on my Nexus 4: (768x1280, 2.0 density) And this is the result on my MacBook: (480x800, 0.6875 density) I'm using the Open Sans Condensed (link to google fonts) As you can see on desktop looks good, but on the phone is so big. Here the code of my test: public class TextTest extends ApplicationAdapter { private static final String TAG = TextTest.class.getName(); private static final String TEXT = "Tap the screen to start"; private OrthographicCamera camera; private Viewport viewport; private SpriteBatch batch; private BitmapFont font; @Override public void create () { Gdx.app.log(TAG, "Screen size: "+Gdx.graphics.getWidth()+"x"+Gdx.graphics.getHeight()); Gdx.app.log(TAG, "Density: "+Gdx.graphics.getDensity()); camera = new OrthographicCamera(); viewport = new ExtendViewport(Gdx.graphics.getWidth(), Gdx.graphics.getWidth(), camera); batch = new SpriteBatch(); FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/OpenSans-CondLight.ttf")); font = createFont(generator, 64); generator.dispose(); } private BitmapFont createFont(FreeTypeFontGenerator generator, float dp) { FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter(); int fontSize = (int)(dp * Gdx.graphics.getDensity()); parameter.size = fontSize; Gdx.app.log(TAG, "Font size: "+fontSize+"px"); return generator.generateFont(parameter); } @Override public void render () { Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); int w = -(int)(font.getBounds(TEXT).width / 2); batch.setProjectionMatrix(camera.combined); batch.begin(); font.setColor(Color.BLACK); font.draw(batch, TEXT, w, 0); batch.end(); } @Override public void resize(int width, int height) { viewport.update(width, height); } @Override public void dispose() { font.dispose(); batch.dispose(); } } I'm trying to find a neat way to fix this. What I'm doing wrong? is the camera? the viewport? UPDATE: What I want is to keep the same margins in proportion, independently of the screen size or resolution. This image illustrates what I mean.

    Read the article

  • Why is my Simplex Noise appearing in four columns?

    - by Joe the Person
    I'm trying to make a Texture out of Simplex noise, but it keeps appearing like this regardless of how big or small scale is: The following code is used to produce the image's color date: private Color[,] GetSimplex() { Color[,] colors = new Color[800, 600]; float scale = colors.GetLength(0); for (int x = 0; x < 800; x++) { for (int y = 0; y < 600; y++) { byte noise = (byte)(Noise.Generate(x / scale, y / scale) * 255); colors[x, y] = new Color(noise, noise, noise); } } return colors; }

    Read the article

  • How to make an Actor follow my finger

    - by user48352
    I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. @Override public boolean touchDown(int screenX, int screenY, int pointer, int button) { myWhale.touchDownY = screenY; myWhale.isTouched = true; return true; } @Override public boolean touchUp(int screenX, int screenY, int pointer, int button) { myWhale.isTouched = false; return false; } myWhale is an object from Whale Class where I move my texture position: public void update(float delta) { this.delta = delta; if(isTouched){ dragWhale(); } } public void dragWhale() { if(Gdx.input.getY(0) - touchDownY < 0){ if(Gdx.input.getY(0)<position.y+height/2){ position.y = position.y - velocidad*delta; } } else{ if(Gdx.input.getY(0)>position.y+height/2){ position.y = position.y + velocidad*delta; } } } So the object moves to the center of the position where the person is pressing his/her finger and most of the time it works fine but the object seems to take about half a second to move up or down and sometimes when I press my finger it wont move. Maybe there's another simplier way to do this. I'd highly appreciate if someone points me on the right direction.

    Read the article

  • How to implement a game launch counter in LibGDX

    - by Vishal Kumar
    I'm writing a game using LibGDX in which I want to save the number of launches of a game in a text file. So, In the create() of my starter class, I have the following code ..but it's not working public class MainStarter extends Game { private int count; @Override public void create() { // Set up the application AppSettings.setUp(); if(SettingsManager.isFirstLaunch()){ SettingsManager.createTextFileInLocalStorage("gamedata"); SettingsManager.writeLine("gamedata", "Launched:"+count ,FileType.LOCAL_FILE ); } else{ SettingsManager.writeLine("gamedata", "Not First launch :"+count++ ,FileType.LOCAL_FILE ); } // // Load assets before setting the screen // ##################################### Assets.loadAll(); // Set the tests screen setScreen(new MainMenuScreen(this, "Main Menu")); } } What is the proper way to do this?

    Read the article

  • Programatically Determining Bin Path

    - by Andy
    I'm working on a web app called pj and there is a bin file and a src folder. The relative paths before I deploy the app will look something like: pj/bin and pj/src/pj/script.py. However, after deployment, the relative paths will look like: pj_dep/deployed/bin and pj_dep/deployed/lib/python2.6/site-packages/pj/script.py Question: Within script.py, I am trying to find the path of a file in the bin directory. This leads to 2 different behaviors in the dev and deployment environment. If I do os.path.join(os.path.dirname(__file__), 'bin') to try to get the path for the dev environment, I will have a different path for the deployment environment. Is there a more generalized way I can find the bin directory so that I do not need to rely on an if statement to determine how many directories to go up based on the current env? This doesn't seem flexible and might cause other issues later on when the code is moved.

    Read the article

  • How to print each object in a collection in a separate page in Silverlight

    - by Ash
    I would like to know if its possible to print each object in a collection in separate pages using Silverlight printing API. Suppose I have a class Label public class Label { public string Address { get; set; } public string Country { get; set; } public string Name { get; set; } public string Town { get; set; } } I can use print API and print like this. private PrintDocument pd; private void PrintButton_Click(object sender, RoutedEventArgs e) { pd.Print("Test Print"); } private void pd_PrintPage(object sender, PrintPageEventArgs e) { Label labelToPrint = new Label() { Name = "Fake Name", Address = "Fake Address", Country = "Fake Country", Town = "Town" }; var printpage = new LabelPrint(); printpage.DataContext = new LabelPrintViewModel(labelToPrint); e.PageVisual = printpage; } LabelPrint Xaml <StackPanel x:Name="LayoutRoot" VerticalAlignment="Center" HorizontalAlignment="Center"> <TextBlock Text="{Binding Name}" /> <TextBlock Text="{Binding Address}" /> <TextBlock Text="{Binding Town}" /> <TextBlock Text="{Binding Country}" /> </StackPanel> Now, say I've a collection of Label objects, List<Label> labels = new List<Label>() { labelToPrint, labelToPrint, labelToPrint, labelToPrint }; How can I print each object in the list in separate pages ? Thanks for any suggestions ..

    Read the article

  • Can't remove a view included using a include tag

    - by Julio Rodrigues
    Removing a view that was included using a <include> tag seems to have no effect. ViewGroup currentPersonContainer = (ViewGroup) root.findViewById(R.id.propria_pessoa_container); if (dto.occupation!= null) { . . . } else { root.removeView(currentPersonContainer); } After the root.removeView(currentPersonContainer); I can still find it in root and the view is still visible. How can I remove a view included in a xml layout resource file?

    Read the article

  • replacing data.frame element-wise operations with data.table (that used rowname)

    - by Harold
    So lets say I have the following data.frames: df1 <- data.frame(y = 1:10, z = rnorm(10), row.names = letters[1:10]) df2 <- data.frame(y = c(rep(2, 5), rep(5, 5)), z = rnorm(10), row.names = letters[1:10]) And perhaps the "equivalent" data.tables: dt1 <- data.table(x = rownames(df1), df1, key = 'x') dt2 <- data.table(x = rownames(df2), df2, key = 'x') If I want to do element-wise operations between df1 and df2, they look something like dfRes <- df1 / df2 And rownames() is preserved: R> head(dfRes) y z a 0.5 3.1405463 b 1.0 1.2925200 c 1.5 1.4137930 d 2.0 -0.5532855 e 2.5 -0.0998303 f 1.2 -1.6236294 My poor understanding of data.table says the same operation should look like this: dtRes <- dt1[, !'x', with = F] / dt2[, !'x', with = F] dtRes[, x := dt1[,x,]] setkey(dtRes, x) (setkey optional) Is there a more data.table-esque way of doing this? As a slightly related aside, more generally, I would have other columns such as factors in each data.table and I would like to omit those columns while doing the element-wise operations, but still have them in the result. Does this make sense? Thanks!

    Read the article

  • SignalR - No connection could be made because the target machine actively refused it?

    - by user2151460
    Trying to create a Console application that is going to send data to a website. The website is built with Codeiginter framework, if that matters. When i'm running my Console application, i get the error that a connection could not be made, and that the machine refused it. Been watching some tutorials, but most of them are using Hubs etc, which imo i do not need for this simple task?. All i want to do is to send data to the website, one way. Here is my Console application using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Client; namespace signalrDemo { class Program { static void Main(string[] args) { var connection = new Connection("http://localhost:3000/servers/2"); connection.Received += data => Console.WriteLine(data); connection.Start().ContinueWith(task => { if (task.IsFaulted) { Console.WriteLine("Failed to start: {0}", task.Exception.GetBaseException()); } else { Console.WriteLine("Success! Connected with client connection id {0}", connection.ConnectionId); } }); Console.ReadLine(); } } } And at my website, i have this code $(function () { var connection = $.connection('http://localhost/servers/2'); connection.received(function (data) { $("message").append(data + '<br />'); }); connection.start().done(); }); Thank you.

    Read the article

  • Is it possible to split HTML using DOMDocument?

    - by Lynn Adrianna
    Using DOMDocument, is it possible to split a block of HTML by text wrapped in tags and those that are not, while maintaining the order? Sorry, if this doesn't make sense. My example should make it clear. Let's say I have the following block of HTML: text1<b style="color:pink">text2</b>text3<b>text4</b> <b style="font-weight:bold">text5</b> Is it possible create an array as such: array( [0] => text1 [1] => <b style="color:pink">text2</b> [2] => text3 [3] => <b>text4</b> [4] => [5] => <b style="font-weight:bold">text5</b> ) Below is my current working solution, which uses a regular expression, to split the HTML. $tokens = preg_split('/(<b\b[^>]*>.*?<\/b>)/i', $html, null, PREG_SPLIT_DELIM_CAPTURE); However, I always read that it is a bad idea to parse HTML using regular expressions, so was just wondering if there is a better way.

    Read the article

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