Search Results

Search found 1101 results on 45 pages for 'essential'.

Page 39/45 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • Key Windows Phone Development Concepts

    - by Tim Murphy
    As I am doing more development in and out of the enterprise arena for Windows Phone I decide I would study for the 70-599 test.  I generally take certification tests as a way to force me to dig deeper into a technology.  Between the development and studying I decided it would be good to put a post together of key development features in Windows Phone 7 environment.  Contrary to popular belief the launch of Windows Phone 8 will not obsolete Windows Phone 7 development.  With the launch of 7.8 coming shortly and people who will remain on 7.X for the foreseeable future there are still consumers needing these apps so don’t throw out the baby with the bath water. PhoneApplicationService This is a class that every Windows Phone developer needs to become familiar with.  When it comes to application state this is your go to repository.  It also contains events that help with management of your application’s lifecycle.  You can access it like the following code sample. 1: PhoneApplicationService.Current.State["ValidUser"] = userResult; DeviceNetworkInformation This class allows you to determine the connectivity of the device and be notified when something changes with that connectivity.  If you are making web service calls you will want to check here before firing off. I have found that this class doesn’t actually work very well for determining if you have internet access.  You are better of using the following code where IsConnectedToInternet is an App level property. private void Application_Launching(object sender, LaunchingEventArgs e){ // Validate user access if (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType != Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None) { IsConnectedToInternet = true; } else { IsConnectedToInternet = false; } NetworkChange.NetworkAddressChanged += new NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);}void NetworkChange_NetworkAddressChanged(object sender, EventArgs e){ IsConnectedToInternet = (Microsoft.Phone.Net.NetworkInformation.NetworkInterface.NetworkInterfaceType != Microsoft.Phone.Net.NetworkInformation.NetworkInterfaceType.None);} Push Notification Push notification allows your application to receive notifications in a way that reduces the application’s power needs. This MSDN article is a good place to get the basics of push notification, but you can see the essential concept in the diagram below.  There are three types of push notification: toast, Tile and raw.  The first two work regardless of the state of the application where as raw messages are discarded if your application is not running.   Live Tiles Live tiles are one of the main differentiators of the Windows Phone platform.  They allow users to find information at a glance from their start screen without navigating into individual apps.  Knowing how to implement them can be a great boost to the attractiveness of your application. The simplest step-by-step explanation for creating live tiles is here. Local Database While your application really only has Isolated Storage as a data store there are some ways of giving you database functionality to develop against.  There are a number of open source ORM style solutions.  Probably the best and most native way I have found is to use LINQ to SQL.  It does take a significant amount of setup, but the ease of use once it is configured is worth the cost.  Rather than repeat the full concepts here I will point you to a post that I wrote previously. Tasks (Bing, Email) Leveraging built in features of the Windows Phone platform is an easy way to add functionality that would be expensive to develop on your own.  The classes that you need to make yourself familiar with are BingMapsDirectionsTask and EmailComposeTask.  This will allow your application to supply directions and give the user an email path to relay information to friends and associates. Event model Because of the ability for users to switch quickly to switch to other apps or the home screen is just one reason why knowing the Windows Phone event model is important.  You need to be able to save data so that if a user gets a phone call they can come back to exactly where they were in your application.  This means that you will need to handle such events as Launching, Activated, Deactivated and Closing at an application level.  You will probably also want to get familiar with the OnNavigatedTo and OnNavigatedFrom events at the page level.  These will give you an opportunity to save data as a user navigates through your app. Summary This is just a small portion of the concepts that you will use while building Windows Phone apps, but these are some of the most critical.  With the launch of Windows Phone 8 this list will probably expand.  Take the time to investigate these topics further and try them out in your apps. del.icio.us Tags: Windows Phone 7,Windows Phone,WP7,Software Development,70-599

    Read the article

  • To Make Diversity Work, Managers Must Stop Ignoring Difference

    - by HCM-Oracle
    By Kate Pavao - Originally posted on Profit Executive coaches Jane Hyun and Audrey S. Lee noticed something during their leadership development coaching and consulting: Frustrated employees and overwhelmed managers. “We heard from voices saying, ‘I wish my manager understood me better’ or ‘I hope my manager would take the time to learn more about me and my background,’” remembers Hyun. “At the same token, the managers we were coaching had a hard time even knowing how to start these conversations.”  Hyun and Lee wrote Flex to address some of the fears managers have when it comes to leading diverse teams—such as being afraid of offending their employees by stumbling into sensitive territory—and also to provide a sure-footed strategy for becoming a more effective leader. Here, Hyun talks about what it takes to create innovate and productive teams in an increasingly diverse world, including the key characteristics successful managers share. Q: What does it mean to “flex”? Hyun: Flexing is the art of switching between leadership styles to work more effectively with people who are different from you. It’s not fundamentally changing who you are, but it’s understanding when you need to adapt your style in a situation so that you can accommodate people and make them feel more comfortable. It’s understanding the gap that might exist between you and others who are different, and then flexing across that gap to get the result that you're looking for. It’s up to all of us, not just managers, but also employees, to learn how to flex. When you hire new people to the organization, they're expected to adapt. The new people in the organization may need some guidance around how to best flex. They can certainly take the initiative, but if you can give them some direction around the important rules, and connect them with insiders who can help them figure out the most critical elements of the job, that will accelerate how quickly they can contribute to your organization. Q: Why is it important right now for managers to understand flexing? Hyun: The workplace is becoming increasingly younger, multicultural and female. The numbers bear it out. Millennials are entering the workforce and becoming a larger percentage of it, which is a global phenomenon. Thirty-six percent of the workforce is multicultural, and close to half is female. It makes sense to better understand the people who are increasingly a part of your workforce, and how to best lead them and manage them as well. Q: What do companies miss out on when managers don’t flex? Hyun: There are high costs for losing people or failing to engage them. The estimated costs of replacing an employee is about 150 percent of that person’s salary. There are studies showing that employee disengagement costs the U.S. something like $450 billion a year. But voice is the biggest thing you miss out on if you don’t flex. Whenever you want innovation or increased productivity from your people, you need to figure out how to unleash these things. The way you get there is to make sure that everybody’s voice is at the table. Q: What are some of the common misassumptions that managers make about the people on their teams? Hyun: One is what I call the Golden Rule mentality: We assume when we go to the workplace that people are going to think like us and operate like us. But sometimes when you work with people from a different culture or a different generation, they may have a different mindset about doing something, or a different approach to solving a problem, or a different way to manage some situation. When see something that’s different, we don't understand it, so we don't trust it. We have this hidden bias for people who are like us. That gets in the way of really looking at how we can tap our team members best potential by understanding how their difference may help them be effective in our workplace. We’re trained, especially in the workplace, to make assumptions quickly, so that you can make the best business decision. But with people, it’s better to remain curious. If you want to build stronger cross-cultural, cross-generational, cross-gender relationships, before you make a judgment, share what you observe with that team member, and connect with him or her in ways that are mutually adaptive, so that you can work together more effectively. Q: What are the common characteristics you see in leaders who are successful at flexing? Hyun: One is what I call “adaptive ability”—leaders who are able to understand that someone on their team is different from them, and willing to adapt his or her style to do that. Another one is “unconditional positive regard,” which is basically acceptance of others, even in their vulnerable moments. This attitude of grace is critical and essential to a healthy environment in developing people. If you think about when people enter the workforce, they're only 21 years old. It’s quite a formative time for them. They may not have a lot of management experience, or experience managing complex or even global projects. Creating the best possible condition for their development requires turning their mistakes into teachable moments, and giving them an opportunity to really learn. Finally, these leaders are not rigid or constrained in a single mode or style. They have this insatiable curiosity about other people. They don’t judge when they see behavior that doesn’t make sense, or is different from their own. For example, maybe someone on their team is a less aggressive than they are. The leader needs to remain curious and thinks, “Wow, I wonder how I can engage in a dialogue with this person to get their potential out in the open.”

    Read the article

  • Android RelativeLayout fill_parent unexpected behavior in a ListView with varying row heights

    - by Jameel Al-Aziz
    I'm currently working on a small update to a project and I'm having an issue with Relative_Layout and fill_parent in a list view. I'm trying to insert a divider between two sections in each row, much like the divider in the call log of the default dialer. I checked out the Android source code to see how they did it, but I encountered a problem when replicating their solution. To start, here is my row item layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:padding="10dip" android:layout_height="fill_parent" android:maxHeight="64dip" android:minHeight="?android:attr/listPreferredItemHeight"> <ImageView android:id="@+id/infoimage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:src="@drawable/info_icon_big" android:layout_alignParentRight="true" android:layout_centerVertical="true"/> <View android:id="@+id/divider" android:background="@drawable/divider_vertical_dark" android:layout_marginLeft="11dip" android:layout_toLeftOf="@+id/infoimage" android:layout_width="1px" android:layout_height="fill_parent" android:layout_marginTop="5dip" android:layout_marginBottom="5dip" android:layout_marginRight="4dip"/> <TextView android:id="@+id/TextView01" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@+id/ImageView01" android:layout_toLeftOf="@+id/divider" android:gravity="left|center_vertical" android:layout_marginLeft="4dip" android:layout_marginRight="4dip"/> <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:background="@drawable/bborder" android:layout_centerVertical="true"/> </RelativeLayout> The issue I'm facing is that each row has a thumbnail of varying height (ImageView01). If I set the RelativeLayout's layout_height property to fill_parent, the divider does not scale vertically to fill the row (it just remains a 1px dot). If I set layout_height to "?android:attr/listPreferredItemHeight", the divider fills the row, but the thumbnails shrink. I've done some debugging in the getView() method of the adapter, and it seems that the divider's height is not being set properly once the row has it's proper height. Here is a portion of the getView() method: public View getView(int position, View view, ViewGroup parent) { if (view == null) { view = inflater.inflate(R.layout.tag_list_item, parent, false); } The rest of the method simply sets the appropriate text and images for the row. Also, I create the inflater object in the adapter's constructor with: inflater = LayoutInflater.from(context); Am I missing something essential? Or does fill_parent just not work with dynamic heights?

    Read the article

  • JLabel animation in JPanel

    - by Trizicus
    After scratching around I found that it's best to implement a custom image component by extending a JLabel. So far that has worked great as I can add multiple "images" (jlabels without the layout breaking. I just have a question that I hope someone can answer for me. I noticed that in order to animate JLabels across the screen I need to setlayout(null); and setbounds of the component and then to animate eventually setlocation(x,y);. Is this a best practice or a terrible way to animate a component? I plan on eventually making an animation class but I don't want to do so and end up having to chuck it. I have included relevant code for a quick review check. import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JPanel; import javax.swing.Timer; public class GraphicsPanel extends JPanel { private Timer timer; private long startTime = 0; private int numFrames = 0; private float fps = 0.0f; private int x = 0; GraphicsPanel() { final Entity ent1 = new Entity(); ent1.setBounds(x, 0, ent1.getWidth(), ent1.getHeight()); add(ent1); //ESSENTIAL setLayout(null); //GAMELOOP timer = new Timer(30, new ActionListener() { public void actionPerformed(ActionEvent e) { getFPS(); incX(); ent1.setLocation(x, 0); repaint(); } }); timer.start(); } public void incX() { x++; } @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g.create(); g2.setClip(0, 0, getWidth(), getHeight()); g2.setColor(Color.BLACK); g2.drawString("FPS: " + fps, 1, 15); } public void getFPS() { ++numFrames; if (startTime == 0) { startTime = System.currentTimeMillis(); } else { long currentTime = System.currentTimeMillis(); long delta = (currentTime - startTime); if (delta > 1000) { fps = (numFrames * 1000) / delta; numFrames = 0; startTime = currentTime; } } } } Thank you!

    Read the article

  • How to call function that inside JQuery Plugin From outside the plugin?

    - by CaTz
    hi, i am using textarea elastic plugin JQuery. this is the plugin (function(jQuery){ jQuery.fn.extend({ elastic: function() { // We will create a div clone of the textarea // by copying these attributes from the textarea to the div. var mimics = [ 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'fontSize', 'lineHeight', 'fontFamily', 'width', 'fontWeight']; return this.each( function() { // Elastic only works on textareas if ( this.type != 'textarea' ) { return false; } var $textarea = jQuery(this), $twin = jQuery('<div />').css({'position': 'absolute','display':'none','word-wrap':'break-word'}), lineHeight = parseInt($textarea.css('line-height'),10) || parseInt($textarea.css('font-size'),'10'), minheight = parseInt($textarea.css('height'),10) || lineHeight*3, maxheight = parseInt($textarea.css('max-height'),10) || Number.MAX_VALUE, goalheight = 0, i = 0; // Opera returns max-height of -1 if not set if (maxheight < 0) { maxheight = Number.MAX_VALUE; } // Append the twin to the DOM // We are going to meassure the height of this, not the textarea. $twin.appendTo($textarea.parent()); // Copy the essential styles (mimics) from the textarea to the twin var i = mimics.length; while(i--){ $twin.css(mimics[i].toString(),$textarea.css(mimics[i].toString())); } // Sets a given height and overflow state on the textarea function setHeightAndOverflow(height, overflow){ curratedHeight = Math.floor(parseInt(height,10)); if($textarea.height() != curratedHeight){ $textarea.css({'height': curratedHeight + 'px','overflow':overflow}); } } // This function will update the height of the textarea if necessary function update() { // Get curated content from the textarea. var textareaContent = $textarea.val().replace(/&/g,'&amp;').replace(/ /g, '&nbsp;').replace(/<|>/g, '&gt;').replace(/\n/g, '<br />'); var twinContent = $twin.html(); if(textareaContent+'&nbsp;' != twinContent){ // Add an extra white space so new rows are added when you are at the end of a row. $twin.html(textareaContent+'&nbsp;'); // Change textarea height if twin plus the height of one line differs more than 3 pixel from textarea height if(Math.abs($twin.height()+lineHeight/3 - $textarea.height()) > 3){ var goalheight = $twin.height()+lineHeight/3; if(goalheight >= maxheight) { setHeightAndOverflow(maxheight,'auto'); } else if(goalheight <= minheight) { setHeightAndOverflow(minheight,'hidden'); } else { setHeightAndOverflow(goalheight,'hidden'); } } } } // Hide scrollbars $textarea.css({'overflow':'hidden'}); // Update textarea size on keyup $textarea.keyup(function(){ update(); }); $textarea.focus(function(){ update(); }); // And this line is to catch the browser paste event $textarea.live('input paste',function(e){ setTimeout( update, 250); }); // Run update once when elastic is initialized update(); }); } }); })(jQuery); How can i call from the outside of the plugin to the update function that is inside?

    Read the article

  • getView() (for a Custom ListView ) doesn't get called on notifyDatasetChanged()

    - by hungson175
    Hi everyone, I have the following problem, and searched for a while but haven't got any solution from the net: I have a custom list view, each item has the following layout (I just post the essential): <LinearLayout> <ImageView android:id="@+id/friendlist_iv_avatar" /> <TextView andorid:id="@+id/friendlist_tv_nick_name" /> <ImageView android:id="@+id/friendlist_iv_status_icon" /> </LinearLayout> And I have a class FriendRowItem, which is inflated from the above layout: public class FriendRowItem extends LinearLayout{ private ImageView ivAvatar; private ImageView ivStatusIcon; private TextView tvNickName; public FriendRowItem(Context context) { super(context); RelativeLayout friendRow = (RelativeLayout) Helpers.inflate(context, R.layout.friendlist_row); this.addView(friendRow); ivAvatar = (ImageView)findViewById(R.id.friendlist_iv_avatar); ivStatusIcon = (ImageView)findViewById(R.id.friendlist_iv_status_icon); tvNickName = (TextView)findViewById(R.id.friendlist_tv_nick_name); } public void setPropeties(Friend friend) { //Avatar ivAvatar.setImageResource(friend.getAvatar().getDrawableResourceId()); //Status Status.Type status = friend.getStatusType(); if ( status == Type.ONLINE) { ivStatusIcon.setImageResource(R.drawable.online_icon); } else { ivStatusIcon.setImageResource(R.drawable.offline_icon); } //Nickname String name = friend.getChatID(); if ( friend.hasName()) { name = friend.getName(); } tvNickName.setText(name); } } In the main activity, I have a custom listview: lvMainListView, with an custom adapter (whose class extends ArrayAdapter - and off course: override the method getView ), the data set of the adapter is: ArrayList<Friend> friends: private class FriendRowAdapter extends ArrayAdapter<Friend> { public FriendRowAdapter(Context applicationContext, int friendlistRow, ArrayList<Friend> friends) { super(applicationContext, friendlistRow, friends); } @Override public View getView(int position,View convertView,ViewGroup parent) { Friend friend = getItem(position); FriendRowItem row = (FriendRowItem) convertView; if ( row == null ) { row = new FriendRowItem(ShowFriendsList.this.getApplicationContext()); } row.setPropeties( friend ); return row; } } the problem is when I change the status of a friend from OFFLINE to ONLINE, then call notifyDataSetChanged(), nothing happens : the status icon of that friend doesn't change. I tried debugging, and saw the code: notifyDataSetChanged() get called, but the custom getView() is not fired ! Can you please tell me, that is normal in Android, or did I do something wrong ? (I am using Android 1.5). Thank you in advance, Son

    Read the article

  • How to implement login page using Spring Security so that it works with Spring web flow?

    - by simon
    I have a web application using Spring 2.5.6 and Spring Security 2.0.4. I have implemented a working login page, which authenticates the user against a web service. The authentication is done by defining a custom authentincation manager, like this: <beans:bean id="customizedFormLoginFilter" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter"> <custom-filter position="AUTHENTICATION_PROCESSING_FILTER" /> <beans:property name="defaultTargetUrl" value="/index.do" /> <beans:property name="authenticationFailureUrl" value="/login.do?error=true" /> <beans:property name="authenticationManager" ref="customAuthenticationManager" /> <beans:property name="allowSessionCreation" value="true" /> </beans:bean> <beans:bean id="customAuthenticationManager" class="com.sevenp.mobile.samplemgmt.web.security.CustomAuthenticationManager"> <beans:property name="authenticateUrlWs" value="${WS_ENDPOINT_ADDRESS}" /> </beans:bean> The authentication manager class: public class CustomAuthenticationManager implements AuthenticationManager, ApplicationContextAware { @Transactional @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { //authentication logic return new UsernamePasswordAuthenticationToken(principal, authentication.getCredentials(), grantedAuthorityArray); } The essential part of the login jsp looks like this: <c:url value="/j_spring_security_check" var="formUrlSecurityCheck"/> <form method="post" action="${formUrlSecurityCheck}"> <div id="errorArea" class="errorBox"> <c:if test="${not empty param.error}"> ${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message} </c:if> </div> <label for="loginName"> Username: <input style="width:125px;" tabindex="1" id="login" name="j_username" /> </label> <label for="password"> Password: <input style="width:125px;" tabindex="2" id="password" name="j_password" type="password" /> </label> <input type="submit" tabindex="3" name="login" class="formButton" value="Login" /> </form> Now the problem is that the application should use Spring Web Flow. After the application was configured to use Spring Web Flow, the login does not work anymore - the form action to "/j_spring_security_check" results in a blank page without error message. What is the best way to adapt the existing login process so that it works with Spring Web Flow?

    Read the article

  • Git sh.exe process forking issue on windows XP, slow?

    - by AndyL
    Git is essential to my workflow. I run MSYS Git on Windows XP on my quad core machine with 3GB of RAM, and normally it is responsive and zippy. Suddenly an issue has cropped up whereby it takes 30 seconds to run any command from the Git Bash command prompt, including ls or cd. Interestingly, from the bash prompt it looks likes ls runs fairly quickly, I can then see the output from ls, but it then takes ~30 seconds for the prompt to return. If I switch to the windows command prompt (by running cmd from the start menu) git related commands also take forever, even just to run. For example git status can take close to a minute before anything happens. Sometimes the processes simply don't finish. Note that I have "MSYS Git" installed as well as regular "MSYS" for things like MinGW and make. I believe the problem is related to sh.exe located in C:\Program Files\Git\bin. When I run ls from the bash prompt, or when I invoke git from the windows prompt, task manager shows up to four instances of sh.exe processes that come and go. Here I am waiting for ls to return and you can see the task manager has git.exe running and four instances of sh.exe: If I ctrl-c in the middle of an ls I sometimes get errors that include: sh.exe": fork: Resource temporarily unavailable 0 [main] sh.exe" 1624 proc_subproc: Couldn't duplicate my handle<0x6FC> fo r pid 6052, Win32 error 5 sh.exe": fork: Resource temporarily unavailable Or for git status: $ git status sh.exe": fork: Resource temporarily unavailable sh.exe": fork: Resource temporarily unavailable sh.exe": fork: Resource temporarily unavailable sh.exe": fork: Resource temporarily unavailable Can I fix this so that git runs quickly again, and if so how? Things I have tried: Reboot Upgrade MSYS Git to most recent version & Reboot Upgrade MSYS to most recent version & Reboot Uninstall MSYS & uninstall and reinstall MSYS Git alone & Reboot I'd very much like to not wipe my box and reinstall Windows, but I will if I can't get this fixed. I can no longer code if it takes me 30 s to run git status or cd.

    Read the article

  • <plugin> not a function

    - by bah
    Hi, I've been trying to solve this mystery almost 2 hours, this is giving me a headache. I tried 2 plug-ins already and I'm always getting "* is not a function". My code is exactly like examples so I don't know why it's not working. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>asd</title> <script type="text/javascript" src="jquery.js"></script> <script type='text/javascript' src='serial/jquery.scrollTo'></script> <script type='text/javascript' src='serial/jquery.serialScroll'></script> <script type="text/javascript"> $(document).ready(function(){ $('#slider').serialScroll({ items:'li', offset:-230, //when scrolling to photo, stop 230 before reaching it (from the left) start:1, //as we are centering it, start at the 2nd duration:1200, force:true, stop:true, lock:false, cycle:false, //don't pull back once you reach the end easing:'easeOutQuart', //use this easing equation for a funny effect jump: true //click on the images to scroll to them }); }); </script> </head> <body> <div id="slider"> <ul> <li><img width="500" height="500" src="dummy/dummy.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy1.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy2.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy3.jpg" alt="Css Template Preview" /></li> </ul> </div> </body> </html> I must be missing something essential there because I see nothing what's wrong. I'm using jQuery 1.4.2. and there are plug-ins I've tried - Easy Slider, jQuery serial scroll

    Read the article

  • Reading Source Code Aloud

    - by Jon Purdy
    After seeing this question, I got to thinking about the various challenges that blind programmers face, and how some of them are applicable even to sighted programmers. Particularly, the problem of reading source code aloud gives me pause. I have been programming for most of my life, and I frequently tutor fellow students in programming, most often in C++ or Java. It is uniquely aggravating to try to verbally convey the essential syntax of a C++ expression. The speaker must give either an idiomatic translation into English, or a full specification of the code in verbal longhand, using explicit yet slow terms such as "opening parenthesis", "bitwise and", et cetera. Neither of these solutions is optimal. On the one hand, an idiomatic translation is only useful to a programmer who can de-translate back into the relevant programming code—which is not usually the case when tutoring a student. In turn, education (or simply getting someone up to speed on a project) is the most common situation in which source is read aloud, and there is a very small margin for error. On the other hand, a literal specification is aggravatingly slow. It takes far far longer to say "pound, include, left angle bracket, iostream, right angle bracket, newline" than it does to simply type #include <iostream>. Indeed, most experienced C++ programmers would read this merely as "include iostream", but again, inexperienced programmers abound and literal specifications are sometimes necessary. So I've had an idea for a potential solution to this problem. In C++, there is a finite set of keywords—63—and operators—54, discounting named operators and treating compound assignment operators and prefix versus postfix auto-increment and decrement as distinct. There are just a few types of literal, a similar number of grouping symbols, and the semicolon. Unless I'm utterly mistaken, that's about it. So would it not then be feasible to simply ascribe a concise, unique pronunciation to each of these distinct concepts (including one for whitespace, where it is required) and go from there? Programming languages are far more regular than natural languages, so the pronunciation could be standardised. Speakers of any language would be able to verbally convey C++ code, and due to the regularity and fixity of the language, speech-to-text software could be optimised to accept C++ speech with a high degree of accuracy. So my question is twofold: first, is my solution feasible; and second, does anyone else have other potential solutions? I intend to take suggestions from here and use them to produce a formal paper with an example implementation of my solution.

    Read the article

  • Strange iPhone memory leak in xml parser

    - by Chris
    Update: I edited the code, but the problem persists... Hi everyone, this is my first post here - I found this place a great ressource for solving many of my questions. Normally I try my best to fix anything on my own but this time I really have no idea what goes wrong, so I hope someone can help me out. I am building an iPhone app that parses a couple of xml files using TouchXML. I have a class XMLParser, which takes care of downloading and parsing the results. I am getting memory leaks when I parse an xml file more than once with the same instance of XMLParser. Here is one of the parsing snippets (just the relevant part): for(int counter = 0; counter < [item childCount]; counter++) { CXMLNode *child = [item childAtIndex:counter]; if([[child name] isEqualToString:@"PRODUCT"]) { NSMutableDictionary *product = [[NSMutableDictionary alloc] init]; for(int j = 0; j < [child childCount]; j++) { CXMLNode *grandchild = [child childAtIndex:j]; if([[grandchild stringValue] length] > 1) { NSString *trimmedString = [[grandchild stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; [product setObject:trimmedString forKey:[grandchild name]]; } } // Add product to current category array switch (categoryId) { case 0: [self.mobil addObject: product]; break; case 1: [self.allgemein addObject: product]; break; case 2: [self.besitzeIch addObject: product]; break; case 3: [self.willIch addObject: product]; break; default: break; } [product release]; } } The first time, I parse the xml no leak shows up in instruments, the next time I do so, I got a lot of leaks (NSCFString / NSCFDictionary). Instruments points me to this part inside CXMLNode.m, when I dig into a leaked object: theStringValue = [NSString stringWithUTF8String:(const char *)theXMLString]; if ( _node->type != CXMLTextKind ) xmlFree(theXMLString); } return(theStringValue); I really spent a long time and tried multiple approaches to fix this, but to no avail so far, maybe I am missing something essential? Any help is highly appreciated, thank you!

    Read the article

  • How do I prevent programmatically the "Program Compatibility Assistant" in Vista (and Windows 7) fro

    - by Asaf
    I develop a C++ program which might use adobe flash, although it is not essential. I use CoCreateInstance to create the flash object, and if it fails, I know flash is not installed so I don't use it. However, in Vista (and I think Windows 7 as well), when flash is not installed, after leaving the application, the "Program Compatibility Assistant" pops up a message saying that "This program requires a missing Windows component" specifying the flash.ocx. Is there a way to prevent this message from appearing? I don't want to force any user to install flash (especially since it's the IE ActiveX, and FireFox users might not have it installed), and my application can operate well without the flash. Plus this message is really annoying when it appears after every run. I don't mean of course disabling the PCA on the user's machine, but programmatically disable this specific appearance on all machines. Any thoughts? Thanks [EDIT:] I followed Shay's lead (thanks), and did some more digging of my own. I added the following XML to the application's manifest: <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false"> </requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> (see also: msdn.microsoft.com/en-us/library/bb756929.aspx) This solved the problem on Vista 64. To solve the same problem on Windows 7, I added the following: <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <!--The ID below indicates application support for Windows Vista --> <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!--The ID below indicates application support for Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> </application> </compatibility> (See also: blogs.msdn.com/yvesdolc/archive/2009/09/22/the-new-compatibility-section-in-the-application-manifest.aspx) Solved Windows 7. But for some reason, it still happens in Vista 32... I also tried editing the manifest of the specific DLL which causes the problem, but it had no effect. Only the executable's manifest itself affected the problem. So... Vista 32?

    Read the article

  • Silverlight with MVVM Inheritance: ModelView and View matching the Model

    - by moonground.de
    Hello Stackoverflowers! :) Today I have a special question on Silverlight (4 RC) MVVM and inheritance concepts and looking for a best practice solution... I think that i understand the basic idea and concepts behind MVVM. My Model doesn't know anything about the ViewModel as the ViewModel itself doesn't know about the View. The ViewModel knows the Model and the Views know the ViewModels. Imagine the following basic (example) scenario (I'm trying to keep anything short and simple): My Model contains a ProductBase class with a few basic properties, a SimpleProduct : ProductBase adding a few more Properties and ExtendedProduct : ProductBase adding another properties. According to this Model I have several ViewModels, most essential SimpleProductViewModel : ViewModelBase and ExtendedProductViewModel : ViewModelBase. Last but not least, according Views SimpleProductView and ExtendedProductView. In future, I might add many product types (and matching Views + VMs). 1. How do i know which ViewModel to create when receiving a Model collection? After calling my data provider method, it will finally end up having a List<ProductBase>. It containts, for example, one SimpleProduct and two ExtendedProducts. How can I transform the results to an ObservableCollection<ViewModelBase> having the proper ViewModel types (one SimpleProductViewModel and two ExtendedProductViewModels) in it? I might check for Model type and construct the ViewModel accordingly, i.e. foreach(ProductBase currentProductBase in resultList) if (currentProductBase is SimpleProduct) viewModels.Add( new SimpleProductViewModel((SimpleProduct)currentProductBase)); else if (currentProductBase is ExtendedProduct) viewModels.Add( new ExtendedProductViewModels((ExtendedProduct)currentProductBase)); ... } ...but I consider this very bad practice as this code doesn't follow the object oriented design. The other way round, providing abstract Factory methods would reduce the code to: foreach(ProductBase currentProductBase in resultList) viewModels.Add(currentProductBase.CreateViewModel()) and would be perfectly extensible but since the Model doesn't know the ViewModels, that's not possible. I might bring interfaces into game here, but I haven't seen such approach proven yet. 2. How do i know which View to display when selecting a ViewModel? This is pretty the same problem, but on a higher level. Ended up finally having the desired ObservableCollection<ViewModelBase> collection would require the main view to choose a matching View for the ViewModel. In WPF, there is a DataTemplate concept which can supply a View upon a defined DataType. Unfortunately, this doesn't work in Silverlight and the only replacement I've found was the ResourceSelector of the SLExtensions toolkit which is buggy and not satisfying. Beside that, all problems from Question 1 apply as well. Do you have some hints or even a solution for the problems I describe, which you hopefully can understand from my explanation? Thank you in advance! Thomas

    Read the article

  • Performance Optimization for Matrix Rotation

    - by Summer_More_More_Tea
    Hello everyone: I'm now trapped by a performance optimization lab in the book "Computer System from a Programmer's Perspective" described as following: In a N*N matrix M, where N is multiple of 32, the rotate operation can be represented as: Transpose: interchange elements M(i,j) and M(j,i) Exchange rows: Row i is exchanged with row N-1-i A example for matrix rotation(N is 3 instead of 32 for simplicity): ------- ------- |1|2|3| |3|6|9| ------- ------- |4|5|6| after rotate is |2|5|8| ------- ------- |7|8|9| |1|4|7| ------- ------- A naive implementation is: #define RIDX(i,j,n) ((i)*(n)+(j)) void naive_rotate(int dim, pixel *src, pixel *dst) { int i, j; for (i = 0; i < dim; i++) for (j = 0; j < dim; j++) dst[RIDX(dim-1-j, i, dim)] = src[RIDX(i, j, dim)]; } I come up with an idea by inner-loop-unroll. The result is: Code Version Speed Up original 1x unrolled by 2 1.33x unrolled by 4 1.33x unrolled by 8 1.55x unrolled by 16 1.67x unrolled by 32 1.61x I also get a code snippet from pastebin.com that seems can solve this problem: void rotate(int dim, pixel *src, pixel *dst) { int stride = 32; int count = dim >> 5; src += dim - 1; int a1 = count; do { int a2 = dim; do { int a3 = stride; do { *dst++ = *src; src += dim; } while(--a3); src -= dim * stride + 1; dst += dim - stride; } while(--a2); src += dim * (stride + 1); dst -= dim * dim - stride; } while(--a1); } After carefully read the code, I think main idea of this solution is treat 32 rows as a data zone, and perform the rotating operation respectively. Speed up of this version is 1.85x, overwhelming all the loop-unroll version. Here are the questions: In the inner-loop-unroll version, why does increment slow down if the unrolling factor increase, especially change the unrolling factor from 8 to 16, which does not effect the same when switch from 4 to 8? Does the result have some relationship with depth of the CPU pipeline? If the answer is yes, could the degrade of increment reflect pipeline length? What is the probable reason for the optimization of data-zone version? It seems that there is no too much essential difference from the original naive version. EDIT: My test environment is Intel Centrino Duo processor and the verion of gcc is 4.4 Any advice will be highly appreciated! Kind regards!

    Read the article

  • How are you using IronPython?

    - by Will Dean
    I'm keen to drink some modern dynamic language koolaid, so I've believed all the stuff on Michael Foord's blog and podcasts, I've bought his book (and read some of it), and I added an embedded IPy runtime to a large existing app a year or so ago (though that was for someone else and I didn't really use it myself). Now I need to do some fairly simple code generation stuff, where I'm going to call a few methods on a few .net objects (custom, C#-authored objects), create a few strings, write some files, etc. The experience of trying this leaves me feeling like the little boy who thinks he's the only one who can see that The Emperor has no clothes on. If you're using IronPython, I'd really appreciate knowing how you deal with the following aspects of it: Code editing - do you use the .NET framework without Intellisense? Refactoring - I know a load of 'refactoring' is about working around language-related busywork, so if Python is sufficiently lightweight then we won't need that, But things like renames seem to me to be essential to iteratively developing quality code regardless of language. Crippling startup time - One of the things which is supposed to be good about interpreted languages is the lack of compile time leading to fast interactive development. Unfortunately I can compile a C# application and launch it quicker than IPy can start up. Interactive hacking - the IPy console/repl is supposed to be good for this, but I haven't found a good way to take the code you've interactively arrived at and persist it into a file - cut and paste from the console is fairly miserable. And the console seems to hold references to .NET assemblies you've imported, so you have to quit it and restart it if you're working on the C# stuff as well. Hacking on C# in something like LinqPad seems a much faster and easier way to try things out (and has proper Intellisense). Do you use the console? Debugging - what's the story here? I know someone on the IPy team is working on a command-line hobby-project, but let's just say I'm not immediately attracted to a command line debugger. I don't really need a debugger from little Python scripts, but I would if I were to use IPy for scripting unit tests, for example. Unit testing - I can see that dynamic languages could be great for this, but is there any IDE test-runner integration (like for Resharper, etc). The Foord book has a chapter about this, which I'll admit I have not yet read properly, but it does seem to involve driving a console-mode test-runner from the command prompt, which feels to be an enormous step back from using an integrated test runner like TestDriven.net or Resharper. I really want to believe in this stuff, so I am still working on the assumption that I've missed something. I would really like to know how other people are dealing with IPy, particularly if they're doing it in a way which doesn't feel like we've just lost 15 years'-worth of tool development.

    Read the article

  • Expression Too Complex In Access 2007

    - by Jazzepi
    When I try to run this query in Access through the ODBC interface into a MySQL database I get an "Expression too complex in query expression" error. The essential thing I'm trying to do is translate abbreviated names of languages into their full body English counterparts. I was curious if there was some way to "trick" access into thinking the expression is smaller with sub queries, or if someone else had a better idea of how to solve this problem. I thought about making a temporary table and doing a join on it, but that's not supported in Access SQL. Just as an FYI, the query worked fine until I added the big long IFF chain. I tested the query on a smaller IFF chain for three languages, and that wasn't an issue, so the problem definitely stems from the huge IFF chain (It's 26 deep). Also, I might be able to drop some of the options (like combining the different forms of Chinese or Portuguese) As a test, I was able to get the SQL query to work after paring it down to 14 IFF() statements, but that's a far cry from the 26 languages I'd like to represent. SELECT TOP 5 Count( * ) AS [Number of visits by language], IIf(login.lang="ar","Arabic",IIf(login.lang="bg","Bulgarian",IIf(login.lang="zh_CN","Chinese (Simplified Han)",IIf(login.lang="zh_TW","Chinese (Traditional Han)",IIf(login.lang="cs","Czech",IIf(login.lang="da","Danish",IIf(login.lang="de","German",IIf(login.lang="en_US","United States English",IIf(login.lang="en_GB","British English",IIf(login.lang="es","Spanish",IIf(login.lang="fr","French",IIf(login.lang="el","Greek",IIf(login.lang="it","Italian",IIf(login.lang="ko","Korean",IIf(login.lang="hu","Hungarian",IIf(login.lang="nl","Dutch",IIf(login.lang="pl","Polish",IIf(login.lang="pt_PT","European Portuguese",IIf(login.lang="pt_BR","Brazilian Portuguese",IIf(login.lang="ru","Russian",IIf(login.lang="sk","Slovak",IIf(login.lang="sl","Slovenian","IIf(login.lang="fi","Finnish",IIf(login.lang="sv","Swedish",IIf(login.lang="tr","Turkish","Unknown")))))))))))))))))))))))))) AS [Language] FROM login, reservations, reservation_users, schedules WHERE (reservations.start_date Between DATEDIFF('s','1970-01-01 00:00:00',[Starting Date in the Following Format YYYY/MM/DD]) And DATEDIFF('s','1970-01-01 00:00:00',[Ending Date in the Following Format YYYY/MM/DD])) And reservations.is_blackout=0 And reservation_users.memberid=login.memberid And reservation_users.resid=reservations.resid And reservation_users.invited=0 And reservations.scheduleid=schedules.scheduleid And scheduletitle=[Schedule Title] GROUP BY login.lang ORDER BY Count( * ) DESC; @ Michael Todd I completely agree. The list of languages should have been a table in the database and the login.lang should have been a FK into that table. Unfortunately this isn't how the database was written, and it's not really mine to modify. The languages are placed into the login.lang field by the PHP running on top of the database.

    Read the article

  • WPF: Order of stretch sizing

    - by RFBoilers
    I'm creating a modal dialog window which contains three essential parts: a TextBlock containing instructions, a ContentControl for the dialog panel, and a ContentControl for the dialog buttons. Each of these parts are contained in a separate Grid row. I have some specific constraints when it comes to how the dialog should be sized. The issue I'm having is with the instructions TextBlock. I want the instructions to be as wide as the ContentControl for the dialog panel. The instructions should then wrap and grow vertically as needed. Should the instructions not be able to grow vertically, then it should begin to grow horizontally. Getting the instructions to be the width of the ContentControl and grow vertically was simple. The part I can't seem to figure out is how to get it to grow horizontally when out of vertical space. My initial thought was to create a class that extends TextBlock and override MeasureOverride. However, that method is sealed. Currently, I'm playing with the idea of have the dialog Window override MeasureOverride to calculate the available size for the instructions block. Am I missing a much simpler way of accomplishing this? Does anyone have any better ideas than this? Messing with MeasureOverride seems like it will be a lot of work. Here is some sample code to give you a general idea of how the dialog is laid out: <Window x:Class="Dialogs.DialogWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="dialogWindow" ShowInTaskbar="False" WindowStyle="None" AllowsTransparency="True" Background="Transparent" ResizeMode="NoResize" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen"> <Border Style="{StaticResource WindowBorderStyle}" Margin="15"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <TextBlock Margin="25,5" VerticalAlignment="Top" HorizontalAlignment="Left" Text="{Binding Instructions}" TextWrapping="Wrap" Width="{Binding ElementName=panelContentControl, Path=ActualWidth, Mode=OneWay}"/> <ContentControl x:Name="panelContentControl" Grid.Row="1" Margin="25,5" Content="{Binding PanelContent}"/> <ContentControl x:Name="buttonsContentControl" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="25,5" Content="{Binding ButtonsContent}"/> </Grid> </Border> </Window>

    Read the article

  • How do you use technology to memorize set of terms?

    - by user49767
    Always there are few set of items needs to be memorized in short span of time. Here are my following cases. 1) My Job requires some set of items needs to be memorized. 2) I am a developer who has to learn 150+ tags within next 3 days. 3) Fix developer/support has to remember minimum of 125+ tags (set of possible values). 4) It is better if team's SQL developer knows all the table and columns in my database. 5) When guys join new department or job. Memorizing few related items will definitely gives some benefit. Most of the cases, I suggest people to understand the domain better and nothing wrong in using google (but remember correct search-word). But recently I came across a junior developer who took lot of effort in memorizing set of things (150+ table structures, fix protocol tags, almost 300+ configuration items from property file) and was very very successful in his job and was swift in responding for support queries. Needless to say he is smart worker too (not a dumb guy). When I try to recollect some of the successful employees I met, they were so good in remembering entire schema and they did in short span of time. But I don't argue that memorizing alone gives success, but it greatly helps when situation demands. Here my question is, I am not good at remembering things, but it shouldn't be lame excuse. Hence I am evaluating using technolgies better to memorize set of items. Not very much interested in memory techniques (mnemoninc, photography memory, etc..). Even I have recorded 100+ items and listen to that whenever I found free time, defintely there were some fruitful result. Now I need your suggestion about what are all the ways to exploit technology to memorize. There could be so many reason why guys remember a subject (passionate, essential, author, creator, responsbile). Not interested in dissecting why guys remeber. Rather much interested in using ways, and techniques (cheat sheet...) to remember a set of itmes. Note : I appreciate, encourage people who could rephrase my question better. Note : I have kept couple of cheat-sheet close to my monitor, honestly it did not help me :).

    Read the article

  • IP address numbers in MySQL subquery

    - by Iain Collins
    I have a problem with a subquery involving IPV4 addresses stored in MySQL (MySQL 5.0). The IP addresses are stored in two tables, both in network number format - e.g. the format output by MySQL's INET_ATON(). The first table ('events') contains lots of rows with IP addresses associated with them, the second table ('network_providers') contains a list of provider information for given netblocks. events table (~4,000,000 rows): event_id (int) event_name (varchar) ip_address (unsigned 4 byte int) network_providers table (~60,000 rows): ip_start (unsigned 4 byte int) ip_end (unsigned 4 byte int) provider_name (varchar) Simplified for the purposes of the problem I'm having, the goal is to create an export along the lines of: event_id,event_name,ip_address,provider_name If do a query along the lines of either of the following, I get the result I expect: SELECT provider_name FROM network_providers WHERE INET_ATON('192.168.0.1') >= network_providers.ip_start ORDER BY network_providers.ip_start DESC LIMIT 1 SELECT provider_name FROM network_providers WHERE 3232235521 >= network_providers.ip_start ORDER BY network_providers.ip_start DESC LIMIT 1 That is to say, it returns the correct provider_name for whatever IP I look up (of course I'm not really using 192.168.0.1 in my queries). However, when performing this same query as a subquery, in the following manner, it doesn't yield the result I would expect: SELECT event.id, event.event_name, (SELECT provider_name FROM network_providers WHERE event.ip_address >= network_providers.ip_start ORDER BY network_providers.ip_start DESC LIMIT 1) as provider FROM events Instead the a different (incorrect) value for network_provider is returned - over 90% (but curiously not all) values returned in the provider column contain the wrong provider information for that IP. Using event.ip_address in a subquery just to echo out the value confirms it contains the value I'd expect and that the subquery can parse it. Replacing event.ip_address with an actual network number also works, just using it dynamically in the subquery in this manner that doesn't work for me. I suspect the problem is there is something fundamental and important about subqueries in MySQL that I don't get. I've worked with IP addresses like this in MySQL quite a bit before, but haven't previously done lookups for them using a subquery. The question: I'd really appreciate an example of how I could get the output I want, and if someone here knows, some enlightenment as to why what I'm doing doesn't work so I can avoid making this mistake again. Notes: The actual real-world usage I'm trying to do is considerably more complicated (involving joining two or three tables). This is a simplified version, to avoid overly complicating the question. Additionally, I know I'm not using a between on ip_start & ip_end - that's intentional (the DB's can be out of date, and such cases the owner in the DB is almost always in the next specified range and 'best guess' is fine in this context) however I'm grateful for any suggestions for improvement that relate to the question. Efficiency is always nice, but in this case absolutely not essential - any help appreciated.

    Read the article

  • Google Docs iphone library error reporting

    - by phil harris
    I'm in the process of adding a Google Docs interface to my iPhone app, and I'm largely following the example in the GoogleDocs.m file from Tom Saxton's example app. The objective-c library I'm using is from http://code.google.com/p/gdata-objectivec-client/wiki/GDataObjCIntroduction The library file used is from gdata-objectivec-client-1.10.0.zip. This service:username:password method is a slight variant of the one found in the Saxton file GoogleDocs.m starting at line 351: - (void)service:(NSString *)username password:(NSString *)password { if(service == nil) { service = [[[GDataServiceGoogleDocs alloc] init] autorelease]; [service setUserAgent:s_strUserAgent]; [service setShouldCacheDatedData:NO]; [service setServiceShouldFollowNextLinks:NO]; (void)[service authenticateWithDelegate:self didAuthenticateSelector:@selector(ticket:authenticatedWithError:)]; } // update the username/password each time the service is requested if (username != nil && [username length] && password != nil && [password length]) [service setUserCredentialsWithUsername:username password:password]; else [service setUserCredentialsWithUsername:nil password:nil]; } // associated callback for service:username:password: method - (void)ticket:(GDataServiceTicket *)ticket authenticatedWithError:(NSError *)error { NSLog(@"%@",@"authenticatedWithError called"); if(error == nil) [self selectBackupRestore]; else { NSLog(@"error code(%d)", [error code]); NSLog(@"error domain(%d)", [error domain]); NSLog(@"localizedDescription(%@)", error.localizedDescription); NSLog(@"localizedFailureReason(%@)", error.localizedFailureReason); NSLog(@"localizedRecoveryOptions(%@)", error.localizedRecoveryOptions); NSLog(@"localizedRecoverySuggestion(%@)", error.localizedRecoverySuggestion); } } Please note the service:username:password method and the callback compile and run fine. The problem is that the callback is passing a non-nil NSError object. I added an NSLog() for every error reporting attribute of NSError and the (Xcode) log output of a test run is below. [Session started at 2010-05-27 12:27:16 -0700.] 2010-05-27 12:27:38.778 iFilebox[74596:207] authenticatedWithError called 2010-05-27 12:27:38.779 iFilebox[74596:207] error code(-1) 2010-05-27 12:27:38.780 iFilebox[74596:207] error domain(499324) 2010-05-27 12:27:38.781 iFilebox[74596:207] localizedDescription(Operation could not be completed. (com.google.GDataServiceDomain error -1.)) 2010-05-27 12:27:38.782 iFilebox[74596:207] localizedFailureReason((null)) 2010-05-27 12:27:38.782 iFilebox[74596:207] localizedRecoveryOptions((null)) 2010-05-27 12:27:38.783 iFilebox[74596:207] localizedRecoverySuggestion((null)) My essential question is in the error reporting. I was hoping the localizedDescription would be more specific of the error. All I get for the error code value is -1, and the only description of the error is "Operation could not be completed. (com.google.GDataServiceDomain error -1.". Not very helpful. Does anyone know what a GDataServiceDomain error -1 is? Where can I find a full list of all error codes returned, and a description of what they mean?

    Read the article

  • Recommended ASP.NET Shared Hosting

    - by coffeeaddict
    Ok, I have to admit I'm getting fed up with www.discountasp.net's pricing model and this annoyance has built up over the past 8 years or so. I've been with them for years and absolutely love them on the technical side, however it's getting ridiculously expensive for so little that you get. I mean here's my scenario: 1) I am running 2 SQL Server databases which costs me $10/ea per month so that's $20/month for 2 and I only get 500 mb disk space which is horrible 2) I am paying $10/mo just for the hosting itself which I only get 1 gig of disk space! I mean common! 3) I am simply running 2 small apps (Screwturn Wiki & Subtext Blog)...so I don't really care if it's up 99% or not, it's not worth paying a total of $300 just to keep these 2 apps running over discountasp.net Anyone else feel the same? Yes, I know they have great support, probably have great servers running behind this but in the end I really don't care as long as my site is up 95% or better. Yes, the hosting toolset rocks. But you know I bet you I can find a similar set somewhere else. I like how I can totally control IIS 7 at discountasp and I can control my own app pool etc. That's very powerful and essential. But anyone have any good alternatives to discountasp that gives me close to the same at a much more reasonable cost point? I mean http://www.m6.net/prices.aspx gives you 10 SQL Databases for $7 and 200 gigs disk space! I don't know about their tools or support but just looking at those numbers and some other hosts I've seen, I feel that discountasp.net is way out of line. They don't even offer any purchasing discounts such as it would be nice if my 2nd SQL Server is only $5/month not $10...stuff like this, to make it much more realistic and fair. Opinions (people who do have discountasp.net, people who have left them, or people who have another host they like)??? But geez $300 just to host a couple DBs and lightweight open source apps? Not worth the price they are charging. I'm almost at a price point that enables me to get a decent dedicated server! I really don't care about beta support. Not a big deal to me.

    Read the article

  • Iphone App deve- Very basic table view but getting errors , trying for 2 days!! just for info using

    - by user342451
    Hi guys, trying to write this code since 2 days now, but i keep getting error, it would be nice if anyone could sort this out, thanks. Basically its the same thing i doing from the tutorial on youtube. awaiting a reply // // BooksTableViewController.m // Mybooks // // import "BooksTableViewController.h" import "BooksDetailViewController.h" import "MYbooksAppDelegate.h" @implementation BooksTableViewController @synthesize BooksArray; @synthesize BooksDetailViewController; /* - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { // Initialization code } return self; } */ (void)viewDidLoad { [super viewDidLoad]; self.title = NSLocalizedString(@"XYZ",@"GOD is GREAT"); NSMutableArray *array = [[NSArray alloc] initWithObjects:@"H1",@"2",@"3",nil]; self.booksArray = array; [array release]; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview // Release anything that's not essential, such as cached data } pragma mark Table view methods (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.booksArray count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identity = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identity]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:identity] autorelease]; } // Set up the cell... cell.textLabel.text = [booksArray objectAtIndex:indexPath.row]; return cell; } /* - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { booksDetailsViewControler *NC = [[booksDetailsViewControler alloc] initWithNibName:@"BooksDetailsView" bundle:nil]; [self.navigationController pushViewController:NC animated:YES]; //[booksDetailViewController changeProductText:[booksArray objectAtIndex:indexPath.row]]; } */ NSInteger row = [indexPath row]; if (self.booksDetailViewController == nil) { BooksiDetailViewController *aCellDetails = [[AartiDetailViewController alloc] initWithNibName:@" BooksDetailViewController" bundle:nil]; self.booksDetailViewController = aCellDetails; [aCellDetails release]; } booksDetailViewController.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]]; //DailyPoojaAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; //[delegate.AartiNavController pushViewController:aartiDetailsViewControler animated:YES]; [self.navigationController pushViewController:aartiDetailViewController animated:YES]; } /* NSInteger row = [indexPath row]; if (self.booksDetailsViewControler == nil) { AartiDetailsViewControler *aBookDetail = [[BooksDetailsViewControler alloc] initWithNibName:@"booksDetaislView" bundle:nil]; self.booksDetailsViewControler = aBookDetail; [aBookDetail release]; } booksDetailsViewControler.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]]; [self.navigationController pushViewController:booksDetailsViewControler animated:YES]; */ (void)dealloc { [aartiDetailViewController release]; [super dealloc]; } @end

    Read the article

  • Very basic table view but getting errors

    - by user342451
    Hi guys, trying to write this code since 2 days now, but i keep getting error, it would be nice if anyone could sort this out, thanks. Basically its the same thing i doing from the tutorial on youtube. awaiting a reply // // BooksTableViewController.m // Mybooks // // #import "BooksTableViewController.h" #import "BooksDetailViewController.h" #import "MYbooksAppDelegate.h" @implementation BooksTableViewController @synthesize BooksArray; @synthesize BooksDetailViewController; /* - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { // Initialization code } return self; } */ - (void)viewDidLoad { [super viewDidLoad]; self.title = NSLocalizedString(@"XYZ",@"GOD is GREAT"); NSMutableArray *array = [[NSArray alloc] initWithObjects:@"H1",@"2",@"3",nil]; self.booksArray = array; [array release]; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview // Release anything that's not essential, such as cached data } #pragma mark Table view methods - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.booksArray count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identity = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identity]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:identity] autorelease]; } // Set up the cell... cell.textLabel.text = [booksArray objectAtIndex:indexPath.row]; return cell; } /* - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { booksDetailsViewControler *NC = [[booksDetailsViewControler alloc] initWithNibName:@"BooksDetailsView" bundle:nil]; [self.navigationController pushViewController:NC animated:YES]; //[booksDetailViewController changeProductText:[booksArray objectAtIndex:indexPath.row]]; } */ NSInteger row = [indexPath row]; if (self.booksDetailViewController == nil) { BooksiDetailViewController *aCellDetails = [[AartiDetailViewController alloc] initWithNibName:@" BooksDetailViewController" bundle:nil]; self.booksDetailViewController = aCellDetails; [aCellDetails release]; } booksDetailViewController.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]]; //DailyPoojaAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; //[delegate.AartiNavController pushViewController:aartiDetailsViewControler animated:YES]; [self.navigationController pushViewController:aartiDetailViewController animated:YES]; } /* NSInteger row = [indexPath row]; if (self.booksDetailsViewControler == nil) { AartiDetailsViewControler *aBookDetail = [[BooksDetailsViewControler alloc] initWithNibName:@"booksDetaislView" bundle:nil]; self.booksDetailsViewControler = aBookDetail; [aBookDetail release]; } booksDetailsViewControler.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]]; [self.navigationController pushViewController:booksDetailsViewControler animated:YES]; */ - (void)dealloc { [aartiDetailViewController release]; [super dealloc]; } @end

    Read the article

  • Why am I getting ClassNotFoundExpection when I have properly imported said class and am looking at it in its directory?

    - by Strider
    This is my Javac compiling statement: javac -cp "C:\java\code\j3D\j3dcore.jar;C:\java\code\j3D\j3dutils.jar;C:\java\code\j3D\vecmath.jar" Simple.java compiles with no problems. The three jar files (j3dcore, j3dutils, and vecmath) are the essential jar's for my program (or at least I am led to believe according to this official tutorial on J3D For the record I ripped this code almost line from line from this pdf file. jar files are correctly located in referenced locations When I run my Simple program, (java Simple) I am greeted with Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/j3d/Cavas3d Caused by: java.lang.ClassNotFoundExpection: javax.media.j3d.Canvas3D Currently I am staring directly at this Canvas3D.class that is located within j3dcore.jar\javax\media\j3d\ wtfisthis.jpg Here is the source code: //First java3D Program import java.applet.Applet; import java.awt.BorderLayout; import java.awt.Frame; import java.awt.event.*; import com.sun.j3d.utils.applet.MainFrame; import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils.geometry.ColorCube; import javax.media.j3d.*; import javax.vecmath.*; import java.awt.GraphicsConfiguration; public class Simple extends Applet { public Simple() { setLayout(new BorderLayout()); GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration(); Canvas3D canvas3D = new Canvas3D(config); add("Center", canvas3D); BranchGroup scene = createSceneGraph(); scene.compile(); // SimpleUniverse is a Convenience Utility class SimpleUniverse simpleU = new SimpleUniverse(canvas3D); // This moves the ViewPlatform back a bit so the // objects in the scene can be viewed. simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); } // end of HelloJava3Da (constructor) public BranchGroup createSceneGraph() { // Create the root of the branch graph BranchGroup objRoot = new BranchGroup(); // Create a simple shape leaf node, add it to the scene graph. // ColorCube is a Convenience Utility class objRoot.addChild(new ColorCube(0.4)); return objRoot; } public static void main(String args[]){ Simple world = new Simple(); } }` Did I import correctly? Did I incorrectly reference my jar files in my Javac statement? If I clearly see Canvas3D within its correct directory why cant java find it? The first folder in both j3dcore.jar and vecmath.jar is "javax". Is the compiler getting confused? If the compiler is getting confused how do I specify where to find that exact class when referencing it within my source code?

    Read the article

  • How solve consumer/producer task using semaphores

    - by user1074896
    I have SimpleProducerConsumer class that illustrate consumer/producer problem (I am not sure that it's correct). public class SimpleProducerConsumer { private Stack<Object> stack = new Stack<Object>(); private static final int STACK_MAX_SIZE = 10; public static void main(String[] args) { SimpleProducerConsumer pc = new SimpleProducerConsumer(); new Thread(pc.new Producer(), "p1").start(); new Thread(pc.new Producer(), "p2").start(); new Thread(pc.new Consumer(), "c1").start(); new Thread(pc.new Consumer(), "c2").start(); new Thread(pc.new Consumer(), "c3").start(); } public synchronized void push(Object d) { while (stack.size() >= STACK_MAX_SIZE) try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } stack.push(new Object()); System.out.println("push " + Thread.currentThread().getName() + " " + stack.size()); notify(); } public synchronized Object pop() { while (stack.size() == 0) try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } try { Thread.sleep(50); } catch (InterruptedException e) { e.printStackTrace(); } stack.pop(); System.out.println("pop " + Thread.currentThread().getName() + " " + stack.size()); notify(); return null; } class Consumer implements Runnable { @Override public void run() { while (true) { pop(); } } } class Producer implements Runnable { @Override public void run() { while (true) { push(new Object()); } } } } I found simple realization of semaphore(here:http://docs.oracle.com/javase/tutorial/essential/concurrency/guardmeth.html I know that there is concurrency package) How I need to change code to exchange java objects monitors to my custom semaphore. (To illustrate C/P problem using semaphores) Semaphore: class Semaphore { private int counter; public Semaphore() { this(0); } public Semaphore(int i) { if (i < 0) throw new IllegalArgumentException(i + " < 0"); counter = i; } public synchronized void release() { if (counter == 0) { notify(); } counter++; } public synchronized void acquire() throws InterruptedException { while (counter == 0) { wait(); } counter--; } }

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45  | Next Page >