Search Results

Search found 1365 results on 55 pages for 'joe z'.

Page 29/55 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Using SHIFT_JIS text in PHP

    - by Joe Corkery
    I am building a form that needs to accept characters encoded in SHIFT_JIS and then send those results via email to a recipient. I've tried to simply capture the results from the $_POST variable and then to insert them into a block of text like this: $contents = <<<TEST Name: $NameJp ... TEST but that doesn't appear to work (which doesn't really surprise me). This is my first attempt at dealing with non-ASCII characters in PHP and I am hoping that people might have some suggestions. Perhaps I am missing a simple function to encode the text. Also, are there any other potential pitfalls that I might encounter? Thanks.

    Read the article

  • Why the macros in Objective-C / Cocoa?

    - by Joe
    I'm coming from a place without macros (Java/Python/C#/Scala) so perhaps my perspective is distorted but... Why are macros used in Cocoa? Two that spring to mind are NSLocalizedString and NSAssert (and STAssert). Would it be so hard / unsuitable to make them functions (which could be inlined)? I suppose I find them a little bizarre as an unnecessary throw-back to C (and yes, I am familiar with the pedigree of Obj-C). Is it just something that was done back in the day or is there a specific reason?

    Read the article

  • Can't seem to sign AWS Cloud Front URL properly

    - by Joe Corkery
    Hi everybody, I found a lot of detailed examples online on how to sign an Amazon CloudFront URL for private content. Unfortunately, whenever I implement these examples my URL doesn't seem to work. The resource path is correct because I can download the file when it is set for world read, but the URL doesn't work when set just for authorized users. The PHP code I am using is below. If anybody has any insights as to what I might be doing wrong (I'm guessing it is something obvious that I am just not seeing right now), it would be greatly appreciated. function urlCloudFront($resource) { $AWS_CF_KEY = 'APKA...'; $priv_key = file_get_contents(path_to_pem_file); $pkeyid = openssl_get_privatekey($priv_key); $expires = strtotime("+ 3 hours"); $policy_str = '{"Statement":[{"Resource":"'.$resource.'","Condition":{"DateLessThan":{"AWS:EpochTime":'.$expires.'}}}]}'; $policy_str = trim( preg_replace( '/\s+/', '', $policy_str ) ); $res = openssl_sign($policy_str, $signature, $pkeyid, OPENSSL_ALGO_SHA1); $signature_base64 = (base64_encode($signature)); $repl = array('+' => '-','=' => '_','/' => '~'); $signature_base64 = strtr($signature_base64,$repl); $url = $resource . '?Expires=' .$expires. '&Signature=' . $signature_base64 . '&Key-Pair-Id='. $AWS_CF_KEY; print '<p><A href="' .$url. '">Download VIDA (CloudFrount)</A>'; } urlCloudFront("http://mydistcloud.cloudfront.net/mydir/myfile.tar.gz"); Thanks.

    Read the article

  • how to dynamically break NHibernation cascade

    - by Joe Black
    The NHibernate cascade setting in the entity mapping is static. Is there anyway to dynamically disable the "cascade" setting in code to avoid expensive cascade operation in NHiberate during a bulky data transaction? We do not want to use stored procedures or native SQL because we need to have the entity changes captured by NHibernate (audit).

    Read the article

  • How does one advance in programming?

    - by Joe Barr
    I really have the felling as if I'm stuck in my own craft. I've been developing and learning for a while now and keep having the feeling that I should advance more, or even be more knowledgeable. I've started projects I didn't finish because I thought I lacked the knowledge and the skill to make that feature work just right, or to make that code magically appear on my screen. I've read books I didn't finish, thinking I wasn't advanced enough for the subjects they covered. I've been around long enough to know that everything comes with experience, hard work and dedication. Having said this, I just want to be able to work without getting stuck on a particular problem that involves my cluelessness of a language or a tool feature. My question to you would be, how does one advance in programming? What are the secrets (if any) to advance to the point of fluency in a particular language or a task. Thank you!

    Read the article

  • Javascript - Jquery .load() and setInterval() issue.

    - by Joe
    Let's say I do this: $("#content").load(...); Within what I'm loading some javascript is included: var myCounter = 0; var myInterval = setInterval(function(){ myCounter++; $("#counter-display").html("Count: "+myCounter); }); For an unknown reason, if I reload the content with $("#content").load(...); - myInterval is now being called twice. I tried doing something like: if (myInterval !== undefined){ //dont set interval again } However, it doesn't work. Does anyone know any method so that myInterval is cleared on .load, without needing to put the javascript outside of the loaded file?

    Read the article

  • Where to put to_xls and from_xls in a rails app

    - by Joe Arasin
    So I have a model that I need to be able to serialize to/read from an Excel(XLS) document. I am a bit of a loss as to where this code actually belongs. My initial thought is that the to_xls is a view, but after poking around and seeing things like (to|from)_xml and (to|from)_json in ActiveRecord, I was wondering if maybe this stuff belonged in the model. Alternatively, does it belong in just a whole separate container somewhere? For what it's worth, users will be downloading models from the site, modifying them in excel, then posting them.

    Read the article

  • Using XAML + designer to edit Plain Old CLR Objects?

    - by Joe White
    I want to write a POCO in XAML, and use a DataTemplate to display that object in the GUI at runtime. So far, so good; I know how to do all that. Since I'll already have a DataTemplate that can transform my POCO into a WPF visual tree, is there any way to get the Visual Studio designer to play along, and have the Design View show me the POCO+DataTemplate's resulting GUI, as I edit the POCO's XAML? (Obviously the designer wouldn't know how to edit the "design view"; I wouldn't expect the Toolbox or click-and-drag to work on the design surface. That's fine -- I just want to see a preview as I edit.) If you're curious, the POCOs in question would be level maps for a game. (At this point, I'm not planning to ship an end-user map editor, so I'll be doing all the editing myself in Visual Studio.) So the XAML isn't WPF GUI objects like Window and UserControl, but it's still not something where I would want to blindly bang out some XAML and hope for the best. I want to see what I'm doing (the GUI map) as I'm doing it. If I try to make a XAML file whose root is my map object, the designer shows "Intentionally Left Blank - The document root element is not supported by the visual designer." It does this even if I've defined a DataTemplate in App.xaml's <Application.Resources>. But I know the designer can show my POCO, when it's inside a WPF object. One possible way of accomplishing what I want would be to have a ScratchUserControl that just contains a ContentPresenter, and write my POCO XAML inside that ContentPresenter's Content property, e.g.: <UserControl ...> <ContentPresenter> <ContentPresenter.Content> <Maps:Map .../> </ContentPresenter.Content> </ContentPresenter> </UserControl> But then I would have to be sure to copy the content back out into its own file when I was done editing, which seems tedious and error-prone, and I don't like tedious and error-prone. And since I can preview my XAML this way, isn't there some way to do it without the UserControl?

    Read the article

  • Displaying same image multiple times at different locations in a web page using JavaScript or CSS

    - by Joe B
    I’m looking to create a web page with 6 coupons on it, two per line in a web space of 1275 X 1650. Each coupon space will consist of a different image. The problem is I will be creating 20 such web pages that will have these coupons on them. Now some of the same images will appear in different locations/positions on the various web pages. Is there a way to update the same image that appear in different locations/positions at the same time? And what language is used to complete this? I’ve tried CSS but it don’t think it’s possible. So should I be using JavaScript.

    Read the article

  • Inline assembler get address of pointer Visual Studio

    - by Joe
    I have a function in VS where I pass a pointer to the function. I then want to store the pointer in a register to further manipulate. How do you do that? I have tried void f(*p) { __asm mov eax, p // try one FAIL __asm mov eax, [p] // try two FAIL __asm mov eax, &p // try three FAIL } Both 1 and 2 are converted to the same code and load the value pointed to. I just want the address. Oddly, option 1 works just fine with integers. void f() { int i = 5; __asm mov eax, i // SUCCESS? }

    Read the article

  • Can Tomcat provide seperate (or HTTPS only) sessions for HTTPS requests?

    - by Joe
    I have a web application which contains both secure (SSL) and non-secure pages. A user can login to the site and must appear logged-in in both the SSL and non-SSL areas. (NB. SSL isn't implemented via Tomcat, but via Apache HTTPD servers which sit in front of Tomcat - so Tomcat has no SSL configuration.) The logged-in state is currently maintained via a servlet session (using Tomcat's vanilla session management). The obvious issue with this approach is that the JSESSIONID cookie is transported over both HTTP and HTTPS connections, meaning that it's potentially possible to intercept it and hijack the session. Are there any solutions to this without rolling our own session management (i.e. does Tomcat cater for this situation)? I'm prepared to implement our own session management, but don't want to reinvent something that may already be supported.

    Read the article

  • Getting key/value pairs from plist-style xml using simplexml in php

    - by Anthony
    Here is an example bit from the xml file: <array> <dict> <key>Name</key> <string>Joe Smith</string> <key>Type</key> <string>Profile</string> <key>Role</key> <string>User</string> <key>Some Number</key> <integer>1</integer> <key>Some Boolean</key> <true/> </dict> </array> I have two separate goals. The first is to extract an array from the dictnode that would look like: [Name] => Joe Smith [Type] => Profile [Role] => User [Some Number] => 1 [Some Boolean] => true It's not crucial that the boolean be included, so if that adds too much complexity, I'd rather just know how to deal with the others for now. The second goal is to be able to select the value node (<string>, <integer>,etc) so that I can change the value. I would need to select it based on the text value of the preceding key element. I think the following XPath should work: //key[.=$keyname]/following-sibling[1] But I'm not sure. Basically, this whole system that Apple uses seems logical, but totally contrary to the XML is supposed to work. If I ran the world, the original XML would look more like: <dict type="array"> <value key="Name" type="string">Joe Smith</value> <value key="Type" type="string">Profile</value> <value key="Role type="string">User</value> <value key="Some Number" type="integer">1</value> <value key="Some Boolean" type="boolean">true</value> </dict> But since it is fairly logical, I am wondering if I'm missing some obvious way of handling it.

    Read the article

  • string maniupulations, oops, how do I replace parts of a string

    - by Joe Gibson
    I am very new to python. Could someone explain how I can manipulate a string like this? This function receives three inputs: complete_fmla: has a string with digits and symbols but has no hyphens ('-') nor spaces. partial_fmla: has a combination of hyphens and possibly some digits or symbols, where the digits and symbols that are in it (other than hyphens) are in the same position as in the complete_formula. symbol: one character The output that should be returned is: If the symbol is not in the complete formula, or if the symbol is already in the partial formula, the function should return the same formula as the input partial_formula. If the symbol is in the complete_formula and not in the partial formula, the function should return the partial_formula with the symbol substituting the hyphens in the positions where the symbol is, in all the occurrences of symbol in the complete_formula. For example: generate_next_fmla (‘abcdeeaa’, ‘- - - - - - - - ’, ‘d’) should return ‘- - - d - - - -’ generate_next_fmla (‘abcdeeaa’, ‘- - - d - - - - ’, ‘e’) should return ‘- - - d e e - -’ generate_next_fmla (‘abcdeeaa’, ‘- - - d e e - - ’, ‘a’) should return ‘a - - d e e a a’ Basically, I'm working with the definition: def generate_next_fmla (complete_fmla, partial_fmla, symbol): Do I turn them into lists? and then append? Also, should I find out the index number for the symbol in the complete_fmla so that I know where to append it in the string with hyphens??

    Read the article

  • Java Data Structure

    - by Joe
    Hi there, I'm looking for a data structure that will act like a Queue so that I can hava First In First Out behaviour, but ideally I would also be able to see if an element exists in that Queue in constant time as you can do with a HashMap, rather than the linear time that you get with a LinkedList. I thought a LinkedHashMap might do the job, but although I could make an iterator and just take and then remove the first element of the iteration to produce a sort of poll() method, I'm wondering if there is a better way. Many thanks in advance

    Read the article

  • How to use Facebook graph API to retrieve fan photos uploaded to wall of fan page?

    - by Joe
    I am creating an external photo gallery using PHP and the Facebook graph API. It pulls thumbnails as well as the large image from albums on our Facebook Fan Page. Everything works perfect, except I'm only able to retrieve photos that an ADMIN posts to our page. (graph.facebook.com/myalbumid/photos) Is there a way to use graph api to load publicy uploaded photos from fans? I want to retrieve the pictures from the "Photos from" album, but trying to get the ID for the graph query is not like other albums... it looks like this: http://www.facebook.com/media/set/?set=o.116860675007039 Another note: The only way i've come close to retreiving this data is by using the "feed" option.. ie: graph.facebook.com/pageid/feed EDIT: This is about as far as I could get- it works, but has certain issues stated below. Maybe someone could expand on this, or provide a better solution. (Using FB PHP SDK) <?php require_once ('config.php'); // get all photos for album $photos = $facebook->api("/YourID/tagged"); $maxitem =10; $count = 0; foreach($photos['data'] as $photo) { if ($photo['type'] == "photo"): echo "<img src='{$photo['picture']}' />", "<br />"; endif; $count+= 1; if ($count >= "$maxitem") break; } ?> Issues with this: 1) The fact that I don't know a method for graph querying specific "types" of Tags, I had to run a conditional statement to display photos. 2) You cannot effectively use the "?limit=#" with this, because as I said the "tagged" query contains all types (photo, video, and status). So if you are going for a photo gallery and wish to avoid running an entire query by using ?limit, you will lose images. 3) The only content that shows up in the "tagged" query is from people that are not Admins of the page. This isn't the end of the world, but I don't understand why Facebook wouldn't allow yourself to be shown in this data as long as you posted it "as yourself" and not as the page.

    Read the article

  • How can I get Visual Studio 2010 to show Chinese comments properly

    - by Joe H
    I have some code from a Chinese business partner, but all of the comments in the code which are in Chinese. However, Visual Studio displays them as gibberish. How can I get them to display properly. Here is a code example with some comments converted to gibberish: //Á¬½Óµ½·þÎñÆ÷ void CTestAPIDlg::OnBnClickedButton2() { UpdateData(TRUE); //ÉèÖÃÊÇ·ñ¼Ç¼ÈÕÖ¾ m_ObjRSI->EnableLog(m_bIsOnLogReg,m_bIsOnLogComm); //ÅжÏÊÇ·ñÆôÓôúÀí if (m_bIsOnProxy) { //´úÀí²ÎÊý char proxyIP[64]; char proxyUserName[64]; char proxyUserPwd[64]; ZeroMemory(proxyIP,sizeof(proxyIP)); ZeroMemory(proxyUserName,sizeof(proxyUserName)); ZeroMemory(proxyUserPwd,sizeof(proxyUserPwd)); //×¢£º´Ë´¦ÒòΪÊÇʹÓÃunicode±àÒ룬ËùÒÔÒª×Ö·ûת»»£¬ÏÂͬ. WideCharToMultiByte(CP_ACP,0,m_strProxyIP,-1,proxyIP,64,NULL,NULL); WideCharToMultiByte(CP_ACP,0,m_strProxyUserName,-1,proxyUserName,64,NULL,NULL); WideCharToMultiByte(CP_ACP,0,m_strProxyPwd,-1,proxyUserPwd,64,NULL,NULL); //ÉèÖôúÀí²ÎÊý m_ObjRSI->SetProxyParam(proxyIP,m_iProxyPort,proxyUserName,proxyUserPwd,m_iProxyType); } //Á¬½Ó²ÎÊý char szIp[64]; ZeroMemory(szIp,sizeof(szIp)); WideCharToMultiByte(CP_ACP,0,m_strIP,-1,szIp,64,NULL,NULL); //Á¬½Ó·þÎñÆ÷ m_ObjRSI->SetCommParam(szIp,m_iPort,m_iCheckIDPort); m_ObjRSI->StartService(); //ÉèÖð´Å¥×´Ì¬ ((CButton*)GetDlgItem(IDC_CHECK2))->EnableWindow(FALSE); ((CButton*)GetDlgItem(IDC_CHECK3))->EnableWindow(FALSE); } Thanks in advance for any help...

    Read the article

  • Getting data from a ListView into an array

    - by Joe
    I have a ListView control on my form set up like this in details mode: What I would like to do, is get all the values of the data cells when the user presses the Delete booking button. So using the above example, my array would be filled with this data: values(0) = "asd" values(1) = "BS1" values(2) = "asd" values(3) = "21/04/2010" values(4) = "2" This is my code so far: Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim items As ListView.SelectedListViewItemCollection = _ Me.ManageList.SelectedItems Dim item As ListViewItem Dim values(0 To 4) As String Dim i As Integer = 0 For Each item In items values(i) = item.SubItems(i).Text i = i + 1 Next End Sub But only values(0) gets filled with the first data cell of the selection (in this case "asd") and the rest of the array entries are blank. I have confirmed this with a breakpoint and checked the array entries myself. I'm REALLY lost on this, and have been trying for about an hour now. Any help would be appreciated, thanks :) Also please note that there can only be one row selection at once. Thanks.

    Read the article

  • Rename PHP Downloaded File in File Downloader/Accelerator Applications

    - by Joe
    I have the following "download" script in PHP which basically makes an address on my website download the file for the user, eg. mysite.com/download.php?fileid=10 The question I have is, how can I send the file name to the used for the download when a user downloads the .php address with a File Downloaders/Accelerators? eg. "Content-Disposition" in this case makes the file called download.php where as I want it to be renamed to $downloadFileName as usual. // Set headers header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Description: File Transfer"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=\"".$downloadFileName."\""); header("Content-Transfer-Encoding: binary"); // Read the file from disk readfile($downloadLocation);

    Read the article

  • Memory efficient collection class

    - by Joe
    I'm building an array of dictionaries (called keys) in my iphone application to hold the section names and row counts for a tableview. the code looks like this: [self.results removeAllObjects]; [self.keys removeAllObjects]; NSUInteger i,j = 0; NSString *key = [NSString string]; NSString *prevKey = [NSString string]; if ([self.allResults count] > 0) { prevKey = [NSString stringWithString:[[[self.allResults objectAtIndex:0] valueForKey:@"name"] substringToIndex:1]]; for (NSDictionary *theDict in self.allResults) { key = [NSString stringWithString:[[theDict valueForKey:@"name"] substringToIndex:1]]; if (![key isEqualToString:prevKey]) { NSDictionary *newDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:i],@"count", prevKey,@"section", [NSNumber numberWithInt:j], @"total",nil]; [self.keys addObject:newDictionary]; prevKey = [NSString stringWithString:key]; i = 1; } else { i++; } j++; } NSDictionary *newDictionary = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:i],@"count", prevKey,@"section", [NSNumber numberWithInt:j], @"total",nil]; [self.keys addObject:newDictionary]; } [self.tableview reloadData]; The code works fine first time through but I sometimes have to rebuild the entire table so I redo this code which orks fine on the simulator, but on my device the program bombs when I execute the reloadData line : malloc: *** mmap(size=3772944384) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug malloc: *** mmap(size=3772944384) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug Program received signal: “EXC_BAD_ACCESS”. If I remove the reloadData line the code works on the device. I'm wondering if this is something to do with the way I've built the keys array (ie using autoreleased strings and dictionaries).

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >