Search Results

Search found 3484 results on 140 pages for 'chris dubois'.

Page 78/140 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • How do I sort a multidimensional hash array by a key maybe three levels in, in PHP?

    - by Chris Denman
    I am moving from Perl to PHP and am struggling to get my head around PHP sorting. Here's what I have in Perl: $log{12345}{0}{20100102}{name}='blah'; $log{54312}{1}{20100101}{name}='blah'; $log{14323}{3}{20100103}{name}='blah'; foreach $entry (sort {$log{$cook}{$a}{time} cmp $log{$cook}{$b}{time}} keys %{$log{$cook}}){ ... } Basically, I would have the same array structure in PHP but want to sort like I do above.

    Read the article

  • markitup wysiwyg with a standard HTML form

    - by Chris
    Hi, I'm trying to use the markitup editor on my site and I'm having a problem trying to figure out what I need to do to submit the text area to my server side script. I'm guessing there is something simple that needs to be done but my lack of JS/JQuery knowledge is making it really hard to find a answer The editor works fine, I just want to use my own form and submit button with it, however when I try to submit the form I don't get any of the textarea data in my script. Any idea what I need to do? This is the min that works (before submit) In the Head of my HTML <script type="text/javascript" > <!-- $(document).ready(function() { $("#markItUp").markItUp(mySettings); }); --> </script> And the body: <form id="postpreview" name="newpost" action="/someurl" method="POST" /> <input type="hidden" name="key1" value="val1" /> <input type="hidden" name="key2" value="val2" /> <textarea name="text" id="markItUp"></textarea> <input id="SubmitPost" type="image" value="Continue" name="Doit" class="preview" src="/img/somimage" /> </form> As I said, everything prior to the submit works but once I submit I don't get anything for the form data element "text". I tried doing this in the head: <script type="text/javascript" > <!-- $(document).ready(function() { $("#markItUp").markItUp(mySettings); $("#SubmitPost").click(function(){ data = markItUp.textarea.value; $.post("scripturl",{ key1: "value1", key2: "value2", text: data }); }); }); --> </script> I've also tried: <script type="text/javascript" > <!-- $(document).ready(function() { $("#markItUp").markItUp(mySettings); $("#postpreview").submit(function(){ var data = $("#markItUp").html(); $.post("live",{ func: "posting", text: data }); return false; }); }); --> </script> And I have no luck - the last attempt above just disabled the form (so clicking on the submit or preview buttons did nothing). Any ideas? I guessing its really simple to use my own form but I have no clue how to do it. TIA!

    Read the article

  • Using sectioned tables from an sqlite file with an iPhone uitableview

    - by Chris
    I am currently trying to make a sectioned table like this: Section 1: Entry 1 Entry 2 Entry 3 Section 2: Entry 4 Entry 5 Entry 6 Section 3: Entry 7 Entry 8 ... However, using this code: Event *lists = (Event *)[eventList objectAtIndex:indexPath.row]; accessStatement = "select * from DatabaseName"; [self findEvents]; // Code that builds each object's strings from database cell.textLabel.text = lists.name; Section 1: Entry 1 Entry 2 Entry 3 Section 2: Entry 1 Entry 2 Entry 3 Section 3: Entry 1 Entry 2 ... It keeps on repeating itself. How do I make the index so that it continues in each section rather than restarts? Thanks in advance.

    Read the article

  • ASM programming, how to use loop?

    - by chris
    Hello. Im first time here.I am a college student. I've created a simple program by using assembly language. And im wondering if i can use loop method to run it almost samething as what it does below the program i posted. and im also eager to find someome who i can talk through MSN messanger so i can ask you questions right away.(if possible) ok thank you .MODEL small .STACK 400h .data prompt db 10,13,'Please enter a 3 digit number, example 100:',10,13,'$' ;10,13 cause to go to next line first_digit db 0d second_digit db 0d third_digit db 0d Not_prime db 10,13,'This number is not prime!',10,13,'$' prime db 10,13,'This number is prime!',10,13,'$' question db 10,13,'Do you want to contine Y/N $' counter dw 0d number dw 0d half dw ? .code Start: mov ax, @data ;establish access to the data segment mov ds, ax mov number, 0d LetsRoll: mov dx, offset prompt ; print the string (please enter a 3 digit...) mov ah, 9h int 21h ;execute ;read FIRST DIGIT mov ah, 1d ;bios code for read a keystroke int 21h ;call bios, it is understood that the ascii code will be returned in al mov first_digit, al ;may as well save a copy sub al, 30h ;Convert code to an actual integer cbw ;CONVERT BYTE TO WORD. This takes whatever number is in al and ;extends it to ax, doubling its size from 8 bits to 16 bits ;The first digit now occupies all of ax as an integer mov cx, 100d ;This is so we can calculate 100*1st digit +10*2nd digit + 3rd digit mul cx ;start to accumulate the 3 digit number in the variable imul cx ;it is understood that the other operand is ax ;AND that the result will use both dx::ax ;but we understand that dx will contain only leading zeros add number, ax ;save ;variable <number> now contains 1st digit * 10 ;---------------------------------------------------------------------- ;read SECOND DIGIT, multiply by 10 and add in mov ah, 1d ;bios code for read a keystroke int 21h ;call bios, it is understood that the ascii code will be returned in al mov second_digit, al ;may as well save a copy sub al, 30h ;Convert code to an actual integer cbw ;CONVERT BYTE TO WORD. This takes whatever number is in al and ;extends it to ax, boubling its size from 8 bits to 16 bits ;The first digit now occupies all of ax as an integer mov cx, 10d ;continue to accumulate the 3 digit number in the variable mul cx ;it is understood that the other operand is ax, containing first digit ;AND that the result will use both dx::ax ;but we understand that dx will contain only leading zeros. Ignore them add number, ax ;save -- nearly finished ;variable <number> now contains 1st digit * 100 + second digit * 10 ;---------------------------------------------------------------------- ;read THIRD DIGIT, add it in (no multiplication this time) mov ah, 1d ;bios code for read a keystroke int 21h ;call bios, it is understood that the ascii code will be returned in al mov third_digit, al ;may as well save a copy sub al, 30h ;Convert code to an actual integer cbw ;CONVERT BYTE TO WORD. This takes whatever number is in al and ;extends it to ax, boubling its size from 8 bits to 16 bits ;The first digit now occupies all of ax as an integer add number, ax ;Both my variable number and ax are 16 bits, so equal size mov ax, number ;copy contents of number to ax mov cx, 2h div cx ;Divide by cx mov half, ax ;copy the contents of ax to half mov cx, 2h; mov ax, number; ;copy numbers to ax xor dx, dx ;flush dx jmp prime_check ;jump to prime check print_question: mov dx, offset question ;print string (do you want to continue Y/N?) mov ah, 9h int 21h ;execute mov ah, 1h int 21h ;execute cmp al, 4eh ;compare je Exit ;jump to exit cmp al, 6eh ;compare je Exit ;jump to exit cmp al, 59h ;compare je Start ;jump to start cmp al, 79h ;compare je Start ;jump to start prime_check: div cx; ;Divide by cx cmp dx, 0h ;reset the value of dx je print_not_prime ;jump to not prime xor dx, dx; ;flush dx mov ax, number ;copy the contents of number to ax cmp cx, half ;compare half with cx je print_prime ;jump to print prime section inc cx; ;increment cx by one jmp prime_check ;repeat the prime check print_prime: mov dx, offset prime ;print string (this number is prime!) mov ah, 9h int 21h ;execute jmp print_question ;jumps to question (do you want to continue Y/N?) this is for repeat print_not_prime: mov dx, offset Not_prime ;print string (this number is not prime!) mov ah, 9h int 21h ;execute jmp print_question ;jumps to question (do you want to continue Y/N?) this is for repeat Exit: mov ah, 4ch int 21h ;execute exit END Start

    Read the article

  • Storing a SHA512 Password Hash in Database

    - by Chris
    In my ASP.NET web app I'm hashing my user passwords with SHA512. Despite much SO'ing and Googling I'm unclear how I should be storing them in the database (SQL2005) - the code below shows the basics of how I'm creating the hash as a string and I'm currently inserting it into the database into a Char(88) column as that seems to be the length created consistently Is holding it as a String the best way to do it, if so will it always be 88 chars on a SHA512 (as I have seen some bizarre stuff on Google)? Dim byteInput As Byte() = Encoding.UTF8.GetBytes(sSalt & sInput) Dim hash As HashAlgorithm = New SHA512Managed() Dim sInsertToDatabase As String = Convert.ToBase64String(hash.ComputeHash(byteInput))

    Read the article

  • What's the right way to calculate derived data in a Flex AdvancedDataGrid using summaries?

    - by Chris R
    Here's the gist of the problem: I have a set of rows of data with (say) field1 to field4 in them. I'm using a GroupingCollection to group on field1 and field2. So, I have something like this: f1.1 f2.1 f3.1 f4.1 f3.2 f4.2 f2.2 f3.3 f4.3 f3.4 f4.4 f3.5 f4.5 f1.2 f2.1 f3.6 f4.6 f2.2 f3.7 f4.7 f3.8 f4.8 f3.9 f4.9 (or at least, I hope that's clear enough) I need to calculate some derived values for each leaf row, for example f3, that is the ratio of f3 to the average of all f3 in that particular part of the tree. So, for f3.7 I need to calculate f3.7 / avg(f3.7..f3.9) and fill that into the f3_index property on the row, displaying that in lieu of f3 itself. So, basically, what it looks like I have to do is add source field values in the summarizeFunction implementation. It seems to me that there must be a better way of doing this. Is there?

    Read the article

  • Difficulties using custom control - RichTextEditor

    - by Chris
    I am working on a school project that uses ASP.NET. I found this TextEditor control ( http://blogs.msdn.com/kirti/archive/2007/11/10/rich-text-editor-is-here.aspx ) that I am trying to include but it isn't working. The error I am getting is: Error Rendering Control - TextEditor. An unhandled exception has occurred. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index. I see this error when I go Design part of the editor. I just don't understand this error at all. Also I am a lil bit confused as there is no parameter called index. :( What I have done is reference the binary in my project and then on the page I am trying to use it have registered its namespace and assembly with this line: <%@ Register Assembly="RichTextEditor" Namespace="AjaxControls" TagPrefix="rtt" %> I then go ahead and try to add the control to the page with this line of code: <rtt:richtexteditor ID="TextEditor" Theme="Blue" runat="server" /> Any help would be much appreciated. I haven't done anything like add a custom control before.

    Read the article

  • Why does Java's invokevirtual need to resolve the called method's compile-time class?

    - by Chris
    Consider this simple Java class: class MyClass { public void bar(MyClass c) { c.foo(); } } I want to discuss what happens on the line c.foo(). At the bytecode level, the meat of c.foo() will be the invokevirtual opcode, and, according to the documentation for invokevirtual, more or less the following will happen: Look up the foo method defined in compile-time class MyClass. (This involves first resolving MyClass.) Do some checks, including: Verify that c is not an initialization method, and verify that calling MyClass.foo wouldn't violate any protected modifiers. Figure out which method to actually call. In particular, look up c's runtime type. If that type has foo(), call that method and return. If not, look up c's runtime type's superclass; if that type has foo, call that method and return. If not, look up c's runtime type's superclass's superclass; if that type has foo, call that method and return. Etc.. If no suitable method can be found, then error. Step #3 alone seems adequate for figuring out which method to call and verifying that said method has the correct argument/return types. So my question is why step #1 gets performed in the first place. Possible answers seem to be: You don't have enough information to perform step #3 until step #1 is complete. (This seems implausible at first glance, so please explain.) The linking or access modifier checks done in #1 and #2 are essential to prevent certain bad things from happening, and those checks must be performed based on the compile-time type, rather than the run-time type hierarchy. (Please explain.)

    Read the article

  • Howto install distribute for Python 3

    - by chris.nullptr
    I am trying to install distribute using ActivePython 3.1.2 on Windows. Running python distribute_setup.py as described at the cheese shop give me: No setuptools distribution found running install ... File "build\src\setuptools\command\easy_install.py", line 16, in <module> from setuptools.sandbox import run_setup File "build\src\setuptools\sandbox.py", line 164, in <module> fromlist=['__name__']).__file__) AttributeError: 'module' object has no attribute '__file__' Something went wrong during the installation. See the error message above. Is there possibly an unknown dependency that I'm missing?

    Read the article

  • Applications for the Church Programming Language

    - by Chris S
    Has anyone worked with the programming language Church? Can anyone recommend practical applications? I just discovered it, and while it sounds like it addresses some long-standing problems in AI and machine-learning, I'm sceptical. I had never heard of it, and was surprised to find it's actually been around for a few years, having been announced in the paper Church: a language for generative models.

    Read the article

  • What is the point of JComboBox's getSelectedItem()?

    - by Chris Cooper
    I just read the JavaDoc for JComboBox (I promise I have a life... I wasn't reading through for fun. =P), and I think the problems I'm having with my program can be attributed to the getSelectedItem() method. The documentation says: Returns the current selected item. If the combo box is editable, then this value may not have been added to the combo box with addItem, insertItemAt or the data constructors. If you can't get values that were added with those methods or with the constructor, of what use is the method? And how can I get the value from an "editable" JComboBox? Link to JavaDoc: http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComboBox.html#getSelectedItem()

    Read the article

  • Magento loadByAttribute for Custom Category Attributes

    - by Chris
    I have created custom attributes for a category in my module's install script like so: $attrib = array( 'type' => 'varchar', 'group' => 'My Data', 'backend' => '', 'frontend' => '', 'label' => 'My Custom Field', 'input' => 'text', 'class' => '', 'source' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'visible' => true, 'required' => false, 'user_defined' => false, 'default' => '', 'searchable' => false, 'filterable' => false, 'comparable' => false, 'visible_on_front' => false, 'unique' => true, ); $installer->addAttribute(3, 'custom_field', $attrib); The field shows up fine in the admin, and when I create the category in my script like so: $p_category = Mage::getModel('catalog/category') ->setStoreId(0) ->load(2); $category = Mage::getModel('catalog/category'); $category->setStoreId(0) ->setName('Test Category') ->setCustomField('abcd') ->setDisplayMode('PRODUCTS') ->setAttributeSetId($category->getDefaultAttributeSetId()) ->setIsActive(1) ->setIsAnchor(1) ->setPath(implode('/',$p_category->getPathIds())) ->setInitialSetupFlag(true) ->save(); I can see the value 'abcd' in the Magneto admin interface. But when I call the code below: <?php $category = Mage::getModel('catalog/category')->loadByAttribute('custom_field', 'abcd'); print_r($category); ?> I get no result. But if I loadByAttribute using the 'name' field set to 'Test Category', I DO get a result. So, in the database, I looked into the catalog_category_entity_varchar table and noticed that the 'name' attribute had an entry for both store_id = 0 AND store_id = 1 whereas the 'custom_field' attribute had only an entry for store_id = 1. When I added a store_id = 0 entry for 'custom_field' with the value set to 'abcd' in the catalog_category_entity_varchar table, loadByAttribute got the expected result. My question is, why is the 'name' field getting a store_id = 0 entry in catalog_category_entity_varchar and my custom field is not? How do I load categories by custom attributes?

    Read the article

  • Jquery button.click bug?

    - by Chris
    I have the following home-grown jquery plugin: (function($) { $.fn.defaultButton = function(button) { var field = $(this); var target = $(button); if (field.attr('type').toLowerCase() != 'text') return; field.keydown(function (e) { if ((e.which || e.keyCode) == 13) { console.log('enter'); target.click(); return false; } }); } })(jQuery); I'm using it like so: $('#SignUpForm input').defaultButton('#SignUpButton'); $('#SignUpButton').click(function(e) { console.log('click'); $.ajax({ type: 'post', url: '<%=ResolveUrl("~/WebServices/ForumService.asmx/SignUp")%>', contentType: 'application/json; charset=utf-8', dataType: 'json', data: JSON.stringify({ email: $('#SignUpEmail').val(), password: $('#SignUpPassword').val() }), success: function(msg) { $.modal.close(); } }); }); The first time, it works. The second time, nothing happens. I see enter and click the first time in the firebug log, but the second time I only see the enter message. It's almost like the button's click handler is being unregistered somehow. Any thoughts?

    Read the article

  • Delphi hook to redirect to different ip

    - by Chris
    What is the best way to redirect ANY browser to a different ip for specific sites? For example if the user will type www.facebook.com in any browser he will be redirected to 127.0.0.1. Also the same should happen if he will type 66.220.146.11. What I have until now is this: using the winpkfilter I am able to intercept all the traffic on port 80, with type(in or out), source ip, destination ip and packet. My problem is to modify somehow the packet so the browser will be redirected. This is the code that i have right now: program Pass; {$APPTYPE CONSOLE} uses SysUtils, Windows, Winsock, winpkf, iphlp; var iIndex, counter : DWORD; hFilt : THANDLE; Adapts : TCP_AdapterList; AdapterMode : ADAPTER_MODE; Buffer, ParsedBuffer : INTERMEDIATE_BUFFER; ReadRequest : ETH_REQUEST; hEvent : THANDLE; hAdapter : THANDLE; pEtherHeader : TEtherHeaderPtr; pIPHeader : TIPHeaderPtr; pTcpHeader : TTCPHeaderPtr; pUdpHeader : TUDPHeaderPtr; SourceIP, DestIP : TInAddr; thePacket : PChar; f : TextFile; SourceIpString, DestinationIpString : string; SourceName, DestinationName : string; function IPAddrToName(IPAddr : string) : string; var SockAddrIn : TSockAddrIn; HostEnt : PHostEnt; WSAData : TWSAData; begin WSAStartup($101, WSAData); SockAddrIn.sin_addr.s_addr := inet_addr(PChar(IPAddr)); HostEnt := gethostbyaddr(@SockAddrIn.sin_addr.S_addr, 4, AF_INET); if HostEnt < nil then begin result := StrPas(Hostent^.h_name) end else begin result := ''; end; end; procedure ReleaseInterface(); begin // Restore default mode AdapterMode.dwFlags := 0; AdapterMode.hAdapterHandle := hAdapter; SetAdapterMode(hFilt, @AdapterMode); // Set NULL event to release previously set event object SetPacketEvent(hFilt, hAdapter, 0); // Close Event if hEvent < 0 then CloseHandle(hEvent); // Close driver object CloseFilterDriver(hFilt); // Release NDISAPI FreeNDISAPI(); end; begin // Check the number of parameters if ParamCount() < 2 then begin Writeln('Command line syntax:'); Writeln(' PassThru.exe index num'); Writeln(' index - network interface index.'); Writeln(' num - number or packets to filter'); Writeln('You can use ListAdapters to determine correct index.'); Exit; end; // Initialize NDISAPI InitNDISAPI(); // Create driver object hFilt := OpenFilterDriver('NDISRD'); if IsDriverLoaded(hFilt) then begin // Get parameters from command line iIndex := StrToInt(ParamStr(1)); counter := StrToInt(ParamStr(2)); // Set exit procedure ExitProcessProc := ReleaseInterface; // Get TCP/IP bound interfaces GetTcpipBoundAdaptersInfo(hFilt, @Adapts); // Check paramer values if iIndex > Adapts.m_nAdapterCount then begin Writeln('There is no network interface with such index on this system.'); Exit; end; hAdapter := Adapts.m_nAdapterHandle[iIndex]; AdapterMode.dwFlags := MSTCP_FLAG_SENT_TUNNEL or MSTCP_FLAG_RECV_TUNNEL; AdapterMode.hAdapterHandle := hAdapter; // Create notification event hEvent := CreateEvent(nil, TRUE, FALSE, nil); if hEvent <> 0 then if SetPacketEvent(hFilt, hAdapter, hEvent) <> 0 then begin // Initialize request ReadRequest.EthPacket.Buffer := @Buffer; ReadRequest.hAdapterHandle := hAdapter; SetAdapterMode(hFilt, @AdapterMode); counter := 0; //while counter <> 0 do while true do begin WaitForSingleObject(hEvent, INFINITE); while ReadPacket(hFilt, @ReadRequest) <> 0 do begin //dec(counter); pEtherHeader := TEtherHeaderPtr(@Buffer.m_IBuffer); if ntohs(pEtherHeader.h_proto) = ETH_P_IP then begin pIPHeader := TIPHeaderPtr(Integer(pEtherHeader) + SizeOf(TEtherHeader)); SourceIP.S_addr := pIPHeader.SourceIp; DestIP.S_addr := pIPHeader.DestIp; if pIPHeader.Protocol = IPPROTO_TCP then begin pTcpHeader := TTCPHeaderPtr(Integer(pIPHeader) + (pIPHeader.VerLen and $F) * 4); if (pTcpHeader.SourcePort = htons(80)) or (pTcpHeader.DestPort = htons(80)) then begin inc(counter); if Buffer.m_dwDeviceFlags = PACKET_FLAG_ON_SEND then Writeln(counter, ') - MSTCP --> Interface') else Writeln(counter, ') - Interface --> MSTCP'); Writeln(' Packet size = ', Buffer.m_Length); Writeln(Format(' IP %.3u.%.3u.%.3u.%.3u --> %.3u.%.3u.%.3u.%.3u PROTOCOL: %u', [byte(SourceIP.S_un_b.s_b1), byte(SourceIP.S_un_b.s_b2), byte(SourceIP.S_un_b.s_b3), byte(SourceIP.S_un_b.s_b4), byte(DestIP.S_un_b.s_b1), byte(DestIP.S_un_b.s_b2), byte(DestIP.S_un_b.s_b3), byte(DestIP.S_un_b.s_b4), byte(pIPHeader.Protocol)] )); Writeln(Format(' TCP SRC PORT: %d DST PORT: %d', [ntohs(pTcpHeader.SourcePort), ntohs(pTcpHeader.DestPort)])); //get the data thePacket := pchar(pEtherHeader) + (sizeof(TEtherHeaderPtr) + pIpHeader.VerLen * 4 + pTcpHeader.Offset * 4); { SourceIpString := IntToStr(byte(SourceIP.S_un_b.s_b1)) + '.' + IntToStr(byte(SourceIP.S_un_b.s_b2)) + '.' + IntToStr(byte(SourceIP.S_un_b.s_b3)) + '.' + IntToStr(byte(SourceIP.S_un_b.s_b4)); DestinationIpString := IntToStr(byte(DestIP.S_un_b.s_b1)) + '.' + IntToStr(byte(DestIP.S_un_b.s_b2)) + '.' + IntToStr(byte(DestIP.S_un_b.s_b3)) + '.' + IntToStr(byte(DestIP.S_un_b.s_b4)); } end; end; end; // if ntohs(pEtherHeader.h_proto) = ETH_P_RARP then // Writeln(' Reverse Addr Res packet'); // if ntohs(pEtherHeader.h_proto) = ETH_P_ARP then // Writeln(' Address Resolution packet'); //Writeln('__'); if Buffer.m_dwDeviceFlags = PACKET_FLAG_ON_SEND then // Place packet on the network interface SendPacketToAdapter(hFilt, @ReadRequest) else // Indicate packet to MSTCP SendPacketToMstcp(hFilt, @ReadRequest); { if counter = 0 then begin Writeln('Filtering complete'); readln; break; end; } end; ResetEvent(hEvent); end; end; end; end.

    Read the article

  • Where specifically do UIImageWriteToSavePhotosAlbum or UISaveVideoAtPathToSavedPhotosAlbum save thei

    - by Chris Markle
    Simple question I think and I'll be trying ot myself to see... When people talk about using UIImageWriteToSavePhotosAlbum or UISaveVideoAtPathToSavedPhotosAlbum is the "saved photos album" the "Camera Roll" or the "Photo Library" (or something else either than these two) that I see in the Photo Albums application? I don't think the doc makes it super-explicit as to which it is...

    Read the article

  • Unable to capture standard output of process using Boost.Process

    - by Chris Kaminski
    Currently am using Boost.Process from the Boost sandbox, and am having issues getting it to capture my standard output properly; wondering if someone can give me a second pair of eyeballs into what I might be doing wrong. I'm trying to take thumbnails out of RAW camera images using DCRAW (latest version), and capture them for conversion to QT QImage's. The process launch function: namespace bf = ::boost::filesystem; namespace bp = ::boost::process; QImage DCRawInterface::convertRawImage(string path) { // commandline: dcraw -e -c <srcfile> -> piped to stdout. if ( bf::exists( path ) ) { std::string exec = "bin\\dcraw.exe"; std::vector<std::string> args; args.push_back("-v"); args.push_back("-c"); args.push_back("-e"); args.push_back(path); bp::context ctx; ctx.stdout_behavior = bp::capture_stream(); bp::child c = bp::launch(exec, args, ctx); bp::pistream &is = c.get_stdout(); ofstream output("C:\\temp\\testcfk.jpg"); streamcopy(is, output); } return (NULL); } inline void streamcopy(std::istream& input, std::ostream& out) { char buffer[4096]; int i = 0; while (!input.eof() ) { memset(buffer, 0, sizeof(buffer)); int bytes = input.readsome(buffer, sizeof buffer); out.write(buffer, bytes); i++; } } Invoking the converter: DCRawInterface DcRaw; DcRaw.convertRawImage("test/CFK_2439.NEF"); The goal is to simply verify that I can copy the input stream to an output file. Currently, if I comment out the following line: args.push_back("-c"); then the thumbnail is written by DCRAW to the source directory with a name of CFK_2439.thumb.jpg, which proves to me that the process is getting invoked with the right arguments. What's not happening is connecting to the output pipe properly. FWIW: I'm performing this test on Windows XP under Eclipse 3.5/Latest MingW (GCC 4.4).

    Read the article

  • [ASP.NET] Difficulties using custom control - RichTextEditor

    - by Chris
    I am working on a school project that uses ASP.NET. I found this TextEditor control ( http://blogs.msdn.com/kirti/archive/2007/11/10/rich-text-editor-is-here.aspx ) that I am trying to include but it isn't working. The error I am getting is: Error Rendering Control - TextEditor. An unhandled exception has occurred. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index. I see this error when I go Design part of the editor. I just don't understand this error at all. Also I am a lil bit confused as there is no parameter called index. :( What I have done is reference the binary in my project and then on the page I am trying to use it have registered its namespace and assembly with this line: <%@ Register Assembly="RichTextEditor" Namespace="AjaxControls" TagPrefix="rtt" %> I then go ahead and try to add the control to the page with this line of code: <rtt:richtexteditor ID="TextEditor" Theme="Blue" runat="server" /> Any help would be much appreciated. I haven't done anything like add a custom control before.

    Read the article

  • Windows batch files: .bat vs .cmd?

    - by Chris Noe
    As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the same using either suffix. Assuming that my code will never need to run on anyhting older than NT, does it really matter which way I name my batch files, or is there some gotcha awaiting me by using the wrong suffix?

    Read the article

  • Extending User object in Django: User model inheritance or use UserProfile?

    - by Chris
    To extend the User object with custom fields, the Django docs recommend using UserProfiles. However, according to this answer to a question about this from a year or so back: extending django.contrib.auth.models.User also works better now -- ever since the refactoring of Django's inheritance code in the models API. And articles such as this lay out how to extend the User model with custom fields, together with the advantages (retrieving properties directly from the user object, rather than through the .get_profile()). So I was wondering whether there is any consensus on this issue, or reasons to use one or the other. Or even what the Django team currently think?

    Read the article

  • multiple polls with email submit function

    - by Chris Mousdale
    I want to add a 4 sets of polls that each have around 4 radio buttons each for answers - then i would like to add an 'enter your email address' field below these polls. Finally I would like the submit button after the email field to 'submit' the data from the polls and the email address entered - so only one submit button. Just to make things even better, I would like some form of validation, that will not pass the form unless all 4 polls have a radio button pressed and a valid email. All this is then to go into a MySQL database. I have the email validation bit nailed - so thats fine.. it's the multiple polls bit thats getting me - I cannot get it to work?! Do i have to effectively add 5 forms? Any help would be greatly appreciated.

    Read the article

  • HMAC SHA1 ColdFusion

    - by Chris
    Please help! I have been pulling out my hair over this one. :) I have a site that I need to HMAC SHA1 for authentication. It currently works with another language but now I need to move it to ColdFusion. For the life of me I cannot get the strings to match. Any assistance would be much appreciated. Data: https%3A%2F%2Fwww%2Etestwebsite%2Ecom%3Fid%3D5447 Key: 265D5C01D1B4C8FA28DC55C113B4D21005BB2B348859F674977B24E0F37C81B05FAE85FB75EA9CF53ABB9A174C59D98C7A61E2985026D2AA70AE4452A6E3F2F9 Correct answer: WJd%2BKxmFxGWdbw4xQJZXd3%2FHkFQ%3d My answer: knIVr6wIt6%2Fl7mBJPTTbwQoTIb8%3d Both are Base64 encoded and then URL encoded.

    Read the article

  • Anybody got a C# function that maps the SQL datatype of a column to its CLR equivalent?

    - by Chris McCall
    I'm sitting down to write a massive switch() statement to turn SQL datatypes into CLR datatypes in order to generate classes from MSSQL stored procedures. I'm using this chart as a reference. Before I get too far into what will probably take all day and be a huge pain to fully test, I'd like to call out to the SO community to see if anyone else has already written or found something in C# to accomplish this seemingly common and assuredly tedious task.

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >