Daily Archives

Articles indexed Saturday October 6 2012

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

  • deactivate dynamic contrast on dell xps

    - by Rock
    I am experiencing annoying automatic backlight brightness changes under ubuntu 12.04 LTS on my Dell XPS ultrabook. It seems to be connected to the amount of white pixels on the screen (switching back an forth between dark/light application windows makes the effect noticable, but also just scrolling through a website.) So I think it is the dynamic contrast feature of the notebook screen. How do I turn this off in Ubuntu? Windows offers specific Intel driver options for this, but I can't find any for Ubuntu. EDIT: Model: Dell XPS 14 Ultrabook and currently running Unity

    Read the article

  • alt + tab not working properly

    - by Ankit
    alt + tab functionality has suddenly started misbehaving. it's showing only desktop and the current active app instead of all the applications opened. For eg currently, opened applications are firefox and terminal but when i press alt+tab i can see either "desktop + firefox" or "desktop + terminal" depending upon whether the current active application is browser or terminal. I have not installed any update. Please help.

    Read the article

  • No options for sound output

    - by Chef Flambe
    Newbie here. Trying out Ubuntu for kicks. I have a 10.04 Ubuntu system dual booting on my Windows 7 laptop, fully updated, an Asus A53S. I have an external Samsung monitor/tv hooked up via HDMI. I'm getting sound from the external monitor fine when using Win7 but can't get anything with Ubuntu. I've read threads here about similar stuff and they say go check my sound options but I don't have any additional options than the one listed - Internal Audio. What else can I check/do?

    Read the article

  • Help me i can't format my usb? i have already tried with mkdosfs and gparted

    - by Mauri Olivares
    I have a MicroSD card in a USB adapter (which plugs into a USB port on my machine, and acts like a USB flash drive). I was using Unetbootin to make this a bootable USB flash drive with Kubuntu. But I needed to cancel while it was working. So I killed the Unetbootin process from the console. Since then, I can't format the MicroSD or delete the folder that Kubuntu made. I have also tried mkdosfs, with no success. I can't mount the drive anymore either? What can I do, to make this drive usable again? Trying to create a new partition table in GParted, as described in Eliah Kagan's answer, does not work. It fails with the error message "imposible crear tabla de particiones" ("unable to create a partition table").

    Read the article

  • Using RTL languages with MS Office in Wine 1.4

    - by saeed hardan
    I've installed MS Office 2007 in Ubuntu 12.04 using Wine 1.4 with no problems, and it works fine with the English Language. However, I need to use it to work with Arabic and Hebrew, and it doesn't work when I switch to a Hebrew or Arabic keyboard. The typing gets reversed. I saw an earlier post for something similar, but it is closed and I think it was for the earlier Wine 1.3. Supposedly Wine 1.4 has added RTL -- is there a way to get it working?

    Read the article

  • Recursively rename files - oneliner preferably

    - by zetah
    I found this answer how do i... but it simply doesn't work - it did not rename any file for unknown to me reason Before I started to search around I thought that it should be easy task even for novice penguin, but it doesn't seem so for me. For example, I simply can't tell ls to list all *.txt in all subfolders, which was surprise to me (without grep or similar). Then I found find and find . -name name_1.txt lists files fine, but for f in $(find . -name name_1.txt) ; do echo "$f" ; done splits whole file paths with space as separator, so it's unusable to pass that output to some command like mv or rename I want to ask whats wrong with above command and if possible some nifty oneliner so I can recursively rename name_1.txt to name_2.txt

    Read the article

  • Is it safe to have no TOS or PP?

    - by JamerTheProgrammer
    I have coded my own forums from the ground up. I have tried my best to make my code as secure as possible and encrypting everything I can. I want to use this forum for a Minecraft server. I have one concern however.... I would like to setup this forum now but having no TOS or Privacy Policy has put me off. Will having none of either cause me any legal trouble in the unlikely event of a data leakage? Thanks

    Read the article

  • Is there such a thing as a Google Result Set simulator?

    - by Dave Adams
    I am always making tweaks to my site, be it in the .htaccess file, some new SEO plugin, different types of content or whatever. For all these changes, I would really like to be able test it immediately and see if the change had any positive or negative effect. I am just wondering if there was some way of doing immediate testing using some simulator instead of having to wait for Google to discover and index it - which could take a long time.

    Read the article

  • How do I calculate the boundary of the game window after transforming the view?

    - by Cypher
    My Camera class handles zoom, rotation, and of course panning. It's invoked through SpriteBatch.Begin, like so many other XNA 2D camera classes. It calculates the view Matrix like so: public Matrix GetViewMatrix() { return Matrix.Identity * Matrix.CreateTranslation(new Vector3(-this.Spatial.Position, 0.0f)) * Matrix.CreateTranslation(-( this.viewport.Width / 2 ), -( this.viewport.Height / 2 ), 0.0f) * Matrix.CreateRotationZ(this.Rotation) * Matrix.CreateScale(this.Scale, this.Scale, 1.0f) * Matrix.CreateTranslation(this.viewport.Width * 0.5f, this.viewport.Height * 0.5f, 0.0f); } I was having a minor issue with performance, which after doing some profiling, led me to apply a culling feature to my rendering system. It used to, before I implemented the camera's zoom feature, simply grab the camera's boundaries and cull any game objects that did not intersect with the camera. However, after giving the camera the ability to zoom, that no longer works. The reason why is visible in the screenshot below. The navy blue rectangle represents the camera's boundaries when zoomed out all the way (Camera.Scale = 0.5f). So, when zoomed out, game objects are culled before they reach the boundaries of the window. The camera's width and height are determined by the Viewport properties of the same name (maybe this is my mistake? I wasn't expecting the camera to "resize" like this). What I'm trying to calculate is a Rectangle that defines the boundaries of the screen, as indicated by my awesome blue arrows, even after the camera is rotated, scaled, or panned. Here is how I've more recently found out how not to do it: public Rectangle CullingRegion { get { Rectangle region = Rectangle.Empty; Vector2 size = this.Spatial.Size; size *= 1 / this.Scale; Vector2 position = this.Spatial.Position; position = Vector2.Transform(position, this.Inverse); region.X = (int)position.X; region.Y = (int)position.Y; region.Width = (int)size.X; region.Height = (int)size.Y; return region; } } It seems to calculate the right size, but when I render this region, it moves around which will obviously cause problems. It needs to be "static", so to speak. It's also obscenely slow, which causes more of a problem than it solves. What am I missing?

    Read the article

  • Search resetting selection in tableview

    - by Jay
    I've got an NSTableView bound to an NSArrayController via content and selection indexes. All great so far - content displayed, etc. Now an NSSearchField is bound to the array controller via filterPredicate and the property of the array content instances that's to be searched. Searching/filtering the table view works great; table view showing only matching entries. However, searching resets the selection on the NSTableView if the existing selection isn't in the search results. Worse, not only during the search but after ending the search there's no selection on the table view. The NSArrayController is set up to Avoid Empty Selection. Any hints on how to properly configure bindings in this scenario to really prevent an empty selection much appreciated!

    Read the article

  • Aftering captureing a layout screenshot, ImageView is transparent

    - by Behnam
    After capturing a layout screenshot, Containing ImageViews pixels is semi-transparent ( it's abnormal ). Also widget that has transparent color is transparent ( it's normal ). Solid widget is not transparent ( it's normal ). Source of imageviews is JPG files ( so no transparent pixels in the bitmap ). Code: final Bitmap rawBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); final Canvas canvas = new Canvas(rawBitmap); rendererView.layout(0, 0, width, height); rendererView.draw(canvas); rawBitmap.compress(CompressFormat.PNG, 100, new FileOutputStream("/sdcard/test" + System.currentTimeMillis() + ".png")); Result:

    Read the article

  • PyOpenGL - passing transformation matrix into shader

    - by M-V
    I am having trouble passing projection and modelview matrices into the GLSL shader from my PyOpenGL code. My understanding is that OpenGL matrices are column major, but when I pass in projection and modelview matrices as shown, I don't see anything. I tried the transpose of the matrices, and it worked for the modelview matrix, but the projection matrix doesn't work either way. Here is the code: import OpenGL from OpenGL.GL import * from OpenGL.GL.shaders import * from OpenGL.GLU import * from OpenGL.GLUT import * from OpenGL.GLUT.freeglut import * from OpenGL.arrays import vbo import numpy, math, sys strVS = """ attribute vec3 aVert; uniform mat4 uMVMatrix; uniform mat4 uPMatrix; uniform vec4 uColor; varying vec4 vCol; void main() { // option #1 - fails gl_Position = uPMatrix * uMVMatrix * vec4(aVert, 1.0); // option #2 - works gl_Position = vec4(aVert, 1.0); // set color vCol = vec4(uColor.rgb, 1.0); } """ strFS = """ varying vec4 vCol; void main() { // use vertex color gl_FragColor = vCol; } """ # particle system class class Scene: # initialization def __init__(self): # create shader self.program = compileProgram(compileShader(strVS, GL_VERTEX_SHADER), compileShader(strFS, GL_FRAGMENT_SHADER)) glUseProgram(self.program) self.pMatrixUniform = glGetUniformLocation(self.program, 'uPMatrix') self.mvMatrixUniform = glGetUniformLocation(self.program, "uMVMatrix") self.colorU = glGetUniformLocation(self.program, "uColor") # attributes self.vertIndex = glGetAttribLocation(self.program, "aVert") # color self.col0 = [1.0, 1.0, 0.0, 1.0] # define quad vertices s = 0.2 quadV = [ -s, s, 0.0, -s, -s, 0.0, s, s, 0.0, s, s, 0.0, -s, -s, 0.0, s, -s, 0.0 ] # vertices self.vertexBuffer = glGenBuffers(1) glBindBuffer(GL_ARRAY_BUFFER, self.vertexBuffer) vertexData = numpy.array(quadV, numpy.float32) glBufferData(GL_ARRAY_BUFFER, 4*len(vertexData), vertexData, GL_STATIC_DRAW) # render def render(self, pMatrix, mvMatrix): # use shader glUseProgram(self.program) # set proj matrix glUniformMatrix4fv(self.pMatrixUniform, 1, GL_FALSE, pMatrix) # set modelview matrix glUniformMatrix4fv(self.mvMatrixUniform, 1, GL_FALSE, mvMatrix) # set color glUniform4fv(self.colorU, 1, self.col0) #enable arrays glEnableVertexAttribArray(self.vertIndex) # set buffers glBindBuffer(GL_ARRAY_BUFFER, self.vertexBuffer) glVertexAttribPointer(self.vertIndex, 3, GL_FLOAT, GL_FALSE, 0, None) # draw glDrawArrays(GL_TRIANGLES, 0, 6) # disable arrays glDisableVertexAttribArray(self.vertIndex) class Renderer: def __init__(self): pass def reshape(self, width, height): self.width = width self.height = height self.aspect = width/float(height) glViewport(0, 0, self.width, self.height) glEnable(GL_DEPTH_TEST) glDisable(GL_CULL_FACE) glClearColor(0.8, 0.8, 0.8,1.0) glutPostRedisplay() def keyPressed(self, *args): sys.exit() def draw(self): glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) # build projection matrix fov = math.radians(45.0) f = 1.0/math.tan(fov/2.0) zN, zF = (0.1, 100.0) a = self.aspect pMatrix = numpy.array([f/a, 0.0, 0.0, 0.0, 0.0, f, 0.0, 0.0, 0.0, 0.0, (zF+zN)/(zN-zF), -1.0, 0.0, 0.0, 2.0*zF*zN/(zN-zF), 0.0], numpy.float32) # modelview matrix mvMatrix = numpy.array([1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.5, 0.0, -5.0, 1.0], numpy.float32) # render self.scene.render(pMatrix, mvMatrix) # swap buffers glutSwapBuffers() def run(self): glutInitDisplayMode(GLUT_RGBA) glutInitWindowSize(400, 400) self.window = glutCreateWindow("Minimal") glutReshapeFunc(self.reshape) glutDisplayFunc(self.draw) glutKeyboardFunc(self.keyPressed) # Checks for key strokes self.scene = Scene() glutMainLoop() glutInit(sys.argv) prog = Renderer() prog.run() When I use option #2 in the shader without either matrix, I get the following output: What am I doing wrong?

    Read the article

  • MAC : How to check if the file is still being copied in cpp?

    - by Peda Pola
    In my current project, we had a requirement to check if the file is still copying. We have already developed a library which will give us OS notification like file_added , file_removed , file_modified, file_renamed on a particular folder along with the corresponding file path. The problem here is that, lets say if you add 1 GB file, it is giving multiple notification such as file_added , file_modified, file_modified as the file is being copied. Now i decided to surpass these notifications by checking if the file is copying or not. Based on that i will ignore events. I have written below code which tells if the file is being copied or not which takes file path as input parameter. Details:- In Mac, while file is being copied the creation date is set as some date less than 1970. Once it is copied the date is set to current date. Am using this technique. Based on this am deciding that file is being copied. Problem:- when we copy file in the terminal it is failing. Please advice me any approach. bool isBeingCopied(const boost::filesystem::path &filePath) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; bool isBeingCopied = false; if([[[[NSFileManager defaultManager] attributesOfItemAtPath:[NSString stringWithUTF8String:filePath.string().c_str()] error:nil] fileCreationDate] timeIntervalSince1970] < 0) { isBeingCopied = true; } [pool release]; return isBeingCopied; }

    Read the article

  • Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in

    - by alundra00
    hi i am new to php and now i having problem with login Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in... Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in.... coding php: <?php include ("config/koneksi.php"); include ("config/library.php"); $pass = md5($_POST['password']); $login = mysql_query("SELECT * FROM user WHERE id_user='$_POST[username]' AND sesi='$pass'"); $found = mysql_num_rows($login); //error $r = mysql_fetch_array($login); //error if ($r){ session_start(); session_register("username"); session_register("sesi"); session_register("role"); $_SESSION[username] = $r[id_user]; $_SESSION[sesi] = $r[sesi]; $_SESSION[role]= $r[role]; header ('location:home.php'); }

    Read the article

  • jQuery click event on parent, but finding the child (clicked) element

    - by Mahdi
    let say I have a parent element which has so many nested child elements inside of itself: <div id="p"> <div id="c1"> <div id="c2"></div> <div id="c3"></div> </div id="c4"> <div id="c5"></div> </div> </div> I've already bind a click event on the parent: $('#p').bind('click', function() { alert($(this).attr('id')); }); Because the event is assigned to the parent element, I always see the parent id, however, I'm wondering if there is any possible way to find out which of this child elements has been clicked? I also can't assign any event to the child elements or remove the event listener from parent div.

    Read the article

  • How to use Boolean variable in c:if

    - by Patriks
    I am using this code in jsf <c:if test="#{sV.done.booleanValue()}"> <option value="#{sV.id}" selected="selected">#{sV.text}</option> </c:if> <c:if test="#{not sV.done.booleanValue()}"> <option value="#{sV.id}">#{sV.text}</option> </c:if> sv is my class containing data (pojo), done is an Boolean variable, I want to display option tag with selected attribute if sV.done is true. But I couldn't make it. Don't know where I am wrong. Otherwise there can be something worong with c? because c:forEach was not working before some time in my case in same page. it can be the reason? Where I am wrong?

    Read the article

  • passing int into android activities

    - by Dawood Abbasi
    i pass int to next activity using this code Intent intent = new Intent(A.this, B.class); intent.putExtra("selectedType", i); startActivity(intent); and then receive this in activity B Intent intent = new Intent(); int i = intent.getIntExtra("selectedType", 0); Toast.makeText(getApplicationContext(), String.valueOf(i), Toast.LENGTH_LONG).show(); but when in this activity, it always display 0.

    Read the article

  • PHP radio button check if null

    - by Dallox
    So in class we get this school task where we need to check if one of the fields in unfilled and display an error. No we did this but for some strange reason it doesnt display a error when a radio button is unchecked. (textfield null check works fine) I've tried with a friend many possabilities but they all doesnt seem to work. We have been stuck at this task for 2 hours. Now we have tried making seperate if's but that doesnt seem to work too. These are the important parts: <p> <input type="hidden" name="taal" value="false"> Choose a language <input type="radio" name="taal" value="N"> Dutch <input type="radio" name="taal" value="E"> English <input type="radio" name="taal" value="S"> Spanish if (@$_POST['taal'] == null){ echo "No Language gotten"; return; }

    Read the article

  • Trying to match variables in a PHP array

    - by Nick B
    I'm stuck with a php array problem. I've to a webpage that takes values from a URL, and I need to cross reference those values against some values on the page and if they match output a 'yes'. It's an expression engine bodge job. The URL is something like domain.com/page/C12&C14 The C12 and C14 represent different categories. I've taken the last bit of the url, removed the 'C' from the values and then exploded the 12&14 into an array. I print_r the array on the page and it shows: Array ( [0] = 12 [1] = 14 ) So, the values are in the array. Lovely. Now on the page I have an html list which looks like 10 12 14 15 I want to output a YES next to the variables that are current in the array so the ideal output would be: 10 12 - YES 14 - YES 15 I was trying this but it keeps just saying No next to all of them. $currentnumber = 12; foreach ($tharray as $element) { if ($element == $currentnumber) { echo "Yes"; } else { echo "No"; } } I thought that should work, but it's not. I checked and the array and the variable are both stings. I did a strlen() on both to see if they are the same, but $currentnumber outputs '13' and the array variable outputs '2'. Any ideas as to why it's saying 13? Is the variable the wrong type of string - and if so how would I convert it?

    Read the article

  • how to set the output image use com.android.camera.action.CROP

    - by adi.zean
    I have code to crop an image, like this : public void doCrop(){ Intent intent = new Intent("com.android.camera.action.CROP"); intent.setType("image/"); List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent,0); int size = list.size(); if (size == 0 ){ Toast.makeText(this, "Cant find crop app").show(); return; } else{ intent.setData(selectImageUri); intent.putExtra("outputX", 300); intent.putExtra("outputY", 300); intent.putExtra("aspectX", 1); intent.putExtra("aspectY", 1); intent.putExtra("scale", true); intent.putExtra("return-data", true); if (size == 1) { Intent i = new Intent(intent); ResolveInfo res = list.get(0); i.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name)); startActivityForResult(i, CROP_RESULT); } } } public void onActivityResult (int requestCode, int resultCode, Intent dara){ if (resultCode == RESULT_OK){ if (requestCode == CROP_RESULT){ Bundle extras = data.getExtras(); if (extras != null){ bmp = extras.getParcelable("data"); } File f = new File(selectImageUri.getPath()); if (f.exists()) f.delete(); Intent inten3 = new Intent(this, tabActivity.class); startActivity(inten3); } } } from what i have read, the code intent.putExtra("outputX", 300); intent.putExtra("outputY", 300); is use to set the resolution of crop result, but why i can't get the result image resolution higer than 300x300? when i set the intent.putExtra("outputX", 800); intent.putExtra("outputY", 800); the crop function has no result or crash, any idea for this situation? the log cat say "! ! ! FAILED BINDER TRANSACTION ! ! !

    Read the article

  • Can we represent bit fields in JSON/BSON?

    - by zubair
    We have a dozen simulators talking to each other on UDP. The interface definition is managed in a database. The simulators are written using different languages; mostly C++, some in Java and C#. Currently, when systems engineer makes changes in the interface definition database, simulator developers manually update the communication data structures in their code. The data is mostly 2-5 bytes with bit fields for each signal. What I want to do is to generate one file from interface definition database describing byte and bit field definitions and let each developer add it to his simulator code with minimal fuss. I looked at JSON/BSON but couldn't find a way to represent bit fields in it. Thanks Zubair

    Read the article

  • getting aspect related information reg

    - by GowthamanSS
    Suppose i have these structure as class ss { public void createfile() { StreamWriter sw= new StreamWriter("d:/test.txt"); } } i need to do aspect where ever i use StreamWriter? as for as consideration i already used the below code as [assembly: MyAspect(AttributeTargetAssembly="mscorlib", AttributeTargetTypes="System.IO.File", AttributeTargetMembers="Create"] for file.create method .. it works fine .. Is there any way to solve this problem ... waiting for your response

    Read the article

  • Choosing the right web service

    - by Ratan Sharma
    My website currently working in ASP.NET 1.1 Old Process In our database we have huge amount of data stored for a decoding purpose. We have to update this huge set of data table each week(Data is supplied from a vendor). In our website (in asp.net 1.1) we query our database to decode information. New process Now instead of storing data in our database and query them, we want to replace this through the web service, AS now the vendor is supplying us a DLL, which will give us the decoded information. Information on the DLL provided by the vendor The DLL provided, can only be added in 4.0 sites. SO that also impleies that i can not directly add the dll to my 1.1 site. This DLL is exposing certain methods, we simply have to add the DLL refernce in our web service and call the method and fetch the needed information. Thus we will not have to store those information in our database. So which type of web service I should go for (asmx OR WCF) that will use the DLLs provided by vendor to fetch the decoded information ?? Flexibility i am looking for in the web service are: It can be consumed from asp.net 1.1 site directly and also using jQuery ajax. It can be consumed from other web services running on the server. It can be consumed from some windows services running from the server. NOTE : Moreover we have a plan to migrate our website from asp.net 1.1 to 4.0 version in future.So it should be that much supportive for future upgrade.

    Read the article

  • EllipseGeometry is not rendering in Silverlight

    - by Mark Nelson
    I'm trying to draw a circle in WP7 Silverlight using EllipseGeometry instead of Ellipse. The sample XAML in MSDN does not display anything on the canvas in Visual Studio. If I run the app, it does display in the emulator. <Canvas> <Path Fill="Gold" Stroke="Black" StrokeThickness="1"> <Path.Data> <EllipseGeometry Center="50,50" RadiusX="50" RadiusY="50" /> </Path.Data> </Path> </Canvas> Any ideas what is happening?

    Read the article

  • Getting child elements that are related to a parent in same table

    - by Madawar
    I have the following database schema class posts(Base): __tablename__ = 'xposts' id = Column(Integer, primary_key=True) class Comments(Base): __tablename__ = 'comments' id = Column(Integer, primary_key=True) comment_parent_id=Column(Integer,unique=True) #comment_id fetches comment of a comment ie the comment_parent_id comment_id=Column(Integer,default=None) comment_text=Column(String(200)) Values in database are 1 12 NULL Hello First comment 2 NULL 12 First Sub comment I want to fetch all Comments and sub comments of a post using sqlalchemy and have this so far qry=session.query(Comments).filter(Comments.comment_parent_id!=None) print qry.count() Is there a way i can fetch the all the subcomments of a comment in a query i have tried outerjoin on the same table(comments) and it seemed stupid and it failed.

    Read the article

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