Daily Archives

Articles indexed Monday October 29 2012

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

  • Boost Shared Pointers and Memory Management

    - by Izza
    I began using boost rather recently and am impressed by the functionality and APIs provided. In using boost::shared_ptr, when I check the program with Valgrind, I found a considerable number of "Still reachable" memory leaks. As per the documentation of Valgrind, these are not a problem. However, since I used to use the standard C++ library only, I always made sure that any program written is completely free from memory leaks. My question is, are these memory leaks something to worry about? I tried using reset(), however it only decrements the reference count, doesn't deallocate memory. Can I safely ignore these, or any way to forcibly deallocate the memory allocated by boost::shared_ptr? Thank you.

    Read the article

  • Drawing Sprites for iOS games on iPad

    - by TheGamingArt
    So, I'm quite new and confused on the way to tackle creating sprites/sprite sheets for iOS games. I own the full CS5 sweet and have been told that fireworks is the best way to go for creating these (although I don't have the slightest idea in how yet and would love some tutorials/books specifying sprite sheet creation). My thoughts directed me towards tablet drawing, as I am awful at drawing with a mouse and/or tablet without a screen on it (such as a basic wacom). I was thinking about getting an iPad, as this would provide me with an iPad for testing purposes and a tablet. Does anyone know if it's possible (or even a good idea) to draw out your sprites on the iPad. Is it possible to export them out into Fireworks and such?

    Read the article

  • Login verification always this same redirect

    - by user1738013
    This is my code: session_helper if ( ! function_exists('is_login')) { function is_login() { $CI =& get_instance(); $is_logged_in = $CI->session->userdata('is_logged_in'); if (!isset($is_logged_in) || $is_logged_in != TRUE) { redirect('login'); } } } check_login <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Check_login extends CI_Controller { function __construct() { parent::__construct(); $this->is_logged_in(); } function is_logged_in() { $this->load->helper('session_helper'); $this->load->helper('url'); is_login(); } } When I induction this function: Every time is induction redirect('login'); Where is my problem?

    Read the article

  • Is there a way to query if array field contains a certain value in Doctrine2?

    - by dpimka
    Starting out with Symfony2 + Doctrine. I have a table with User objects (fos_user), for which my schema contains a roles column of an 'array' type. Doctrine saves fields of this type by serializing them from php 'array' to 'longtext' (in mysql's case). So let's say I have the following users saved into DB: **User1**: array(ROLE_ADMIN, ROLE_CUSTOM1) **User2**: array(ROLE_ADMIN, ROLE_CUSTOM2) **User3**: array(ROLE_CUSTOM2) Now in my controller I want to select all users with ROLE_ADMIN set. Is there a way to write a DQL query which would directly return me User1 and User2? Or do I need to fetch all users to have Doctrine to unserialize roles column and then for each of them do in_array('ROLE_ADMIN', $user-getRoles())? I have searched the DQL part of the manual, but so far did not find anything similar to my needs...

    Read the article

  • Can you explain this generics behavior and if I have a workaround?

    - by insta
    Sample program below: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GenericsTest { class Program { static void Main(string[] args) { IRetrievable<int, User> repo = new FakeRepository(); Console.WriteLine(repo.Retrieve(35)); } } class User { public int Id { get; set; } public string Name { get; set; } } class FakeRepository : BaseRepository<User>, ICreatable<User>, IDeletable<User>, IRetrievable<int, User> { // why do I have to implement this here, instead of letting the // TKey generics implementation in the baseclass handle it? //public User Retrieve(int input) //{ // throw new NotImplementedException(); //} } class BaseRepository<TPoco> where TPoco : class,new() { public virtual TPoco Create() { return new TPoco(); } public virtual bool Delete(TPoco item) { return true; } public virtual TPoco Retrieve<TKey>(TKey input) { return null; } } interface ICreatable<TPoco> { TPoco Create(); } interface IDeletable<TPoco> { bool Delete(TPoco item); } interface IRetrievable<TKey, TPoco> { TPoco Retrieve(TKey input); } } This sample program represents the interfaces my actual program uses, and demonstrates the problem I'm having (commented out in FakeRepository). I would like for this method call to be generically handled by the base class (which in my real example is able to handle 95% of the cases given to it), allowing for overrides in the child classes by specifying the type of TKey explicitly. It doesn't seem to matter what parameter constraints I use for the IRetrievable, I can never get the method call to fall through to the base class. Also, if anyone can see an alternate way to implement this kind of behavior and get the result I'm ultimately looking for, I would be very interested to see it. Thoughts?

    Read the article

  • Entity Framework does not map 2 columns from a SqlQuery calling a stored procedure

    - by user1783530
    I'm using Code First and am trying to call a stored procedure and have it map to one of my classes. I created a stored procedure, BOMComponentChild, that returns details of a Component with information of its hierarchy in PartsPath and MyPath. I have a class for the output of this stored procedure. I'm having an issue where everything except the two columns, PartsPath and MyPath, are being mapped correctly with these two properties ending up as Nothing. I searched around and from my understanding the mapping bypasses any Entity Framework name mapping and uses column name to property name. The names are the same and I'm not sure why it is only these two columns. The last part of the stored procedure is: SELECT t.ParentID ,t.ComponentID ,c.PartNumber ,t.PartsPath ,t.MyPath ,t.Layer ,c.[Description] ,loc.LocationID ,loc.LocationName ,CASE WHEN sup.SupplierID IS NULL THEN 1 ELSE sup.SupplierID END AS SupplierID ,CASE WHEN sup.SupplierName IS NULL THEN 'Scinomix' ELSE sup.SupplierName END AS SupplierName ,c.Active ,c.QA ,c.IsAssembly ,c.IsPurchasable ,c.IsMachined ,t.QtyRequired ,t.TotalQty FROM BuildProducts t INNER JOIN [dbo].[BOMComponent] c ON c.ComponentID = t.ComponentID LEFT JOIN [dbo].[BOMSupplier] bsup ON bsup.ComponentID = t.ComponentID AND bsup.IsDefault = 1 LEFT JOIN [dbo].[LookupSupplier] sup ON sup.SupplierID = bsup.SupplierID LEFT JOIN [dbo].[LookupLocation] loc ON loc.LocationID = c.LocationID WHERE (@IsAssembly IS NULL OR IsAssembly = @IsAssembly) ORDER BY t.MyPath and the class it maps to is: Public Class BOMComponentChild Public Property ParentID As Nullable(Of Integer) Public Property ComponentID As Integer Public Property PartNumber As String Public Property MyPath As String Public Property PartsPath As String Public Property Layer As Integer Public Property Description As String Public Property LocationID As Integer Public Property LocationName As String Public Property SupplierID As Integer Public Property SupplierName As String Public Property Active As Boolean Public Property QA As Boolean Public Property IsAssembly As Boolean Public Property IsPurchasable As Boolean Public Property IsMachined As Boolean Public Property QtyRequired As Integer Public Property TotalQty As Integer Public Property Children As IDictionary(Of String, BOMComponentChild) = New Dictionary(Of String, BOMComponentChild) End Class I am trying to call it like this: Me.Database.SqlQuery(Of BOMComponentChild)("EXEC [BOMComponentChild] @ComponentID, @PathPrefix, @IsAssembly", params).ToList() When I run the stored procedure in management studio, the columns are correct and not null. I just can't figure out why these won't map as they are the important information in the stored procedure. The types for PartsPath and MyPath are varchar(50).

    Read the article

  • How do I find the Recaptcha ID?

    - by Joe
    I've been stuck on something for the past day. I'm building a RoR bot, and part of it involves signing up for an email account with mail.com. I've automated all the filling out of the form, apart from the captcha (Recaptcha). I'll be using the deathbycaptcha Ruby gem. However, in order to have the captcha solved, I'll need to get either its ID or its URL. While this shows up when I "enable form details" with the Firefox Web Developer toolbar, it doesn't seem to be in the source. How can I find it out? I'm using Watir. Thanks! Joe

    Read the article

  • Fancybox2 Inline Content Gallery

    - by beefchimi
    I am trying to create a gallery of inline content with Fancybox 2, and am failing miserably. I checked out some other resources online and they seem to indicate doing this relatively easily, yet, I cannot seem to get it to work. Here is my fiddle: http://jsfiddle.net/beefchimi/jtxHd/2/ Now, I feel like the fiddle is not loading the resources, so thats a problem. But even with the resources this does not work, I get the fancybox error. Resources: http://fancyapps.com/fancybox/source/jquery.fancybox.pack.js?v=2.1.3 http://fancyapps.com/fancybox/source/jquery.fancybox.css?v=2.1.3 Any help would be greatly appreciated. EDIT: So I can't submit my question without including some code, because linking to jsfiddle isn't okay, so, here is my fancybox initialization, which you will also find in the jsfiddle: $(document).ready(function() { $('a.inlinepopup').fancybox({ 'width' : '75%', 'height' : '75%', 'autoScale' : false, 'type' : 'iframe' }); });

    Read the article

  • jQuery plugins: How can I stop divs from overlapping?

    - by anir
    I'm using Masonry and Embedly plugin to display embedded content, I've put together an example in jsfiddle.net/anir/pBtbb/3/ It appears the Masonry plugin loads first and it causes the overlapping problem (they only show correctly when you resize the result window) I've read that I could use callback functions or retrigger Masonry once embedly has finished rendering content, but I don't know how to do it. Can you help me? Is there any other solution to fix this?

    Read the article

  • How to group rows into two groups in sql?

    - by user1055638
    Lets say I have such a table: id|time|operation 1 2 read 2 5 write 3 3 read 4 7 read 5 2 save 6 1 open and now I would like to do two things: Divide all these records into two groups: 1) all rows where operation equals to "read" 2) all other rows. Sum the time in each group. So that my query would result only into two rows. What I got so far is: select sum(time) as total_time, operation group by operation ; Although that gives me many groups, depending on the number of distinct operations. How I could group them only into two categories? Cheers!

    Read the article

  • const keyword in Objective-c

    - by user392412
    int main(int argc, char *argv[]) { @autoreleasepool { const int x = 1; const NSMutableArray *array1 = [NSMutableArray array]; const NSMutableString *str1 = @"1"; NSString * const str2 = @"2"; // x = 2; compile error [array1 addObject:@"2"]; // ok // [str1 appendString:@"2"]; // runtime error // Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to mutate immutable object with appendString:' // str2 = @"3"; compile error } } my Question is Why array1 addObject is legal and why str1 appendString is forbidden?

    Read the article

  • java.sql.SQLException: No suitable driver found for jdbc:db2:

    - by Celia
    Im using hibernate to connect to my DB2 database. I got java.sql.SQLException: No suitable driver found for jdbc:db2://ldild4268.mycompany.com:55000/myDB. I have db2jcc.jar, db2jcc_javax.jar, db2jcc_license_cu.jar, db2policy.jar, db2ggjava.jar and db2umplugin.jar added into my Java Build Path. I am able to connect to my database through SQuirrel. database.properties: jdbc.driverClassName=com.ibm.db2.jcc.DB2Driver jdbc.url=jdbc:db2://ldild4268.mycompany.com:55000/myDB jdbc.username=uname jdbc.password=pwd datasource.xml: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>/WEB-INF/database.properties</value> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> hibernate.xml: <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> <property name="mappingResources"> <list> <value>/myModel.hbm.xml</value> </list> </property> </bean> myModel.hbm.xml: <hibernate-mapping> <class name="com.myCompany.model.myModel" table="table1" catalog=""> <composite-id> <key-property name="key1" column="key1" length="10"/> <key-property name="key2" column="key2" length="19"/> </composite-id> <property name="name" type="string"> <column name="Name" length="50"/> </property> </class> </hibernate-mapping> myModelDaoImpl: @Repository("myModelDao") public class myModelDaoImpl extends PortfolioHibernateDaoSupport implements myModelDao{ private SessionFactory sessionFactory; public List<Date> getKey1() { return this.sessionFactory.getCurrentSession() .createQuery("select pn.key1 from com.myCompany.model.myModel pn") .list(); } public String getPs() { String query = "select pn.name from com.myCompany.model.myModel pn where pn.key1='2011-09-30' and pn.key2=1049764"; List list = getHibernateTemplate().find(query); } } also, the method getKey1 throws nullPointer exception. How can I use createquery instead of hibernateTemplate? Thanks in advance!

    Read the article

  • Keeping the application state - deploy/install apk

    - by Buffalo
    I'm trying to have my application minimized when paused and then when it's resumed, it should be restored to its previous state, not recreated. This works perfectly when deploying the application on a device/emulator from Eclipse. The problem occurs when I get the apk (either from bin\ or from Project - Android tools - Export signed application package) and install it on a device with a file browser (Astro): the application is destroyed when paused and then recreated. I can call moveTaskToBack(true); in my activity, yet it will still be recreated when launching it. All the discussions around this are based on achieving the opposite: closing the application when minimizing it. Is there any way of achieving what I want?

    Read the article

  • Scrolling RelativeLayout- white border over part of the content

    - by Tanis.7x
    I have a fairly simply Fragment that adds a handful of colored ImageViews to a RelativeLayout. There are more images than can fit on screen, so I implemented some custom scrolling. However, When I scroll around, I see that there is an approximately 90dp white border overlapping part of the content right where the edges of the screen are before I scroll. It is obvious that the ImageViews are still being created and drawn properly, but they are being covered up. How do I get rid of this? I have tried: Changing both the RelativeLayout and FrameLayout to WRAP_CONTENT, FILL_PARENT, MATCH_PARENT, and a few combinations of those. Setting the padding and margins of both layouts to 0dp. Example: Fragment: public class MyFrag extends Fragment implements OnTouchListener { int currentX; int currentY; RelativeLayout container; final int[] colors = {Color.BLACK, Color.RED, Color.BLUE}; @Override public View onCreateView(LayoutInflater inflater, ViewGroup fragContainer, Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_myfrag, null); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); container = (RelativeLayout) getView().findViewById(R.id.container); container.setOnTouchListener(this); // Temp- Add a bunch of images to test scrolling for(int i=0; i<1500; i+=100) { for (int j=0; j<1500; j+=100) { int color = colors[(i+j)%3]; ImageView image = new ImageView(getActivity()); image.setScaleType(ImageView.ScaleType.CENTER); image.setBackgroundColor(color); LayoutParams lp = new RelativeLayout.LayoutParams(100, 100); lp.setMargins(i, j, 0, 0); image.setLayoutParams(lp); container.addView(image); } } } @Override public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: { currentX = (int) event.getRawX(); currentY = (int) event.getRawY(); break; } case MotionEvent.ACTION_MOVE: { int x2 = (int) event.getRawX(); int y2 = (int) event.getRawY(); container.scrollBy(currentX - x2 , currentY - y2); currentX = x2; currentY = y2; break; } case MotionEvent.ACTION_UP: { break; } } return true; } } XML: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" tools:context=".FloorPlanFrag"> <RelativeLayout android:id="@+id/container" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </FrameLayout>

    Read the article

  • Create 2nd tables and add data

    - by Tyler Matema
    I have this task from school, and I am confuse and lost on how I got to do this. So basically I have to create 2 tables to the database but I have to created from php. I have created the first table, but not the second one for some reason. And then, I have to populate first and second tables with 10 and 20 sample records respectively, populate, does it mean like adding more fake users? if so is it like the code shown below? *I got error on the populating second part as well Thank you so much for the help. <?php $host = "host"; $user = "me"; $pswd = "password"; $dbnm = "db"; $conn = @mysqli_connect($host, $user, $pswd, $dbnm); if (!$conn) die ("<p>Couldn't connect to the server!<p>"); $selectData = @mysqli_select_db ($conn, $dbnm); if(!$selectData) { die ("<p>Database Not Selected</p>"); } //1st table $sql = "CREATE TABLE IF NOT EXISTS `friends` ( `friend_id` INT NOT NULL auto_increment, `friend_email` VARCHAR(20) NOT NULL, `password` VARCHAR(20) NOT NULL, `profile_name` VARCHAR(30) NOT NULL, `date_started` DATE NOT NULL, `num_of_friends` INT unsigned, PRIMARY KEY (`friend_id`) )"; //2nd table $sqlMyfriends = "CREATE TABLE `myfriends` ( `friend_id1` INT NOT NULL, `friend_id2` INT NOT NULL, )"; $query_result1 = @mysqli_query($conn, $sql); $query_result2 = @mysqli_query($conn, $sqlMyfriends); //populating 1st table $sqlSt3="INSERT INTO friends (friend_id, friend_email, password, profile_name, date_started, num_of_friends) VALUES('NULL','[email protected]','123','abc','2012-10-25', 5)"; $queryResult3 = @mysqli_query($dbConnect,$sqlSt3) //populating 2nd table $sqlSt13="INSERT INTO myfriends VALUES(1,2)"; $queryResult13=@mysqli_query($dbConnect,$sqlSt13); mysqli_close($conn); ?>

    Read the article

  • Merging rows with uniqueness constraints

    - by Flambino
    I've got a little time-tracking web app (implemented in Rails 3.2.8 & MySQL). The app has several users who add their time to specific tasks, on a given date. The system is set up so a user can only have 1 time entry (i.e. row) per task per date. I.e. if you add time twice on the same task and date, it'll add time to the existing row, rather than create a new one. Now I'm looking to merge 2 tasks. In the simplest terms, merging task ID 2 into task ID 1 would take this time | user_id | task_id | date ------+----------+----------+----------- 10 | 1 | 1 | 2012-10-29 15 | 2 | 1 | 2012-10-29 10 | 1 | 2 | 2012-10-29 5 | 3 | 2 | 2012-10-29 and change it into this time | user_id | task_id | date ------+----------+----------+----------- 20 | 1 | 1 | 2012-10-29 <-- time values merged (summed) 15 | 2 | 1 | 2012-10-29 <-- no change 5 | 3 | 1 | 2012-10-29 <-- task_id changed (no merging necessary) I.e. merge by summing the time values, where the given user_id/date/task combo would conflict. I figure I can use a unique constraint to do a ON DUPLICATE KEY UPDATE ... if I do an insert for every task_id=2 entry. But that seems pretty inelegant. I've also tried to figure a way to first update all the rows in task 1 with the summed-up times, but I can't quite figure that one out. Any ideas?

    Read the article

  • One log4j.xml - many scripts

    - by psed
    One of my utility jar files is used by different nix scripts, located in different categories. Problem: unable to initialize log4j framework (unable to find log4j.xml). Solution, that allows to configure logger correctly while launching jar classes by different scripts - usage of env vars and force configuring using DOMConfigurtor.configure(pathToConfXml) method. is it possible to avoid path hardcoding and configure logger inside of a script? Appreciate all your help. Thanks.

    Read the article

  • when rendering the page on different browsers layout changes

    - by user1776590
    I have create a website using asp.net and when I render the the website on firefox and IE the website look the same and when rendering it on Chrome it move the button lower and changes the location of it this is my master page code <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="UMSite.master.cs" Inherits="WebApplication4.UMSiteMaster" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head runat="server"> <title></title> <link href="~/Styles/UM.css" rel="stylesheet" type="text/css" /> <asp:ContentPlaceHolder ID="HeadContent" runat="server"> </asp:ContentPlaceHolder> </head> <body> <form id="Form1" runat="server"> <div class="page"> <div class="header"> <div class="title"> <h1><img alt="" src="Styles/UMHeader.png" width= "950" height= "65" /></h1> <div class="clear hideSkiplink"> <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"> <Items> <asp:MenuItem NavigateUrl="~/Home.aspx" Text="Home"/> </Items> </asp:Menu> </div> </div> </div></h1> <div class="main" runat="server"> <asp:ContentPlaceHolder ID="MainContent" runat="server"/> </div> </form> </body> </html> the below is the css /* DEFAULTS ----------------------------------------------------------*/ body { background: #b6b7bc; font-size: .80em; font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif; margin: 0px; padding: 0px; color: #696969; height: 192px; } a:link, a:visited { color: #034af3; } a:hover { color: #1d60ff; text-decoration: none; } a:active { color: #034af3; } p { margin-bottom: 10px; line-height: 1.6em; } /* HEADINGS ----------------------------------------------------------*/ h1, h2, h3, h4, h5, h6 { font-size: 1.5em; color: #666666; font-variant: small-caps; text-transform: none; font-weight: 200; margin-bottom: 0px; } h1 { font-size: 1.6em; padding-bottom: 0px; margin-bottom: 0px; } h2 { font-size: 1.5em; font-weight: 600; } h3 { font-size: 1.2em; } h4 { font-size: 1.1em; } h5, h6 { font-size: 1em; } /* this rule styles <h1> and <h2> tags that are the first child of the left and right table columns */ .rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 { margin-top: 0px; } /* PRIMARY LAYOUT ELEMENTS ----------------------------------------------------------*/ .page { width: 950px; height:auto; background-color: #fff; margin: 10px auto 5px auto; border: 1px solid #496077; } .header { position:relative; margin: 0px; padding: 0px; background: #E30613; width: 100%; top: 0px; left: 0px; height: 90px; } .header h1 { font-weight: 700; margin: 0px; padding: 0px 0px 0px 0px; color: #E30613; border: none; line-height: 2em; font-size: 2em; } .main { padding: 0px 12px; margin: 0px 0px 0px 0px; min-height: 630px; width:auto; background-image:url('UMBackground.png'); } .leftCol { padding: 6px 0px; margin: 0px 0px 0px 0px; width: 200px; min-height: 200px; width:auto; } .footer { color: #4e5766; padding: 0px 0px 0px 0px; margin: 0px auto; text-align: center; line-height: normal; } /* TAB MENU ----------------------------------------------------------*/ div.hideSkiplink { background-color:#E30613; width: 950px; height: 35px; margin-top: 0px; } div.menu { padding: 1px 0px 1px 2px; } div.menu ul { list-style: none; margin: 0px; padding: 5px; width: auto; } div.menu ul li a, div.menu ul li a:visited { background-color: #E30613; border: 1.25px #00BFFF solid; color: #F5FFFA; display:inline; line-height: 1.35em; padding: 10px 30px; text-decoration: none; white-space: nowrap; } div.menu ul li a:hover { background-color: #000000; color: #F5FFFA; text-decoration: none; } div.menu ul li a:active { background-color: #E30613; color: #cfdbe6; text-decoration: none; } /* FORM ELEMENTS ----------------------------------------------------------*/ fieldset { margin: 1em 0px; padding: 1em; border: 1px solid #ccc; } fieldset p { margin: 2px 12px 10px 10px; } fieldset.login label, fieldset.register label, fieldset.changePassword label { display: block; } fieldset label.inline { display: inline; } legend { font-size: 1.1em; font-weight: 600; padding: 2px 4px 8px 4px; } input.textEntry { width: 320px; border: 1px solid #ccc; } input.passwordEntry { width: 320px; border: 1px solid #ccc; } div.accountInfo { width: 42%; } /* MISC ----------------------------------------------------------*/ .clear { clear: both; } .title { display: block; float: left; text-align: left; width: 947px; height: 132px; } .loginDisplay { font-size: 1.1em; display: block; text-align: right; padding: 10px; color: White; } .loginDisplay a:link { color: white; } .loginDisplay a:visited { color: white; } .loginDisplay a:hover { color: white; } .failureNotification { font-size: 1.2em; color: Red; } .bold { font-weight: bold; } .submitButton { text-align: right; padding-right: 10px; }

    Read the article

  • Cordova polluted logs with persistent.js add()

    - by slaver113
    I am using the latest phonegap/cordova version 2.1. and my log in Eclipse logcat get polluted with code when i do var allItems = Item.all(); allItems.list(null, function (results) { results.forEach(function (r) { console.log(r.id+ " " + r.lat + " " + r.long + " " + r.state); }); }); I get a output like (for 100s of lines) 10-29 10:56:13.270: I/Web Console(5961): } function (value) { 10-29 10:56:13.270: I/Web Console(5961): if (value === undefined) { 10-29 10:56:13.270: I/Web Console(5961): return getterCallback(); 10-29 10:56:13.270: I/Web Console(5961): } else { 10-29 10:56:13.270: I/Web Console(5961): setterCallback(value); 10-29 10:56:13.270: I/Web Console(5961): return scope; 10-29 10:56:13.270: I/Web Console(5961): } 10-29 10:56:13.270: I/Web Console(5961): } function (value) { 10-29 10:56:13.270: I/Web Console(5961): if (value === undefined) { 10-29 10:56:13.270: I/Web Console(5961): return getterCallback(); 10-29 10:56:13.270: I/Web Console(5961): } else { 10-29 10:56:13.270: I/Web Console(5961): setterCallback(value); 10-29 10:56:13.270: I/Web Console(5961): return scope; 10-29 10:56:13.270: I/Web Console(5961): } 10-29 10:56:13.270: I/Web Console(5961): } function (value) { 10-29 10:56:13.270: I/Web Console(5961): if (value === undefined) { 10-29 10:56:13.270: I/Web Console(5961): return getterCallback(); 10-29 10:56:13.270: I/Web Console(5961): } else { 10-29 10:56:13.270: I/Web Console(5961): setterCallback(value); 10-29 10:56:13.270: I/Web Console(5961): return scope; 10-29 10:56:13.270: I/Web Console(5961): } 10-29 10:56:13.270: I/Web Console(5961): } at :1149822901

    Read the article

  • wmi not available for some time after reboot

    - by Alex Okrushko
    I'm having the problem with the WMI availability on logon. Right after reboot I open cmd and with python interpreter: >>> import wmi >>> c = wmi.WMI() >>> c.Win32_OperatingSystem() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\wmi.py", line 1147, in __getattr__ return getattr (self._namespace, attribute) File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 516, in __getattr__ raise AttributeError("%s.%s" % (self._username_, attr)) AttributeError: winmgmts:.Win32_OperatingSystem >>> 5 minutes later I open another cmd and python interpreter: Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import wmi >>> c = wmi.WMI() >>> c.Win32_OperatingSystem() [<_wmi_object: \\W520-ALEX-WIN7\root\cimv2:Win32_OperatingSystem=@>] >>> NOTE: the first cmd still keeps saying AttributeError even 5 minutes later. NOTE 2: if I logout and login wmi is available, so it is somehow effected by reboot with process explorer I check the environmental variables and they are the same for both cmds What could that be? Please help. UPDATE: Apparently the problem is connecting to the wbem services: >>> import win32com.client >>> win32com.client.Dispatch('WbemScripting.SWbemLocator') <COMObject WbemScripting.SWbemLocator> >>> wmi_service= win32com.client.Dispatch('WbemScripting.SWbemLocator') >>> wbem_service = wmi_service.ConnectServer('.','root/cimv2') >>> wbem_service <COMObject <unknown>> >>> items = wbem_service.ExecQuery('Select * from Win32_OperatingSystem') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<COMObject <unknown>>", line 3, in ExecQuery File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 282, in _ApplyTypes_ result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes ) + args) pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, u'SWbemServicesEx ', u'Generic failure ', None, 0, -2147217407), None) >>> NOTE 3: wmic os always worked. NOTE 4: re-installing pywin32 package didn't help. Neither did Re-registering/re-compiling the WMI components and resetting of the WMI database (as recommended here) NOTE 5: my 4 Other laptops don't have this problem. Also wmiprov.log has: (Mon Oct 29 11:40:07 2012.248587) : *************************************** (Mon Oct 29 11:40:07 2012.248587) : Could not get pointer to binary resource for file: (Mon Oct 29 11:40:07 2012.248587) : C:\Windows\system32\drivers\ndis.sys[MofResourceName](Mon Oct 29 11:40:07 2012.248587) : (Mon Oct 29 11:40:07 2012.248587) : *************************************** (Mon Oct 29 11:40:07 2012.248587) : *************************************** (Mon Oct 29 11:40:07 2012.248587) : Could not get pointer to binary resource for file: (Mon Oct 29 11:40:07 2012.248587) : C:\Windows\system32\drivers\en-US\ndis.sys.mui[MofResourceName](Mon Oct 29 11:40:07 2012.248587) : (Mon Oct 29 11:40:07 2012.248587) : *************************************** (Mon Oct 29 11:40:07 2012.248603) : *************************************** (Mon Oct 29 11:40:07 2012.248603) : Could not get pointer to binary resource for file: (Mon Oct 29 11:40:07 2012.248603) : C:\Windows\system32\DRIVERS\wmiacpi.sys[MofResource](Mon Oct 29 11:40:07 2012.248603) : (Mon Oct 29 11:40:07 2012.248603) : *************************************** (Mon Oct 29 11:40:07 2012.248603) : *************************************** (Mon Oct 29 11:40:07 2012.248603) : Could not get pointer to binary resource for file: (Mon Oct 29 11:40:07 2012.248603) : C:\Windows\system32\DRIVERS\monitor.sys[MonitorWMI](Mon Oct 29 11:40:07 2012.248603) : (Mon Oct 29 11:40:07 2012.248603) : *************************************** NOTE 6: the WMIDiag tool report is at my dropbox

    Read the article

  • $(MSBuildStartupDirectory) in Visual Studio points to different places on different machines

    - by skolima
    In a large solution, I'm integrating Gendarme into Visual Studio 2008 compilation process. I am using GendarmeMsBuild task along with a .targets file to add a AfterBuild target to every project in the solution. I am looking for a way to import this file into .csproj files in a way that wouldn't require me to change the include path (the projects have different nesting levels). Apart from using NuGet SolutionDir variable, best way to solve this seemed to be to use $(MSBuildStartupDirectory). However, as it turns out, on some machines, using the same version of VS 2008 (as same updates installed, as far as I was able to check) this resolves to the solution directory, and on others to c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE. How can I either get this to always resolve to the solution folder or obtain the base folder in another consistent way?

    Read the article

  • Faster, Simpler access to Azure Tables with Enzo Azure API

    - by Herve Roggero
    After developing the latest version of Enzo Cloud Backup I took the time to create an API that would simplify access to Azure Tables (the Enzo Azure API). At first, my goal was to make the code simpler compared to the Microsoft Azure SDK. But as it turns out it is also a little faster; and when using the specialized methods (the fetch strategies) it is much faster out of the box than the Microsoft SDK, unless you start creating complex parallel and resilient routines yourself. Last but not least, I decided to add a few extension methods that I think you will find attractive, such as the ability to transform a list of entities into a DataTable. So let’s review each area in more details. Simpler Code My first objective was to make the API much easier to use than the Azure SDK. I wanted to reduce the amount of code necessary to fetch entities, remove the code needed to add automatic retries and handle transient conditions, and give additional control, such as a way to cancel operations, obtain basic statistics on the calls, and control the maximum number of REST calls the API generates in an attempt to avoid throttling conditions in the first place (something you cannot do with the Azure SDK at this time). Strongly Typed Before diving into the code, the following examples rely on a strongly typed class called MyData. The way MyData is defined for the Azure SDK is similar to the Enzo Azure API, with the exception that they inherit from different classes. With the Azure SDK, classes that represent entities must inherit from TableServiceEntity, while classes with the Enzo Azure API must inherit from BaseAzureTable or implement a specific interface. // With the SDK public class MyData1 : TableServiceEntity {     public string Message { get; set; }     public string Level { get; set; }     public string Severity { get; set; } } //  With the Enzo Azure API public class MyData2 : BaseAzureTable {     public string Message { get; set; }     public string Level { get; set; }     public string Severity { get; set; } } Simpler Code Now that the classes representing an Azure Table entity are defined, let’s review the methods that the Azure SDK would look like when fetching all the entities from an Azure Table (note the use of a few variables: the _tableName variable stores the name of the Azure Table, and the ConnectionString property returns the connection string for the Storage Account containing the table): // With the Azure SDK public List<MyData1> FetchAllEntities() {      CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConnectionString);      CloudTableClient tableClient = storageAccount.CreateCloudTableClient();      TableServiceContext serviceContext = tableClient.GetDataServiceContext();      CloudTableQuery<MyData1> partitionQuery =         (from e in serviceContext.CreateQuery<MyData1>(_tableName)         select new MyData1()         {            PartitionKey = e.PartitionKey,            RowKey = e.RowKey,            Timestamp = e.Timestamp,            Message = e.Message,            Level = e.Level,            Severity = e.Severity            }).AsTableServiceQuery<MyData1>();        return partitionQuery.ToList();  } This code gives you automatic retries because the AsTableServiceQuery does that for you. Also, note that this method is strongly-typed because it is using LINQ. Although this doesn’t look like too much code at first glance, you are actually mapping the strongly-typed object manually. So for larger entities, with dozens of properties, your code will grow. And from a maintenance standpoint, when a new property is added, you may need to change the mapping code. You will also note that the mapping being performed is optional; it is desired when you want to retrieve specific properties of the entities (not all) to reduce the network traffic. If you do not specify the properties you want, all the properties will be returned; in this example we are returning the Message, Level and Severity properties (in addition to the required PartitionKey, RowKey and Timestamp). The Enzo Azure API does the mapping automatically and also handles automatic reties when fetching entities. The equivalent code to fetch all the entities (with the same three properties) from the same Azure Table looks like this: // With the Enzo Azure API public List<MyData2> FetchAllEntities() {        AzureTable at = new AzureTable(_accountName, _accountKey, _ssl, _tableName);        List<MyData2> res = at.Fetch<MyData2>("", "Message,Level,Severity");        return res; } As you can see, the Enzo Azure API returns the entities already strongly typed, so there is no need to map the output. Also, the Enzo Azure API makes it easy to specify the list of properties to return, and to specify a filter as well (no filter was provided in this example; the filter is passed as the first parameter).  Fetch Strategies Both approaches discussed above fetch the data sequentially. In addition to the linear/sequential fetch methods, the Enzo Azure API provides specific fetch strategies. Fetch strategies are designed to prepare a set of REST calls, executed in parallel, in a way that performs faster that if you were to fetch the data sequentially. For example, if the PartitionKey is a GUID string, you could prepare multiple calls, providing appropriate filters ([‘a’, ‘b’[, [‘b’, ‘c’[, [‘c’, ‘d[, …), and send those calls in parallel. As you can imagine, the code necessary to create these requests would be fairly large. With the Enzo Azure API, two strategies are provided out of the box: the GUID and List strategies. If you are interested in how these strategies work, see the Enzo Azure API Online Help. Here is an example code that performs parallel requests using the GUID strategy (which executes more than 2 t o3 times faster than the sequential methods discussed previously): public List<MyData2> FetchAllEntitiesGUID() {     AzureTable at = new AzureTable(_accountName, _accountKey, _ssl, _tableName);     List<MyData2> res = at.FetchWithGuid<MyData2>("", "Message,Level,Severity");     return res; } Faster Results With Sequential Fetch Methods Developing a faster API wasn’t a primary objective; but it appears that the performance tests performed with the Enzo Azure API deliver the data a little faster out of the box (5%-10% on average, and sometimes to up 50% faster) with the sequential fetch methods. Although the amount of data is the same regardless of the approach (and the REST calls are almost exactly identical), the object mapping approach is different. So it is likely that the slight performance increase is due to a lighter API. Using LINQ offers many advantages and tremendous flexibility; nevertheless when fetching data it seems that the Enzo Azure API delivers faster.  For example, the same code previously discussed delivered the following results when fetching 3,000 entities (about 1KB each). The average elapsed time shows that the Azure SDK returned the 3000 entities in about 5.9 seconds on average, while the Enzo Azure API took 4.2 seconds on average (39% improvement). With Fetch Strategies When using the fetch strategies we are no longer comparing apples to apples; the Azure SDK is not designed to implement fetch strategies out of the box, so you would need to code the strategies yourself. Nevertheless I wanted to provide out of the box capabilities, and as a result you see a test that returned about 10,000 entities (1KB each entity), and an average execution time over 5 runs. The Azure SDK implemented a sequential fetch while the Enzo Azure API implemented the List fetch strategy. The fetch strategy was 2.3 times faster. Note that the following test hit a limit on my network bandwidth quickly (3.56Mbps), so the results of the fetch strategy is significantly below what it could be with a higher bandwidth. Additional Methods The API wouldn’t be complete without support for a few important methods other than the fetch methods discussed previously. The Enzo Azure API offers these additional capabilities: - Support for batch updates, deletes and inserts - Conversion of entities to DataRow, and List<> to a DataTable - Extension methods for Delete, Merge, Update, Insert - Support for asynchronous calls and cancellation - Support for fetch statistics (total bytes, total REST calls, retries…) For more information, visit http://www.bluesyntax.net or go directly to the Enzo Azure API page (http://www.bluesyntax.net/EnzoAzureAPI.aspx). About Herve Roggero Herve Roggero, Windows Azure MVP, is the founder of Blue Syntax Consulting, a company specialized in cloud computing products and services. Herve's experience includes software development, architecture, database administration and senior management with both global corporations and startup companies. Herve holds multiple certifications, including an MCDBA, MCSE, MCSD. He also holds a Master's degree in Business Administration from Indiana University. Herve is the co-author of "PRO SQL Azure" from Apress and runs the Azure Florida Association (on LinkedIn: http://www.linkedin.com/groups?gid=4177626). For more information on Blue Syntax Consulting, visit www.bluesyntax.net.

    Read the article

  • XPath execution utility

    - by TATWORTH
    I have written an XPath test utility at http://commonxpath.codeplex.com/releases/view/96687This is a WPF application that allows you to enter some test XML and and an XPath expression. When writing such expressions it is important to get the XPath expression correct before embedding it into a program.The program is available as source under LGPL so you can run it both on your office and home PCs. There is a link to help on XPATH syntax.

    Read the article

  • Specs, Form and Function – What am I Missing?

    - by Barry Shulam
    0 0 1 628 3586 08041 29 8 4206 14.0 Normal 0 false false false EN-US JA X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:Cambria; mso-ascii-font-family:Cambria; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Cambria; mso-hansi-theme-font:minor-latin;} Friday October 26th the Microsoft Surface RT arrived at the office.  I was summoned to my boss’s office for the grand unpacking.  If I had planned ahead I could have used my iPhone 4 to film the event and post it on YouTube however the desire to hold the device and turn it ON was more inviting than becoming a proxy reviewer for Engadget’s website.  1980 was the first time we had a personal computer in our house.  It was a  Kaypro computer. It weighed 29 pounds more than any persons lap could hold.  Then the term “portable computer” meant you could remove it from the building and take it else where.  Today I am typing on this entry on a Macbook Air which weighs 2.38 pounds. This morning Amazons front page main title is: “Much More for Much Less” I was born at the right time to start with the CPM operating system on the Kaypro thru the DOS, Windows, Linux, Mac OSX and mobile phone operating systems and languages.  If you are not aware Technology is moving at a rapid pace.  The New iPad (those who are keeping score – iPad4) is replacing a 7 month old machine the New iPad (iPad 3) I have used and owned many technology devices in my life.  The main point that most of the reader who are in the USA overlook is the fact that we are in the USA.  The devices we purchase have a great digital garden to support them.  The Kaypro computer had a 7-inch screen.  It was a TV tube with two colors – Black and Green.  You could see the 80-column screen flicker with characters – have you every played Pac-Man emulated on the screen with the ABC characters. Traveling across the world you will find that not all apps on your device will function as they did back home because they are not offered outside of your country of origin. I think the main question a buyer of technology should be asking is Function.  The greatest Specs with out function limit you.  The most beautiful form with out function is the same as a crystal vase on your shelf – not a good cereal bowl in the morning. Microsoft Surface RT, Amazon Kindle Fire and Apple iPad all great devices in their respective customers hands. My advice for those looking to purchase on this year:  If the device is your only technology device you buy what you WANT and LIKE. Consider this parallel universe if its not your only device?  Ever go shopping for clothing, shoes, and accessories with your wife, girlfriend, sister or mother?  If you listen carefully you will hear the little voices coming out of there heads saying:  “This goes well with that and I can use it also with that outfit” ”Do you think this clashes with that?”  “Ohh I love how that combination looks on you”.  Portable devices such as tablets and computers can offer a whole lot more when they are combined with the digital echo system you have at home and the manufacturer offers online. Pros of each Device: Microsoft Surface RT: There is a new functionality named SmartGlass which will let you share the content off your tablet to your XBOX 360.  Microsoft office is loaded on the tablet.  You can have more than one user profile on the tablet if you share it with others.   Amazon Kindle or Kindle HD: If you are an Amazon consumer with an annual Amazon Prime service you can consume videos and read books off the Amazon site.  Its the cheapest device.  Its a step up from the kindle reader in many ways.   Apple Ipad or Ipad mini: Over 270 Thousand applications.  Airplay permits you the ability to share to your TV screen. If you are a cord cutter (a person who gets their entertainment content over the web or air vs Cable Providers) the Airplay or Smart glass are a huge bonus.  iPad mini or not: The mini will fit in a purse where the larger one will not.  Its lighter which makes it nice to hold for prolonged periods.  It has an option for LTE wireless which non of the other sub 9 inch tables offer.  The screen is non retina which means the applications are smaller.  Speaking with individuals who are above 50 in age that wear glasses they retina does not make a difference for them however they prefer the larger iPad over the new mini.   Happy Shopping this Channuka Season.   The Kosher Coder.   Follow me on twitter @KosherCoder

    Read the article

  • How to disable multiple form submit (POST) in IIS

    - by user1209640
    We had a major SharePoint outage a few months back because a user wedged their keyboard in such a way as to cause the Enter button to be pressed indefinitely. The user was on a customized people search page and hundreds of POSTs by the same user were submitted asynchronously, which overloaded the server. Because I work in a large organization, I am looking for a more global way to prevent this from happening. Is there a way to prevent multiple web form submissions by a common user within a short period of time within IIS? I am aware we can write javascript to disable the button after it is clicked, but we are hoping to prevent this issue from occurring on other pages where a similar possibility may exist. Update: It appears looking at the source code, the javascript is performing a document.location = url, whenever keycode 13 (Enter) is pressed. Again, we can write JS to prevent this in this location, but we also want to be able to guard against this kind of issue more generally... preferably at the IIS level.

    Read the article

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