Daily Archives

Articles indexed Wednesday April 28 2010

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

  • Is there a DOS command for verifying what version of .NET is installed

    - by Travis
    I have set of scripts for doing scripted installs. You can use the scripts on any server 2008 machine. However, I need to check if .NET 3.5 has been installed (before the scripts run) using a dos batch file. Is that possible? I know I can check if a file in the C:\WINDOWS\Microsoft.NET\Framework\v3.5 exists, but it would be nice to have something a little more reliable. I would like to check if it's actually installed, not just if the dir/file exists. Hope that makes sense. Thanks in advance.

    Read the article

  • REST API unauthenticated requests exception based on the User-Agent

    - by Shay Tsadok
    Hi All, I am developing a REST API that supports two kinds of authentication protocols: login form authentication - for browser based clients. Simple Basic authentication - for non-browser clients. I developed a flow in which unauthenticated requests redirected to the "login form", the problem is that this is an undesired behavior for non-borwser clients! I thought to solve it by decide according to the "User-Agent" what to do: browsers will be redirected to the "login form" and non-browser clients will get the standard 401:Basic Authentication. A. What do you think about this solution? B. Is there a standard way in Java to check if the request came from browser, or do i need to develop this kind of mechanism by my own? Thanks in advance!

    Read the article

  • How do I use the iPhone Simulator in 3.2 (not iPad Simulator)

    - by JustinXXVII
    I'm fixing my app to be a universal binary. Testing on the simulator seems to default to the iPad. For small corrections like checking orientations and small UI updates, the only way I can find to get the iPhone version is to plug in my iPhone and build and run on device. Loading the debugger takes valuable time, when running on simulator is so much faster for this kind of work. Can I set the simulator to default to iPhone for this? Setting it to 3.1.3 doesn't work because of the 3.2 code I have in the binary for the iPad.

    Read the article

  • The jsf2 h:outputText tag is not formating the h:outputText with the MessageFormat

    - by Thiago Diniz
    The jsf2 h:outputText tag is not formating the h:outputText with the MessageFormat my faces config <application> <resource-bundle> <base-name>Messages_pt_BR</base-name> <var>bundle</var> </resource-bundle> </application> My resource bundle: ... EventPageTitle=Event: {0} ... My JSF2 XHTML: <h:outputText value="#{bundle.EventPageTitle}" > <f:param value="#{seuTicketEventController.selected.eventName}"/> </h:outputText> The Output: Event: {0} Does anyone knows how to solve this problem? I have searched everywhere but i can't a solution!

    Read the article

  • Android: Filtering a SimpleCursorAdapter ListView

    - by Diego Tori
    Right now, I'm running into issues trying to implement a FilterQueryProvider in my custom SimpleCursorAdapter, since I'm unsure of what to do in the FilterQueryProvider's runQuery function. In other words, since the query that comprises my ListView basically gets the rowID, name, and a third column from my databases's table, I want to be able to filter the cursor based on the partial value of the name column. However, I am uncertain of whether I can do this directly from runQuery without expanding my DB class since I want to filter the existing cursor, or will I have to create a new query function in my DB class that partially searches my name column, and if so, how would I go about creating the query statement while using the CharSequence constraint argument in runQuery? I am also concerned about the performance issues associated with trying to run multiple queries based on partial text since the DB table in question has about 1300-1400 rows. In other words, would I run into a bottleneck trying to filter the cursor?

    Read the article

  • Android TextView formating.

    - by Tarmon
    Hey Everyone, I am trying to implement a TextView that is serving as a header for a ListView. I want to format it so that I have basically a title centered on the first line and then additional information on the lines following. How can I format the text/string to create this kind of formatting? Thanks, Rob

    Read the article

  • How Can I ReWrite flat link to a dynamic link and preserve the Query string?

    - by jeremysawesome
    Hello All, I am wanting to rewrite a url like: http://my.project/mydomain.com/ANY_NUMBER_OF_CATEGORIES/designer/4/designer-name/page.html to this: http://my.projects/mydomain.com/ANY_NUMBER_OF_CATEGORIES/page.html?designer=4 I would like to use mod-rewrite to accomplish this. Things to note: Any number of categories can be between 'mydomain.com/' and '/designer'. For instance the url could be http://my.project/mydomain.com/designer/4/designer-name/page.html or it could be http://my.project/mydomain.com/tops/shirts/small/designer/4/designer-name/page.html A query string may be provided in the original url that needs to be preserved in the rewritten url. For example url provided could be: http://my.project/mydomain.com/designer/4/designer-name/page.html?color=red&type=shirt Given the url above the resulting url would need to be: http://my.projects/mydomain.com/page.html?designer=4&color=red&type=shirt The order of the query string does not matter. The 'designer=4' part could come before or after the rest of the query string. I'm new to .htaccess and re-writes so any examples and or explanations would be greatly appreciated. Thank you very much.

    Read the article

  • Any way to remove IEs black border around submit button in active forms?

    - by Magnar
    I am implementing a design that uses custom styled submit-buttons. They are quite simply light grey buttons with a slightly darker outer border: input.button { background: #eee; border: 1px solid #ccc; } This looks just right in Firefox, Safari and Opera. The problem is with Internet Explorer, both 6 and 7. Since the form is the first one on the page, it's counted as the main form - and thus active from the get go. The first submit button in the active form receives a solid black border in IE, to mark it as the main action. If I turn off borders, then the black extra border in IE goes away too. I am looking for a way to keep my normal borders, but remove the outline.

    Read the article

  • Why is the proper "respond_to" format not getting called?

    - by humble_coder
    Hi All, I'm having a bit of an odd issue. Really too odd to type out, but here goes. Basically I have a controller that refuses to "respond_to" using javascript unless I assign my "chart.generate_xml" to a variable before the "respond_to" block like so: @xml = @chart.generate_xml(@begin_date,@end_date,1.hour) respond_to do |format| format.html format.js{ render :update do |page| page.insert_html :bottom, "chart-div", @xml #page.insert_html :bottom, "chart-div", @chart.generate_xml(@begin_date,@end_date,1.hour) end } If I remove the upper "@xml= …" portion and go with the lower "page.insert", the "format.js" section doesn't get called. And if I try to force the format with "request.format = :js", I get the javascript returned as text. I'm not doing anything special here in that method call, so I'm not sure why it would choose to respond any differently. FWIW, the method that triggers this controller action is using JS to do so, so I'm confused as to why "format.js" isn't always getting called. Thoughts? Best.

    Read the article

  • UIButton not firing selector if I draw it using CALayer

    - by Horatiu Paraschiv
    Hi everybody I create this button like this: _myButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; DLBadgeLayerDelegate *layerDelegate = [[DLBadgeLayerDelegate alloc] init]; _myButton.frame = CGRectMake(0.0 , 0.0, 100.0, 100.0); [_myButton addTarget:self action:@selector(myButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; _myButton.layer.backgroundColor = [[UIColor redColor] CGColor]; _myButton.center = CGPointMake(10.0, 10.0); [self addSubview:_myButton]; [_myButton release]; The button appears on the screen but if I tap on it nothing happens. If I just create a Rounded rect button instead with no custom drawing on its layer or if I just leave the layer line of code out all works well. Do you have any Idea why do I get this behaviour as I would like to do some custom drawing in the button's layer?

    Read the article

  • Am I correctly extracting JPEG binary data from this mysqldump?

    - by Glenn
    I have a very old .sql backup of a vbulletin site that I ran around 8 years ago. I am trying to see the file attachments that are stored in the DB. The script below extracts them all and is verified to be JPEG by hex dumping and checking the SOI (start of image) and EOI (end of image) bytes (FFD8 and FFD9, respectively) according to the JPEG wiki page. But when I try to open them with evince, I get this message "Error interpreting JPEG image file (JPEG datastream contains no image)" What could be going on here? Some background info: sqldump is around 8 years old vbulletin 2.x was the software that stored the info most likely php 4 was used most likely mysql 4.0, possibly even 3.x the column datatype these attachments are stored in is mediumtext My Python 3.1 script: #!/usr/bin/env python3.1 import re trim_l = re.compile(b"""^INSERT INTO attachment VALUES\('\d+', '\d+', '\d+', '(.+)""") trim_r = re.compile(b"""(.+)', '\d+', '\d+'\);$""") extractor = re.compile(b"""^(.*(?:\.jpe?g|\.gif|\.bmp))', '(.+)$""") with open('attachments.sql', 'rb') as fh: for line in fh: data = trim_l.findall(line)[0] data = trim_r.findall(data)[0] data = extractor.findall(data) if data: name, data = data[0] try: filename = 'files/%s' % str(name, 'UTF-8') ah = open(filename, 'wb') ah.write(data) except UnicodeDecodeError: continue finally: ah.close() fh.close() update The JPEG wiki page says FF bytes are section markers, with the next byte indicating the section type. I see some that are not listed in the wiki page (specifically, I see a lot of 5C bytes, so FF5C). But the list is of "common markers" so I'm trying to find a more complete list. Any guidance here would also be appreciated.

    Read the article

  • Update JProgressBar from new Thread

    - by Dacto
    How can I update the JProgressBar.setValue(int) from another thread? My secondary goal is do it in the least amount of classes possible. Here is the code I have right now: **Part of the main class....** pp.addActionListener( new ActionListener(){ public void actionPerformed(ActionEvent event) { new Thread(new Task(sd.getValue())).start(); } }); public class Task implements Runnable{ int val; public Task(int value){ this.val = value; } @Override public void run() { for (int i=0; i<=value; i++){ //Progressively increment variable i pbar.setValue(i); //Set value pbar.repaint(); //Refresh graphics try{Thread.sleep(50);} //Sleep 50 milliseconds catch (InterruptedException err){} } } } pp is a JButton and starts the new thread when the JButton is clicked. pbar is the JProgressBar object from the Main class. How can I update its value?(progress) The code above in run() cannot see the pbar.

    Read the article

  • Using SimpleModal (jQuery plugin) to display a popup iFrame without unnecessary scrollbars

    - by Alex Black
    I'm using SimpleModal: http://www.ericmmartin.com/projects/simplemodal/ And displaying an iframe, as per the example: // Display an external page using an iframe var src = "http://365.ericmmartin.com/"; $.modal('<iframe src="' + src + '" height="450" width="830" style="border:0">', { closeHTML:"", containerCss:{ backgroundColor:"#fff", borderColor:"#fff", height:450, padding:0, width:830 }, overlayClose:true }); And the popup has two sets of scrollbars, one perhaps for the HTML element representing the popup, and one for the iFrame. Try the demo to see. Ideally I'd like no scrollbars if the content fits, otherwise a single vertical scrollbar. Any ideas? Thanks! Alex

    Read the article

  • How to make teamcity's svn checkout more verbose?

    - by Benju
    We have a very large svn external containing about 30,000 500k files. This checkout can take a long time and we would like to see the progress in the TeamCity logs as it happens. Is there a way to use a more verbose logging when doing the svn checkout than just.... [19:26:00]: Updating sources: Agent side checkout... [19:26:00]: [Updating sources: Agent side checkout...] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist [19:26:00]: [Updating sources: Agent side checkout...] Cleaning /opt/TeamCity/buildAgent/work/937995fe3d15f1e7 [19:26:00]: [Updating sources: Agent side checkout...] VCS Root: guru 6 trunk with externals [19:26:00]: [VCS Root: guru 6 trunk with externals] revision: 6521_2010/04/27 19:25:58 -0500

    Read the article

  • Is there a way to initialize ImageKit's IKSaveOptions to default to TIFF with LZW compression?

    - by Rei
    I'm using Mac OS X 10.6 SDK ImageKit's IKSaveOptions to add the file format accessory to an NSSavePanel using: - (id)initWithImageProperties:(NSDictionary *)imageProperties imageUTType:(NSString *)imageUTType; and - (void)addSaveOptionsAccessoryViewToSavePanel:(NSSavePanel *)savePanel; I have tried creating an NSDictionary to specify Compression = 5, but I cannot seem to get the IKSaveOptions to show Format:TIFF, Compression:LZW when the NSSavePanel first appears. I've also tried saving the returned imageProperties dictionary and the userSelection dictionary, and then tried feeding that back in for the next time, but the NSSavePanel always defaults to Format:TIFF with Compression:None. Does anyone know how to customize the default format/compression that shows up in the accessory view? I would like to default the save options to TIFF/LZW and furthermore would like to restore the user's last file format choice for next time. I am able to control the file format using the imageUTType (e.g. kUTTypeJPEG, kUTTypePNG, kUTTypeTIFF, etc) but I am still unable to set the initial compression option for TIFF or JPEG formats. Thanks, -Rei

    Read the article

  • Problem with URL encoded parameters in URL view helper

    - by Richard Knop
    So my problem is kinda weird, it only occurs when I test the application offline (on my PC with WampServer), the same code works 100% correctly online. Here is how I use the helper (just example): <a href="<?php echo $this->url(array('module' => 'admin', 'controller' => 'index', 'action' => 'approve-photo', 'id' => $this->escape($a->id), 'ret' => urlencode('admin/index/photos')), null, true); ?>" class="blue">approve</a> Online, this link works great, it goes to the action which looks similar to this: public function approvePhotoAction() { $request = $this->getRequest(); $photos = $this->_getTable('Photos'); $dbTrans = false; try { $db = $this->_getDb(); $dbTrans = $db->beginTransaction(); $photos->edit($request->getParam('id'), array('status' => 'approved')); $db->commit(); } catch (Exception $e) { if (true === $dbTrans) { $db->rollBack(); } } $this->_redirect(urldecode($request->getParam('ret'))); } So online, it approves the photo and redirects back to the URL that is encoded as "ret" param in the URL ("admin/index/photos"). But offline with WampServer I click on the link and get 404 error like this: Not Found The requested URL /public/admin/index/approve-photo/id/1/ret/admin/index/photos was not found on this server. What the hell? I'm using the latest version of WampServer (WampServer 2.0i [11/07/09]). Everything else works. Here is my .htaccess file, just in case: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /index.php [NC,L] # Turn off magic quotes #php_flag magic_quotes_gpc off I'm using virtual hosts to test ZF projects on my local PC. Here is how I add virtual hosts. httpd.conf: NameVirtualHost *:80 <VirtualHost *:80> ServerName myproject DocumentRoot "C:\wamp\www\myproject" </VirtualHost> the hosts file: 127.0.0.1 myproject Any help would be appreciated because this makes testing and debugging projects on my localhost a nightmare and almost impossible task. I have to upload everything online to check if it works :( UPDATE: Source code of the _redirect helper (built in ZF helper): /** * Set redirect in response object * * @return void */ protected function _redirect($url) { if ($this->getUseAbsoluteUri() && !preg_match('#^(https?|ftp)://#', $url)) { $host = (isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:''); $proto = (isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=="off") ? 'https' : 'http'; $port = (isset($_SERVER['SERVER_PORT'])?$_SERVER['SERVER_PORT']:80); $uri = $proto . '://' . $host; if ((('http' == $proto) && (80 != $port)) || (('https' == $proto) && (443 != $port))) { $uri .= ':' . $port; } $url = $uri . '/' . ltrim($url, '/'); } $this->_redirectUrl = $url; $this->getResponse()->setRedirect($url, $this->getCode()); } UPDATE 2: Output of the helper offline: /admin/index/approve-photo/id/1/ret/admin%252Findex%252Fphotos And online (the same): /admin/index/approve-photo/id/1/ret/admin%252Findex%252Fphotos UPDATE 3: OK. The problem was actually with the virtual host configuration. The document root was set to C:\wamp\www\myproject instead of C:\wamp\www\myproject\public. And I was using this htaccess to redirect to the public folder: RewriteEngine On php_value upload_max_filesize 15M php_value post_max_size 15M php_value max_execution_time 200 php_value max_input_time 200 # Exclude some directories from URI rewriting #RewriteRule ^(dir1|dir2|dir3) - [L] RewriteRule ^\.htaccess$ - [F] RewriteCond %{REQUEST_URI} ="" RewriteRule ^.*$ /public/index.php [NC,L] RewriteCond %{REQUEST_URI} !^/public/.*$ RewriteRule ^(.*)$ /public/$1 RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^.*$ - [NC,L] RewriteRule ^public/.*$ /public/index.php [NC,L] Damn it I don't know why I forgot about this, I thought the virtual host was configured correctly to the public folder, I was 100% sure about that, I also double checked it and saw no problem (wtf? am I blind?).

    Read the article

  • switching default keyevents actions after key combinations

    - by liysd
    I need to change default actions of two events. When I press "enter" one action occurs, when I press "shift-enter" another. I need to switch it. I means if I press "enter" than "shift-enter" action occurs. I tried something like this but if doesn't work. f(evt.keyCode == 13) { if(!evt.shiftKey){ evt.preventDefault(); evt.shiftKey = true; var e = jQuery.Event("keydown"); e.which = 13; e.shiftKey = true; $(wym._doc).trigger(e); Is there any way to do it?

    Read the article

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