Search Results

Search found 8189 results on 328 pages for 'fedora 16'.

Page 85/328 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • From string to hex MD5 hash and back

    - by Pablo Fernandez
    I have this pseudo-code in java: bytes[] hash = MD5.hash("example"); String hexString = toHexString(hash); //This returns something like a0394dbe93f bytes[] hexBytes = hexString.getBytes("UTF-8"); Now, hexBytes[] and hash[] are different. I know I'm doing something wrong since hash.length() is 16 and hexBytes.length() is 32. Maybe it has something to do with java using Unicode for chars (just a wild guess here). Anyways, the question would be: how to get the original hash[] array from the hexString. The whole code is here if you want to look at it (it's ~ 40 LOC) http://gist.github.com/434466 The output of that code is: 16 [-24, 32, -69, 74, -70, 90, -41, 76, 90, 111, -15, -84, -95, 102, 65, -10] 32 [101, 56, 50, 48, 98, 98, 52, 97, 98, 97, 53, 97, 100, 55, 52, 99, 53, 97, 54, 102, 102, 49, 97, 99, 97, 49, 54, 54, 52, 49, 102, 54] Thanks a lot!

    Read the article

  • pdf file creation in php

    - by pavun_cool
    Actually I have used following code , for creating the simple pdf file . It executed fine in the browsers. But I am not able to get the pdf file . But it gives me some output when I am running the code in CLI . my doubt is , where I need specify pdf file name ( creation file ) . <?php require('fpdf.php'); $pdf=new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output(); ?> CLI output: 2 0 obj << /Type /Page /Parent 1 0 R /Contents 3 0 R endobj 3 0 obj << /Length 4 0 R stream 2.834646 0 0 2.834646 0 841.9 cm 2 J 0.2 w BT /F1 5.64 Tf ET BT 11 -16.692 Td (Hello World!) Tj ET

    Read the article

  • Get a specific entry by group in SQL

    - by Jensen
    Hi, I've a database who contain some datas in that form: icon(name, size, tag) (myicon.png, 16, 'twitter') (myicon.png, 32, 'twitter') (myicon.png, 128, 'twitter') (myicon.png, 256, 'twitter') (anothericon.png, 32, 'facebook') (anothericon.png, 128, 'facebook') (anothericon.png, 256, 'facebook') So as you see it, the name field is not uniq I can have multiple icons with the same name and they are separated with the size field. Now in PHP I have a query that get ONE icon set, for example : mysql_query("SELECT * FROM icon WHERE tag='".$tag."' ORDER BY size LIMIT 0, 10"); With this example if $tag contain 'twitter' it will show ONLY the first SQL data entry with the tag 'twitter', so it will be : (myicon.png, 16, 'twitter') This is what I want, but I would prefer the '128' size by default. Is this possible to tell SQL to send me only the 128 size when existing and if not another size ? Thanks !

    Read the article

  • Filtering and copying with PowerShell

    - by Bergius
    In my quest to improve my PowerShell skills, here's an example of an ugly solution to a simple problem. Any suggestions how to improve the oneliner are welcome. Mission: trim a huge icon library down to something a bit more manageable. The original directory structure looks like this: /Apps and Utilities /Compile /32 Bit Alpha png /Compile 16 n p.png /+ 10 or more files /+ 5 more formats with 10 or more files each /+ 20 or so icon names /+ 22 more categories I want to copy the 32 Bit Alpha pngs and flatten the directory structure a bit. Here's my quick and very dirty solution: $dest = mkdir c:\icons; gci -r | ? { $_.Name -eq '32 Bit Alph a png' } | % { mkdir ("$dest\" + $_.Parent.Parent.Name + "\" + $_.Parent.Name); $_ } | gci | % { cp $_. FullName -dest ("$dest\" + $_.Directory.Parent.Parent + "\" + $_.Directory.Parent) } Not nice, but it solved my problem. Resulting structure: /Apps and Utilities /Compile /Compile 16 n p.png /etc /etc /etc How would you do it?

    Read the article

  • T-SQL error object exists when separated in if/else blocks

    - by Jeff O
    I get the error: Msg 2714, Level 16, State 1, Line 16 There is already an object named '#mytemptable' in the database. There are ways around it, but wonder why this happens. Seems like SQL Server is verifying both blocks of the if/else statement? declare @choice int select @choice = 1 if @choice = 1 begin select 'MyValue = 1' AS Pick into #my_temp_table end else begin select 'MyValue <> 1' AS Pick into #my_temp_table end select * from #temptable drop table #temptable If the tables have different names, it works. Or if I create the temp table and use Insert Into... statements that works as well.

    Read the article

  • WPF Image Button formatting

    - by Sonic Soul
    If I create a button with an image inside, it gets blown up to much larger size than the image. If i try to constrain the size of image, and container button, the image gets cut off: <Button Background="Transparent" Width="18" Height="18" Margin="0,0,0,0" Padding="0,0,0,0" BorderBrush="{x:Null}"> <Image Width="16" Height="16" /> </Button> Native image size is 16x16. Here the button is 18x18 with 0 padding, yet the image still gets cut-off on right/bottom. how can i make the entire button be exactly the size of the image w/out any cut off?

    Read the article

  • Display field from another table in SQL

    - by Roland Bengtsson
    I'm a newbie with SQL... Now I want to do display some instances of AddrDistances from DevExpress CxGrid with SQL. Select Cast((DistanceAsMeters * 0.001) as Decimal(8,1)) DistanceAsKm, bold_id, created, fromAddress, toAddress From AddrDistance Where DistanceAsMeters = 0 and PseudoDistanceAsCostKm = 0 and not AddrDistance.bold_id in (select bold_id from DistanceQueryTask) Order By Created Desc This SQL is working and the result is: DistanceAsKM Bold_ID Created FromAddress ToAddress 0 134808 16.02.2010 121795 134570 0 121701 10.03.2010 120850 122991 The result I want is this: DistanceAsKM Bold_ID Created FromAddress ToAddress 0 134808 16.02.2010 Kalmar Stockholm 0 121701 10.03.2010 Falkenberg Oslo So the amount of rows is right but I want to replace the numbers in FromAddress and ToAddress with strings from another table. The numbers shows here is just the boldid. Every object in the database have an unique boldid. The addresses above is stored in table Address and it have a City field with the column and a boldid as a key. What should I write in SQL to get this right ? Is there something in the CxGrid that could help here ? Regards

    Read the article

  • Convert row to column using sql server 2008?

    - by jaykanth
    Table name is Looupvalue id Ptypefield Value 1 1 D 2 1 E 3 1 F 4 1 G 5 1 H 6 2 FL 7 2 IF 8 2 VVS1 9 2 VVS2 10 2 VS1 11 2 VS2 12 3 0.50 13 3 1.00 14 3 1.50 15 3 2.00 16 4 Marquise 17 4 Round 18 4 Pear 19 4 Radiant 20 4 Princess Lookupvalue table value convert roow to column depends on ptypefield Like id 1 id 2 id 3 id 4 1 D 6 fl 12 0.50 16 Marquise 2 E 7 If 13 1 17 Round.... 3 F 8 vvs2 14 1.5 4 G 9 vvs2 15 2 5 H 10 vs1 11 vs2 Thanks

    Read the article

  • Memory corruption in System.Move due to changed 8087CW mode (png + stretchblt)

    - by André Mussche
    I have strange a memory corruption problem. After many hours debugging and trying I think I found something. For example: I do a simple string assignment: sTest := 'SET LOCK_TIMEOUT '; However, the result sometimes becomes: sTest = 'SET LOCK'#0'TIMEOUT ' So, the _ gets replaced by an 0 byte. I have seen this happening once (reproducing is tricky, dependent on timing) in the System.Move function, when it uses the FPU stack (fild, fistp) for fast memory copy (in case of 9 till 32 bytes to move): ... @@SmallMove: {9..32 Byte Move} fild qword ptr [eax+ecx] {Load Last 8} fild qword ptr [eax] {Load First 8} cmp ecx, 8 jle @@Small16 fild qword ptr [eax+8] {Load Second 8} cmp ecx, 16 jle @@Small24 fild qword ptr [eax+16] {Load Third 8} fistp qword ptr [edx+16] {Save Third 8} ... Using the FPU view and 2 memory debug views (Delphi - View - Debug - CPU - Memory) I saw it going wrong... once... could not reproduce however... This morning I read something about the 8087CW mode, and yes, if this is changed into $27F I get memory corruption! Normally it is $133F: The difference between $133F and $027F is that $027F sets up the FPU for doing less precise calculations (limiting to Double in stead of Extended) and different infiniti handling (which was used for older FPU’s, but is not used any more). Okay, now I found why but not when! I changed the working of my AsmProfiler with a simple check (so all functions are checked at enter and leave): if Get8087CW = $27F then //normally $1372? if MainThreadID = GetCurrentThreadId then //only check mainthread DebugBreak; I "profiled" some units and dll's and bingo (see stack): Windows.StretchBlt(3372289943,0,0,514,345,4211154027,0,0,514,345,13369376) pngimage.TPNGObject.DrawPartialTrans(4211154027,(0, 0, 514, 345, (0, 0), (514, 345))) pngimage.TPNGObject.Draw($7FF62450,(0, 0, 514, 345, (0, 0), (514, 345))) Graphics.TCanvas.StretchDraw((0, 0, 514, 345, (0, 0), (514, 345)),$7FECF3D0) ExtCtrls.TImage.Paint Controls.TGraphicControl.WMPaint((15, 4211154027, 0, 0)) So it is happening in StretchBlt... What to do now? Is it a fault of Windows, or a bug in PNG (included in D2007)? Or is the System.Move function not failsafe?

    Read the article

  • Changing MSSQL Database sorting

    - by plaisthos
    I have a request to change the collation of a MS SQL Database: ALTER DATABASE solarwind95 collate SQL_Latin1_General_CP1_CI_AS but I get this strange error: Meldung 5075, Ebene 16, Status 1, Zeile 1 Das 'Spalte'-Objekt 'CustomPollerAssignment.PollerID' ist von 'Datenbanksortierung' abhängig. Die Datenbanksortierung kann nicht geändert werden, wenn ein schemagebundenes Objekt von ihr abhängig ist. Entfernen Sie die Anhängigkeiten der Datenbanksortierung, und wiederholen Sie den Vorgang. Sorry for the german errror message. I do not know how to switch the language to english, but here is a translation: Translation: Message 5075, Layer 16, Status 1, Row 1 The 'column' object 'CustomPollerAssignment.PollerID' depends on 'Database sorting. The database sorting cannot be changed if a schema bound object depends on it. Remove the dependency of the database sortieren and retry. I got a ton more of the errors like that.

    Read the article

  • What is the best way to convert a hexidecimal string to a byte array (.NET)?

    - by Robert Wagner
    I have a hexidecimal string that I need to convert to a byte array. The best way (ie efficient and least code) is: string hexstr = "683A2134"; byte[] bytes = new byte[hexstr.Length/2]; for(int x = 0; x < bytes.Length; x++) { bytes[x] = Convert.ToByte(hexstr.Substring(x * 2, 2), 16); } In the case where I have a 32bit value I can do the following: string hexstr = "683A2134"; byte[] bytes = BitConverter.GetBytes(Convert.ToInt32(hexstr, 16)); However what about in the general case? Is there a better built in function, or a clearer (doesn't have to be faster, but still performant) way of doing this? I would prefer a built in function as there seems to be one for everything (well common things) except this particular conversion.

    Read the article

  • SQL Server 2005 drop column with constraints

    - by Julien N
    Hi ! In Sql Server 2005 I have a column with a "DEFAULT" constraint. I'd like to create a script that drops that column. The problem is that is returns me that error : Msg 5074, Level 16, State 1, Line 1 The object 'DF__PeriodSce__IsClo__4BCC3ABA' is dependent on column 'IsClosed'. Msg 4922, Level 16, State 9, Line 1 ALTER TABLE DROP COLUMN IsClosed failed because one or more objects access this column. I couldn't find an easy way to drop a column and all its associated constraints (only found big scripts that look into system table... there MUST (!!) be a "nice" way to do that !). And as the DEFAULT constraint's name has been randomly generated, I can't drop it by name. Thanks for your help.

    Read the article

  • Problem with update sql with excel

    - by phenevo
    Hi, I have a problem with this query: Update Provinces Set Provinces.DefaultName=T2.Defaultname from Provinces inner join OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\provinces.xlsx;HDR=YES', 'SELECT Code, Defaultname FROM [Arkusz1$]') T2 On Provinces.Code = t2.Code where Provinces.Code = T2.Code I get error: Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error. Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)". What is a reason of this unpleasent situation ?

    Read the article

  • MSSQL 2000 Stored Procedure to Split Shift Times

    - by JClaspill
    I am being asked to alter a system to include the ability to have pay differentials based on hours worked. The old method included a stored procedure (MSSQL2000 db) that did the basics, but simply knows the start and end of every shift. So, this is the information I start with: EMPLOYEE | TYPE | HOURS | INSTAMP | OUTSTAMP Dave | Hourly | 8.643055 | 2011-01-08 07:57:35.557 | 2011-01-08 16:36:10.120 And I need to turn that into something like: EMPLOYEE | TYPE | HOURS | INSTAMP | OUTSTAMP Dave | Hourly | 4.00 | 2011-01-08 08:00:00.000 | 2011-01-08 12:00:00.000 Dave | ShiftDiff1 | 4.50 | 2011-01-08 12:00:00.000 | 2011-01-08 16:30:00.000 The ShiftDiff's range from hours to certain days, to a combo of both. Should I try to make the SQL2000 SP do this or pass the info back to my ASP.NET(C#) app and let it handle it, then send back?

    Read the article

  • Math - Adding with PHP

    - by Wayne
    Basically I can't get it right. I need something like this: if($p == 1) { $start = 0; $limit = 16; } The numbers must add on depending on the value of the $p, e.g. if $p is 5 then the values of $start and $limit would be: if($p == 5) { $start = 64; $limit = 80; } The math is to add 16, depending on the value of $p. Thanks.

    Read the article

  • C++ Microsoft SAPI: How to set Windows text-to-speech output to a memory buffer?

    - by Vladimir
    Hi all, I have been trying to figure out how to "speak" a text into a memory buffer using Windows SAPI 5.1 but so far no success, even though it seems it should be quite simple. There is an example of streaming the synthesized speech into a .wav file, but no examples of how to stream it to a memory buffer. In the end I need to have the synthesized speech in a char* array in 16 kHz 16-bit little-endian PCM format. Currently I create a temp .wav file, redirect speech output there, then read it, but it seems to be a rather stupid solution. Anyone knows how to do that? Thanks!

    Read the article

  • Stuck in Infinite Loop while PostInvalidating

    - by Nicholas Roge
    I'm trying to test something, however, the loop I'm using keeps getting stuck while running. It's just a basic lock thread while doing something else before continuing kind of loop. I've double checked that I'm locking AND unlocking the variable I'm using, but regardless it's still stuck in the loop. Here are the segments of code I have that cause the problem: ActualGame.java: Thread thread=new Thread("Dialogue Thread"){ @Override public void run(){ Timer fireTimer=new Timer(); int arrowSequence=0; gameHandler.setOnTouchListener( new OnTouchListener(){ @Override public boolean onTouch(View v, MotionEvent me) { //Do something. if(!gameHandler.fireTimer.getActive()){ exitLoop=true; } return false; } } ); while(!exitLoop){ while(fireTimer.getActive()||!gameHandler.drawn); c.drawBitmap(SpriteSheet.createSingleBitmap(getResources(), R.drawable.dialogue_box,240,48),-48,0,null); c.drawBitmap(SpriteSheet.createSingleBitmap(getResources(),R.drawable.dialogue_continuearrow,32,16,8,16,arrowSequence,0),-16,8,null); gameHandler.drawn=false; gameHandler.postInvalidate(); if(arrowSequence+1==4){ arrowSequence=0; exitLoop=true; }else{ arrowSequence++; } fireTimer.startWait(100); } gameHandler.setOnTouchListener(gameHandler.defaultOnTouchListener); } }; thread.run(); And the onDraw method of GameHandler: canvas.scale(scale,scale); canvas.translate(((screenWidth/2)-((terrainWidth*scale)/2))/scale,((screenHeight/2)-((terrainHeight*scale)/2))/scale); canvas.drawColor(Color.BLACK); for(int layer=0;layer(less than)tiles.length;layer++){ if(layer==playerLayer){ canvas.drawBitmap(playerSprite.getCurrentSprite(), playerSprite.getPixelLocationX(), playerSprite.getPixelLocationY(), null); continue; } for(int y=0;y(less than)tiles[layer].length;y++){ for(int x=0;x(less than)tiles[layer][y].length;x++){ if(layer==0&&tiles[layer][y][x]==null){ tiles[layer][y][x]=nullTile; } if(tiles[layer][y][x]!=null){ runningFromTileEvent=false; canvas.drawBitmap(tiles[layer][y][x].associatedSprite.getCurrentSprite(),x*tiles[layer][y][x].associatedSprite.spriteWidth,y*tiles[layer][y][x].associatedSprite.spriteHeight,null); } } } } for(int i=0;i(less than)canvasEvents.size();i++){ if(canvasEvents.elementAt(i).condition(this)){ canvasEvents.elementAt(i).run(canvas,this); } } Log.e("JapaneseTutor","Got here.[1]"); drawn=true; Log.e("JapaneseTutor","Got here.[2]"); If you need to see the Timer class, or the full length of the GameHandler or ActualGame classes, just let me know.

    Read the article

  • Typical text encoding and EOL behavior on mobile devices

    - by Dan W
    Typical things to worry about when dealing with text are the BOM/signature, encoding, and the end of line (EOL) char/chars. I know that Windows often favours \r\n (CR+LF) and Mac/Linux favours \n (LF), but how about popular mobile devices such as the iPhone and Android? Do typical apps on those platforms favour one or the other (or maybe even \r for iOS)? I'll supply both types to the user just in case, but I'd like to choose one as default. Also, which text encodings are mobiles most likely to use - UTF-8, iso-8859-1, Windows 1252 (or other default codepage) or maybe even UTF-16? And if they use UTF-8/16, are they likely to need (or require not having) a BOM/signature? What is the typical behavior here? Once again, I'll supply a range of encodings to the user just in case, but I'd like to prioritize or use certain encodings as default if it's appropriate.

    Read the article

  • gwt not showing the right image

    - by arinte
    I have a gwt image object . In my code I set my visibleRect like this: btnSearch.setVisibleRect(-64,-80,16,16); So when I run my code with firebug the html looks like this: <img border="0" style="width: 16px; height: 16px; background: url(&quot;http://tempest/deltaflow/Content/Images/icon.png&quot;) no-repeat scroll 64px 80px transparent;" src="http://127.0.0.1:8888/trunkui/clear.cache.gif"> Why is the '-' left off? When I edit it with firebug to have the '-' it works fine.

    Read the article

  • How to save array of integer numbers in a column in SQL Server 2005

    - by hamed
    I have a table in SQL Server 2005 with the following properties: Users (UserID, Username, Password) where UserID is primary key I want to save an array of integer numbers in the password attribute in the Users table. -------------------- 0 1 2 3 -------------------- 1543 6543 7658 8765 -------------------- I plan to save this into the password column. On the other hand I use pictures instead of texts for password and each picture has a code (4 digit) and a password include 4 picture that produce 16 digit. I want to save these 16 digits (array of Ints) into the Password column please help me. thanks

    Read the article

  • Error creating a table : "There is already an object named ... in the database", but not object with

    - by DavRob60
    Hi, I'm trying to create a table on a Microsoft SQL Server 2005 (Express). When i run this query USE [QSWeb] GO /****** Object: Table [dbo].[QSW_RFQ_Log] Script Date: 03/26/2010 08:30:29 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[QSW_RFQ_Log]( [RFQ_ID] [int] NOT NULL, [Action_Time] [datetime] NOT NULL, [Quote_ID] [int] NULL, [UserName] [nvarchar](256) NOT NULL, [Action] [int] NOT NULL, [Parameter] [int] NULL, [Note] [varchar](255) NULL, CONSTRAINT [QSW_RFQ_Log] PRIMARY KEY CLUSTERED ( [RFQ_ID] ASC, [Action_Time] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO I got this error message Msg 2714, Level 16, State 4, Line 2 There is already an object named 'QSW_RFQ_Log' in the database. Msg 1750, Level 16, State 0, Line 2 Could not create constraint. See previous errors. but if i try to find the object in question using this query: SELECT * FROM QSWEB.sys.all_objects WHERE upper(name) like upper('QSW_RFQ_%') I got this (0 row(s) affected) What is going on????

    Read the article

  • how to overwrite rcov method with loading custom file

    - by kdoya
    I use rcov 0.9.8 on ruby 1.9.1 and rvm for ROR application. Rcov has problem on ruby 1.9. I found solution for encoding problems from here. --- lib/rcov/code_coverage_analyzer.rb~ 2010-03-21 16:15:47.000000000 +0100 +++ lib/rcov/code_coverage_analyzer.rb 2010-03-21 16:11:49.000000000 +0100 @@ -250,6 +250,10 @@ end def update_script_lines__ + if '1.9'.respond_to?(:force_encoding) + SCRIPT_LINES__.each{|k,v| v.each{|src| src.try(:force_encoding, 'utf-8')}} + end + @script_lines__ = @script_lines__.merge(SCRIPT_LINES__) end But I want to overwrite method with loading custom file. Rcov does not have require option. Any ideas?

    Read the article

  • How can I add Copperplate Gothic Bold font in my iPhone program ?

    - by srikanth rongali
    Hi, I need to display some text in cocos2d layer. I added UITextView to it. I added the text in the text View. But, for setting the font by ( UIFont class), I could not do it. I saw the list of supported fonts for iPhone, In that list Copperplate Gothic Bold is not there. I downloaded it from net. It is working good for CCLabel and CCFontMenuItem. How can I make it work for UILabel ? * Assertion failure in -[UILabel setFont:], /SourceCache/UIKit/UIKit-963.10/UILabel.m:445 2010-05-19 16:07:43.282 testOfGameScreen[1155:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: font != nil' 2010-05-19 16:07:43.285 testOfGameScreen[1155:207] Stack: ( I am getting the above error when using UIFont with Copperplate Gothic Bold Thank you.

    Read the article

  • HD Crash SQL server -> DBCC - consistency errors in table 'sysindexes'

    - by Julian de Wit
    Hello A client of mine has had an HD crash an a SQL DB got corrupt : They did not make backups so they have a big problem. When I tried (an ultimate measure) to DBCC-repair I got the following message. Can anybody help me with this ? Server: Msg 8966, Level 16, State 1, Line 1 Could not read and latch page (1:872) with latch type SH. sysindexes failed. Server: Msg 8944, Level 16, State 1, Line 1 Table error: Object ID 2, index ID 0, page (1:872), row 11. Test (columnOffsets->IsComplex (varColumnNumber) && (ColumnId == COLID_HYDRA_TEXTPTR || ColumnId == COLID_INROW_ROOT || ColumnId == COLID_BACKPTR)) failed. Values are 2 and 5. The repair level on the DBCC statement caused this repair to be bypassed. CHECKTABLE found 0 allocation errors and 1 consistency errors in table 'sysindexes' (object ID 2). DBCC execution completed. If DBCC printed error messages, contact your system administrator.

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >