Search Results

Search found 176 results on 8 pages for 'dina ak'.

Page 3/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • Testing with Qt's QTestLib module

    - by ak
    Hi I started writing some tests with Qt's unit testing system. How do you usually organize the tests? It is one test class per one module class, or do you test the whole module with a single test class? Qt docs (or some podcast that I recently watched) suggested to follow the former strategy. I want to write tests for a module. The module provides only one class that is going to be used by the module user, but there is a lot of logic abstracted in other classes, which I would also like to test, besides testing the public class. The problem is that Qt's proposed way to run tests involved the QTEST_MAIN macro: QTEST_MAIN(TestClass) #include "test_class.moc" and eventually one test program is capable of testing just one test class. And it kinda sucks to create test projects for every single class in the module. Of course, one could take a look at the QTEST_MAIN macro, rewrite it, and run other test classes. But is there something, that works out of the box?

    Read the article

  • Drupal: Renumbering node ids

    - by AK
    Having spent some time migrating old data into a new drupal site, my first node id is already into the 4 digit territory. Has anyone had any experience in this position of renumbering node ids starting from #1? Maybe using direct queries on the database, or a module that traverses and renumbers all the nodes? Of course, nodereferences have to be preserved... are there any other potential hangups if I try to script this?

    Read the article

  • Splitting tables by field to optimize MySQL?

    - by AK
    Do splitting fields into multiple tables ever yield faster queries? Consider the following two scenarios: Table1 ----------- int PersonID text Value1 float Value2 or Table1 ----------- int PersonID text Value1 Table2 ----------- int PersonID float Value2 If Value1 and Value2 are always being displayed together, I imagine Table1 is always faster because the second schema would require two SELECT statements. But are there any situations where you would choose the second? If the number of records were expected to be really large?

    Read the article

  • Unpredictable CCK field name in returned View data

    - by AK
    I'm using views_get_view_result to directly access the data in a view. I've stumbled upon this odd behavior where cck fields are prefixed with the first field name as a query optimization. Explained here. What's bizarre though is that fields are named differently depending on whether I retrieve that data as Anonymous or as Admin. I'm pretty sure all my permissions are set up, and the view itself has no restrictions. What is going on here? This is a big problem since I can't know how to retrieve a field. Here's a dump of the two view results. Notice that node_data_field_game_date_field_game_home_score_value != node_data_field_game_official_field_game_home_score_value. // View as Admin stdClass Object ( [nid] => 3191 [node_data_field_game_date_field_game_date_value] => 2010-03-27T00:00:00 [node_type] => game [node_vid] => 5039 [node_data_field_game_date_field_game_official_value] => 0 [node_node_data_field_game_home_team_title] => TeamA [node_node_data_field_game_home_team_nid] => 3396 [node_data_field_game_date_field_game_home_score_value] => 68 [node_node_data_field_game_visitor_team_title] => TeamB [node_node_data_field_game_visitor_team_nid] => 3442 [node_data_field_game_date_field_game_visitor_score_value] => 118 ) // View as Anonymous stdClass Object ( [nid] => 3191 [node_data_field_game_date_field_game_date_value] => 2010-03-27T00:00:00 [node_type] => game [node_vid] => 5039 [node_data_field_game_official_field_game_official_value] => 0 [node_node_data_field_game_home_team_title] => TeamA [node_node_data_field_game_home_team_nid] => 3396 [node_data_field_game_official_field_game_home_score_value] => 68 [node_node_data_field_game_visitor_team_title] => TeamB [node_node_data_field_game_visitor_team_nid] => 3442 [node_data_field_game_official_field_game_visitor_score_value] => 118 )

    Read the article

  • Can you hide tables from a MySQL user in phpMyAdmin?

    - by AK
    I have a MySQL user added to a database that I would like to prevent from viewing certain tables. I can limit their privileges through MySQL by preventing them from running statements like DROP or ALTER. But is it possible to prevent them from viewing certain tables in phpMyAdmin? If there isn't a MySQL privilege that controls this (I wouldn't imagine there would be), is there a configuration in phpMyAdmin that allows this? I understand one workaround here is to move the tables to a new database that they're not added to. This isn't an option for my application.

    Read the article

  • MySQL nested CASE error I need help with?

    - by AK
    What I am trying to do here is: IF the records in table todo as identified in $done have a value in the column recurinterval then THEN reset date_scheduled column ELSE just set status_id column to 6 for those records. This is the error I get from mysql_error() ... You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASE recurinterval != 0 AND recurinterval IS NOT NULL THEN SET date_sche' at line 2 How can I make this statement work? UPDATE todo CASE recurinterval != 0 AND recurinterval IS NOT NULL THEN SET date_scheduled = CASE recurunit WHEN 'DAY' THEN DATE_ADD(date_scheduled, INTERVAL recurinterval DAY) WHEN 'WEEK' THEN DATE_ADD(date_scheduled, INTERVAL recurinterval WEEK) WHEN 'MONTH' THEN DATE_ADD(date_scheduled, INTERVAL recurinterval MONTH) WHEN 'YEAR' THEN DATE_ADD(date_scheduled, INTERVAL recurinterval YEAR) END WHERE todo_id IN ($done) ELSE SET status_id = 6 WHERE todo_id IN ($done) END The following mySQL statement worked just fine before I revised like above. UPDATE todo SET date_scheduled = CASE recurunit WHEN 'DAY' THEN DATE_ADD(date_scheduled, INTERVAL recurinterval DAY) WHEN 'WEEK' THEN DATE_ADD(date_scheduled, INTERVAL recurinterval WEEK) WHEN 'MONTH' THEN DATE_ADD(date_scheduled, INTERVAL recurinterval MONTH) WHEN 'YEAR' THEN DATE_ADD(date_scheduled, INTERVAL recurinterval YEAR) END WHERE todo_id IN ($done) AND recurinterval != 0 AND recurinterval IS NOT NULL

    Read the article

  • How to find scrollable elements in DOM using XPath?

    - by ak.
    Basically I need to find all elements on the page that have a scrollbar (vertical or horizontal) How to tell if an element has a scrollbar and can actually be scrolled? I found this code snippet on jsperf. Is it possible to capture the logic behind the code into and XPath expression? Or are there any other ways to check for scrollbars? Added: Just to explain what I'm trying to do: I'm developing extension for Firefox. Basically it introduces Vim-style mouseless shortcuts (I know there is Vimperator and Pentadactyl...). One of the features I'd like to implement is to allow the use to select the container that's scrolled with j/k keys. That's why I need to discover all scrollable elements on any given random page.

    Read the article

  • Can we find out the difference between 2 RGb colors to find out a 3rd color?

    - by AK
    2 colors are mixed together. If i have the RGB for the resultant color and RGB for one of the colors mixed, then somehow i could calculate the 2nd color? I will try to explain visually what i am trying to say. Here is a flickr link http://www.flickr.com/photos/48150615@N08/4407414157 I know that the circle in the middle has an opacity of 20% Is there any way to know the color value of the circle so that i can deduct that to get the same color value as the background color.

    Read the article

  • sql boolean truth test: zero OR null

    - by AK
    Is there way to test for both 0 and NULL with one equality operator? I realize I could do this: WHERE field = 0 OR field IS NULL But my life would be a hundred times easier if this would work: WHERE field IN (0, NULL) (btw, why doesn't that work?) I've also read about converting NULL to 0 in the SELECT statement (with COALESCE). The framework I'm using would also make this unpleasant. Realize this is oddly specific, but is there any way to test for 0 and NULL with one WHERE predicate?

    Read the article

  • JQuery Active Refresh Not Working After Server-Side Redirect

    - by Ömer Faruk AK
    I have a page which is refreshing actively every 5 second. But when i click a button from the page which is redirect to itself at server-side and then it's not refreshing. What can i do? JQuery Code; <script type="text/javascript" charset="${_response_encoding}"> // Reload the whole messages panel var refresh = function() { $('#thread').load('@{room()} #thread', function() { $('#thread').trigger('create'); }); } var create = function(){ $('#thread').trigger('create'); } // Call refresh every 5 seconds $(document).ready(setInterval(refresh, 5000)); </script> Server-Side Code; public static void served(Long servingID) { Serving serv = Serving.findById(servingID); serv.isServed = true; serv.save(); index(); }

    Read the article

  • Removing [nid:n] in nodereference autocomplete

    - by AK
    Using the autocomplete field for a cck nodereference always displays the node id as a cryptic bracketed extension: Page Title [nid:23] I understand that this ensures that selections are unique in case nodes have the same title, but obviously this is a nasty thing to expose to the user. Has anyone had any success in removing these brackets, or adding a different unique identifier?

    Read the article

  • Excel: Plot order total in map coordinates

    - by Phliplip
    I have a set of data that looks like this: -X--Y----Amount- AE 24 $178,00 Y 27 $162,00 AD 34 $680,00 AK 35 $178,00 Y 25 $29,00 U 23 $178,00 X 38 $193,00 AC 30 $226,00 AK 39 $152,00 AJ 34 $217,00 AC 35 $183,00 AA 22 $211,00 Z 19 $172,00 AJ 32 $187,00 AF 26 $272,00 AI 27 $220,00 AJ 34 $320,00 AB 32 $183,00 AB 35 $272,00 AC 32 $207,00 AB 28 $178,00 AC 30 $168,00 AC 28 $178,00 AB 32 $310,00 AD 30 $188,00 AB 35 $188,00 The sample above is only an excerpt of the total dataset of 16K rows Each row represents a single delivery order, where the 2 first columns are the map coordinate and the third the purchase amount. Would it be possible to plot the above data in a chart or coordinate system. Where the each plot should be a summary of all sales in the same map coordinate. Also a similar chart of order count would be nice to have.

    Read the article

  • IE / Facebook Issue : Why Facebook Like box not display in Internet Explorer6 - IE8 ?

    - by Vaibhav Bhalke
    Now My final Application.html file contains are < !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd" < html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" < head < meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" / < /head < body < script type="text/javascript" language="javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" < /script < script type="text/javascript" FB_RequireFeatures(["Connect"], function(){ var x=1; } ); < /script < script src="http://static.ak.connect.facebook.com/connect.php/en_US" type="text/javascript" < /script < /body < /html My Java code for LIke Box is as follows FBPageFanWidget.java class FBPageFanWidget extends Composite { public FBPageFanWidget() { VerticalPanel mainPanel = new VerticalPanel(); mainPanel .getElement() .setInnerHTML( "< script type='text/javascript' src='http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US'< /script< script type='text/javascript'FB.init('');< /script< fb:fan profile_id=\"113106068709539\" stream=\"0\" connections=\"10\" logobar=\"0\" width=\"244\" height=\"240\" css='http://127.0.01:8080/webapplicationname/facebook.css?1'< /fb:fan"); initWidget(mainPanel); } } We used proper facebook API_KEY & PAGE_ID It's very important for us to Show Facebook like Box in Our web application Because we have more IE users. If we add FBPageFanWidget.java in our web applicaton then Our Home page is not display in IE because we add Facebook LikeBox so we made changes in Our FBPageFanWidget.java class FBPageFanWidget extends Composite { public FBPageFanWidget() { VerticalPanel mainPanel = new VerticalPanel(); if (!isIE()) { mainPanel.getElement() .setInnerHTML("<script type='text/javascript' src='http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US'></script><script type='text/javascript'>FB.init('');</script><fb:fan profile_id=\"113106068709539\" stream=\"0\" connections=\"10\" logobar=\"0\" width=\"244\" height=\"240\" css='http://127.0.01:8080/webapplicationname/facebook.css?1'></fb:fan>"); } initWidget(mainPanel); } public native String getUserAgent() /-{ return navigator.userAgent; }-/; private boolean isIE() { return (getUserAgent().indexOf("MSIE") > -1); } } when we did this changes Then Facebook Like Box display in every browser excluding IE6 - IE8 :( and also display Our Home page in IE8 excludeing Facebook Like Box. It means There is probelm in IE ? or what changes i need to do in my html file or java file to show facebook like Box properly with displaying our home page It's very important for us to Show Facebook like Box in Our web application Because we have more IE users. Please Reply ASAP. Hope-for Best Co-operation from your side !!!!

    Read the article

  • IE / Facebook Issue : Why Facebook Like box not display in Internet Explorer 6 - IE8 ?

    - by Vaibhav Bhalke
    IE / Facebook Issue : Why Facebook Like box not display in Internet Explorer6 - IE8 ? Facebook like box display throgh my web application on every browser excluding IE-IE8 Now final Application.html file contains are < !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd"><BR> < html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <BR>< head> < meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> < /head><BR> < body> < script type="text/javascript" language="javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"> < /script> <BR> < script type="text/javascript"> FB_RequireFeatures(["Connect"], function(){ var x=1; } ); < /script> <BR> < script src="http://static.ak.connect.facebook.com/connect.php/en_US" type="text/javascript"> < /script> < /body> < /html> My Java code for LIke Box is as follows FBPageFanWidget.java class FBPageFanWidget extends Composite { public FBPageFanWidget() { VerticalPanel mainPanel = new VerticalPanel(); mainPanel .getElement() .setInnerHTML( "< script type='text/javascript' src='http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US'>< /script>< script type='text/javascript'>FB.init('');< /script>< fb:fan profile_id=\"113106068709539\" stream=\"0\" connections=\"10\" logobar=\"0\" width=\"244\" height=\"240\" css='http://127.0.01:8080/webapplicationname/facebook.css?1'>< /fb:fan>"); initWidget(mainPanel); } } We used proper facebook API_KEY & PAGE_ID It's very important for us to Show Facebook like Box in Our web application Because we have more IE users. If we add FBPageFanWidget.java in our web applicaton then Our Home page is not display in IE because we add Facebook LikeBox so we made changes in Our FBPageFanWidget.java class FBPageFanWidget extends Composite { public FBPageFanWidget() { VerticalPanel mainPanel = new VerticalPanel(); if (!isIE()) { mainPanel.getElement() .setInnerHTML("<script type='text/javascript' src='http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US'></script><script type='text/javascript'>FB.init('');</script><fb:fan profile_id=\"113106068709539\" stream=\"0\" connections=\"10\" logobar=\"0\" width=\"244\" height=\"240\" css='http://127.0.01:8080/webapplicationname/facebook.css?1'></fb:fan>"); } initWidget(mainPanel); } public native String getUserAgent() /*-{ return navigator.userAgent; }-*/; private boolean isIE() { return (getUserAgent().indexOf("MSIE") > -1); } } when we did this changes Then Facebook Like Box display in every browser excluding IE6 - IE8 :( and also display Our Home page in IE8 excludeing Facebook Like Box. It means There is probelm in IE ? or what changes i need to do in my html file or java file to show facebook like Box properly with displaying our home page It's very important for us to Show Facebook like Box in Our web application Because we have more IE users. Please Reply ASAP. Hope-for Best Co-operation from your side !!!!

    Read the article

  • Facebook Connect - Security Warning

    - by Skoder
    Hey all, I'm using Facebook connect using FBML tags. Although it works, when I run the site in Internet Explorer, a security warning comes up similar to this: The current webpage is trying to open a site in your Trusted sites list. Do you want to allow this? Current site: http://www.facebook.com Trusted site: http://localhost" My Facebook code involves these two: http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js I tried changing them to HTTPS: https://ssl.connect... but the errors still appear. None of my pages use SSL. I've also tried turning facebook-logo='false' but still no luck. Any ideas on how to fix this? Although it's not show-stopping, it doesn't give a good impression to users who may be feel it insecure. Thanks

    Read the article

  • Facebook Connect 'next' error

    - by Mark
    I am trying to experiment with the new facebook authentication system, and I can't getthe login to work. I'm getting the following error message: API Error Code: 100 API Error Description: Invalid parameter Error Message: next is not owned by the application. The url that is being sent to facebook is: http://www.facebook.com/connect/uiserver.php?app_id=444444444444444&next=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Df357eceb0361a8a%26origin%3Dhttp%253A%252F%252Fwww.mysite.com%252Ff38fea4f9ea573%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df23b800f8a78%26result%3DxxRESULTTOKENxx&display=popup&channel=http%3A%2F%2Fwww.mysite.com%2Ffbtester.php&cancel=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Df6095a98598be8%26origin%3Dhttp%253A%252F%252Fwww.mysite.com%252Ff38fea4f9ea573%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df23b800f8a78%26result%3DxxRESULTTOKENxx&locale=en_US&return_session=1&session_version=3&fbconnect=1&canvas=0&legacy_return=1&method=permissions.request Note that the 'Next' variable in the url is: next=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Df357eceb0361a8a%26origin%3Dhttp%253A%252F%252Fwww.mysite.com%252Ff38fea4f9ea573%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df23b800f8a78%26result%3DxxRESULTTOKENxx Any ideas what could be going wrong? All I've done is copy and paste the facebook login demo code from facebook's website: <?php define('FACEBOOK_APP_ID', 'your application id'); define('FACEBOOK_SECRET', 'your application secret'); function get_facebook_cookie($app_id, $application_secret) { $args = array(); parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args); ksort($args); $payload = ''; foreach ($args as $key => $value) { if ($key != 'sig') { $payload .= $key . '=' . $value; } } if (md5($payload . $application_secret) != $args['sig']) { return null; } return $args; } $cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET); ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <body> <?php if ($cookie) { ?> Your user ID is <?= $cookie['uid'] ?> <?php } else { ?> <fb:login-button></fb:login-button> <?php } ?> <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({appId: '<?= FACEBOOK_APP_ID ?>', status: true, cookie: true, xfbml: true}); FB.Event.subscribe('auth.login', function(response) { window.location.reload(); }); </script> </body> </html> Thanks for the help!

    Read the article

  • Need advice on speeding up tableViewCell photo loading performance

    - by ambertch
    I have around 20 tableview cells that each contain a number (2-5) thumbnail sized pictures (they are VERY small Facebook profile pictures, ex. http://profile.ak.fbcdn.net/hprofile-ak-sf2p/hs254.snc3/23133_201668_2989_q.jpg). Each picture is an UIImageView added to the cell's contentview. Scrolling performance is poor, and measuring the draw time I've found the UIImage rendering is the bottleneck. I've researched/thought of some solutions but as I am new to iphone development I am not sure which strategy to pursue: preload all the images and retrieve them from disk instead of URL when drawing cells (I'm not sure if cell drawing will still be slow, so I want to hold off on the time investment here) Have the cells display a placeholder image from disk, while the picture is asynchronously loaded (this seems to be the best solution, but I'm currently not sure exactly how to do best do this) There's the fast drawing recommendation from Tweetie, but I don't know that will have much affect if it turns out my overhead is in network loading (http://blog.atebits.com/2008/12/fast-scrolling-in-tweetie-with-uitableview/) Thoughts/implementation advice? Thanks!

    Read the article

  • Computing unique index for every poker starting hand

    - by Aly
    As there are 52 cards in a deck we know there are 52 choose 2 = 1326 distinct matchups, however in preflop poker this can be bucketed into 169 different hands such as AK offsuit and AK suited as whether it is A hearts K hearts or A spade K spades it makes no difference preflop. My question is, is there a nice mathematical property in which I can uniquely index each of these 169 hands (from 0 to 168 preferably). I am trying to create a look up table as a double[][] = new double [169][169] but have no way of changing a hand representation such as AKs (an Ace and a King of the same suit) to a unique index in this array.

    Read the article

  • Can't setup Facebook Login on my website..

    - by Mark
    I am trying to experiment with the new facebook authentication system, and I can't getthe login to work. I'm getting the following error message: API Error Code: 100 API Error Description: Invalid parameter Error Message: next is not owned by the application. The url that is being sent to facebook is: http://www.facebook.com/connect/uiserver.php?app_id=444444444444444&next=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Df357eceb0361a8a%26origin%3Dhttp%253A%252F%252Fwww.mysite.com%252Ff38fea4f9ea573%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df23b800f8a78%26result%3DxxRESULTTOKENxx&display=popup&channel=http%3A%2F%2Fwww.mysite.com%2Ffbtester.php&cancel=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Df6095a98598be8%26origin%3Dhttp%253A%252F%252Fwww.mysite.com%252Ff38fea4f9ea573%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df23b800f8a78%26result%3DxxRESULTTOKENxx&locale=en_US&return_session=1&session_version=3&fbconnect=1&canvas=0&legacy_return=1&method=permissions.request Note that the 'Next' variable in the url is: next=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Df357eceb0361a8a%26origin%3Dhttp%253A%252F%252Fwww.mysite.com%252Ff38fea4f9ea573%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df23b800f8a78%26result%3DxxRESULTTOKENxx Any ideas what could be going wrong? All I've done is copy and paste the facebook login demo code from facebook's website: define('FACEBOOK_APP_ID', 'your application id'); define('FACEBOOK_SECRET', 'your application secret'); function get_facebook_cookie($app_id, $application_secret) { $args = array(); parse_str(trim($COOKIE['fbs' . $app_id], '\"'), $args); ksort($args); $payload = ''; foreach ($args as $key = $value) { if ($key != 'sig') { $payload .= $key . '=' . $value; } } if (md5($payload . $application_secret) != $args['sig']) { return null; } return $args; } $cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET); ? Your user ID is <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({appId: '<?= FACEBOOK_APP_ID ?>', status: true, cookie: true, xfbml: true}); FB.Event.subscribe('auth.login', function(response) { window.location.reload(); }); </script> Thanks for the help!

    Read the article

  • Can I mix compile time string comparison with MPL templates?

    - by Negative Zero
    I got this compile time string comparison from another thread using constexpr and C++11 (http://stackoverflow.com/questions/5721813/compile-time-assert-for-string-equality). It works with constant strings like "OK" constexpr bool isequal(char const *one, char const *two) { return (*one && *two) ? (*one == *two && isequal(one + 1, two + 1)) : (!*one && !*two); } I am trying to use it in the following context: static_assert(isequal(boost::mpl::c_str<boost::mpl::string<'ak'>>::value, "ak"), "should not fail"); But it gives me an compilation error of static_assert expression is not an constant integral expression. Can I do this?

    Read the article

  • PHP or C# script to parse CSV table values to fill in one-to-many table

    - by Yaaqov
    I'm looking for an example of how to split-out comma-delimited data in a field of one table, and fill in a second table with those individual elements, in order to make a one-to-many relational database schema. This is probably really simple, but let me give an example: I'll start with everything in one table, Widgets, which has a "state" field to contain states that have that widget: Table: WIDGET =============================== | id | unit | states | =============================== |1 | abc | AL,AK,CA | ------------------------------- |2 | lmn | VA,NC,SC,GA,FL | ------------------------------- |3 | xyz | KY | =============================== Now, what I'd like to create via code is a second table to be joined to WIDGET called *Widget_ST* that has widget id, widget state id, and widget state name fields, for example Table: WIDGET_ST ============================== | w_id | w_st_id | w_st_name | ------------------------------ |1 | 1 | AL | |1 | 2 | AK | |1 | 3 | CA | |2 | 1 | VA | |2 | 2 | NC | |2 | 1 | SC | |2 | 2 | GA | |2 | 1 | FL | |3 | 1 | KY | ============================== I am learning C# and PHP, so responses in either language would be great. Thanks.

    Read the article

  • D2K to OA Framework Transition

    - by PRajkumar
    What is the difference between D2K form and OA Framework? It is a very innocent but important question for someone that desires to make transition from D2K to OA Framework. I hope you have already read and implemented OA Framework Getting Started. I will re-visit my own experience of implementing HelloWorld program in "OA Framework". When I implemented HelloWorld a year ago, I had no clue as to what I was doing & why I was doing those steps. I merely copied the steps from Oracle Tutorial without understanding them. Hence in this blog, I will try to explain in simple manner the meaning of OA Framework HelloWorld Program and compare the steps to D2K form [where possible]. To keep things simple, only basics will be discussed. Following key Steps were needed for HelloWorld Step 1 Create a new Workspace and a new Project as dictated by Oracle's tutorial. When defining project, you will specify a default package, which in this case was oracle.apps.ak.hello This means the following: - ak is the short name of the Application in Oracle           [means fnd_applications.short_name] hello is the name of your project Step 2 Next, you will create a OA Page within hello project Think OA Page as the fmx file itself in D2K. I am saying so because this page gets attached to the form function. This page will be created within hello project, hence the package name oracle.apps.ak.hello.webui Note the webui, it is a convention to have page in webui, means this page represents the Web User Interface You will assign the default AM [OAApplicationModule]. Think of AM "Connection Manager" and "Transaction State Manager" for your page          I can't co-relate this to anything in D2k, as there is no concept of Connection Pooling and that D2k is not stateless. Reason being that as soon as you kick off a D2K Form, it connects to a single session of Oracle and sticks to that single Oracle database session. So is not the case in OAF, hence AM is needed. Step 3 You create Region within the Page. ·         Region is what will store your fields. Text input fields will be of type messageTextInput. Think of Canvas in D2K. You can have nested regions. Stacked Canvas in D2K comes the closest to this component of OA Framework Step 4 Add a button to one of the nested regions The itemStyle should be submitButton, in case you want the page to be submitted when this button is clicked There is no WHEN-BUTTON-PRESSED trigger in OAF. In Framework, you will add a controller java code to handle events like Form Submit button clicks. JDeveloper generates the default code for you. Primarily two functions [should I call methods] will be created processRequest [for UI Rendering Handling] and processFormRequest          Think of processRequest as WHEN-NEW-FORM-INSTANCE, though processRequest is very restrictive. Note What is the difference between processRequest and processFormRequest? These two methods are available in the Default Controller class that gets created. processFormRequest This method is commonly used to react/respond to the event that has taken place, for example click of a button. Some examples are if(oapagecontext.getParameter("Cancel") != null) (Do your processing for Cancellation/ Rollback) if(oapagecontext.getParameter("Submit") != null) (Do your validations and commit here) if(oapagecontext.getParameter("Update") != null) (Do your validations and commit here) In the above three examples, you could be calling oapagecontext.forwardImmediately to re-direct the page navigation to some other page if needed. processRequest In this method, usually page rendering related code is written. Effectively, each GUI component is a bean that gets initialised during processRequest. Those who are familiar with D2K forms, something like pre-query may be written in this method. Step 5 In the controller to access the value in field "HelloName" the command is String userContent = pageContext.getParameter("HelloName"); In D2k, we used :block.field. In OAFramework, at submission of page, all the field values get passed into to OAPageContext object. Use getParameter to access the field value To set the value of the field, use OAMessageTextInputBean field HelloName = (OAMessageTextInputBean)webBean.findChildRecursive("HelloName"); fieldHelloName.setText(pageContext,"Setting the default value" ); Note when setting field value in controller: Note 1. Do not set the value in processFormRequest Note 2. If the field comes from View Object, then do not use setText in controller Note 3. For control fields [that are not based on View Objects], you can use setText to assign values in processRequest method Lets take some notes to expand beyond the HelloWorld Project Note 1 In D2K-forms we sort of created a Window, attached to Canvas, and then fields within that Canvas. However in OA Framework, think of Page being fmx/Window, think of Region being a Canvas, and fields being within Regions. This is not a formal/accurate understanding of analogy between D2k and Framework, but is close to being logical. Note 2 In D2k, your Forms fmb file was compiled to fmx. It was fmx file that was deployed on mid-tier. In case of OAF, your OA Page is nothing but a XML file. We call this MDS [meta data]. Whatever name you give to "Page" in OAF, an XML file of the same name gets created. This xml file must then be loaded into database by using XML Importer command. Note 3 Apart from MDS XML file, almost everything else is merely deployed to your mid-tier. Usually this is underneath $JAVA_TOP/oracle/apps/../.. All java files will go underneath java top/oracle/apps/../.. etc. Note 4 When building tutorial, ignore the steps for setting "Attribute Sets". These are not mandatory. Oracle might just have developed their tutorials without including these. Think of these like Visual Attributes of D2K forms Note 5 Controller is where you will write any java code in OA Framework. You can create a Controller per Page or have a different Controller for each of the Regions with the same Page. Note 6 In the method processFormRequest of the Controller, you can access the values of the page by using notation pageContext.getParameter("<fieldname here>"). This method processFormRequest is executed when the OAF Screen/Page is submitted by click of a button. Note 7 Inside the controller, all the Database Related interactions for example interaction with View Objects happen via Application Module. But why so? Because Application Module Manages the transaction state of the Application. OAApplicationModuleImpl oaapplicationmoduleimpl = OAApplicationModuleImpl)oapagecontext.getApplicationModule(oawebbean); OADBTransaction oadbtransaction = OADBTransaction)oaapplicationmoduleimpl.getDBTransaction(); Note 8 In D2K, we have control block or a block based on database view. Similarly, in OA Framework, if the field does not have view Object attached, then it is like a control field. Hence in HelloWorld example, field HelloName is a control field [in D2K terminology]. A view Object can either be based on a view/table, synonym or on a SQL statement. Note 9 I wish to access the fields in multi record block that is based on view Object. Can I do this in Controller? Sure you can. To traverse through those records, do the below ·         Get the reference to the View Object using (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("VO Name Here") ·         Loop through the records in View Objects using count returned from oaviewobject.getFetchedRowCount() ·         For each record, fetch the value of the fields within the loop as oracle.jbo.Row row = oaviewobject.getRowAtRangeIndex(loop index here); (String)row.getAttribute("Column name of VO here ");

    Read the article

  • Facebook Share Button and Counter no longer displaying any Count

    - by donaldthe
    Is it just me or did the Facebook Share button that displays the count of shares and likes just stop working over the past few days? The sharing still works, the count of shares no longer displays. The link that is generated look like this http://www.facebook.com/sharer.php?u= and the JavaScript file on my page is this http://static.ak.fbcdn.net/connect.php/js/FB.Share I haven't changed anything and this has worked for years

    Read the article

  • Why this not working in IE ?

    - by ankit vishwakarma
    <script> FB.init({ appId : '117680911578526', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); //alert(FB.getSession()); /*window.fbAsyncInit = function() { FB.Canvas.setAutoResize(); }*/ </script> <script type="text/javascript"> FB.ui( { // http://www.facebook.com/connect/prompt_feed.php?action_links=%5B%7B%22text%22%3A%22Movies%22%2C%22href%22%3A%22http%3A%2F%2Fapps.facebook.com%2Fhindi_movies%2F%22%7D%5D&api_key=117680911578526&attachment=%7B%22name%22%3A%22Raavan%20%22%2C%22href%22%3A%22http%3A%2F%2Fapps.facebook.com%2Fhindi_movies%2Fmovie%2F6%22%2C%22caption%22%3A%22I%20reviewed%20Raavan%20%20movie%20on%20HindiPix%22%2C%22media%22%3A%5B%7B%22type%22%3A%22image%22%2C%22src%22%3A%22http%3A%2F%2Fmovies.kewlsocial.com%2Fmovies%2Fuploads%2Fmovies%2FRaavna_movie_small_thumb.jpg%22%2C%22href%22%3A%22http%3A%2F%2Fapps.facebook.com%2Fhindi_movies%2Fmovie%2F6%22%7D%5D%7D&callback=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Df1630e903ba2956%26origin%3Dhttp%253A%252F%252Fmovies.kewlsocial.com%252Ff33a89873048d9c%26relation%3Dparent%26transport%3Dflash%26frame%3Df1395ad7dcd52ce%26result%3D%2522xxRESULTTOKENxx%2522&channel_url=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%23%3F%3D%26cb%3Dfc544c0f809639%26origin%3Dhttp%253A%252F%252Fmovies.kewlsocial.com%252Ff33a89873048d9c%26relation%3Dparent.parent%26transport%3Dflash&display=dialog&locale=en_US&message=&method=stream.publish&sdk=joey&user_prompt_message=Share%20your%20thoughts%20about%20movie method: 'stream.publish', //auto_publish: true, display: 'dialog', message: '' , //some default msg in textbox attachment: { name: '<?=$movie['movie_title']?>', caption: 'I reviewed <?=$movie['movie_title']?> movie on HindiPix', href: 'http://apps.facebook.com/hindi_movies/movie/<?=$this->uri->segment(3)?>', media:[{ 'type':'image', 'src':'http://movies.kewlsocial.com/movies/uploads/movies/<?=$movie['movie_image']?>', 'href':'http://apps.facebook.com/hindi_movies/movie/<?=$this->uri->segment(3)?>' }] } , action_links: [{ text: 'Movies', href: 'http://apps.facebook.com/hindi_movies/' }], //user_message_prompt: 'Radhey' user_prompt_message: 'Share your thoughts about movie' }/*, function(response) { if (response && response.post_id) { alert('Post was published.'); } else { alert('Post was not published.'); } }*/ ); </script>

    Read the article

  • possible to have a 'publish to facebook' button on my site?

    - by Haroldo
    I'm building a music events website and want to have a 'share this event' button which publishes the event details on facebook. this tool looks like exactly what i want: http://developers.facebook.com/tools.php?connect_wizard&wizard=stream_publish however, if i copy the code snippet to new file on my site, it doesn't work. I'm assuming there's a few lines of extra php/js i need somewhere? so far i have <body> <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> <script src="http://static.ak.connect.facebook.com/connect.php/en_GB" type="text/javascript"></script> <script type="text/javascript">FB.init("89bb37189bede9e30eb07a66b9a1c52a");</script> <script type="text/javascript"> function callPublish(msg, attachment, action_link) { FB.ensureInit(function () { FB.Connect.streamPublish('', attachment, action_link); }); } </script> <input type="button" onclick="callPublish('',{'name':'jkhkjhkjh','href':'http://www.headfirstbristol.co.uk/','description':'jhfg jkdfgkjdfgjkdfkgdfg df gdg dfg dfg dfg dfg dfg dfg dfg','media':[{'type':'image','src':'http://www.headfirstbristol.co.uk/site_files/images/hf-logo.jpg','href':'http://www.headfirstbristol.co.uk/'}]},null);return false;" value="Preview Dialog" />

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >