Daily Archives

Articles indexed Saturday June 23 2012

Page 7/15 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Different Style Technique

    - by Muhammad Iqbal Dwi Cahyo
    I'm newbie here.. Please anyone knows, to create a character that his/her Style Tech is had a different kind of movement... I wanna make my character 2d his/her power technique like rasengan, I mean first the ball its just spining around and then going bigger and much more bigger so blow up if it touch his/her opponent? How the coding is, and what I've must do? Please your guide, thank's a lot... ^_^

    Read the article

  • What is a normalized Vector?

    - by draiden
    Can someone explain the following code? I need to learn what each part means so I can turn it into enemy movement in a space shoot-em-up Vec2d playerPos; Vec2d direction; // always normalized float velocity; I get the above is naming two 2d Vector objects, and creating a variable called velocity. I'm not sure what the normalized comment is about, though. update() { direction = normalize(playerPos - enemyPos); playerPos = playerPos + direction * velocity; }

    Read the article

  • Break the object body

    - by Siddharth
    In my game, I want to break the object body creating slicing effect. After research I found that I have to use ray casting but I don't know how to use it. If some one know how to break the physics body then please provide information to me. EDIT : I don't have any logic how to do that in andengine. Only I have some link to do slicing http://www.emanueleferonato.com/2012/03/05/breaking-objects-with-box2d-the-realistic-way/ Yes I have to slice physics body into two parts. My physics body have 2d objects.

    Read the article

  • Android change background of key dynamically

    - by Wouter
    I'm building a custom keyboard in android. My input.xml: <com.mykeyboard.MyKeyboardView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/keyboard" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:keyBackground="@drawable/keybg" /> All the keys do have the same background. Now I'm trying to dynamically change the background of one single key. Is this possible?

    Read the article

  • Display (tier) prices with qty increments and taxes

    - by witrin
    I need to display (tier) prices based on the qty increments of a product. E.g. a simple product, with a regular price of 50¢, no taxes and qty increments of 20 should be displayed on product views with "$10 per 20". Without using taxes this should be quite easy. But there seems to be no "default" helper or model to do this with taxes enabled and different calulation algorithms (e.g. Mage_Tax_Model_Calculation::CALC_UNIT_BASE); expect for quotes in Mage_Tax_Model_Sales_Total_Quote_Tax and Mage_Tax_Model_Sales_Total_Quote_Subtotal. Did I miss something here, or do I have to write the business logic on my own? And how I would best encapsulate it?

    Read the article

  • Wordpress meta data is written on top of page instead of the loop

    - by Fruxelot
    i'm building a wordpress webpage based on the Skeleton Wordpress theme. I have 2 posts showing on a page and each of these posts have custom fields values (meta data). Im using the shortcode from the skeleton theme to get a post-feed from a specific category and in that loop i have inserted this tag that displays the custom fields data <?php the_meta(); ?> I am getting the data - but the problem is, the data is shown on TOP of the page instead of inside the in the post. What could've ive possibly done wrong? or is it something with skeleton i am doing wrong? Webpage : http://visbyfangelse.se.preview.binero.se/rum-priser-preview/ as you can see two posts are shown - and the meta data is shown on the top of the page. Code to the loop : http://pastebin.com/mRQY5GNz As you can see i want the meta displayed in the div which i assigned this class to "my_room_meta".

    Read the article

  • How call soap service using jQuery

    - by Alen D
    I have a problem with calling soap service from php page. I was implemented two page,first page was created in php, and second page was created in asp.net. In asp.net application I have SOAP service, which methods should be called from php. Method on my SOAP service, look like this: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public bool UpdateVotes(string vote) { //Code } On PHP application I call UpdateVotes method on the next way: $.ajax({ type: "POST", url: "http://localhost:5690/VoteServices.asmx/UpdateVotes", data: "{'vote': '" + vote + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { }, error: function (xhr, status, error) { } }); First I run asp.net application with SOAP service, and than I start php aplication. When i click on button for calling web method on service i browser console i got this error: Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:5690/VoteServices.asmx/UpdateVotes XMLHttpRequest cannot load http://localhost:5690/VoteServices.asmx/UpdateVotes. Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin.

    Read the article

  • Animate function jQuery

    - by Antonio Pitasi
    I'm new here and I have a problem the jQuery's function "animate" function myFunction(newpage) { $('#loader').animate({opacity: 0.0}, 400, 'linear', function(){ // callback of fadeOut() $(this).load(newpage + ".php #toload", function(){ // callback of load() $('#loader').animate({opacity: 100.0}, 400, 'linear', function(){ //callback of fadeIn() // (not relevant for my problem, I think) $.getScript("js/test.js"); }); }); }); } My problem is: the first "animate" works like a charm but the second load the new content correctly, without the animation (a simple fadeIn). Anyone can help me? Thanks in advice! P.S. Sorry for my english

    Read the article

  • Using Everyauth/Express and Multiple Configurations?

    - by Zane Claes
    I'm successfully using Node.js + Express + Everyauth ( https://github.com/abelmartin/Express-And-Everyauth/blob/master/app.js ) to login to Facebook, Twitter, etc. from my application. The problem I'm trying to wrap my head around is that Everyauth seems to be "configure and forget." I set up a single everyauth object and configure it to act as middleware for express, and then forget about it. For example, if I want to create a mobile Facebook login I do: var app = express.createServer(); everyauth.facebook .appId('AAAA') .appSecret('BBBB') .entryPath('/login/facebook') .callbackPath('/callback/facebook') .mobile(true); // mobile! app.use(everyauth.middleware()); everyauth.helpExpress(app); app.listen(8000); Here's the problem: Both mobile and non-mobile clients will connect to my server, and I don't know which is connecting until the connection is made. Even worse, I need to support multiple Facebook app IDs (and, again, I don't know which one I will want to use until the client connects and I partially parse the input). Because everyauth is a singleton which in configured once, I cannot see how to make these changes to the configuration based upon the request that is made. What it seems like is that I need to create some sort of middleware which acts before the everyauth middleware to configure the everyauth object, such that everyauth subsequently uses the correct appId/appSecret/mobile parameters. I have no clue how to go about this... Suggestions? Here's the best idea I have so far, though it seems terrible: Create an everyauth object for every possible configuration using a different entryPath for each...

    Read the article

  • Error in computed Field of select Query

    - by Shehzad Bilal
    This Query is giving me an error of #1054 - Unknown column 'totalamount' in 'where clause' SELECT (amount1 + amount2) as totalamount FROM `Donation` WHERE totalamount > 1000 I know i can resolve this error by using group by clause and replace my where condition with having clause. But is there any other solution beside using having clause. If group by is the only solution then I want to know why I have to use group by clause even I havent use any aggregate function thanks.

    Read the article

  • UILabels NOT Updating

    - by Chris Calleja Urry
    i have a UITableView that is being populated by core data , now , when i click on a cell , it pushes me to another view where i can edit the data that is in that particular index , when i return , the system either crashes or else doesnt load the changes onto the labels , any ideas ? code below -(void)viewWillAppear:(BOOL)animated { searchCriteria = [[NSMutableString alloc] initWithString:@"clientName"]; NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"clientName" ascending:YES]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [fetchRequest setSortDescriptors:sortDescriptors]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Client" inManagedObjectContext:managedObjectContext]; [fetchRequest setEntity:entity]; fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:nil cacheName:@"Root"]; [self.clientTableView reloadData]; [super viewWillAppear:animated]; } and -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } Client * client = [self.fetchedResultsController objectAtIndexPath:indexPath]; clientNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 250.00, 30.0)]; clientNameLabel.tag = 1; clientNameLabel.backgroundColor = [UIColor clearColor]; clientNameLabel.textColor = [UIColor whiteColor]; clientNameLabel.font = [UIFont boldSystemFontOfSize:13]; clientNameLabel.text = client.clientName; [cell.contentView addSubview:clientNameLabel]; clientAccountNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(15.0, 35.0, 250.00, 30.00)]; clientAccountNumberLabel.tag = 2; clientAccountNumberLabel.textColor = [UIColor whiteColor]; clientAccountNumberLabel.backgroundColor = [UIColor clearColor]; clientAccountNumberLabel.font = [UIFont boldSystemFontOfSize:13]; clientAccountNumberLabel.text = client.clientAccountNumber; [cell.contentView addSubview:clientAccountNumberLabel]; clientTelephoneNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(300.0, 0.0, 250, 30.00)]; clientTelephoneNumberLabel.tag = 3; clientTelephoneNumberLabel.textColor = [UIColor whiteColor]; clientTelephoneNumberLabel.backgroundColor = [UIColor clearColor]; clientTelephoneNumberLabel.font = [UIFont boldSystemFontOfSize:13]; [cell.contentView addSubview:clientTelephoneNumberLabel]; addressLine1Label = [[UILabel alloc] initWithFrame:CGRectMake(315.0, 35.0, 250, 30.00)]; addressLine1Label.tag = 4; addressLine1Label.textColor = [UIColor whiteColor]; addressLine1Label.backgroundColor = [UIColor clearColor]; addressLine1Label.font = [UIFont boldSystemFontOfSize:13]; addressLine1Label.text = client.addressLine1; [cell.contentView addSubview:addressLine1Label]; addressLine2Label = [[UILabel alloc] initWithFrame:CGRectMake(315.0, 35.0, 250, 30.00)]; addressLine2Label.tag = 5; addressLine2Label.textColor = [UIColor whiteColor]; addressLine2Label.backgroundColor = [UIColor clearColor]; addressLine2Label.text = client.addressLine2; addressLine2Label.font = [UIFont boldSystemFontOfSize:13]; [cell.contentView addSubview:addressLine2Label]; addressLine3Label = [[UILabel alloc] initWithFrame:CGRectMake(315.0, 35.0, 250, 30.00)]; addressLine3Label.tag = 6; addressLine3Label.textColor = [UIColor whiteColor]; addressLine3Label.backgroundColor = [UIColor clearColor]; addressLine3Label.font = [UIFont boldSystemFontOfSize:13]; addressLine3Label.text = client.addressLine3; [cell.contentView addSubview:addressLine3Label]; addressLine4Label = [[UILabel alloc] initWithFrame:CGRectMake(315.0, 35.0, 250, 30.00)]; addressLine4Label.tag = 7; addressLine4Label.textColor = [UIColor whiteColor]; addressLine4Label.backgroundColor = [UIColor clearColor]; addressLine4Label.font = [UIFont boldSystemFontOfSize:13]; addressLine4Label.text = client.addressLine4; [cell.contentView addSubview:addressLine4Label]; return cell; } The Crash Logs are as follows : 2012-06-23 17:08:05.541 iSalesForce[11773:15803] no object at index 1 in section at index 0 And some other code you might find useful are : - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [fetchedObjects count]; } - (float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 70.0; }

    Read the article

  • C++ Passing `this` into method by reference

    - by David
    I have a class constructor that expects a reference to another class object to be passed in as an argument. I understand that references are preferable to pointers when no pointer arithmetic will be performed or when a null value will not exist. This is the header declaration of the constructor: class MixerLine { private: MIXERLINE _mixerLine; public: MixerLine(const MixerDevice& const parentMixer, DWORD destinationIndex); ~MixerLine(); } This is the code that calls the constructor (MixerDevice.cpp): void MixerDevice::enumerateLines() { DWORD numLines = getDestinationCount(); for(DWORD i=0;i<numLines;i++) { MixerLine mixerLine( this, i ); // other code here removed } } Compilation of MixerDevice.cpp fails with this error: Error 3 error C2664: 'MixerLine::MixerLine(const MixerDevice &,DWORD)' : cannot convert parameter 1 from 'MixerDevice *const ' to 'const MixerDevice &' But I thought pointer values could be assigned to pointers, e.g. Foo* foo = new Foo(); Foo& bar = foo;

    Read the article

  • throwing exception from APCProc crashes program

    - by lazy_banana
    I started to do some research on how terminate a multithreaded application properly and I found those 2 post(first, second) about how to use QueueUserAPC to signal other threads to terminate. I thought I should give it a try, and the application keeps crashing when I throw the exception from the APCProc. Code: #include <stdio.h> #include <windows.h> class ExitException { public: char *desc; DWORD exit_code; ExitException(char *desc,int exit_code): desc(desc), exit_code(exit_code) {} }; //I use this class to check if objects are deconstructed upon termination class Test { public: char *s; Test(char *s): s(s) { printf("%s ctor\n",s); } ~Test() { printf("%s dctor\n",s); } }; DWORD CALLBACK ThreadProc(void *useless) { try { Test t("thread_test"); SleepEx(INFINITE,true); return 0; } catch (ExitException &e) { printf("Thread exits\n%s %lu",e.desc,e.exit_code); return e.exit_code; } } void CALLBACK exit_apc_proc(ULONG_PTR param) { puts("In APCProc"); ExitException e("Application exit signal!",1); throw e; return; } int main() { HANDLE thread=CreateThread(NULL,0,ThreadProc,NULL,0,NULL); Sleep(1000); QueueUserAPC(exit_apc_proc,thread,0); WaitForSingleObject(thread,INFINITE); puts("main: bye"); return 0; } My question is why does this happen? I use mingw for compilation and my OS is 64bit. Can this be the reason?I read that you shouldn't call QueueApcProc from a 32bit app for a thread which runs in a 64bit process or vice versa, but this shouldn't be the case.

    Read the article

  • Why use of session name and session id in the get variables does not work?

    - by Roman
    I have the following code: $location .= 'red=no&'.session_name() . "=". session_id(); $content = file_get_contents($location); echo $content; If I run it, noting is displayed in my browser. However, if I modify it in the following way: $location .= 'red=no'; $content = file_get_contents($location); echo $content; everything works fine (I see the content in my browser). What is also strange, if I display the value of the $location variable from the first example (url) and manually paste it in the address line of my browser, I do see the content. So, my browser is able to use this URL and file_get_contents not. Does anybody know how it can be explained?

    Read the article

  • Select unseen random row from MySQL table

    - by user1476925
    We have a list of questions in a MySQL database and want it to show a random approved question to the user. When you click the Random button, we want another random question to be shown, but not any of the ones the user has already seen. Right now the script looks like this: <?php mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("aldrig") or die(mysql_error()); $result = mysql_query("SELECT * FROM spg WHERE approved='1' ORDER BY RAND() LIMIT 1;") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { echo "<div class='contentTitle'><h1>"; echo $row['text']; echo "</h1></div>"; } ?>

    Read the article

  • What is wrong with my JPGEncoder

    - by hitek
    Here is my code if (event.target.content is Bitmap) { infotext.text = "got something"; var image:Bitmap = Bitmap(event.target.content); var bitmapData:BitmapData = image.bitmapData; this.addChild(image); var j:JPGEncoder = new JPGEncoder(100); var bytes:ByteArray = new ByteArray(); bytes=j.encode(bitmapData); } else { throw new Error("What the heck bob?"); } When I run a debug session everything works fine till it reaches to the line bytes=j.encode(bitmapData); after that nothing happens and my program just goes into limbo Please help

    Read the article

  • Objects With No Behavior

    - by Patrick Donovan
    I've been teaching myself object oriented programming and I'm thinking about a situation where I have an object "Transaction", that has quite a few properties to it like account, amount, date, currency, type, etc. I never plan to mutate these data points, and calculation logic will live in other classes. My question is, is it poor Python design to instantiate thousands of objects just to hold data? I find the data far easier to work with embedded in a class rather than trying to cram it into some combination of data structures.

    Read the article

  • why arrayfun does NOT improve my struct array operation performance

    - by HaveF
    here is the input data: % @param Landmarks: % Landmarks should be 1*m struct. % m is the number of training set. % Landmark(i).data is a n*2 matrix old function: function Landmarks=CenterOfGravity(Landmarks) % align center of gravity for i=1 : length(Landmarks) Landmarks(i).data=Landmarks(i).data - ones(size(Landmarks(i).data,1),1)... *mean(Landmarks(i).data); end end new function which use arrayfun: function [Landmarks] = center_to_gravity(Landmarks) Landmarks = arrayfun(@(struct_data)... struct('data', struct_data.data - repmat(mean(struct_data.data), [size(struct_data.data, 1), 1]))... ,Landmarks); end %function center_to_gravity when using profiler, I find the usage of time is NOT what I expected: Function Total Time Self Time* CenterOfGravity 0.011s 0.004 s center_to_gravity 0.029s 0.001 s Can someone tell me why? BTW...I can't add "arrayfun" as a new tag for my reputation.

    Read the article

  • I am Unable to Post Xml to Linkedin Share API

    - by Vijesh V.Nair
    I am using Delphi 2010, with Indy 10.5.8(svn version) and oAuth.pas from chuckbeasley. I am able to collect token with app key and App secret, authorize token with a web page and Access the final token. Now I have to post a status with Linkedin’s Share API. I am getting a unauthorized response. My request and responses are giving bellow. Request, POST /v1/people/~/shares HTTP/1.0 Content-Encoding: utf-8 Content-Type: text/xml; charset=us-ascii Content-Length: 999 Authorization: OAuth oauth_consumer_key="xxx",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1340438599",oauth_nonce="BB4C78E0A6EB452BEE0FAA2C3F921FC4",oauth_version="1.0",oauth_token="xxx",oauth_signature="Pz8%2FPz8%2FPz9ePzkxPyc%2FDD82Pz8%3D" Host: api.linkedin.com Accept: text/html, */* Accept-Encoding: identity User-Agent: Mozilla/3.0 (compatible; Indy Library) %3C%3Fxml+version=%25221.0%2522%2520encoding%253D%2522UTF-8%2522%253F%253E%253Cshare%253E%253Ccomment%253E83%2525%2520of%2520employers%2520will%2520use%2520social%2520media%2520to%2520hire%253A%252078%2525%2520LinkedIn%252C%252055%2525%2520Facebook%252C%252045%2525%2520Twitter%2520%255BSF%2520Biz%2520Times%255D%2520http%253A%252F%252Fbit.ly%252FcCpeOD%253C%252Fcomment%253E%253Ccontent%253E%253Ctitle%253ESurvey%253A%2520Social%2520networks%2520top%2520hiring%2520tool%2520-%2520San%2520Francisco%2520Business%2520Times%253C%252Ftitle%253E%253Csubmitted-url%253Ehttp%253A%252F%252Fsanfrancisco.bizjournals.com%252Fsanfrancisco%252Fstories%252F2010%252F06%252F28%252Fdaily34.html%253C%252Fsubmitted-url%253E%253Csubmitted-image-url%253Ehttp%253A%252F%252Fimages.bizjournals.com%252Ftravel%252Fcityscapes%252Fthumbs%252Fsm_sanfrancisco.jpg%253C%252Fsubmitted-image-url%253E%253C%252Fcontent%253E%253Cvisibility%253E%253Ccode%253Eanyone%253C%252Fcode%253E%253C%252Fvisibility%253E%253C%252Fshare%253E Response, HTTP/1.1 401 Unauthorized Server: Apache-Coyote/1.1 x-li-request-id: K14SWRPEPL Date: Sat, 23 Jun 2012 08:07:17 GMT Vary: * x-li-format: xml Content-Type: text/xml;charset=UTF-8 Content-Length: 341 Connection: keep-alive <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <error> <status>401</status> <timestamp>1340438838344</timestamp> <request-id>K14SWRPEPL</request-id> <error-code>0</error-code> <message>[unauthorized]. OAU:xxx|nnnnn|*01|*01:1340438599:Pz8/Pz8/Pz9ePzkxPyc/DD82Pz8=</message> </error> Please help. Regards, Vijesh Nair

    Read the article

  • weak or strong for IBOutlet and other

    - by Piero
    I have switched my project to ARC, and I don't understand if I have to use strong or weak for IBOutlets. Xcode do this: in interface builder, if a create a UILabel for example and I connect it with assistant editor to my ViewController, it create this: @property (nonatomic, strong) UILabel *aLabel; It uses the strong, instead I read a tutorial on RayWenderlich website that say this: But for these two particular properties I have other plans. Instead of strong, we will declare them as weak. @property (nonatomic, weak) IBOutlet UITableView *tableView; @property (nonatomic, weak) IBOutlet UISearchBar *searchBar; Weak is the recommended relationship for all outlet properties. These view objects are already part of the view controller’s view hierarchy and don’t need to be retained elsewhere. The big advantage of declaring your outlets weak is that it saves you time writing the viewDidUnload method. Currently our viewDidUnload looks like this: - (void)viewDidUnload { [super viewDidUnload]; self.tableView = nil; self.searchBar = nil; soundEffect = nil; } You can now simplify it to the following: - (void)viewDidUnload { [super viewDidUnload]; soundEffect = nil; } So use weak, instead of the strong, and remove the set to nil in the videDidUnload, instead Xcode use the strong, and use the self... = nil in the viewDidUnload. My question is: when do I have to use strong, and when weak? I want also use for deployment target iOS 4, so when do I have to use the unsafe_unretain? Anyone can help to explain me well with a small tutorial, when use strong, weak and unsafe_unretain with ARC?

    Read the article

  • Git doesn't sync files until committed, even if checked out in a different branch

    - by DertWaiter
    Okay, I have git 1.7.11.1 on Windows and I have a local test repository with 2 branches. One is master with index.php and help.php. I then create another branch called slave :) I run from git bash rm help.php and it disappears from the folder, but I don't stage anything. I switch to checkout master branch and it is supposed to restore file help.php because it is not modified in the master branch, isn't it? And it does not do it. When I go back to the slave branch and commit and then switch to checkout master then help.php appears. Is that the way it is supposed to to work? Why?

    Read the article

  • Replace text in XSL using wildcards

    - by JosephThomas
    This is similar to an earlier problem I was having which you guys solved in less than a day. I am working with XML files that are generated by a digital video camera. The camera allows the user to save all of the camera's settngs to an SD card so that the settings can be recalled or loaded into another camera. The XSL stylesheet I am writing will allow users to view the camera's settings, as saved to the SD card in a web browser. While most of the values in the XML file -- as formatted by my stylesheet -- make sense to humans, some do not. What I would like to do is have the stylesheet display text that is based on the value in the XML file but more easily understood by humans. A typical value that can be written to the XML file is "_23_970" which represents the camera's frame rate. This would be better displayed as 23.970 (or 023.970). The first underscore is a sort of place holder to make a space for values over 099.999. The second underscore, obviously represents the decimal. My previous (similar) question involved replacing predictable text, and the solution was matching templates. In this case, however, the camera can be set at any one of 119,999 frame rates (I think I did that math correctly). The approach, I would guess, is to pass a value to the displayed webpage that keeps the numeric values (each digit), replaces the second underscore with a decimal, and replaces the first underscore with either an nbsp or a zero (whichever is easier). If the first character in the string is a "1" (the camera can run at frame rates up to 120.000) then the one should be passed on to the page displayed by the stylesheet. I have read other posts here regarding wildcards, but couldn't find one that answered this question. EDIT: Sorry for leaving out important info. I fared better on my first try at asking a question! I guess I got complacent. Anyhow . . . I should have shown you the code that displays the text in the XSL file as is: <tr> <xsl:for-each select="Settings/Groups/Recording"> <tr><td class="title_column">Frame Rate</td><td><xsl:value-of select="RecOutLinkSpeed"/></td></tr> </xsl:for-each> </tr> I should also have given you the URL for the sample file I have been working with: http://josephthomas.info/Alexa/Setup_120511_140322.xml

    Read the article

  • Stored insert procedure in plpgsql

    - by crazyphoton
    I want to do something like this in PostgreSQL. I tried this: CREATE or replace FUNCTION create_patient(_name text, _email text, _phone text, _password text, _field1 text, _field2 text, _field3 timestamp, _field4 text, OUT _pid integer, OUT _id integer) RETURNS record AS $$ DECLARE _id integer; _type text; _pid integer; BEGIN _type := 'patient'; INSERT into patients (name, email, phone, field1, field2, field3) values (_name, _email, _phone, _field1, _field2, _field3) RETURNING id into _pid; INSERT into users (username, password, type, pid, phone, language) values (_email, _password, _type, _pid, _phone, _field4) RETURNING id into _id; END; $$ LANGUAGE plpgsql; But there are a lot of instances where I would not want to specify some of field1/field2/field3/field4 and want the unspecified fields to use the default value in the table. Currently that is not possible, because to call this function I need to specify all fields. TLDR; Is there a simple way to create a wrapper procedure for INSERT in PL/pgSQL where I can specify which fields I want to insert?

    Read the article

  • std::basic_stringstream<unsigned char> won't compile with MSVC 10

    - by Michael J
    I'm trying to get UTF-8 chars to co-exist with ANSI 8-bit chars. My strategy has been to represent utf-8 chars as unsigned char so that appropriate overloads of functions can be used for the two character types. e.g. namespace MyStuff { typedef uchar utf8_t; typedef std::basic_string<utf8_t> U8string; } void SomeFunc(std::string &s); void SomeFunc(std::wstring &s); void SomeFunc(MyStuff::U8string &s); This all works pretty well until I try to use a stringstream. std::basic_ostringstream<MyStuff::utf8_t> ostr; ostr << 1; MSVC Visual C++ Express V10 won't compile this: c:\program files\microsoft visual studio 10.0\vc\include\xlocmon(213): warning C4273: 'id' : inconsistent dll linkage c:\program files\microsoft visual studio 10.0\vc\include\xlocnum(65) : see previous definition of 'public: static std::locale::id std::numpunct<unsigned char>::id' c:\program files\microsoft visual studio 10.0\vc\include\xlocnum(65) : while compiling class template static data member 'std::locale::id std::numpunct<_Elem>::id' with [ _Elem=Tk::utf8_t ] c:\program files\microsoft visual studio 10.0\vc\include\xlocnum(1149) : see reference to function template instantiation 'const _Facet &std::use_facet<std::numpunct<_Elem>>(const std::locale &)' being compiled with [ _Facet=std::numpunct<Tk::utf8_t>, _Elem=Tk::utf8_t ] c:\program files\microsoft visual studio 10.0\vc\include\xlocnum(1143) : while compiling class template member function 'std::ostreambuf_iterator<_Elem,_Traits> std::num_put<_Elem,_OutIt>:: do_put(_OutIt,std::ios_base &,_Elem,std::_Bool) const' with [ _Elem=Tk::utf8_t, _Traits=std::char_traits<Tk::utf8_t>, _OutIt=std::ostreambuf_iterator<Tk::utf8_t,std::char_traits<Tk::utf8_t>> ] c:\program files\microsoft visual studio 10.0\vc\include\ostream(295) : see reference to class template instantiation 'std::num_put<_Elem,_OutIt>' being compiled with [ _Elem=Tk::utf8_t, _OutIt=std::ostreambuf_iterator<Tk::utf8_t,std::char_traits<Tk::utf8_t>> ] c:\program files\microsoft visual studio 10.0\vc\include\ostream(281) : while compiling class template member function 'std::basic_ostream<_Elem,_Traits> & std::basic_ostream<_Elem,_Traits>::operator <<(int)' with [ _Elem=Tk::utf8_t, _Traits=std::char_traits<Tk::utf8_t> ] c:\program files\microsoft visual studio 10.0\vc\include\sstream(526) : see reference to class template instantiation 'std::basic_ostream<_Elem,_Traits>' being compiled with [ _Elem=Tk::utf8_t, _Traits=std::char_traits<Tk::utf8_t> ] c:\users\michael\dvl\tmp\console\console.cpp(23) : see reference to class template instantiation 'std::basic_ostringstream<_Elem,_Traits,_Alloc>' being compiled with [ _Elem=Tk::utf8_t, _Traits=std::char_traits<Tk::utf8_t>, _Alloc=std::allocator<uchar> ] . c:\program files\microsoft visual studio 10.0\vc\include\xlocmon(213): error C2491: 'std::numpunct<_Elem>::id' : definition of dllimport static data member not allowed with [ _Elem=Tk::utf8_t ] Any ideas? ** Edited 19 June 2012 ** OK, I've gotten closer to understanding this, but not how to solve it. As we all know, static class variables get defined twice: once in the class definition and once outside the class definition which establishes storage space. e.g. // in .h file class CFoo { // ... static int x; }; // in .cpp file int CFoo::x = 42; Now in the VC10 headers we get something like this: template<class _Elem> class numpunct : public locale::facet { // ... _CRTIMP2_PURE static locale::id id; // ... } When the header is included in an application, _CRTIMP2_PURE is defined as __declspec(dllimport), which means that the variable is imported from a dll. Now the header also contains the following template<class _Elem> locale::id numpunct<_Elem>::id; Note the absence of the __declspec(dllimport) qualifier. i.e. The class declaration says that the static linkage of the id variable is in the dll, but for the general case, it gets declared outside the dll. For the known cases, there are specialisations. template locale::id numpunct<char>::id; template locale::id numpunct<wchar_t>::id; These are protected by #ifs so that they are only included when building the DLL. They are excluded otherwise. i.e. the char and wchar_t versions of numpunct ARE inside the dll So we have the class definition saying that id's storage is in the DLL, but that is only true for the char and wchar_t specialisations, meaning that my unsigned char version is doomed. :-( The only way forward that I can think of is to create my own specialisation: basically copying it from the header file and fixing it. This raises many issues. Anybody have a better idea?

    Read the article

  • How to make html image clickable inside a TextView

    - by Gonan
    I have the following text in a string in the resources file: <a href="mailto:[email protected]">&lt;img src="mail_big" /&gt;</a> It shows the image fine (I implemented ImageGetter) but it is not clickable. I have tried adding the Linkify thingy but I don't think it's meant for this case, and so it doesn't work. The setMovementMethod doesn't work either. I have tried different combinations of the above: <a href="mailto:[email protected]">&lt;img src="mail_big" /&gt;hello</a> Here, even the "hello" part is not clickable (neither blue nor underlined). <a href="mailto:[email protected]"><img src="mail_big" /></a> This doesn't even show the image. &lt;a href="mailto:[email protected]"&gt;&lt;img src="mail_big" /&gt;&lt;/a&gt; If I just write the email, without the <a> tag it works perfectly, but I would like to use the image of an envelope that the user can click on. It's not possible to use an imagebutton because this text is in the middle of a string and so I can't split it. Any ideas? Thanks! EDIT: I found a solution or rather found how to do it correctly. All I had to do was adding the setMovementMethod call before the call to setText in the TextView and ALSO, and COMPLETELY NECESSARY, remove the attribute "android:autoLink="all" from the layout. Apparently, parsing mails and urls in a string is mutually exclusive to interpreting the link tags in a string. So one or the other but not both. Finally my layout is just a TextView with nothing special, just width and height. The activity is like this: TextView tv = (TextView)findViewById(R.id.about_text); tv.setMovementMethod(LinkMovementMethod.getInstance()); tv.setText(Html.fromHtml(getString(R.string.about_content), new ImageGetter(), null)); And the string is like this: <string name="about_content"><a href="mailto:[email protected]"><img src="mail" /></a></string>

    Read the article

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