Search Results

Search found 490 results on 20 pages for 'jake thompson'.

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

  • Javascript Replace Child/Loop issue

    - by Charles John Thompson III
    I have this really bizarre issue where I have a forloop that is supposed to replace all divs with the class of "original" to text inputs with a class of "new". When I run the loop, it only replaces every-other div with an input, but if I run the loop to just replace the class of the div and not change the tag to input, it does every single div, and doesn't only do every-other. Here is my loop code, and a link to the live version: live version here function divChange() { var divs = document.getElementsByTagName("div"); for (var i=0; i<divs.length; i++) { if (divs[i].className == 'original') { var textInput = document.createElement('input'); textInput.className = 'new'; textInput.type = 'text'; textInput.value = divs[i].innerHTML; var parent = divs[i].parentNode; parent.replaceChild(textInput, divs[i]); } } }

    Read the article

  • Centered DIV w/ width dependant on text, buffered by two divs that should fill the containing DIV

    - by Andrew Thompson
    I have been wracking my brains on this seemingly small issue the whole day. My web dev friends are baffled and I could not find a suitable answer in my search of this site and others (though, I could have missed it somewhere along the way). Here's the problem: 3 DIVS within one fixed-width container DIV The center DIV has text that will be different on other sites The center DIV needs to be centered, and no larger than the text it contains. This is what I'd like to end up with The basic HTMl: <div id="container" > <div id="left" ></div> <div id="center" >Text inside center should resize this block</div> <div id="right" ></div> </div> Below, I removed most of the styles I have tried. This CSS currently centers the DIV (if I set it as an inline block), but I need the other divs to fill the left and right space remaining: #container { width:750px; text-align:center; } #left { background-color:#E85355; } #center { background-color:#CDD7D7; display:inline-block; } #right { background-color:#65A8A6; } I've tried floating, no-wrap, overflow, etc. Thanks a million to whomever can offer some help! JSFiddle Link

    Read the article

  • Webcast Q&A: ResCare Solves Content Lifecycle Challenges with Oracle WebCenter

    - by Kellsey Ruppel
    Last week we had the fourth webcast in our WebCenter in Action webcast series, "ResCare Solves Content Lifecycle Challenges with Oracle WebCenter", where customer Joe Lichtefeld from ResCare and Wayne Boerger & Doug Thompson from Oracle Partner TEAM Informatics shared how Oracle WebCenter is powering allowing ResCare to solve content lifecycle challenges, reduce compliance and business risks, and increase adoption of intranet as primary business communication tool In case you missed it, here's a recap of the Q&A.   Joe Lichtefeld, ResCare  Q: Did you run into any issues in the deployment of the platform?A: We experienced very few issues when implementing the content management and search functionalities. There were some challenges in determining the metadata structure. We tried to find a fine balance between having enough fields to provide the functionality needed, but trying to limit the impact to the contributing members.  Q: What has been the biggest benefit your end users have seen?A: The biggest benefit to date is two-fold. Content on the intranet can be maintained by the individual contributors more timely than in our old process of all requests being updated by IT. The other big benefit is the ability to find the most current version of a document instead of relying on emails and phone calls to track down the "current" version. Q: Was there any resistance internally when implementing the solution? If so, how did you overcome that?A: We experienced very little resistance. Most of our community groups were eager to be able to contribute and maintain their information. We had the normal hurdles of training and follow-up training with implementing a new system and process. As our second phase rolled out access to all employees, we have received more positive feedback on the accessibility of information. Wayne Boerger & Doug Thompson, TEAM Informatics Q: Can you integrate multiple repositories with the Google Search Appliance? Yes, the Google Search Appliance is designed to index lots of different repositories, from both public and internal sources. There are included connectors to many repositories, such as SharePoint, databases, file systems, LDAP, and with the TEAM GSA Connector and the Oracle Content Server. And the index for these repositories can be configured into different collections depending on the use cases that each customer has, and really, for each need within a customer environment. Q: How many different filters can you add when the search results are returned? A: Presuming this question is about the filtering on the search results. You can add as many filters as you like and it can be done by collection or any number of other criteria. Most importantly, customers now have the ability to limit the returned content by a set metadata value. Q: With the TEAM Sites Connector, what types of content can you sync? A: There’s really no limit; if it can be checked into the content server, then it is eligible for sync into Sites.  So basically, any digital file that has relevance to a Sites implementation can be checked into the WC Content central repository and then the connector can/will manage it. Q: Using the Connector, are there any limitations around where in Sites that synced content can be used? A: There are no limitations about where it can be used. When setting up your environment to use it, you just need to think through the different destinations on the Sites side that might use the content; that way you’ve got the right information to create the rules needed for the connector. If you missed the webcast, be sure to catch the replay to see a live demonstration of WebCenter in action!  ResCare Solves Content Lifecycle Challenges with Oracle WebCenter from Oracle WebCenter

    Read the article

  • Using AES encryption in .NET - CryptographicException saying the padding is invalid and cannot be removed

    - by Jake Petroules
    I wrote some AES encryption code in C# and I am having trouble getting it to encrypt and decrypt properly. If I enter "test" as the passphrase and "This data must be kept secret from everyone!" I receive the following exception: System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.IO.Stream.Dispose() ... And if I enter something less than 16 characters I get no output. I believe I need some special handling in the encryption since AES is a block cipher, but I'm not sure exactly what that is, and I wasn't able to find any examples on the web showing how. Here is my code: using System; using System.IO; using System.Security.Cryptography; using System.Text; public static class DatabaseCrypto { public static EncryptedData Encrypt(string password, string data) { return DatabaseCrypto.Transform(true, password, data, null, null) as EncryptedData; } public static string Decrypt(string password, EncryptedData data) { return DatabaseCrypto.Transform(false, password, data.DataString, data.SaltString, data.MACString) as string; } private static object Transform(bool encrypt, string password, string data, string saltString, string macString) { using (AesManaged aes = new AesManaged()) { aes.Mode = CipherMode.CBC; aes.Padding = PaddingMode.PKCS7; int key_len = aes.KeySize / 8; int iv_len = aes.BlockSize / 8; const int salt_size = 8; const int iterations = 8192; byte[] salt = encrypt ? new Rfc2898DeriveBytes(string.Empty, salt_size).Salt : Convert.FromBase64String(saltString); byte[] bc_key = new Rfc2898DeriveBytes("BLK" + password, salt, iterations).GetBytes(key_len); byte[] iv = new Rfc2898DeriveBytes("IV" + password, salt, iterations).GetBytes(iv_len); byte[] mac_key = new Rfc2898DeriveBytes("MAC" + password, salt, iterations).GetBytes(16); aes.Key = bc_key; aes.IV = iv; byte[] rawData = encrypt ? Encoding.UTF8.GetBytes(data) : Convert.FromBase64String(data); using (ICryptoTransform transform = encrypt ? aes.CreateEncryptor() : aes.CreateDecryptor()) using (MemoryStream memoryStream = encrypt ? new MemoryStream() : new MemoryStream(rawData)) using (CryptoStream cryptoStream = new CryptoStream(memoryStream, transform, encrypt ? CryptoStreamMode.Write : CryptoStreamMode.Read)) { if (encrypt) { cryptoStream.Write(rawData, 0, rawData.Length); return new EncryptedData(salt, mac_key, memoryStream.ToArray()); } else { byte[] originalData = new byte[rawData.Length]; int count = cryptoStream.Read(originalData, 0, originalData.Length); return Encoding.UTF8.GetString(originalData, 0, count); } } } } } public class EncryptedData { public EncryptedData() { } public EncryptedData(byte[] salt, byte[] mac, byte[] data) { this.Salt = salt; this.MAC = mac; this.Data = data; } public EncryptedData(string salt, string mac, string data) { this.SaltString = salt; this.MACString = mac; this.DataString = data; } public byte[] Salt { get; set; } public string SaltString { get { return Convert.ToBase64String(this.Salt); } set { this.Salt = Convert.FromBase64String(value); } } public byte[] MAC { get; set; } public string MACString { get { return Convert.ToBase64String(this.MAC); } set { this.MAC = Convert.FromBase64String(value); } } public byte[] Data { get; set; } public string DataString { get { return Convert.ToBase64String(this.Data); } set { this.Data = Convert.FromBase64String(value); } } } static void ReadTest() { Console.WriteLine("Enter password: "); string password = Console.ReadLine(); using (StreamReader reader = new StreamReader("aes.cs.txt")) { EncryptedData enc = new EncryptedData(); enc.SaltString = reader.ReadLine(); enc.MACString = reader.ReadLine(); enc.DataString = reader.ReadLine(); Console.WriteLine("The decrypted data was: " + DatabaseCrypto.Decrypt(password, enc)); } } static void WriteTest() { Console.WriteLine("Enter data: "); string data = Console.ReadLine(); Console.WriteLine("Enter password: "); string password = Console.ReadLine(); EncryptedData enc = DatabaseCrypto.Encrypt(password, data); using (StreamWriter stream = new StreamWriter("aes.cs.txt")) { stream.WriteLine(enc.SaltString); stream.WriteLine(enc.MACString); stream.WriteLine(enc.DataString); Console.WriteLine("The encrypted data was: " + enc.DataString); } }

    Read the article

  • Is Objective-C++ a totally different language from Objective-C?

    - by Jake Petroules
    As the title says... are they considered different languages? For example if you've written an application using a combination of C++ and Objective-C++ would you consider it to have been written in C++ and Objective-C, C++ and Objective-C++ or all three? Obviously C and C++ are different languages even though C++ and C are directly compatible, how is the situation with Objective-C++ and Objective-C?

    Read the article

  • App.Config Ignored After Pre-Build Event

    - by Jake Hulse
    I have a solution with several projects and several developers, each with their own environment (of course). To manage connection strings between each environment, I have created several app.config files for each environment: app.config.dev, app.config.qa, etc. The pre-build event simply copies the app.config.$(ConfigurationName) to app.config. This pre-build event is done for each project in the solution, and the config string is included in each (including the test project). When I use the pre-build events to manage the app.config files, the connection string cannot be found. I can get the tests to run fine by 2 methods: 1. Do not use the pre-build events to manage the app.config file selection, and do it myself or 2. If I check out app.config and make it writable, then the pre-build events work just fine. We are using Visual Studio 2008. I'm down to my last grey hair here, any ideas? Thanks in advance!

    Read the article

  • C# Julian Date Parser

    - by Jake Pearson
    I have a cell in a spreadsheet that is a date object in Excel but becomes a double (something like 39820.0 for 1/7/2009) when it comes out of C1's xls class. I read this is a Julian date format. Can someone tell me how to parse it back into a DateTime in C#? Update: It looks like I might not have a Julian date, but instead the number of days since Dec 30, 1899.

    Read the article

  • Using FFMPEG to reliably convert videos to mp4 for iphone/ipod and flash players

    - by Jake Stevenson
    I need to convert videos for use in both a flash player and the iphone/ipod touch. I'm using the following batch script with ffmpeg: @echo off ffmpeg.exe -i %1 -s qvga -acodec libfaac -ar 22050 -ab 128k -vcodec libx264 -threads 0 -f ipod %2 This always outputs an mp4 file, and I can always play it on my PC. The videos also seem to play fine on my iphone 3GS. But with some input files it won't work for older iphone versions (3G and iPod touch). Here's the ffmpeg output from one such file: D:\ffmpeg>encode.bat d:\temp\recording.flv d:\temp\out.m4v FFmpeg version SVN-r18709, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl e-libfaac --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheo ra --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid - -enable-libschroedinger --enable-libx264 libavutil 50. 3. 0 / 50. 3. 0 libavcodec 52.27. 0 / 52.27. 0 libavformat 52.32. 0 / 52.32. 0 libavdevice 52. 2. 0 / 52. 2. 0 libswscale 0. 7. 1 / 0. 7. 1 built on Apr 28 2009 04:04:42, gcc: 4.2.4 [flv @ 0x187d650]skipping flv packet: type 18, size 164, flags 0 Input #0, flv, from 'd:\temp\recording.flv': Duration: 00:00:07.17, start: 0.001000, bitrate: N/A Stream #0.0: Video: flv, yuv420p, 320x240, 1k tbr, 1k tbn, 1k tbc Stream #0.1: Audio: nellymoser, 44100 Hz, mono, s16 [libx264 @ 0x13518b0]using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE 4.2 [libx264 @ 0x13518b0]profile Baseline, level 4.2 Output #0, ipod, to 'd:\temp\out.m4v': Stream #0.0: Video: libx264, yuv420p, 320x240, q=2-31, 200 kb/s, 1k tbn, 1k tbc Stream #0.1: Audio: libfaac, 22050 Hz, mono, s16, 128 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Press [q] to stop encoding frame= 90 fps= 0 q=-1.0 Lsize= 128kB time=6.87 bitrate= 152.4kbits/s video:92kB audio:32kB global headers:1kB muxing overhead 2.620892% [libx264 @ 0x13518b0]slice I:8 Avg QP:29.62 size: 7047 [libx264 @ 0x13518b0]slice P:82 Avg QP:30.83 size: 467 [libx264 @ 0x13518b0]mb I I16..4: 17.9% 0.0% 82.1% [libx264 @ 0x13518b0]mb P I16..4: 0.6% 0.0% 0.0% P16..4: 23.1% 0.0% 0.0% 0.0% 0.0% skip:76.3% [libx264 @ 0x13518b0]final ratefactor: 57.50 [libx264 @ 0x13518b0]SSIM Mean Y:0.9544735 [libx264 @ 0x13518b0]kb/s:8412.6 My suspicion is that it has something to do with the audio encoding. If so, does anyone know how to force it to reencode the audio to the proper format? Any other ideas?

    Read the article

  • Pan point on Google Map to specific pixel position on screen (API v3)

    - by Jake
    When overlay is a Google maps overlay and offsetx, offsety is the pixel distance from the maps center that I want to pan latlong to, the following works. var projection = overlay.getProjection(); var pxlocation = projection.fromLatLngToContainerPixel(latlong); map.panTo(projection.fromContainerPixelToLatLng(new google.maps.Point(pxlocation.x+offsetx,pxlocation.y+offsety))); However, I don't always have an overlay on the map and map.getProjection() returns a projection, not a MapCanvasProjection which does not have the methods I need. Is there a way to do this without making an overlay specificaly for it?

    Read the article

  • WPF DataGrid HeaderTemplate Mysterious Padding

    - by Jake Wharton
    I am placing a single button with an image in the header of a column of a DataGrid. The cell template is also just a simple button with an image. <my:DataGridTemplateColumn> <my:DataGridTemplateColumn.HeaderTemplate> <DataTemplate> <Button ToolTip="Add New Template" Name="AddNewTemplate" Click="AddNewTemplate_Click"> <Image Source="../Resources/add.png"/> </Button> </DataTemplate> </my:DataGridTemplateColumn.HeaderTemplate> <my:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button ToolTip="Edit Template" Name="EditTemplate" Click="EditTemplate_Click" Tag="{Binding}"> <Image Source="../Resources/pencil.png"/> </Button> </DataTemplate> </my:DataGridTemplateColumn.CellTemplate> </my:DataGridTemplateColumn> When rendered, the header has approximately 10-15px of padding on the right side only which causes the cells to obviously render at that width leaving the cell button having empty space on both sides. Being a pixel-perfectionist this annoys the hell out of me. I had initially thought that it was space for the arrows displayed when sorted but I have sorting disabled on both the entire DataGrid and explicitly on the column. Here's a image: I assume this is padding form whatever is the parent element of the button. Does anyone know a way to eliminate it?

    Read the article

  • Why wont a simple socket to the localhost connect?

    - by Jake M
    I am following a tutorial that teaches me how to use win32 sockets(winsock2). I am attempting to create a simple socket that connects to the "localhost" but my program is failing when I attempt to connect to the local host(at the function connect()). Do I need admin privileges to connect to the localhost? Maybe thats why it fails? Maybe theres a problem with my code? I have tried the ports 8888 & 8000 & they both fail. Also if I change the port to 80 & connect to www.google.com I can connect BUT I get no response back. Is that because I haven't sent a HTTP request or am I meant to get some response back? Here's my code (with the includes removed): // Constants & Globals // typedef unsigned long IPNumber; // IP number typedef for IPv4 const int SOCK_VER = 2; const int SERVER_PORT = 8888; // 8888 SOCKET mSocket = INVALID_SOCKET; SOCKADDR_IN sockAddr = {0}; WSADATA wsaData; HOSTENT* hostent; int _tmain(int argc, _TCHAR* argv[]) { // Initialise winsock version 2.2 if (WSAStartup(MAKEWORD(SOCK_VER,2), &wsaData) != 0) { printf("Failed to initialise winsock\n"); WSACleanup(); system("PAUSE"); return 0; } if (LOBYTE(wsaData.wVersion) != SOCK_VER || HIBYTE(wsaData.wVersion) != 2) { printf("Failed to load the correct winsock version\n"); WSACleanup(); system("PAUSE"); return 0; } // Create socket mSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (mSocket == INVALID_SOCKET) { printf("Failed to create TCP socket\n"); WSACleanup(); system("PAUSE"); return 0; } // Get IP Address of website by the domain name, we do this by contacting(??) the Domain Name Server if ((hostent = gethostbyname("localhost")) == NULL) // "localhost" www.google.com { printf("Failed to resolve website name to an ip address\n"); WSACleanup(); system("PAUSE"); return 0; } sockAddr.sin_port = htons(SERVER_PORT); sockAddr.sin_family = AF_INET; sockAddr.sin_addr.S_un.S_addr = (*reinterpret_cast <IPNumber*> (hostent->h_addr_list[0])); // sockAddr.sin_addr.s_addr=*((unsigned long*)hostent->h_addr); // Can also do this // ERROR OCCURS ON NEXT LINE: Connect to server if (connect(mSocket, (SOCKADDR*)(&sockAddr), sizeof(sockAddr)) != 0) { printf("Failed to connect to server\n"); WSACleanup(); system("PAUSE"); return 0; } printf("Got to here\r\n"); // Display message from server char buffer[1000]; memset(buffer,0,999); int inDataLength=recv(mSocket,buffer,1000,0); printf("Response: %s\r\n", buffer); // Shutdown our socket shutdown(mSocket, SD_SEND); // Close our socket entirely closesocket(mSocket); // Cleanup Winsock WSACleanup(); system("pause"); return 0; }

    Read the article

  • Visual Studio T4 vs CodeSmith

    - by Jake
    I've been using CodeSmith for the past 2 years and love what it does for me. However, I also know about T4 which is built in to Visual Studio and can do some pretty cool stuff too. Based on conversations with friends T4 in VS2010 T4 is going to be even better. So the question is: do I keep riding the CodeSmith bus or is it time to start converting all of my templates to T4?

    Read the article

  • How can I locate the indexpath of the UITableviewCell a certain button is in when I click that butto

    - by Jake
    I've added a button as an accessory view to uitableviewcell, and I when I press it, I'd like to be able to access the index path of the table view cell it's currently inside of so I can delete/modify the contents of that cell. Should I subclass UIbutton and add make it have it's own index path property? If so, do I need to implement any specific button methods in that subclass of will they automatically be loaded? Any help would be greatly appreciated. Sorry if this is a noobie question.

    Read the article

  • Visualforce and VPN

    - by Jake
    I'm looking to integrate my Salesforce implementation with an external database. I know that in most circumstances I would use Visualforce with an Apex controller/extension to access the data, however the external database will require a VPN connection. Since Visualforce and any controllers or extensions are processed server-side, is there any way to do this through a VPN?

    Read the article

  • SVN Workflow - Chicken Before the Egg - Before merging V1 with V2, I need code from V1 to work on V2

    - by Jake
    Hi, Our distributed team (3 internal devs and 3+ external devs) use SVN to manage our codebase for a web site. We have a branch for each minor version (4.1.0, 4.1.1, 4.1.2, etc...). We have a trunk which we merge each version into when we do a release and publish to our site. An example of the problem we are having is thus: A new feature is added, lets call it "Ability to Create A Project" to 4.1.1. Another feature which depends on the one in 4.1.1 is scheduled to go in 4.1.2, called "Ability to Add Tasks to Projects". So, on Monday, we say 4.1.1 is 'closed' and needs to be tested. Our remote developers usually will start working on features/tickets for 4.1.2 at this point. Throughout the week we will test 4.1.1 and fix any bugs and commit them back to 4.1.1. Then, on Friday or so, we will tag 4.1.1, merge it with trunk, and finally, merge it with 4.1.2. But, for the 4-5 days we are testing, 4.1.2 doesn't have the code from 4.1.1 that some of the new features for 4.1.2 depend on. So a dev who is adding the "Ability to Add Tasks To Projects" feature, doesn't have the "Ability to Create a Project" feature to build upon, and has to do some file copy shenanigans to be able to keep working on it. What could/should we do to smooth out this process? P.S. Apologies if this question has been asked before - I did search but couldn't find what I'm looking for.

    Read the article

  • BitBlt ignores CAPTUREBLT and seems to always capture a cached copy of the target...

    - by Jake Petroules
    I am trying to capture screenshots using the BitBlt function. However, every single time I capture a screenshot, the non-client area NEVER changes no matter what I do. It's as if it's getting some cached copy of it. The client area is captured correctly. If I close and then re-open the window, and take a screenshot, the non-client area will be captured as it is. Any subsequent captures after moving/resizing the window have no effect on the captured screenshot. Again, the client area will be correct. Furthermore, the CAPTUREBLT flag seems to do absolutely nothing at all. I notice no change with or without it. Here is my capture code: QPixmap WindowManagerUtils::grabWindow(WId windowId, GrabWindowFlags flags, int x, int y, int w, int h) { RECT r; switch (flags) { case WindowManagerUtils::GrabWindowRect: GetWindowRect(windowId, &r); break; case WindowManagerUtils::GrabClientRect: GetClientRect(windowId, &r); break; case WindowManagerUtils::GrabScreenWindow: GetWindowRect(windowId, &r); return QPixmap::grabWindow(QApplication::desktop()->winId(), r.left, r.top, r.right - r.left, r.bottom - r.top); case WindowManagerUtils::GrabScreenClient: GetClientRect(windowId, &r); return QPixmap::grabWindow(QApplication::desktop()->winId(), r.left, r.top, r.right - r.left, r.bottom - r.top); default: return QPixmap(); } if (w < 0) { w = r.right - r.left; } if (h < 0) { h = r.bottom - r.top; } #ifdef Q_WS_WINCE_WM if (qt_wince_is_pocket_pc()) { QWidget *widget = QWidget::find(winId); if (qobject_cast<QDesktopWidget*>(widget)) { RECT rect = {0,0,0,0}; AdjustWindowRectEx(&rect, WS_BORDER | WS_CAPTION, FALSE, 0); int magicNumber = qt_wince_is_high_dpi() ? 4 : 2; y += rect.top - magicNumber; } } #endif // Before we start creating objects, let's make CERTAIN of the following so we don't have a mess Q_ASSERT(flags == WindowManagerUtils::GrabWindowRect || flags == WindowManagerUtils::GrabClientRect); // Create and setup bitmap HDC display_dc = NULL; if (flags == WindowManagerUtils::GrabWindowRect) { display_dc = GetWindowDC(NULL); } else if (flags == WindowManagerUtils::GrabClientRect) { display_dc = GetDC(NULL); } HDC bitmap_dc = CreateCompatibleDC(display_dc); HBITMAP bitmap = CreateCompatibleBitmap(display_dc, w, h); HGDIOBJ null_bitmap = SelectObject(bitmap_dc, bitmap); // copy data HDC window_dc = NULL; if (flags == WindowManagerUtils::GrabWindowRect) { window_dc = GetWindowDC(windowId); } else if (flags == WindowManagerUtils::GrabClientRect) { window_dc = GetDC(windowId); } DWORD ropFlags = SRCCOPY; #ifndef Q_WS_WINCE ropFlags = ropFlags | CAPTUREBLT; #endif BitBlt(bitmap_dc, 0, 0, w, h, window_dc, x, y, ropFlags); // clean up all but bitmap ReleaseDC(windowId, window_dc); SelectObject(bitmap_dc, null_bitmap); DeleteDC(bitmap_dc); QPixmap pixmap = QPixmap::fromWinHBITMAP(bitmap); DeleteObject(bitmap); ReleaseDC(NULL, display_dc); return pixmap; } Most of this code comes from Qt's QWidget::grabWindow function, as I wanted to make some changes so it'd be more flexible. Qt's documentation states that: The grabWindow() function grabs pixels from the screen, not from the window, i.e. if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. However, I experience the exact opposite... regardless of the CAPTUREBLT flag. I've tried everything I can think of... nothing works. Any ideas?

    Read the article

  • How to include text files with Executable Jar

    - by Jake
    Hi guys rookie Java question. I have a Java project and I want to include a text file with the executable jar. Right now the text file is in the default package. InputFlatFile currentFile = new InputFlatFile("src/theFile.txt"); I grab the file with that line as you can see using src. However this doesn't work with the executable jar. Can someone please let me know how to keep this file with the executable jar so someone using the program can just click a single icon and run the program. Thanks!

    Read the article

  • pass facebook connect session from php to javascript

    - by Jake
    I'm authenticating via PHP: // the php facebook api downloaded at step 3 require_once("facebook-client/facebook.php"); // start facebook api with the codes defined in step 1. $fb=new Facebook( 'XXXXXXXXXXXXXXXXXXXX' , 'a3eaa49141ed38e230240e1b6368254a' ); $fb_user=$fb->get_loggedin_user(); var_dump($fb_user); And the session is created in PHP. I want to use hte facebook javascript client library from here on out. How do I do this?

    Read the article

  • CSS: How to get two DIVs side by side with automatic height, to the height of their container?

    - by Jake Petroules
    I am designing a website for a client, and I am trying to get two side-by-side DIVs to adjust to 100% of their container. I've got the side-by-side done, but I can't get the right DIV to be the same height as the left one. You can view the problem here: http://campusmomlaundry.petroules.com/ The "challenges" and "benefits" DIVs should be side-by-side and the same height, without manually specifying the height. How can I do this?

    Read the article

  • java - register problem

    - by Jake
    Hi! When i try to register a person with the name Eric for example, and then again registrating Eric it works. This should not happen with the code i have. Eric should not be registrated if theres already an Eric in the list. Here is my full code: import java.util.*; import se.lth.cs.pt.io.*; class Person { private String name; private String nbr; public Person (String name, String nbr) { this.name = name; this.nbr = nbr; } public String getName() { return name; } public String getNumber() { return nbr; } public String toString() { return name + " : " + nbr; } } class Register { private List<Person> personer; public Register() { personer = new ArrayList<Person>(); } // boolean remove(String name) { // } private Person findName(String name) { for (Person person : personer) { if (person.getName() == name) { return person; } } return null; } private boolean containsName(String name) { return findName(name) != null; } public boolean insert(String name, String nbr) { if (containsName(name)) { return false; } Person person = new Person(name, nbr); personer.add(person); Collections.sort(personer, new A()); return true; } //List<Person> findByPartOfName(String partOfName) { //} //List<Person> findByNumber(String nbr) { //} public List<Person> findAll() { List<Person> copy = new ArrayList<Person>(); for (Person person : personer) { copy.add(person); } return copy; } public void printList(List<Person> personer) { for (Person person : personer) { System.out.println(person.toString()); } } } class A implements Comparator < Person > { @Override public int compare(Person o1, Person o2) { if(o1.getName() != null && o2.getName() != null){ return o1.getName().compareTo(o2.getName()); } return 0; } } class TestScript { public static void main(String[] args) { new TestScript().run(); } void test(String msg, boolean status) { if (status) { System.out.println(msg + " -- ok"); } else { System.out.printf("==== FEL: %s ====\n", msg); } } void run() { Register register = new Register(); System.out.println("Vad vill du göra:"); System.out.println("1. Lägg in ny person."); System.out.println("2. Tag bort person."); System.out.println("3. Sök på del av namn."); System.out.println("4. Se vem som har givet nummer."); System.out.println("5. Skriv ut alla personer."); System.out.println("0. Avsluta."); int cmd = Keyboard.nextInt("Ange kommando (0-5): "); if (cmd == 0 ) { } else if (cmd == 1) { String name = Keyboard.nextLine("Namn: "); String nbr = Keyboard.nextLine("Nummer: "); System.out.println("\n"); String inlagd = "OK - " + name + " är nu inlagd."; String ejinlagd = name + " är redan inlagd."; test("Skapar nytt konto", register.insert(name, nbr) == true); System.out.println("\n"); } else if (cmd == 2) { } else if (cmd == 3) { } else if (cmd == 4) { } else if (cmd == 5) { System.out.println("\n"); register.printList(register.findAll()); System.out.println("\n"); } else { System.out.println("Inget giltigt kommando!"); System.out.println("\n"); } } }

    Read the article

  • Git on Windows: How do you set up a mergetool?

    - by Jake
    I've tried msysGit and Git on Cygwin. Both work just fine in and of themselves and both run gitk and git-gui perfectly. Now how the heck do I configure a mergetool? (Vimdiff works on Cygwin, but preferrably I would like something a little more user-friendly for some of our more... Windows-loving coworkers.) Thanks!

    Read the article

  • What is the delegate method that is called when an MKPinAnnotationView is touched?

    - by Jake Schwartz
    I have been searching for this all night and I have just so frustrated. When a MKPinAnnotationView is clicked, the name and the subtitle comes up. I also want to center that point on the view. I figured there was some method I had to override because the information that pops up happened without me having to code it. Hopefully this was clear enough for you all. And in the mean time, I feel like there is some hidden guide on this use of MKMaps and other classes. Either that or it is terribly documented because I am having a lot of trouble finding information. Thanks.

    Read the article

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