Search Results

Search found 499 results on 20 pages for 'bird jaguar iv'.

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

  • Paranoid Encryption

    - by Lord Jaguar
    Call me paranoid, but I really like to keep my stuff secret, but readily available on the cloud. So, asking this question. How safe and reliable is encryption software (e.g., truecrypt)? The reason I ask is that, what is I encrypt my data today with this software and after a couple of years, the software is gone ! What happens to my encrypted data? Is it equally safe to AES encrypt using 7-zip? Will it provide the same level or equivalent level of encryption as truecrypt or other encryption software? (I agree truecrypt will be better because of the container encryption it gives.) And what happens if 7-zip shuts down after 5 years? I am sorry if I am sounding paranoid, but I am coming back to my original question... Is there any application/software independent encryption? Meaning, can I encrypt with one software and decrypt with another so that I will not be dependent on just one vendor? I want my encryption to depend ONLY on the password and NOT on the encryption program/software? The next question, can I write my own program that does AES/stronger encryption when I give it a passphrase, so that I don't need to depend on third party software for encryption? If yes, which language supports the same? Can someone give me a heads up as to where to look for in case of writing my own encryption program?

    Read the article

  • Quaternion based rotation and pivot position

    - by Michael IV
    I can't figure out how to perform matrix rotation using Quaternion while taking into account pivot position in OpenGL.What I am currently getting is rotation of the object around some point in the space and not a local pivot which is what I want. Here is the code [Using Java] Quaternion rotation method: public void rotateTo3(float xr, float yr, float zr) { _rotation.x = xr; _rotation.y = yr; _rotation.z = zr; Quaternion xrotQ = Glm.angleAxis((xr), Vec3.X_AXIS); Quaternion yrotQ = Glm.angleAxis((yr), Vec3.Y_AXIS); Quaternion zrotQ = Glm.angleAxis((zr), Vec3.Z_AXIS); xrotQ = Glm.normalize(xrotQ); yrotQ = Glm.normalize(yrotQ); zrotQ = Glm.normalize(zrotQ); Quaternion acumQuat; acumQuat = Quaternion.mul(xrotQ, yrotQ); acumQuat = Quaternion.mul(acumQuat, zrotQ); Mat4 rotMat = Glm.matCast(acumQuat); _model = new Mat4(1); scaleTo(_scaleX, _scaleY, _scaleZ); _model = Glm.translate(_model, new Vec3(_pivot.x, _pivot.y, 0)); _model =rotMat.mul(_model);//_model.mul(rotMat); //rotMat.mul(_model); _model = Glm.translate(_model, new Vec3(-_pivot.x, -_pivot.y, 0)); translateTo(_x, _y, _z); notifyTranformChange(); } Model matrix scale method: public void scaleTo(float x, float y, float z) { _model.set(0, x); _model.set(5, y); _model.set(10, z); _scaleX = x; _scaleY = y; _scaleZ = z; notifyTranformChange(); } Translate method: public void translateTo(float x, float y, float z) { _x = x - _pivot.x; _y = y - _pivot.y; _z = z; _position.x = _x; _position.y = _y; _position.z = _z; _model.set(12, _x); _model.set(13, _y); _model.set(14, _z); notifyTranformChange(); } But this method in which I don't use Quaternion works fine: public void rotate(Vec3 axis, float angleDegr) { _rotation.add(axis.scale(angleDegr)); // change to GLM: Mat4 backTr = new Mat4(1.0f); backTr = Glm.translate(backTr, new Vec3(_pivot.x, _pivot.y, 0)); backTr = Glm.rotate(backTr, angleDegr, axis); backTr = Glm.translate(backTr, new Vec3(-_pivot.x, -_pivot.y, 0)); _model =_model.mul(backTr);///backTr.mul(_model); notifyTranformChange(); }

    Read the article

  • SQL to search duplicates

    - by Ram
    I have a table for animals like Lion Tiger Elephant Jaguar List item Cheetah Puma Rhino I want to insert new animals in this table and I am t reading the animal names from a CSV file. Suppose I got following names in the file Lion,Tiger,Jaguar as these animals are already in "Animals" table, What should be a single SQL query that will determine if the animals are already exist in the table.

    Read the article

  • Specified key is not a valid size for this algorithm...

    - by phenevo
    Hi, I have with this code: RijndaelManaged rijndaelCipher = new RijndaelManaged(); // Set key and IV rijndaelCipher.Key = Convert.FromBase64String("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678912"); rijndaelCipher.IV = Convert.FromBase64String("1234567890123456789012345678901234567890123456789012345678901234"); I get throws : Specified key is not a valid size for this algorithm. Specified initialization vector (IV) does not match the block size for this algorithm. What's wrong with this strings ? Can I count at some examples strings from You ?

    Read the article

  • android customize gallery focus problem

    - by Faisal khan
    Gallery With reference to the following link http://www.anddev.org/novice-tutorials-f8/a-android-widget-gallery-example-t332-60.html In above link they are actually animating selected item of the gallery but i want to change the picture when it is selected, for that i am having following code. Problem is when i use roller ball to scroll gallery from left to right or right to left to right after scroll on image focus automatically shift to next widget. public class SizingGallery extends Gallery{ public SizingGallery(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected boolean getChildStaticTransformation(View child, Transformation t) { t.clear(); ImageView selectedChild = (ImageView) getSelectedView(); ImageView iv = (ImageView) child; BrowseMapCategoryRow cr = (BrowseMapCategoryRow) iv.getTag(); //Following line change the image resource that causing defocus gallery iv.setImageResource((iv == selectedChild)?cr.getSelectedImgSrc():cr.getUnSelectedImgSrc()); return true; } }

    Read the article

  • get rotation direction of UIView on touchesMoved

    - by mlecho
    this may sound funny, but i spent hours trying to recreate a knob with a realistic rotation using UIView and some trig. I achieved the goal, but now i can not figure out how to know if the knob is rotating left or right. The most pertinent part of the math is here: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint pt = [touch locationInView:self]; float dx = pt.x - iv.center.x; float dy = pt.y - iv.center.y; float ang = atan2(dy,dx); //do the rotation if (deltaAngle == 0.0) { deltaAngle = ang; initialTransform = iv.transform; }else { float angleDif = deltaAngle - ang; CGAffineTransform newTrans = CGAffineTransformRotate(initialTransform, -angleDif); iv.transform = newTrans; currentValue = [self goodDegrees:radiansToDegrees(angleDif)]; } } ideally, i could leverage a numeric value to tell me if the rotation is positive or negative.

    Read the article

  • Converting AES encryption token code in C# to php

    - by joey
    Hello, I have the following .Net code which takes two inputs. 1) A 128 bit base 64 encoded key and 2) the userid. It outputs the AES encrypted token. I need the php equivalent of the same code, but dont know which corresponding php classes are to be used for RNGCryptoServiceProvider,RijndaelManaged,ICryptoTransform,MemoryStream and CryptoStream. Im stuck so any help regarding this would be really appreciated. using System; using System.Text; using System.IO; using System.Security.Cryptography; class AESToken { [STAThread] static int Main(string[] args) { if (args.Length != 2) { Console.WriteLine("Usage: AESToken key userId\n"); Console.WriteLine("key Specifies 128-bit AES key base64 encoded supplied by MediaNet to the partner"); Console.WriteLine("userId specifies the unique id"); return -1; } string key = args[0]; string userId = args[1]; StringBuilder sb = new StringBuilder(); // This example code uses the magic string “CAMB2B”. The implementer // must use the appropriate magic string for the web services API. sb.Append("CAMB2B"); sb.Append(args[1]); // userId sb.Append('|'); // pipe char sb.Append(System.DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ssUTC")); //timestamp Byte[] payload = Encoding.ASCII.GetBytes(sb.ToString()); byte[] salt = new Byte[16]; // 16 bytes of random salt RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); rng.GetBytes(salt); // the plaintext is 16 bytes of salt followed by the payload. byte[] plaintext = new byte[salt.Length + payload.Length]; salt.CopyTo(plaintext, 0); payload.CopyTo(plaintext, salt.Length); // the AES cryptor: 128-bit key, 128-bit block size, CBC mode RijndaelManaged cryptor = new RijndaelManaged(); cryptor.KeySize = 128; cryptor.BlockSize = 128; cryptor.Mode = CipherMode.CBC; cryptor.GenerateIV(); cryptor.Key = Convert.FromBase64String(args[0]); // the key byte[] iv = cryptor.IV; // the IV. // do the encryption ICryptoTransform encryptor = cryptor.CreateEncryptor(cryptor.Key, iv); MemoryStream ms = new MemoryStream(); CryptoStream cs = new CryptoStream(ms, encryptor, CryptoStreamMode.Write); cs.Write(plaintext, 0, plaintext.Length); cs.FlushFinalBlock(); byte[] ciphertext = ms.ToArray(); ms.Close(); cs.Close(); // build the token byte[] tokenBytes = new byte[iv.Length + ciphertext.Length]; iv.CopyTo(tokenBytes, 0); ciphertext.CopyTo(tokenBytes, iv.Length); string token = Convert.ToBase64String(tokenBytes); Console.WriteLine(token); return 0; } } Please help. Thank You.

    Read the article

  • Why are these strange characters appearing in mcrypt?

    - by David
    I Encrypt and Decrypt successfully, but when I decrypt the value, appears strange characters at the final of string "???": The initial $_POST['value'] do not have any blank space or any strange character Any idea to solve this? Encrypt with this: $key='my key'; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $id = mcrypt_generic($td, $_POST['value']); mcrypt_generic_deinit($td); mcrypt_module_close($td); Decrypt with this: $key='my key'; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $id = mdecrypt_generic($td, $_COOKIE['value']); mcrypt_generic_deinit($td); mcrypt_module_close($td);

    Read the article

  • Retrieving Encrypted Rich Text file and showing it in a RichTextBox C#

    - by Ranhiru
    OK, my need here is to save whatever typed in the rich text box to a file, encrypted, and also retrieve the text from the file again and show it back on the rich textbox. Here is my save code. private void cmdSave_Click(object sender, EventArgs e) { FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write); AesCryptoServiceProvider aes = new AesCryptoServiceProvider(); aes.GenerateIV(); aes.GenerateKey(); aes.Mode = CipherMode.CBC; TextWriter twKey = new StreamWriter("key"); twKey.Write(ASCIIEncoding.ASCII.GetString(aes.Key)); twKey.Close(); TextWriter twIV = new StreamWriter("IV"); twIV.Write(ASCIIEncoding.ASCII.GetString(aes.IV)); twIV.Close(); ICryptoTransform aesEncrypt = aes.CreateEncryptor(); CryptoStream cryptoStream = new CryptoStream(fs, aesEncrypt, CryptoStreamMode.Write); richTextBox1.SaveFile(cryptoStream, RichTextBoxStreamType.RichText); } I know the security consequences of saving the key and iv in a file but this just for testing :) Well, the saving part works fine which means no exceptions... The file is created in filePath and the key and IV files are created fine too... OK now for retrieving part where I am stuck :S private void cmdOpen_Click(object sender, EventArgs e) { OpenFileDialog openFile = new OpenFileDialog(); openFile.ShowDialog(); FileStream openRTF = new FileStream(openFile.FileName, FileMode.Open, FileAccess.Read); AesCryptoServiceProvider aes = new AesCryptoServiceProvider(); TextReader trKey = new StreamReader("key"); byte[] AesKey = ASCIIEncoding.ASCII.GetBytes(trKey.ReadLine()); TextReader trIV = new StreamReader("IV"); byte[] AesIV = ASCIIEncoding.ASCII.GetBytes(trIV.ReadLine()); aes.Key = AesKey; aes.IV = AesIV; ICryptoTransform aesDecrypt = aes.CreateDecryptor(); CryptoStream cryptoStream = new CryptoStream(openRTF, aesDecrypt, CryptoStreamMode.Read); StreamReader fx = new StreamReader(cryptoStream); richTextBox1.Rtf = fx.ReadToEnd(); //richTextBox1.LoadFile(fx.BaseStream, RichTextBoxStreamType.RichText); } But the richTextBox1.Rtf = fx.ReadToEnd(); throws an cryptographic exception "Padding is invalid and cannot be removed." while richTextBox1.LoadFile(fx.BaseStream, RichTextBoxStreamType.RichText); throws an NotSupportedException "Stream does not support seeking." Any suggestions on what i can do to load the data from the encrypted file and show it in the rich text box?

    Read the article

  • android circulate gallery iteration with 10 items.

    - by Faisal khan
    I am using the following customize gallery. I am having static 10 images, i want circulatery gallery which should circlate always should never ends after last item it should auto start by 1 or after first it should auto start from end. public class SizingGallery extends Gallery{ public SizingGallery(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected boolean getChildStaticTransformation(View child, Transformation t) { t.clear(); ImageView selectedChild = (ImageView)getSelectedView(); ImageView iv =(ImageView)child; BrowseMapCategoryRow cr = (BrowseMapCategoryRow)iv.getTag(); if (iv == selectedChild) { selectedChild.setImageResource(cr.getSelectedImgSrc()); }else{ iv.setImageResource(cr.getUnSelectedImgSrc()); } return true; } @Override protected int getChildDrawingOrder(int childCount, int i) { return super.getChildDrawingOrder(childCount, i); } }

    Read the article

  • lazy loading images in UIScrollView

    - by idober
    I have an application the requires scrolling of many images. because I can not load all the images, and save it in the memory, I am lazy loading them. The problem is if I scroll too quickly, there are "black images" showing (images that did not manage to load). this is the lazy loading code: int currentImageToLoad = [self calculateWhichImageShowing] + imageBufferZone; [(UIView*)[[theScrollView subviews] objectAtIndex:0]removeFromSuperview]; PictureObject *pic = (PictureObject *)[imageList objectAtIndex:currentImageToLoad]; MyImageView *iv = [[MyImageView alloc] initWithFrame:CGRectMake(currentImageToLoad * 320.0f, 20.0f, 320.0f, 460)]; NSData *imageData = [NSData dataWithContentsOfFile:[pic imageName]]; [iv setupView:[UIImage imageWithData: imageData] :[pic imageDescription]]; [theScrollView insertSubview:iv atIndex:5]; [iv release]; this is the code inside scrollViewWillBeginDecelerating: [NSThread detachNewThreadSelector:@selector(lazyLoadImages) toTarget:self withObject:nil];

    Read the article

  • Ruby on Rails Decryption

    - by user812120
    0 down vote favorite share [g+] share [fb] share [tw] The following function works perfect in PHP. How can it be translated in Ruby on Rails. Please note that both privateKey and iv are 32 characters long. mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $privateKey, base64_decode($enc), MCRYPT_MODE_CBC, $iv) I tried to use the following in Ruby but got a bad decrypt error. cipher = OpenSSL::Cipher.new('aes-256-cbc') cipher.decrypt cipher.key = privateKey cipher.iv = iv decrypted = '' << cipher.update(encrypted) << cipher.final

    Read the article

  • Visualize the depth buffer

    - by Thanatos
    I'm attempting to visualize the depth buffer for debugging purposes, by drawing it on top of the actual rendering when a key is pressed. It's mostly working, but the resulting image appears to be zoomed in. (It's not just the original image, in an odd grayscale) Why is it not the same size as the color buffer? This is what I'm using the view the depth buffer: void get_gl_size(int &width, int &height) { int iv[4]; glGetIntegerv(GL_VIEWPORT, iv); width = iv[2]; height = iv[3]; } void visualize_depth_buffer() { int width, height; get_gl_size(width, height); float *data = new float[width * height]; glReadPixels(0, 0, width, height, GL_DEPTH_COMPONENT, GL_FLOAT, data); glDrawPixels(width, height, GL_LUMINANCE, GL_FLOAT, data); delete [] data; }

    Read the article

  • how to read values from the remote OPC Server

    - by Shailesh Jaiswal
    I have created one asp.net web service. In this web service I am using the web method as follows. The web service is related to the OPC ( OLE for process control) public string ReadServerItems(string ServerName) { string txt = ""; ArrayList obj = new ArrayList(); XmlServer Srv = new XmlServer("XDAGW.CS.WCF.Eval.1"); RequestOptions opt = new RequestOptions(); ReadRequestItemList iList = new ReadRequestItemList(); iList.Items = new ReadRequestItem[3]; iList.Items[0] = new ReadRequestItem(); iList.Items[0].ItemName = "ServerInfo.ConnectedClients"; iList.Items[1] = new ReadRequestItem(); iList.Items[1].ItemName = "ServerInfo.TotalGroups"; iList.Items[2] = new ReadRequestItem(); iList.Items[2].ItemName = "EventSources.Area1.Tracking"; ReplyItemList rslt; OPCError[] err; ReplyBase reply = Srv.Read(opt, iList, out rslt, out err); if ((rslt == null)) txt += err[0].Text; else { foreach (xmldanet.xmlda.ItemValue iv in rslt.Items) { txt += iv.ItemName; if (iv.ResultID == null) // success { txt += " = " + iv.Value.ToString() + "\r\n"; obj.Add(txt); } else txt += " : Error: " + iv.ResultID.Name + "\r\n"; } } return txt; } I am using the namespaces as follows using xmldanet; using xmldanet.xmlda; I have installed XMLDA.NET client component evaluation. In this there is an in built Test client which successfully reads the values of these data items from the remote OPC server. I also provides the template through which we can build the OPC based applications. In the above code I am trying to read the values of the data items but i am not able to read the values. I have applied the breakpoint. In that I can see that the condition if (iv.ResultID == null) becomes false & also there is null values in the variable rslt. Please tell me where I am doing mistake ? how should I correct my mistake ? can provide me the correct code ?

    Read the article

  • Using mcrypt to pass data across a webservice is failing

    - by adam
    Hi I'm writing an error handler script which encrypts the error data (file, line, error, message etc) and passes the serialized array as a POST variable (using curl) to a script which then logs the error in a central db. I've tested my encrypt/decrypt functions in a single file and the data is encrypted and decrypted fine: define('KEY', 'abc'); define('CYPHER', 'blowfish'); define('MODE', 'cfb'); function encrypt($data) { $td = mcrypt_module_open(CYPHER, '', MODE, ''); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, KEY, $iv); $crypttext = mcrypt_generic($td, $data); mcrypt_generic_deinit($td); return $iv.$crypttext; } function decrypt($data) { $td = mcrypt_module_open(CYPHER, '', MODE, ''); $ivsize = mcrypt_enc_get_iv_size($td); $iv = substr($data, 0, $ivsize); $data = substr($data, $ivsize); if ($iv) { mcrypt_generic_init($td, KEY, $iv); $data = mdecrypt_generic($td, $data); } return $data; } echo "<pre>"; $data = md5(''); echo "Data: $data\n"; $e = encrypt($data); echo "Encrypted: $e\n"; $d = decrypt($e); echo "Decrypted: $d\n"; Output: Data: d41d8cd98f00b204e9800998ecf8427e Encrypted: ê÷#¯KžViiÖŠŒÆÜ,ÑFÕUW£´Œt?†÷>c×åóéè+„N Decrypted: d41d8cd98f00b204e9800998ecf8427e The problem is, when I put the encrypt function in my transmit file (tx.php) and the decrypt in my recieve file (rx.php), the data is not fully decrypted (both files have the same set of constants for key, cypher and mode). Data before passing: a:4:{s:3:"err";i:1024;s:3:"msg";s:4:"Oops";s:4:"file";s:46:"/Applications/MAMP/htdocs/projects/txrx/tx.php";s:4:"line";i:80;} Data decrypted: Mª4:{s:3:"err";i:1024@7OYªç`^;g";s:4:"Oops";s:4:"file";sôÔ8F•Ópplications/MAMP/htdocs/projects/txrx/tx.php";s:4:"line";i:80;} Note the random characters in the middle. My curl is fairly simple: $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, 'data=' . $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($ch); Things I suspect could be causing this: Encoding of the curl request Something to do with mcrypt padding missing bytes I've been staring at it too long and have missed something really really obvious If I turn off the crypt functions (so the transfer tx-rx is unencrypted) the data is received fine. Any and all help much appreciated! Thanks, Adam

    Read the article

  • Convert this PHP code to C#

    - by Rob
    I've got this php code and I'd like to get the exact equivalent C# $ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_192, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND); $encryptedData = mcrypt_encrypt(MCRYPT_RIJNDAEL_192, $key, $salt . $message . $nonce, MCRYPT_MODE_CBC, $iv); $base64Data = base64_encode($salt . $iv . $encryptedData); $urlEncodedData = rawurlencode($base64Data); all contributions gratefully received

    Read the article

  • c# midiInGetDevCaps Midi Device Names

    - by user330403
    HI, Iv used the following code from this link. http://stackoverflow.com/questions/1991159/getting-signals-from-a-midi-port-in-c/2024835%232024835 Im wondering what i need to add to able to get a list of device names. Iv looked the MSDN website and found i need to implement midiInGetDevCaps and its a associated Struct. But iv never really done anything with dll imports and structs before so im a bit lost

    Read the article

  • mcrypt_encrypt fails to initialise

    - by mixkat
    I am trying to encrypt some data in PHP using the Rijndael cipher in CBC mode with a 256bit key but for some reason I get the following error message: mcrypt_encrypt() Module initialization failed My code: $hashKey = hash('sha256',$key); $iv = hash('sha256',$hashKey); // ------Cipher-------------key-------------Data-------------Mode---------IV-- $encryptedQuestion = base64_encode(mcrypt_encrypt('MCRYPT_RIJNDAEL_256', $hashKey , $_POST['question'], MCRYPT_MODE_CBC, $iv)); Can anyone see whats wrong with this?

    Read the article

  • Get the touch position inside the imageview in android

    - by Manikandan
    I have a imageview in my activity and I am able to get the position where the user touch the imageview, through onTouchListener. I placed another image where the user touch over that image. I need to store the touch position(x,y), and use it in another activity, to show the tags. I stored the touch position in the first activity. In the first activity, my imageview at the top of the screen. In the second activity its at the bottom of the screen. If I use the position stored from the first acitvity, it place the tag image at the top, not on the imageview, where I previously clicked in the first activity. Is there anyway to get the position inside the imageview. FirstActivity: cp.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub Log.v("touched x val of cap img >>", event.getX() + ""); Log.v("touched y val of cap img >>", event.getY() + ""); x = (int) event.getX(); y = (int) event.getY(); tag.setVisibility(View.VISIBLE); int[] viewCoords = new int[2]; cp.getLocationOnScreen(viewCoords); int imageX = x - viewCoords[0]; // viewCoods[0] is the X coordinate int imageY = y - viewCoords[1]; // viewCoods[1] is the y coordinate Log.v("Real x >>>",imageX+""); Log.v("Real y >>>",imageY+""); RelativeLayout rl = (RelativeLayout) findViewById(R.id.lay_lin); ImageView iv = new ImageView(Capture_Image.this); Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.tag_icon_32); iv.setImageBitmap(bm); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); params.leftMargin = x; params.topMargin = y; rl.addView(iv, params); Intent intent= new Intent(Capture_Image.this,Tag_Image.class); Bundle b=new Bundle(); b.putInt("xval", imageX); b.putInt("yval", imageY); intent.putExtras(b); startActivity(intent); return false; } }); In TagImage.java I used the following: im = (ImageView) findViewById(R.id.img_cam22); b=getIntent().getExtras(); xx=b.getInt("xval"); yy=b.getInt("yval"); im.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int[] viewCoords = new int[2]; im.getLocationOnScreen(viewCoords); int imageX = xx + viewCoords[0]; // viewCoods[0] is the X coordinate int imageY = yy+ viewCoords[1]; // viewCoods[1] is the y coordinate Log.v("Real x >>>",imageX+""); Log.v("Real y >>>",imageY+""); RelativeLayout rl = (RelativeLayout) findViewById(R.id.lay_lin); ImageView iv = new ImageView(Tag_Image.this); Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.tag_icon_32); iv.setImageBitmap(bm); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams( 30, 40); params.leftMargin =imageX ; params.topMargin = imageY; rl.addView(iv, params); return true; } });

    Read the article

  • Raid-1 Western Digital Green AARS, cloning and WD Align Utility

    - by Jaguar
    Hello all, My current setup runs on top of 2x Western Digital 2500KS drives on Raid-1, using the motherboard's 780G raid controller, on WinXP. Everything is fine, but the drives are a bit noisy. I am considering buying 2x WD6400AARS disks which are the 640GB slower 'green' drives, but also feature the Advanced Formatting 4KB sectors. This means that for WinXP the partition will have to be aligned to work properly, else there is a performance penalty. There are 2 questions here: The Green drives from WD are all slower and are (according to WD) susceptible to drop-out's from the controller. Has anyone any experience in this matter? Is there a possibility the controller will drop a drive? If so, can i do anything about it? Secondly, western digital gives a utility to perform the alignment on the partition. The thing is, will the utility see the drives in question as the operating system only sees 1 logical disk? I will be making the transition using a cloning tool (most probably norton ghost) unless i don't find a solution or a clear answer, in which case i'll just buy a win 7 license and make a clean install... thx in advance

    Read the article

  • Getting an boot error when starting computer

    - by Rob Avery IV
    I was in the middle of watching a movie on Netflix, then suddenly everything started crashing. First, explorer.exe closed down, then Google chrome. I had multiple things running in the background (Steam, Raptr, etc.). Individuality, each of those apps closed down also. When they did, a small dialog box popped up for each of them, one at a time, saying that it was missing a file, it couldn't run anymore, or something similar to that. It also had some jumbled up "code" with numbers and letters that I couldn't read. Ever since then, everytime I turn my computer on, it will run for a few seconds and give this error "Reboot and select proper boot device or insert boot media in selected boot device and press a key_". No matter how many times I try to reboot it, it always gives me the same error. A day later after this happened I was able to start the computer, but before it booted, it told me that I didn't shut down the computer properly and asked how I wanted to run the OS (Run Windows in Safety Mode, Run Windows Normally, etc.). Once I logged, everything went SUPER slow and everything crashed almost instantly. The only thing I opened was Microsoft Security Essentials and only got in about two clicks before it was "Not Responding". Then, after that the whole computer froze and I had to restart it. Now, it's back to saying what it originally said, "Reboot and select proper boot device or insert boot media in selected boot device and press a key_". I built this PC back in February 2012. Here are the specs: OS: Windows 7 Ultimate CPU: AMD 8-core GPU: Nvidia GTX Force 560 Ti RAM: 16GB Hard Drive: Hitachi Deskstar 750GB I'm usually very good taking care of my PC. I don't download anything that's not from a trusted site or source. I don't open up any spam email or such or go to any harmful websites like porn or stream movies. I am very clean with the things I do with my PC and don't do many DIFFERENT things with it. I use it pretty often especially for video games and doing homework in Eclipse. Also, good to note that I don't have any Norton or antisoftware installed. I have Microsoft Security Essentials installed but never did a scan. Thanks!

    Read the article

  • How to remove Reply List option in Thunderbird 3?

    - by Joe Casadonte
    I receive email as part of a mailing list that also CC's other people. T-Bird defaults the toolbar button to Reply List instead of Reply All, which strips away the CC's. That's bad, because they're not on the list. Is there a way I can stop T-Bird from presenting Reply List as an option, or at least make Reply All the default? Thanks!

    Read the article

  • Configure samba server for Unix group

    - by Bird Jaguar IV
    I'm trying to set up a samba server with access for users in the Linux (RHEL 6) "wheel" group. I am basing smb.conf off of the example here where it goes through the [accounting] example. In my smb.conf I have [tmp] comment = temporary files path = /var/share valid users = @wheel read only = No create mask = 0664 directory mask = 02777 max connections = 0 (rest of the output from $ testparm /etc/samba/smb.conf is here). And groups `whoami` returns user01 : wheel. When I use the following command from another machine (Mac OS) as the Linux user (user01): $ smbclient -L NETBIOSNAME/tmp it asks for a password, I hit return without a password, and get: Enter user01's password: Anonymous login successful Domain=[DOMAIN] OS=[Unix] Server=[Samba 3.6.9-151.el6_4.1] Sharename Type Comment --------- ---- ------- tmp Disk temporary files IPC$ IPC IPC Service (Samba Server Version 3.6.9-151.el6_4.1) But when I try $ smbclient //NETBIOSNAME/tmp I try entering the password I use for the Linux login, and get a bunch of stuff logged, including check_sam_security: Couldn't find user 'user01' in passdb. ... session setup failed: NT_STATUS_LOGON_FAILURE (I can give more logging information if it would be helpful.) I can't find a reference to more steps I need to add group users in the resource. Should I be manually adding samba users from the group somehow? Thank you

    Read the article

  • Redundant margins when adding ImageView to ScrollView in Android.

    - by Shmuel Meymann
    Hi.. I have been trying to use a ScrollView on a single ImageView with a JPG (~770 x 1024) over an AVD that's 600x800. My main.xml is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ScrollView android:id="@+id/scroller" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> Now, I add a single ImageView with setContentView(R.layout.main); ScrollView sv = (ScrollView)findViewById( R.id.scroller ); ImageView iv = new ImageView(this); iv.setImageDrawable( new BitmapDrawable( "/sdcard/770x1024.jpg" ) ); // same happens with ScaleDrawable. iv.setScaleType( ScaleType.CENTER_INSIDE ); sv.addView( sv ); // and it does not go any better if I use Linear Layout between the ScrollView and the ImageView. The result is The image was displayed in a middle of a ScrollView, wrapped with background area on top and bottom as following: ##### ##### image . . . ##### ##### Where ##### stands for background area I tried to set the background of the ImageView red, and it verified that the blank margins were ImageView background. iv.setBackgroundColor( color.Red ); Where I would expect the image to take no more than its size (scaled to the AVD size) and I expect the ScrollView to let me scroll over the remainder (if any). For some reason, I see that the drawable size is 600x1024. Moreover I tried to add a LinearLayout with a dummy text view such as the linear layout is a parent to the ImageView and the TextView, and the ScrollView is a parent to the LinearLayout. LinearLayout dummy = new LinearLayout( this ); dummy.addView(iv); TextView someTextView = new TextView( this ); someTextView.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT )); dummy.addView( someTextView ); sv.addView( dummy ); The result was very peculiar: The entire layout was set into the width of a text-less text view (19). It is important for me to avoid stretching the image. What is the recommended way to implement a display of a page that can be potentially scrolled? Do I have to do it manually with a plain layout and scrolling upon OnMove events? Thanks Shmuel

    Read the article

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