Daily Archives

Articles indexed Wednesday May 12 2010

Page 23/121 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • git push error 'remote rejected] master -> master (branch is currently checked out)'

    - by hap497
    Hi, Yesterday, I post a question regarding how to clone a git repository from 1 of my machine to another. http://stackoverflow.com/questions/2808177/how-can-i-git-clone-from-another-machine/2809612#2809612 I am able to successfully clone a git repository from my src (192.168.1.2) to my dest (192.168.1.1). But when I did an edit to a file and then do a 'git commit -a -m "test"' and then do a git push. I get this error on my dest (192.168.1.1): git push [email protected]'s password: Counting objects: 21, done. Compressing objects: 100% (11/11), done. Writing objects: 100% (11/11), 1010 bytes, done. Total 11 (delta 9), reused 0 (delta 0) error: refusing to update checked out branch: refs/heads/master error: By default, updating the current branch in a non-bare repository error: is denied, because it will make the index and work tree inconsistent error: with what you pushed, and will require 'git reset --hard' to match error: the work tree to HEAD. error: error: You can set 'receive.denyCurrentBranch' configuration variable to error: 'ignore' or 'warn' in the remote repository to allow pushing into error: its current branch; however, this is not recommended unless you error: arranged to update its work tree to match what you pushed in some error: other way. error: error: To squelch this message and still keep the default behaviour, set error: 'receive.denyCurrentBranch' configuration variable to 'refuse'. To git+ssh://[email protected]/media/LINUXDATA/working ! [remote rejected] master -> master (branch is currently checked out) error: failed to push some refs to 'git+ssh://[email protected]/media/LINUXDATA/working' I have 2 version of git, will that causes this problem? I have git 1.7 on 192.168.1.2 (src) but git 1.5 on 192.168.1.1 (dest). I appreciate if someone can help me with this. Thank you.

    Read the article

  • Must a Language that Implements Monads be Statically Typed?

    - by Morgan Cheng
    I am learning functional programming style. From this link http://channel9.msdn.com/shows/Going+Deep/Brian-Beckman-Dont-fear-the-Monads/, Brian Beckman gave a brilliant introduction about Monad. He mentioned that Monad is about composition of functions so as to address complexity. A Monad includes a unit function that transfers type T to an amplified type M(T); and a Bind function that, given function from T to M(U), transforms type M(T) to another type M(U). (U can be T, but is not necessarily). In my understanding, the language implementing monad should be type-checked statically. Otherwise, type errors cannot be found during compilation and "Complexity" is not controlled. Is my understanding correct?

    Read the article

  • Receive MMS images and make album using iamge using j2me

    - by Abdul Basit
    I am trying to made application which receive MMS images and make a album from them user can view the pictures while running this application. I am facing problem while running application on mobile. while this application is fully working in wireless tookit emulator. Please guide me to fix this problem.`//package hello; import javax.microedition.midlet.; import javax.microedition.lcdui.; import javax.wireless.messaging.*; import java.io.IOException; import java.util.Vector; import javax.microedition.io.Connector; import javax.microedition.lcdui.Display; //, ItemStateListener public class MMSS extends MIDlet implements CommandListener, Runnable, MessageListener { //-----------------------------------Receive MMS --------------------------- private Thread mReceiver = null; private boolean mEndNow = false; private Message msg = null; String msgReceived = null; private Image[] receivedImage = new Image[5]; private Command mExitCommand = new Command("Exit", Command.EXIT, 2); private Command mRedCommand = new Command("Back", Command.SCREEN, 1); private Command mBlueCommand = new Command("Next", Command.SCREEN, 1); private Command mPlay = new Command("Play", Command.SCREEN, 1); protected static final String DEFAULT_IMAGE = "/MMSS_logo.jpg"; //protected static final String DEFAULT_IMAGE = "/wait.png"; private Display mDisplay = null; //protected ImageItem mColorSquare = null; protected Image mInitialImage = null; private String mAppID = "MMSMIDlet"; private TextField imageName = null; //private Form mForm = null; private int count = 0; private int next = 0; private Integer mMonitor = new Integer(0); //----------------------------------- End Receive MMS --------------------------- private boolean midletPaused = false; private Command exitCommand; private Command exitCommand1; private Command backCommand; private Form form; private StringItem stringItem; private ImageItem imageItem; private Image image1; private Alert alert; private List locationList; private Alert cannotAddLocationAlert; public MMSS() { } /** * Initilizes the application. * It is called only once when the MIDlet is started. The method is called before the startMIDlet method. */ private void initialize() { } /** * Performs an action assigned to the Mobile Device - MIDlet Started point. */ public void startMIDlet() { // write pre-action user code here switchDisplayable(null, getForm()); // write post-action user code here } /** * Performs an action assigned to the Mobile Device - MIDlet Resumed point. */ public void resumeMIDlet() { } /** * Switches a current displayable in a display. The display instance is taken from getDisplay method. This method is used by all actions in the design for switching displayable. * @param alert the Alert which is temporarily set to the display; if null, then nextDisplayable is set immediately * @param nextDisplayable the Displayable to be set / public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch // write pre-switch user code here Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch if (alert == null) { display.setCurrent(nextDisplayable); } else { display.setCurrent(alert, nextDisplayable); } } /* * Called by a system to indicated that a command has been invoked on a particular displayable. * @param command the Command that was invoked * @param displayable the Displayable where the command was invoked */ public void commandAction(Command command, Displayable displayable) { // write pre-action user code here if (displayable == form) { if (command == exitCommand) { // write pre-action user code here exitMIDlet(); // write post-action user code here } } // write post-action user code here } /** * Returns an initiliazed instance of exitCommand component. * @return the initialized component instance */ public Command getExitCommand() { if (exitCommand == null) { // write pre-init user code here exitCommand = new Command("Exit", Command.EXIT, 0); // write post-init user code here } return exitCommand; } /** * Returns an initiliazed instance of form component. * @return the initialized component instance */ public Form getForm() { if (form == null) { // write pre-init user code here form = new Form("Welcome to MMSS", new Item[] { getStringItem(), getImageItem() }); form.addCommand(getExitCommand()); form.setCommandListener(this); // write post-init user code here } return form; } /** * Returns an initiliazed instance of stringItem component. * @return the initialized component instance */ public StringItem getStringItem() { if (stringItem == null) { // write pre-init user code here stringItem = new StringItem("Hello", "Hello, World!"); // write post-init user code here } return stringItem; } /** * Returns an initiliazed instance of exitCommand1 component. * @return the initialized component instance / public Command getExitCommand1() { if (exitCommand1 == null) { // write pre-init user code here exitCommand1 = new Command("Exit", Command.EXIT, 0); // write post-init user code here } return exitCommand1; } /* * Returns an initiliazed instance of imageItem component. * @return the initialized component instance */ public ImageItem getImageItem() { if (imageItem == null) { // write pre-init user code here imageItem = new ImageItem("imageItem", getImage1(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER | Item.LAYOUT_EXPAND | Item.LAYOUT_VEXPAND, "");//GEN-LINE:|26-getter|1|26-postInit // write post-init user code here } return imageItem; } /** * Returns an initiliazed instance of image1 component. * @return the initialized component instance */ public Image getImage1() { if (image1 == null) { // write pre-init user code here try { image1 = Image.createImage("/B.jpg"); } catch (java.io.IOException e) { e.printStackTrace(); } // write post-init user code here } return image1; } /** * Returns a display instance. * @return the display instance. */ public Display getDisplay () { return Display.getDisplay(this); } /** * Exits MIDlet. */ public void exitMIDlet() { switchDisplayable (null, null); destroyApp(true); notifyDestroyed(); } /** * Called when MIDlet is started. * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet. */ public void startApp() { if (midletPaused) { resumeMIDlet (); } else { initialize (); startMIDlet (); } midletPaused = false; /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// try { conn = (MessageConnection) Connector.open("mms://:" + mAppID); conn.setMessageListener(this); } catch (Exception e) { System.out.println("startApp caught: "); e.printStackTrace(); } if (conn != null) { startReceive(); } /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// } /** * Called when MIDlet is paused. */ public void pauseApp() { midletPaused = true; mEndNow = true; try { conn.setMessageListener(null); conn.close(); } catch (IOException ex) { System.out.println("pausetApp caught: "); ex.printStackTrace(); } } /** * Called to signal the MIDlet to terminate. * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released. */ public void destroyApp(boolean unconditional) { mEndNow = true; try { conn.close(); } catch (IOException ex) { System.out.println("destroyApp caught: "); ex.printStackTrace(); } } private void startReceive() { mEndNow = false; //---- Start receive thread mReceiver = new Thread(this); mReceiver.start(); } protected MessageConnection conn = null; protected int mMsgAvail = 0; // -------------------- Get Next Images ------------------------------------ private void getMessage() { synchronized(mMonitor) { mMsgAvail++; mMonitor.notify(); } } // -------------------- Display Images Thread ------------------------------ public void notifyIncomingMessage(MessageConnection msgConn) { if (msgConn == conn) getMessage(); } public void itemStateChanged(Item item) { throw new UnsupportedOperationException("Not supported yet."); } class SetImage implements Runnable { private Image img = null; public SetImage(Image inImg) { img = inImg; } public void run() { imageItem.setImage(img); imageName.setString(Integer.toString(count)); } } public void run() { mMsgAvail = 0; while (!mEndNow) { synchronized(mMonitor) { // Enter monitor if (mMsgAvail <= 0) try { mMonitor.wait(); } catch (InterruptedException ex) { } mMsgAvail--; } try { msg = conn.receive(); if (msg instanceof MultipartMessage) { MultipartMessage mpm = (MultipartMessage)msg; MessagePart[] parts = mpm.getMessageParts(); if (parts != null) { for (int i = 0; i < parts.length; i++) { MessagePart mp = parts[i]; byte[] ba = mp.getContent(); receivedImage[count] = Image.createImage(ba, 0, ba.length); } Display.getDisplay(this).callSerially(new SetImage(receivedImage[count])); } } } catch (IOException e) { System.out.println("Receive thread caught: "); e.printStackTrace(); } count++; } // of while } } `

    Read the article

  • Cucumber - How configure it to use "--format pretty" as default?

    - by Gabriel L. Oliveira
    I'm starting learning rails, and having some troubles on configure cucumber to run my bdd tests. What I want is run cucumber features and this translate to cucumber features --format pretty I tried to do this editing the config/cucumber.yml file (on a rails project). Edited the line: default: <%= std_opts % features resulting on: default: <%= std_opts % --format pretty features But it make some erros happen: Using the default profile... All but one formatter must use --out, only one can print to each stream (or STDOUT) (RuntimeError) What I can do to make this option "--format pretty" default? Also, is there any other good option to put as default to make result more clear? Thank you.

    Read the article

  • TabBar implementation issue in iphone

    - by iPhoneDev
    Hi, My project is navigation based template and it was running fine until I made changes in some child view. I need to add 4 Tab in some child view. So what I did is create a TabBarController programmatically on ViewDidLoad as: // (void)viewDidLoad { [super viewDidLoad]; helpView = [[HelpView alloc] initWithNibName:@"HelpView" bundle:nil]; settingView = [[SettingView alloc] initWithNibName:@"SettingView" bundle:nil]; tabBarController = [[UITabBarController alloc] init]; tabBarController.viewControllers = [NSArray arrayWithObjects:helpView,settingView,nil]; [self.view addSubview:[tabBarController view]]; } I am able to add two view in tab bar but not Tab Title. Please let me know what I am missing to display Title on tab button. ( Is a NavigationBased project) Thanks

    Read the article

  • PASS Professional Development Virtual Chapter Reboot

    - by AjarnMark
    The Professional Development Virtual Chapter for PASS is holding its first virtual meeting on Thursday, May 13 at 1:00 PM Eastern / 10:00 AM Pacfic time.  Andy Warren (@sqlandy) will be the speaker.  Click here to attend via Live Meeting.  Also, check the http://prof-dev.sqlpass.org web site and RSS Feed for ongoing updates and details.

    Read the article

  • SQL Sentry First Impressions

    - by AjarnMark
    After struggling to defend my SQL Servers from a political attack recently, I realized that I needed better tools to back me up, and SQL Sentry is the leading candidate. A couple of weeks ago, seemingly from out of nowhere, complaints from the business users started coming in that one of the core internal applications was running dramatically slower than normal, and fingers were being pointed at the SQL Server.  Unfortunately, we don’t have a production DBA whose entire job is to monitor and maintain our SQL Servers.  The responsibility falls to me to do the best I can, investing only a small portion of my time, because there are so many other responsibilities to take care of, and our industry is still deep in recession.  I inherited these SQL Servers and have made significant improvements in process and procedure, but I had not yet made the time to take real baseline measurements or keep a really close eye on the performance.  Like many DBAs, I wrote several of my own tools and used the “built-in tools” like Profiler, PerfMon, and sp_who2 (did I mention most of our instances are SQL Server 2000?).  These have all served me well for in-the-moment troubleshooting and maintenance, but they really fell down on the job when I was called upon to “prove” that SQL Server performance was acceptable and more importantly had not degraded recently (i.e. historical comparisons).  I really didn’t have anything from a historical comparison perspective, but I was able to show that current performance was acceptable, and deflect attention back onto other components (which in fact turned out to be the real culprit). That experience dramatically illustrated the need for better monitoring tools.  Coincidentally, I had been talking recently to my boss about the mini nightmare of monitoring several critical and interdependent overnight jobs that operate on separate instances of SQL Server.  Among other tools, I had been using Idera’s SQL Job Manager which is a free tool and did a nice job of showing me job schedules and histories in a nice calendar view.  This worked fairly well, and for the money (did I mention it was free?) it couldn’t be beat.  But it is based on the stored job history in MSDB, and there were other performance problems that we ran into when we started changing the settings for how much job history to retain, in order to be able to look back a month or more in the calendar view.  Another coincidence (if you believe in such things) was that when we had some of those performance challenges, I posted a couple of questions to the #sqlhelp hashtag on Twitter and Greg Gonzalez (@SQLSensei) suggested I check out SQL Sentry’s Event Manager.  At the time, I just thought he worked there, but later found out that he founded the company.  When I took a quick look at the features & benefits, the one that really jumped out at me is Chaining and Queueing which sounded like it would really help with our “interdependent jobs on different servers” issue. I know that is a lot of background story and coincidences, but hopefully you have stuck with me so far, and now we have arrived at the point where last week I downloaded and installed the 30-day trial of the SQL Sentry Power Suite, which is Event Manager plus Performance Advisor.  And I must say that I really like what I see so far.  Here are a few highlights: Great Support.  I had two issues getting the trial setup and monitoring a handful of our servers.  One of which was entirely my fault (missed a security setting in SQL 2008) and the other was mostly my fault (late change to some config settings that were apparently cached and did not get refreshed properly).  In both cases, the support staff at SQL Sentry were very responsive and rather quickly figured out what the cause and fix was for each of them.  This left me with a great impression of the company.  Kudos to them! Chaining and Queueing.  While I have not yet activated this feature, I am very excited about the possibilities.  We have jobs on three different instances of SQL Server that have to be run in a certain order, and each has to finish before the next can successfully begin, and I believe this feature will ensure just that.  It has been a real pain in the backside when one of those jobs runs just a little too long and does not finish before the job on another instance starts, thus triggering a chain reaction of either outright job failures, or worse, successful completion of completely invalid processing. Calendar View.  I really, really like the Event Manager calendar view where I can see all jobs and events across all instances and identify potential resource contention as well as windows of opportunity for maintenance activity.  Very well done, and based on Event Manager’s own database of accumulated historical information rather than querying the source instances every time. Performance Advisor Dashboard History View.  This view let’s me quickly select a date and time range and it displays graphs of key SQL Server and Windows metrics.  This is exactly the thing I needed to answer the “has performance changed recently” question at the beginning of this post. Reporting Services Subscription Jobs with Report Name.  This was a big and VERY pleasant surprise.  If you have ever looked at the list of SQL Server jobs that SQL Server Reporting Services creates when you make a Subscription, you will notice that they all have some sort of GUID as the name of the job.  This is really ugly, and really annoying because when you are just looking at the SQL Agent and Job Activity Monitor, if you see that Job X failed, you really do not have any indication in the name or the properties of the Job itself, as to what Report that was for.  But with SQL Sentry Event Manager you do.  The Jobs list in the Navigator pane in SQL Sentry, amazingly, displays the name of the Report that the Subscription Job is for.  And when you open it to see more details, it shows you the full Reporting Services path to that Report, so you can immediately track it down in the Report Manager in case you want to identify/notify the owner or edit the Subscription information.  I did not expect this at all, but I sure do like it.  HOORAY! That is just my first impressions from using the tools for a few days.  And I haven’t even gotten into how it showed me where I was completely mistaken about one aspect of my SQL Server disk configurations.  I’ll share that lesson in another blog entry.  But I have to say it again, the combination of Event Manager and Performance Advisor working together have really made me a fan.

    Read the article

  • Linear-time algorithms for sorting vertices in polygon contours

    - by Cheery
    I figured out an algorithm that lets me turn my holed polygons into trapezoids in linear time if I have vertex indices sorted from lowest coordinate to highest. I get simple polygons as contours. They have certain order that might be exploited most of the time. So giving these conditions, is there a near-linear-time algorithm on sorting?

    Read the article

  • How can I order my entries by sum from a separate table?

    - by bgadoci
    I am wondering how I can order posts in my PostController#index to display by a column total in a separate table. Here is how I have it set up. class Post < ActiveRecord::Base :has_many :votes end and Class Vote < ActiveRecord::Base :belongs_to :post end I user can either vote up or down a particular post. I know there are likely better ways to do what I am currently doing but looking for a fix given my current situation. When a user votes up a post, a value of 1 is passed to the Vote Table via a hidden field. When a user votes down a post a value of -1 is passed to the same column (names vote). I am wondering how I can display my posts in order of the sum of the vote column (in the vote table) for a particular post. Another way to say that is, if a particular post has a net vote sum of 5, I want that to appear above a post with a net vote sum of 4. I am assuming that I need to affect the PostController#index action in some fashion. But not sure how to do that.

    Read the article

  • why tempspace results here??

    - by SubPortal
    if we supposed that "A.B." is a value for an xml element called given-names the following code converts this value to "A.tempspacetempspaceB." instead of "A. B." foreach (XElement initial in doc.XPathSelectElements("//given-names")) { string v = initial.Value.Replace(".", ". ").TrimEnd(' '); initial.SetValue(v); } So why tempspace comes here instead of literal space?? thank you for any help.

    Read the article

  • How to pass Endpoint parameter to Endpoint defined as bean in Spring conext

    - by sempa
    I have camel Fileendpoint defined in following way: <bean id="hotfolderEndpoint" class="org.apache.camel.component.file.FileEndpoint" factory-bean="camel" factory-method="getEndpoint"> <constructor-arg ref="hotfolder" /> </bean> I want to define some File parameters such as preMove, move etc. Variable hotfolder is String taken from JNDI and I have no impact on it. When I define property as <bean id="moveExp" class="org.apache.camel.model.language.SimpleExpression"> <property name="expression" value="done/${file:name}"/> </bean> it is not correctly parsed and the file get name done/name

    Read the article

  • Dojo JSON call back always returns an error

    - by Sunny
    Hi Guys, I am using Dojo and making a AJAX call to a JAVA Class and trying to get the output of the program to a Alert box to the client. var showResult = function(result){ console.log("Showing Result()"); var store = new dojo.data.ItemFileReadStore({ data: result}); console.dir(store); store.fetch( { onItem: function(data) { alert("Hie"); }, onError: function(error,request){ alert("ERROR");} }); }; This is my code, showResult basically is call back function from xhr request. I can see console.dir(store) printed onto Firebug but the fetch function always returns the onError block. My store array is of the form {info="Test Message"} and I need to retrieve "Test Message" and display it in a Alert box. Any help?

    Read the article

  • Select more then one node from XML using LINQ

    - by podeig
    I have such XML <root> <content> .... </content> <index> .... </index> <keywords> .... </keywords> </root> But I need to select just and nodes. <content> .... </content> <index> .... </index> I found out how to select just one node. XElement Content = new XElement("content", from el in xml.Elements() select el.Element("content").Elements()); How can I get both nodes?

    Read the article

  • List of header file locations for the Havok Physics Engine

    - by QAH
    Hello everyone! I am trying to integrate the Havok physics engine into my small game. It is a really nice SDK, but the header files are all over the place. Many headers are deeply nested in multiple directories. That gets confusing when you are trying to include headers for different important objects. I would like to know if there is a nice guide that will let you know where certian objects are and what headres they are in. I have already looked at Havok's documentation, and I also looked at the reference manual, but they don't give great detail as to where certain classes are located (header location). Also, is there any programs out there that can scan header files and create a list of where objects can be found? Thanks again

    Read the article

  • Value is out of Range Exception While setting ResourceDictionary Source to CustomControl's generic.X

    - by Subhen
    Hi, I have a custom Control which contains the generic.xaml inside the Themes folder. I have set the build action to Resource. Now from App.xaml I am setting the reference to the DLL by using : xmlns:localFolder="clr-namespace:customControl;assembly=customControl" After the reference is set I am trying to Merge the Resource dictionary in my App.xaml as follow: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="localFolder;component/Themes/generic.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> But while running my application I am getting the following XAMLParseException: Attribute localFolder;component/Themes/generic.xaml value is out of range. [Line: 16 Position: 44]

    Read the article

  • VSTO addin (2003-2007) Ms Word & Webservices

    - by Daveo
    Hi, I am planning on starting my 1st VSTO project. What I want to be able to do is: Download and Upload versions of a MS Word document to a web service. With authentication by overriding the save button Call a web service to list a bunch of tag that can be inserted into a document. When a user double clicks a tag the selected tag is inserted into the cursor position. I am pretty sure this is all possible just want some confirmation? Also would like to know how long would it take to make something like this. I think the biggest issue will be authentication and listing exiting files to download then allowing the user to download a .doc and restore previous versions of that file via the web service.

    Read the article

  • Flex customised drag drop

    - by Preeyanka S
    When I drag and drop between datagrids preventing default behaviour, the cursor's does not come out of the grid. The grid's scroll bars keep moving as i move the mouse.. Even if i click outside the grid the cursor still has control over the grid and keeps scrolling as i move the mouse over the screen up and down.. Please help

    Read the article

  • Making dynamic images have static filenames

    - by michaeltk
    My website currently has various links to a php script that generates the images dynamically. For example, the link may say "img source="/dynamic_images.php?type=pie-chart&color=red" Obviously, this is not great for SEO. I'd like to somehow make the filenames of these links appear to be static, and use a solution (like Mod-Rewrite) to ensure that the images can still be dynamically created. I suppose I could have something like "img src="average-profits-in-scuba-diving-industry.png?type=pie-chart&color=red" (and use Mod-Rewrite to take care of changing the filename prefix to dynamic_images.php), but I'm afraid that the search engines would shy away from the querystring on the end of the image filename. Any solutions? Thanks in advance.

    Read the article

  • Google Protocol Buffers - Fixed size buffer?

    - by Roey
    Hi All. Using Google Protocol Buffers, can I set a maximum size for all messages I encode? if I know that what I encode is never larger than X bytes, then Google Protobuffs would always produce a buffer of size Y, and if I give it a smaller amount of data, pad it to size Y?

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >