{"items":[{"question_id":16668443,"creation_date":1369134189,"last_activity_date":1369134189,"score":0,"answer_count":0,"body":"<p>After reading a lot of articles on singleton pattern, and making some tests, I found no difference between the singleton pattern like this (<a href=\"http://jsfiddle.net/bhsQC/\" rel=\"nofollow\">http://jsfiddle.net/bhsQC/</a>):</p>\n\n<pre><code>var TheObject = function () {\n    var instance;\n\n    function init() {\n        var that = this;\n        var foo = 1;\n\n        function consoleIt() {\n            console.log(that, foo);\n        }\n        return {\n            bar: function () {\n                consoleIt()\n            }\n        };\n    }\n    return {\n        getInstance: function () {\n            if (!instance) {\n                instance = init();\n            }\n            return instance;\n        }\n    };\n}();\nvar myObject = TheObject.getInstance();\nmyObject.bar();\n</code></pre>\n\n<p>and code like this (<a href=\"http://jsfiddle.net/9Qa9H/1/\" rel=\"nofollow\">http://jsfiddle.net/9Qa9H/1/</a>):</p>\n\n<pre><code>var myObject = function () {\n    var that = this;\n    var foo = 1;\n\n    function consoleIt() {\n        console.log(that, foo);\n    }\n    return {\n        bar: function () {\n            consoleIt();\n        }\n    };\n}();\nmyObject.bar();\n</code></pre>\n\n<p>They both make only one instance of the object, they both can have \"private\" members, <code>that</code> points to <code>window</code> object in either of them. It's just that the latter one is simpler. Please, correct me if I'm wrong.</p>\n\n<p>Using standard constructor like this (<a href=\"http://jsfiddle.net/vnpR7/1/\" rel=\"nofollow\">http://jsfiddle.net/vnpR7/1/</a>):</p>\n\n<pre><code>var TheObject = function () {\n    var that = this;\n    var foo = 1;\n\n    function consoleIt() {\n        console.log(that, foo);\n    }\n    return {\n        bar: function () {\n            consoleIt();\n        }\n    };\n};\nvar myObject = new TheObject();\nmyObject.bar();\n</code></pre>\n\n<p>has the advantage of correct usage of <code>that</code>, but lacks the instance \"singularity\".</p>\n\n<p>My question is: <strong>what are the advantages and disadvantages of these three approaches?</strong> (If it matters, I'm working on a web app using Dojo 1.9, so either way, this object will be inside Dojo's <code>require</code>).</p>\n","title":"JavaScript singleton pattern and &#39;this&#39;","tags":["javascript"],"view_count":2,"owner":{"user_id":1328768,"display_name":"Zemljoradnik","reputation":96,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/f21e3ea93f03d3f1912c42188db95135?d=identicon&r=PG","link":"http://stackoverflow.com/users/1328768/zemljoradnik"},"link":"http://stackoverflow.com/questions/16668443/javascript-singleton-pattern-and-this","is_answered":false},{"question_id":16667964,"last_edit_date":1369134188,"creation_date":1369132701,"last_activity_date":1369134188,"score":0,"answer_count":0,"body":"<p>I want to use ldap to automount the user's home and the nfs. I followed the tuto: <a href=\"http://uid.free.fr/Ldap/ldap.html\" rel=\"nofollow\">http://uid.free.fr/Ldap/ldap.html</a> to configure ldap and automount.</p>\n\n<p>I have a syntax error when trying to add this file :</p>\n\n<p>dn: cn=dupont, ou=nfs, ou=services, dc=projet, dc=sys</p>\n\n<p>objectClass: top</p>\n\n<p>objectClass: automount</p>\n\n<p>cn: dupont</p>\n\n<p>automountInformation: fstype=nfs,hard,intr,nodev,nosuid,rw 192.168.0.1:/home/serveur/dupont</p>\n\n<pre><code>ldapadd -x -f au.ldif -W -D cn=admin,dc=projet,dc=sys\n\nldap_add: Invalid syntax (21)\n    additional info: objectClass: value #1 invalid per syntax\n</code></pre>\n\n<p>I can't seem to find the source of this error, can someone help me to undestand, please ?</p>\n\n<pre><code>ldapsearch -x\n\n# extended LDIF\n#\n# LDAPv3\n# base &lt;dc=projet,dc=sys&gt; (default) with scope subtree\n# filter: (objectclass=*)\n# requesting: ALL\n#\n\n# projet.sys\ndn: dc=projet,dc=sys\nobjectClass: top\nobjectClass: dcObject\nobjectClass: organization\no: nsalab\ndc: projet\n\n# admin, projet.sys\ndn: cn=admin,dc=projet,dc=sys\nobjectClass: simpleSecurityObject\nobjectClass: organizationalRole\ncn: admin\ndescription: LDAP administrator\n\n# people, projet.sys\ndn: ou=people,dc=projet,dc=sys\nobjectClass: top\nobjectClass: organizationalUnit\nou: people\ndescription: Branche gens\n\n# etudiants, people, projet.sys\ndn: ou=etudiants,ou=people,dc=projet,dc=sys\nobjectClass: top\nobjectClass: organizationalUnit\nou: etudiants\ndescription: Branche etudiants\n\n# personnel, people, projet.sys\ndn: ou=personnel,ou=people,dc=projet,dc=sys\nobjectClass: top\nobjectClass: organizationalUnit\nou: personnel\ndescription: Branche personnel\n\n# services, projet.sys\ndn: ou=services,dc=projet,dc=sys\nobjectClass: top\nobjectClass: organizationalUnit\nou: services\ndescription: Branche services\n\n# groupes, services, projet.sys\ndn: ou=groupes,ou=services,dc=projet,dc=sys\nobjectClass: top\nobjectClass: organizationalUnit\nou: groupes\ndescription: Branche groupes\n\n# nfs, services, projet.sys\ndn: ou=nfs,ou=services,dc=projet,dc=sys\nobjectClass: top\nobjectClass: organizationalUnit\nou: nfs\ndescription: Branche nfs\n\n# mongroupe, groupes, services, projet.sys\ndn: cn=mongroupe,ou=groupes,ou=services,dc=projet,dc=sys\nobjectClass: top\nobjectClass: posixGroup\ncn: mongroupe\ngidNumber: 1111\ndescription: groupe de test mongroupe\n\n# dupont, etudiants, people, projet.sys\ndn: uid=dupont,ou=etudiants,ou=people,dc=projet,dc=sys\nobjectClass: top\nobjectClass: posixAccount\nobjectClass: person\nobjectClass: organizationalPerson\nobjectClass: inetOrgPerson\nuid: dupont\ncn: Dupont Jean\nsn: Dupont\ngivenName: Jean\nuidNumber: 1100\ngidNumber: 1111\nhomeDirectory: /home/aware/dupont\nloginShell: /bin/bash\nmail: dupont@projet.sys\nl: France\nou: mongroupe\n\n# search result\nsearch: 2\nresult: 0 Success\n\n# numResponses: 11\n# numEntries: 10\n</code></pre>\n","title":"slapd :automount : ldap_add: Invalid syntax (21)","tags":["ldap","debian","automount"],"view_count":4,"owner":{"user_id":2405049,"display_name":"Hallux","reputation":1,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/ca928d93132b9ed2160ea566d7c565c9?d=identicon&r=PG","link":"http://stackoverflow.com/users/2405049/hallux"},"link":"http://stackoverflow.com/questions/16667964/slapd-automount-ldap-add-invalid-syntax-21","is_answered":false},{"question_id":16655274,"last_edit_date":1369134186,"creation_date":1369072282,"last_activity_date":1369134186,"score":0,"answer_count":1,"body":"<p>I have a WCF service that when I check in the WCF Test Client it works fine but after I deployed the service to a remote server(my college server) It doesn't work . I ran it on a wp8 app but it didn't gave me the errors so I ran it on the wcf test client and I found out that I cant connect to my DB  and I don't know why ! </p>\n\n<p>I search all over the web about connection strings because everyone told me that it is probably this but every thing seem fine :( </p>\n\n<p>this is my connection string:</p>\n\n<pre><code>&lt;connectionStrings&gt;\n&lt;add name=\"dbPulpoConnectionString\" providerName=\"System.Data.SqlClient\" connectionString=\"Server=(LocalDb)\\v11.0;Initial Catalog=PulpoDatabase;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\PulpoDatabase.mdf\"/&gt;\n</code></pre>\n\n<p></p>\n\n<p>I changed it also to :</p>\n\n<pre><code> &lt;connectionStrings&gt;\n&lt;add name=\"dbPulpoConnectionString\" providerName=\"System.Data.SqlClient\" connectionString=\"Server=.\\SQLEXPRESS;Initial Catalog=PulpoDatabase;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\\PulpoDatabase.mdf\"/&gt;\n</code></pre>\n\n<p></p>\n\n<p>but it still didnt work>&lt; </p>\n\n<p>edit: In my propretise it says .NET FRAMWORK 4.5 </p>\n\n<p>please please help me I dont know what to do anymore>&lt; </p>\n\n<p>edit: I have all the premisions I need On the remote server , on the remote server I have App_Data folder that my database.mdf files are in there and web.config and bin and the wcf.svc server </p>\n\n<p>edit: my error: </p>\n\n<pre><code>Object reference not set to an instance of an object. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type) at IPulpoService.ShowStatistics(UserVO client) at PulpoServiceClient.ShowStatistics(UserVO client)\n</code></pre>\n","title":"After Deploy/Publishing WCF server doesn&#39;t work","tags":["mysql","wcf","connection-string","wcf-data-services","publish"],"view_count":15,"owner":{"user_id":1967385,"display_name":"SH.IN","reputation":32,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/ca4685a582a12d7c6b3947af7d23b3cc?d=identicon&r=PG","link":"http://stackoverflow.com/users/1967385/sh-in","accept_rate":60},"link":"http://stackoverflow.com/questions/16655274/after-deploy-publishing-wcf-server-doesnt-work","is_answered":false},{"question_id":16668442,"creation_date":1369134184,"last_activity_date":1369134184,"score":0,"answer_count":0,"body":"<p>I have 3 questions </p>\n\n<ol>\n<li>can i use angular js with kendoUi wrappers? if yes how?</li>\n<li>if i am using angular js and kendo-all.min.js on the same html tag let say that we are converting an input tag to auto-complete and at the same time we are binding it with ng-model then what possible affect they can produce in each other?</li>\n<li>what actually angular-kendo is?</li>\n</ol>\n","title":"can i use angular js with kendoUi wrappers? if yes how?","tags":["angularjs","kendo-ui","kendo-asp.net-mvc"],"view_count":2,"owner":{"user_id":2345845,"display_name":"akshay","reputation":13,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/83c7d60fff2b73b66b949d7623755a8a?d=identicon&r=PG","link":"http://stackoverflow.com/users/2345845/akshay"},"link":"http://stackoverflow.com/questions/16668442/can-i-use-angular-js-with-kendoui-wrappers-if-yes-how","is_answered":false},{"question_id":16668441,"creation_date":1369134181,"last_activity_date":1369134181,"score":0,"answer_count":0,"body":"<p>I want a way to automatically route GET and POST requests to subsequent methods in a centralized way.\nI want to create my handler in the following way.</p>\n\n<pre><code>class MyHandler(BaseHandler):\n    def get(self):\n        #handle get requests\n\n    def get(self):\n        #handle post requests\n</code></pre>\n\n<p>This is what webapp2 does and I very much like the style, is it possible to do in Django?\nI also want the view in Class-method style. What kind of BaseHandler and router should I write.</p>\n","title":"Django GET and POST handling methods","tags":["python","django"],"view_count":3,"owner":{"user_id":1161876,"display_name":"specialscope","reputation":1201,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/22a2cd9935dd4646f5e3ff1d1104a593?d=identicon&r=PG","link":"http://stackoverflow.com/users/1161876/specialscope","accept_rate":56},"link":"http://stackoverflow.com/questions/16668441/django-get-and-post-handling-methods","is_answered":false},{"question_id":16663771,"creation_date":1369118904,"last_activity_date":1369134181,"score":0,"answer_count":2,"body":"<p>I have a <code>index.php</code> with a </p>\n\n<pre><code>require 'myfolder/folder/lib1.php';\n</code></pre>\n\n<p>So in <code>app.yaml</code> I reference:</p>\n\n<pre><code>- url: /myfolder/folder/lib1.php\n  script: myfolder/folder/lib1.php\n</code></pre>\n\n<p>but this <code>lib1.php</code> does another <code>require 'lib2.php';</code> at same folder level <code>/myfolder/folder/</code>. So it trows error 500 because it can't find <code>lib2.php</code>.\nHow can I properly reference them both in app.yaml?</p>\n","title":"How to reference nested requires in app.yaml for App Engine PHP","tags":["php","google-app-engine","app.yaml"],"view_count":20,"owner":{"user_id":114441,"display_name":"Veilkrand","reputation":79,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/d7d80e1a98583b7493ee8f74d909849a?d=identicon&r=PG","link":"http://stackoverflow.com/users/114441/veilkrand","accept_rate":86},"link":"http://stackoverflow.com/questions/16663771/how-to-reference-nested-requires-in-app-yaml-for-app-engine-php","is_answered":true},{"question_id":16668439,"creation_date":1369134179,"last_activity_date":1369134179,"score":0,"answer_count":0,"body":"<p>My (newest) Netbeans (<code>NetBeans IDE 7.3 (Build 201302132200)</code>) seems to be failing completely, when I'm trying to access my own GitHub repo using SSH.</p>\n\n<p>Since I've imported an existing local copy of GitHub repository (<code>New &gt; PHP Project with existing sources</code>), created once with TortoiseGit, there were remote settings saved in local copy meta-data (probably in <code>.git</code> folder). So Netbeans offers option <code>Select Configured Git Repository Location</code> in <code>Push to Remote Repository</code> window. But is unsuccessful at that.</p>\n\n<p>Tried following:</p>\n\n<ol>\n<li><p>When I'm using SSH URL (<code>git@github.com:user/reponame.git</code>) and <code>Password</code> option, with account pass, Netbeans tries to connect GitHub (remote) and after circa 5 seconds   throws error <code>Cannot\u00A0connect\u00A0to\u00A0the\u00A0remote\u00A0repository\u00A0at\u00A0git@github.com:user/reponame.git</code>.</p></li>\n<li><p>When using SSH URL with <code>Private/Public Key</code> option, Netbeans throws exactly the same error immediately, so I assume, that for some reason it doesn't even tries to connect GitHub.</p></li>\n</ol>\n\n<p>What is even more strange (?), Netbeans <em>is not asking for private key's passpharse</em>. I've set it, but did not entered it to Netbeans deliberately, to test connection process. I was more than sure, that Netbeans will ask me to provide this passpharse, as it shouldn't be able to use private key without it. To my surprise, it hasn't asked for it and instead it thrown an error saying, that it can't connect GitHub. Strange.</p>\n\n<p>I've copied my repo's URL directly from GitHub website, without any modifications. It seems, that I can only use HTTP URL (<code>https://github.com/user/reponame.git</code>). This works and assures me that all items (URL, user, reponame, password, finally Internet connection) are OK. But, it seems, that Netbeans fails completely on SSH URL.</p>\n\n<p>Above happens always, no matter if I select <code>Select Configured Git Repository Location</code> or <code>Specify Git Repository Location</code> in <code>Push to Remote Repository</code> window. No matter, what I'll do I can't access my repository via SSH in Netbeans and using HTTP is the only option.</p>\n\n<p>I have created my private-public key pair using <code>puttygen.exe</code> from <a href=\"http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html\" rel=\"nofollow\">PuTTY's website</a>. I saved private key in Netbeans installation directory and added public key to <a href=\"https://github.com/settings/ssh\" rel=\"nofollow\">GitHub's SSH Settings</a> page. I used step-by-step guide I normally use with TortoiseGit.</p>\n\n<p>I don't know what else I could miss out or I'm doing wrong? Any idea?</p>\n","title":"Netbeans fails to access GitHub remote using key pair","tags":["github","ssh","netbeans-7","ssh-keys"],"view_count":2,"owner":{"user_id":1469208,"display_name":"trejder","reputation":815,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/63e4f7c36cfb54861bc2c2518bdb7cf2?d=identicon&r=PG","link":"http://stackoverflow.com/users/1469208/trejder","accept_rate":85},"link":"http://stackoverflow.com/questions/16668439/netbeans-fails-to-access-github-remote-using-key-pair","is_answered":false},{"question_id":16668438,"creation_date":1369134178,"last_activity_date":1369134178,"score":0,"answer_count":0,"body":"<p>I have a grid of images and text. By default, only the image is showing. When the user clicks the image, it should expand over the others and show the text. Currently it's partly working.</p>\n\n<p><a href=\"http://jsfiddle.net/kbHfH/1/\" rel=\"nofollow\">http://jsfiddle.net/kbHfH/1/</a></p>\n\n<pre><code>&lt;div id=\"container\"&gt;\n    &lt;div class=\"logo\"&gt;\n        &lt;img src=\"http://www.bnl.gov/today/intra_pics/2012/01/Intel-Logo-110px.jpg\" alt=\"\"&gt;\n\n        &lt;p class=\"logotext\"&gt;\n            ...\n        &lt;/p&gt;\n    &lt;/div&gt;\n    ....\n</code></pre>\n\n<p>If you click the leftmost icon in the top row, it will do what I want. There are some problems though.</p>\n\n<ul>\n<li>When you click any of the icons, the other elements will slide one place closer to the top leftmost corner because the clicked element moves out of it's place due to the absolute positioning.</li>\n<li>If you click any other icon, it will expand correctly, except it goes to the leftmost corner in the top row. It should expand all the way to the left (like it does now) but it should go any higher. If the clicked item isn't the first one in the row, it should still expand the same amount to the left. Clicking it again should get it back to it's original position.</li>\n<li>You should be able to open multiple at the same time. If you have one opened and you open another one the previously opened element should collapse to it's default state.</li>\n</ul>\n\n<p>I have messed with this a long time. I hope I have provided enough details to get help and to get this working.</p>\n","title":"Opening element on top of others","tags":["javascript","jquery","html","css"],"view_count":3,"owner":{"user_id":1279334,"display_name":"MikkoP","reputation":863,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/416e8f6f5f5b4115dea9fae8a2e3c91f?d=identicon&r=PG","link":"http://stackoverflow.com/users/1279334/mikkop","accept_rate":81},"link":"http://stackoverflow.com/questions/16668438/opening-element-on-top-of-others","is_answered":false},{"question_id":16668437,"creation_date":1369134177,"last_activity_date":1369134177,"score":0,"answer_count":0,"body":"<p>I am trying to build my database using related tables. I am getting the right output from the database, however - Since the user is the same, and the only change in data is the courses, I would like to gather the values \"Engelsk\" and \"Matematik\" in the same row, instead of having two outputs which are virtually the same, except the courses. \nIs this even possible without having this in the same row in the database? And if so, I'd very much like to know how :)</p>\n\n<pre><code>Array\n(\n[0] =&gt; Array\n    (\n        [Type] =&gt; Elev\n        [Username] =&gt; test\n        [Name] =&gt; Test Testsen\n        [Grade] =&gt; 9. Klasse\n        [Course] =&gt; Engelsk\n    )\n\n[1] =&gt; Array\n    (\n        [Type] =&gt; Elev\n        [Username] =&gt; test\n        [Name] =&gt; Test Testsen\n        [Grade] =&gt; 9. Klasse\n        [Course] =&gt; Matematik\n    )\n\n)\n</code></pre>\n\n<p>So basically what I would like to achieve is something like this:</p>\n\n<pre><code>Array\n(\n[0] =&gt; Array\n(\n    [Type] =&gt; Elev\n    [Username] =&gt; test\n    [Name] =&gt; Test Testsen\n    [Grade] =&gt; 9. Klasse\n    [Course] =&gt; Engelsk, Matematik\n)\n</code></pre>\n\n<p>My query looks like this:</p>\n\n<pre><code>                SELECT\n                *\n            FROM\n                lek_Essentials\n            LEFT JOIN\n                lek_Type\n            ON\n                lek_Essentials.TypeId = lek_Type.TypeId\n            LEFT JOIN\n                lek_Grades\n            ON\n                lek_Essentials.GradeId = lek_Grades.GradeId\n            LEFT JOIN\n                lek_GradeCourses\n            ON\n                lek_Grades.GradeId = lek_GradeCourses.GradeId\n            LEFT JOIN\n                lek_Courses\n            ON \n                lek_GradeCourses.CourseId = lek_Courses.CourseId\n            LEFT JOIN\n                lek_Request\n            ON\n                lek_Courses.CourseId = lek_Request.CourseId\n            WHERE\n                lek_Essentials.UserId = lek_Request.UserId\n</code></pre>\n","title":"Gathering information in 1 row using related tables","tags":["php","mysql","query","table"],"view_count":2,"owner":{"user_id":2300457,"display_name":"Jens Aagren","reputation":1,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/70857a1777589ac7bc5ae24c59be467c?d=identicon&r=PG","link":"http://stackoverflow.com/users/2300457/jens-aagren"},"link":"http://stackoverflow.com/questions/16668437/gathering-information-in-1-row-using-related-tables","is_answered":false},{"question_id":16668161,"creation_date":1369133302,"last_activity_date":1369134175,"score":0,"answer_count":2,"body":"<p>I'm using <a href=\"http://jeromejaglale.com/doc/php/codeigniter_i18n\" rel=\"nofollow\">this approach</a> to localize my codeigniter web app.\nNow everything works fine, except that I want to remove this repetitive code, to localize I have to put inside every controller action following</p>\n\n<pre><code>public function history() \n    {            \n        $selectedLang = $this-&gt;lang-&gt;lang();\n        switch ($selectedLang)\n        {\n            case \"en\":\n                $data['switchLang'] = \"fr\";  \n                $langView = \"company/historyEN\";\n                break;\n            case \"sr\":\n                $data['switchLang'] = \"en\";                                \n                $langView = \"company/history\";\n                break;\n            default:\n               $data['switchLang'] = \"en\";                       \n                $langView = \"company/history\";\n        }          \n\n        $this-&gt;lang-&gt;load(\"content\");\n        $this-&gt;load-&gt;view($langView, $data);\n    }\n</code></pre>\n\n<p>Is it possible to move this inside CI_Controller class which will be available for all controllers than? if so how? </p>\n\n<p>or something else, please advise me into right direction</p>\n","title":"localization in codeigniter, different view on different laguage","tags":["codeigniter"],"view_count":8,"owner":{"user_id":1375068,"display_name":"panjo","reputation":307,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/1b34822398f5658915785406832f0de1?d=identicon&r=PG","link":"http://stackoverflow.com/users/1375068/panjo","accept_rate":78},"link":"http://stackoverflow.com/questions/16668161/localization-in-codeigniter-different-view-on-different-laguage","is_answered":false},{"question_id":16668436,"creation_date":1369134175,"last_activity_date":1369134175,"score":0,"answer_count":0,"body":"<p>Anyone care to share some example code on sending an in app sms from Rubymotion app?</p>\n","title":"How to send in app sms using rubymotion?","tags":["ios","sms","rubymotion"],"view_count":2,"owner":{"user_id":322209,"display_name":"jjnevis","reputation":468,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/b50843a55f51cebc76b2dda95d36a66c?d=identicon&r=PG","link":"http://stackoverflow.com/users/322209/jjnevis","accept_rate":86},"link":"http://stackoverflow.com/questions/16668436/how-to-send-in-app-sms-using-rubymotion","is_answered":false},{"question_id":16668434,"creation_date":1369134175,"last_activity_date":1369134175,"score":0,"answer_count":0,"body":"<p>I am trying to add protobuf dependency to my maven project.\nI have installed the protobuf jar file using \n    mvn install:install-file -Dpackaging=jar\\\n                           -DgeneratePom=true\\<br>\n                           -DgroupId=com.google.protobuf\\\n                           -DartifactId=protobuf-java\\\n                           -Dfile=protobuf-java-2.5.0.jar\\\n                           -Dversion=2.5.0</p>\n\n<p>Mypom.xml file is as follows:</p>\n\n<pre><code>&lt;project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\"&gt;\n&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;\n&lt;groupId&gt;ProtobufExample&lt;/groupId&gt;\n&lt;artifactId&gt;ProtobufTest&lt;/artifactId&gt;\n&lt;packaging&gt;jar&lt;/packaging&gt;\n&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;\n&lt;name&gt;ProtobufTest&lt;/name&gt;\n&lt;url&gt;http://maven.apache.org&lt;/url&gt;\n\n&lt;properties&gt;\n    &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;\n    &lt;skip.tests&gt;false&lt;/skip.tests&gt;\n&lt;/properties&gt;\n\n\n&lt;dependencies&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;junit&lt;/groupId&gt;\n        &lt;artifactId&gt;junit&lt;/artifactId&gt;\n        &lt;version&gt;3.8.1&lt;/version&gt;\n        &lt;scope&gt;test&lt;/scope&gt;\n    &lt;/dependency&gt;\n    &lt;dependency&gt;\n            &lt;groupId&gt;com.google.protobuf&lt;/groupId&gt;\n            &lt;artifactId&gt;protobuf-java&lt;/artifactId&gt;\n            &lt;version&gt;2.4.1&lt;/version&gt;\n            &lt;scope&gt;compile&lt;/scope&gt;\n        &lt;/dependency&gt;\n\n&lt;/dependencies&gt;\n&lt;build&gt;\n    &lt;finalName&gt;syslog-kafka&lt;/finalName&gt;\n    &lt;plugins&gt;\n        &lt;plugin&gt;\n            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;\n            &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;\n            &lt;version&gt;2.3.2&lt;/version&gt;\n            &lt;configuration&gt;\n                &lt;source&gt;1.6&lt;/source&gt;\n                &lt;target&gt;1.6&lt;/target&gt;\n            &lt;/configuration&gt;\n        &lt;/plugin&gt;\n\n        &lt;plugin&gt;\n            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;\n            &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;\n            &lt;version&gt;2.3.1&lt;/version&gt;\n            &lt;configuration&gt;\n                &lt;finalName&gt;${project.name}-${project.version}&lt;/finalName&gt;\n            &lt;/configuration&gt;\n        &lt;/plugin&gt;\n\n        &lt;plugin&gt;\n            &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;\n            &lt;configuration&gt;\n                &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt;\n                &lt;finalName&gt;${project.name}-${project.version}&lt;/finalName&gt;\n                &lt;descriptors&gt;\n                    &lt;descriptor&gt;src/assembly/dist.xml&lt;/descriptor&gt;\n                &lt;/descriptors&gt;\n            &lt;/configuration&gt;\n        &lt;/plugin&gt;\n\n        &lt;plugin&gt;\n            &lt;groupId&gt;com.google.protobuf&lt;/groupId&gt;\n            &lt;artifactId&gt;protobuf-java&lt;/artifactId&gt;\n            &lt;version&gt;2.5.0&lt;/version&gt;\n            &lt;executions&gt;\n                &lt;execution&gt;\n                    &lt;id&gt;generate-sources&lt;/id&gt;\n                    &lt;goals&gt;\n                        &lt;goal&gt;test&lt;/goal&gt;\n                    &lt;/goals&gt;\n                    &lt;phase&gt;generate-sources&lt;/phase&gt;\n                    &lt;configuration&gt;\n                        &lt;protoSourceRoot&gt;${basedir}/src/main/proto/&lt;/protoSourceRoot&gt;\n                        &lt;includes&gt;\n                            &lt;param&gt;**/*.proto&lt;/param&gt;\n                        &lt;/includes&gt;\n                    &lt;/configuration&gt;\n                &lt;/execution&gt;\n            &lt;/executions&gt;\n            &lt;configuration&gt;\n                &lt;protocExecutable&gt;/usr/local/bin/protoc&lt;/protocExecutable&gt;\n            &lt;/configuration&gt;\n        &lt;/plugin&gt;\n\n    &lt;/plugins&gt;\n\n&lt;/build&gt;\n</code></pre>\n\n<p></p>\n\n<p>When I try to test it using \"mvn test\", I get the following error:\nFailed to parse plugin descriptor for com.google.protobuf:protobuf-java:2.5.0 \nNo plugin descriptor found at META-INF/maven/plugin.xml </p>\n\n<p>Please help me to figure out where am I going wrong.</p>\n","title":"Error while adding protobuf dependency to maven","tags":["maven","protocol-buffers","protobufs"],"view_count":2,"owner":{"user_id":2384376,"display_name":"user2384376","reputation":8,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/72340046e66d8c3abd1d405809059f63?d=identicon&r=PG","link":"http://stackoverflow.com/users/2384376/user2384376"},"link":"http://stackoverflow.com/questions/16668434/error-while-adding-protobuf-dependency-to-maven","is_answered":false},{"question_id":16667075,"creation_date":1369130004,"last_activity_date":1369134173,"score":3,"answer_count":2,"body":"<p>I need to swap two variables with only <code>+=</code> and <code>-=</code> operators and without temporary variables. I know the standart solutions like:</p>\n\n<pre><code>a = a+b;\nb = a-b;\na = a-b;\n</code></pre>\n\n<p>and with <code>xor</code>:</p>\n\n<pre><code>a ^= b;\nb ^= a;\na ^= b;\n</code></pre>\n\n<p>but I can not figure out how to do it with only <code>+=</code> and <code>-=</code>. Is there any way do to that? Thanks in advance!</p>\n","title":"Swap two variables with only += and -= without temp variable","tags":["c","swap"],"view_count":73,"owner":{"user_id":1057941,"display_name":"medvedNick","reputation":658,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/204f870ba126082fed01a246db4adbdf?d=identicon&r=PG","link":"http://stackoverflow.com/users/1057941/medvednick","accept_rate":97},"link":"http://stackoverflow.com/questions/16667075/swap-two-variables-with-only-and-without-temp-variable","is_answered":false},{"question_id":16668384,"creation_date":1369133978,"last_activity_date":1369134172,"score":0,"answer_count":3,"body":"<p>Please clear my doubt regarding object casting</p>\n\n<p>My doubt is the reference variable 'r' which was referencing rose object is now referencing flower object.</p>\n\n<p>What happend to rose object now? Will it be destroyed?\nPls explain    </p>\n\n<p>I have the following code:</p>\n\n<pre><code>class Flower\n{\npublic void smell()     // I\n{\n   System.out.println(\"All flowers give smell, if you can smell\");\n}\n}   \npublic class Rose extends Flower\n{\npublic void smell()     // II\n{\n   System.out.println(\"Rose gives rosy smell\");\n}\npublic static void main(String args[])\n{\n   Flower f = new Flower();\n   Rose r = new Rose();\n\n   f = r;             // subclass to super class, it is valid\n   f.smell();           // II\n\n }\n}\n</code></pre>\n","title":"Object casting in Java","tags":["java"],"view_count":27,"owner":{"user_id":2401175,"display_name":"user2401175","reputation":8,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/4e0e9dcfad95e00700e0309455322461?d=identicon&r=PG","link":"http://stackoverflow.com/users/2401175/user2401175"},"link":"http://stackoverflow.com/questions/16668384/object-casting-in-java","is_answered":true},{"question_id":15800121,"last_edit_date":1369128699,"creation_date":1365032284,"last_activity_date":1369134172,"score":4,"answer_count":3,"accepted_answer_id":15806954,"body":"<p>I have used $.mobile.changepage to do the redirect in my phonegap+jquerymobile projects. However what makes me confused is that I need to put the script of all the pages to the same file index.html. If not, the redirect page can not execute the function in its header.</p>\n\n<p>for example, my index.html seem to be \n<code>$(document).bind(\"deviceready\",function(){$.mobile.changepage(\"test.html\");})</code></p>\n\n<p>then, my device will redirect to test.html which seem to be</p>\n\n<pre><code>$(\"#btnTest\").click(function(){alert(\"123\");})\n&lt;button id=\"btnTest\"&gt;Test&lt;/button&gt;\n</code></pre>\n\n<p>However, the script will never execute in test.html. Then I put the script to index.html, what I expect to be is done. Whatever, if I put all the script to the same page, the project will become harder and harder to be preserved. Appreciated for your help.</p>\n","title":"Why I have to put all the script to index.html in jquery mobile","tags":["javascript","jquery","html","phonegap","jquery-mobile"],"view_count":653,"owner":{"user_id":1679418,"display_name":"Jack He","reputation":157,"user_type":"registered","profile_image":"http://i.stack.imgur.com/jVci3.png?g=1&s=128","link":"http://stackoverflow.com/users/1679418/jack-he","accept_rate":100},"link":"http://stackoverflow.com/questions/15800121/why-i-have-to-put-all-the-script-to-index-html-in-jquery-mobile","is_answered":true},{"question_id":16466841,"last_edit_date":1369134171,"creation_date":1368117869,"last_activity_date":1369134171,"score":-2,"answer_count":0,"closed_date":1368223801,"body":"<p>sql4 = \"SELECT OLTC,OLYY,OLNO,OLSR,OLSRNO,OLMCD,OLQW,SUM(OLSALVAL),odsalprc FROM ORDLAB \" &amp; _\n        \"INNER JOIN ORDDSG ON OLTC=ODTC AND OLYY=ODYY AND OLCHR=ODCHR AND OLNO=ODNO AND OLSR=ODSR \" &amp; _\n        \"where  oltc='\" &amp; Sheet1.Range(\"A2\").Text &amp; \"' and olyy='\" &amp; Sheet1.Range(\"b2\").Text &amp; \"' and olchr='\" &amp; Sheet1.Range(\"c2\").Text &amp; \"' and olno='\" &amp; Sheet1.Range(\"d2\").Text &amp; \"'  AND OLSR=\" &amp; res.Fields.Item(4) &amp; \" \" &amp; _\n        \"GROUP BY OLSR,OLTC,OLYY,OLNO,OLSRNO,OLMCD,olqw,odsalprc \"</p>\n\n<pre><code>    res4.CursorLocation = adUseClient\n    res4.Open sql4, con\n    If res4.RecordCount = 0 Then\n        res4.Close\n     Set res4 = Nothing\n     Else\n\n\n      For z1 = 0 To res4.RecordCount - 1\n      If res4.Fields.Item(5) = \"RHO\" Then\n      Sheet2.Range(\"J63\").Value = res4.Fields.Item(7)\n      Sheet2.Range(\"G65\").Value = res4.Fields.Item(8)\n      Sheet2.Range(\"D66\").Value = res4.Fields.Item(8)\n\n       End If\n      If res4.Fields.Item(5) = \"CFP\" Then\n      Sheet2.Range(\"G62\").Value = res4.Fields.Item(7)\n      Sheet2.Range(\"G65\").Value = res4.Fields.Item(8)\n      Sheet2.Range(\"D66\").Value = res4.Fields.Item(8)\n\n      End If\n      If res4.Fields.Item(5) = \"LCFP\" Then\n      Sheet2.Range(\"G62\").Value = res4.Fields.Item(7)\n      Sheet2.Range(\"G65\").Value = res4.Fields.Item(8)\n      Sheet2.Range(\"D66\").Value = res4.Fields.Item(8)\n      End If\n\n      If res4.Fields.Item(5) = \"RCFP\" Then\n      Sheet2.Range(\"G62\").Value = res4.Fields.Item(7)\n      Sheet2.Range(\"G65\").Value = res4.Fields.Item(8)\n      Sheet2.Range(\"D66\").Value = res4.Fields.Item(8)\n      End If\n\n      If res4.Fields.Item(5) = \"SPL\" Then\n      Sheet2.Range(\"D64\").Value = res4.Fields.Item(7)\n      Sheet2.Range(\"G65\").Value = res4.Fields.Item(8)\n      Sheet2.Range(\"D66\").Value = res4.Fields.Item(8)\n\n      End If\n      If res4.Fields.Item(5) = \"FND\" Then\n      Sheet2.Range(\"D63\").Value = res4.Fields.Item(7)\n      Sheet2.Range(\"G65\").Value = res4.Fields.Item(8)\n\n      Sheet2.Range(\"D66\").Value = res4.Fields.Item(8)\n      End If\n        If res4.Fields.Item(5) = \"SPL\" Then\n        I = res4.Fields.Item(7)\n        Sheet2.Range(\"D64\").Value = I\n        End If\n\n        If res4.Fields.Item(5) = \"RHO\" Then\n        J = res4.Fields.Item(7) + J\n        Sheet2.Range(\"J63\").Value = J\n        End If\n\n        If res4.Fields.Item(5) = \"CFP\" Then\n        K = res4.Fields.Item(7) + J\n        Sheet2.Range(\"G62\").Value = K\n        End If\n\n        If res4.Fields.Item(5) = \"LCFP\" Then\n        L = res4.Fields.Item(7) + 1\n        Sheet2.Range(\"G62\").Value = L\n        End If\n\n        If res4.Fields.Item(5) = \"RCFP\" Then\n        M = res4.Fields.Item(7) + 1\n        Sheet2.Range(\"G62\").Value = M\n        End If\n\n        If res4.Fields.Item(5) = \"FND\" Then\n        N = res4.Fields.Item(7) + 1\n        Sheet2.Range(\"D63\").Value = N\n        End If\n\n     res4.MoveNext\n      Next\n\n    End If\n    If res4.EOF Then res4.Close\n</code></pre>\n","title":"i want sum or item(5) individually...how to run loop","tags":["vba","excel-vba","macros"],"view_count":29,"owner":{"user_id":2341574,"display_name":"user2341574","reputation":1,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/3afc64d6c201fe1f44b73596ed0aa210?d=identicon&r=PG","link":"http://stackoverflow.com/users/2341574/user2341574"},"link":"http://stackoverflow.com/questions/16466841/i-want-sum-or-item5-individually-how-to-run-loop","is_answered":false},{"question_id":16668208,"creation_date":1369133469,"last_activity_date":1369134169,"score":0,"answer_count":4,"body":"<p>I have a select value 'post', when someone wants to change the status of the post from unsolved to solved they have to choose a post en than click 'change to solved'</p>\n\n<p>The problem is when I click on the button, it doesn't change because PHP takes not the whole title of the post. So when my post is called 'Photoshop crashes', it only sends 'Photoshop'. That's why it doesn't update in my database, the query can't find the right post, when the title of the post is only 1 word, my table gets updated.</p>\n\n<pre><code>&lt;?php\nif (isset($_POST['btnSolved'])) \n{\n// wanneer er op de knop geklikt is proberen we user te saven in de databank\nif (!empty($_POST['btnSolved'])) \n{\n    $solved = $_POST['unsolved'];\n    $conn = new mysqli(\"localhost\",\"root\",\"root\",\"PhpProject\");\n    if ($conn -&gt; connect_errno) {\n        throw new Exception(\"No connection with database!\");\n\n    } else {\n        $sql = \"UPDATE Posts SET status = 'Solved' WHERE post='\".$solved.\"'\";\n    }\n   }\n    $conn-&gt;query($sql);\n  }\n  ?&gt;\n</code></pre>\n\n<p>In my body:</p>\n\n<pre><code>&lt;h3&gt;Change status&lt;/h3&gt;\n        &lt;form action=\"&lt;?php echo $_SERVER['PHP_SELF'];?&gt;\" method=\"post\"&gt;\n            &lt;?php\n            if(mysqli_num_rows($showBugs) &gt; 0)\n            {\n                echo \"&lt;select name= unsolved&gt;\"; \n                while ($row = mysqli_fetch_assoc($showBugs)) \n                {\n                    echo \"&lt;option value=\" . $row['subject'] . \"&gt;\" . $row['subject'] . \"&lt;/option&gt;\";\n                }\n                echo \"&lt;/select&gt;\";\n            }\n            ?&gt;\n            &lt;br /&gt;\n            &lt;input class=\"btn btn-info dropdown-toggle\" type=\"submit\" name=\"btnSolved\" value=\"Change to solved\" /&gt;\n        &lt;/form&gt;\n</code></pre>\n\n<p>This is what I get when I do a print of the $sql</p>\n\n<pre><code>UPDATE Posts SET status = 'Solved' WHERE post='Photoshop'\n</code></pre>\n\n<p>Does someone know why PHP can post 1 word, but not the whole title? It might be something stupid, but I don't know how to fix this.</p>\n","title":"post not completely posted PHP","tags":["php","database","post","sql-update"],"view_count":14,"owner":{"user_id":2390663,"display_name":"Lupicora","reputation":3,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/a507752798e78f36ebabfae3b9ee7da9?d=identicon&r=PG","link":"http://stackoverflow.com/users/2390663/lupicora"},"link":"http://stackoverflow.com/questions/16668208/post-not-completely-posted-php","is_answered":false},{"question_id":16668430,"creation_date":1369134166,"last_activity_date":1369134166,"score":0,"answer_count":0,"body":"<pre><code>import static org.junit.Assert.assertTrue;\n\nimport org.junit.Before;\nimport org.junit.Test;\npublic class SwiftTest {\n    SwiftUtil swiftUtil = new SwiftUtil();\n    boolean result;\n    @Test\n    public void checkInPathFolder()\n    {\n        result = swiftUtil.checkInPathFolder();\n        assertTrue(result);\n    }\n    @Test\n    public void checkCustomObjectExists()\n    {\n        result=swiftUtil.validateWFId();\n        assertTrue(result);\n    }\n    @Test\n    public void runSwift()\n    {\n        result=swiftUtil.runSwiftBatch();\n        assertTrue(result);\n    }\n    @Test\n    public void checkTreatedFolder()\n    {\n        result=swiftUtil.checkTreatedFolder();\n        assertTrue(result);\n    }\n    @Test\n    public void checkExceptionFolder()\n    {\n        result=swiftUtil.checkExceptionFolder();\n        assertTrue(result);\n    }\n}\n</code></pre>\n\n<p>Above is my Test case. based on two cases i want to execute set of above test methods.\nFor eg: on Condition X, only checkInPathFolder(),checkCustomObjectExists(),runSwift() should be executed. On Condition Y , checkInPathFolder(),runSwift(),checkExceptionFolder() should be executed.</p>\n","title":"JUnit running test methods conditionally","tags":["java","junit","junit4"],"view_count":4,"owner":{"user_id":1433596,"display_name":"Amogh RAO","reputation":1,"user_type":"registered","profile_image":"http://i.stack.imgur.com/qgSpv.jpg?g=1&s=128","link":"http://stackoverflow.com/users/1433596/amogh-rao"},"link":"http://stackoverflow.com/questions/16668430/junit-running-test-methods-conditionally","is_answered":false},{"question_id":16659294,"creation_date":1369088498,"last_activity_date":1369134163,"score":0,"answer_count":1,"body":"<p>In the following Makefile</p>\n\n<pre><code>f = echo $(1)\n\nt:\n    $(call f,\"a \\\n        b\"); \\\n    $(call f,\"a \\\n        b\")\n</code></pre>\n\n<ul>\n<li>there is only one TAB, at the beginning of line 4 (the first call f)</li>\n<li>no blanks at the end of the lines</li>\n</ul>\n\n<p>The output is</p>\n\n<pre><code>a b\na  b\n</code></pre>\n\n<p>The two calls are identical (except for the initial TAB). Why the output are different ?</p>\n","title":"different output in Makefile rule","tags":["makefile","make","newline"],"view_count":20,"owner":{"user_id":2403409,"display_name":"BraMo logicar","reputation":1,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/46c570af36d384c3af7d8b2d0cd82aaa?d=identicon&r=PG","link":"http://stackoverflow.com/users/2403409/bramo-logicar"},"link":"http://stackoverflow.com/questions/16659294/different-output-in-makefile-rule","is_answered":false},{"question_id":16668284,"last_edit_date":1369134097,"creation_date":1369133680,"last_activity_date":1369134160,"score":-4,"answer_count":2,"body":"<p>I have used the following code to delete and edit some values in the gridview, but as i click delete it shows an error:</p>\n\n<pre><code>Object reference not set to an instance of an object. in line 48 i.e. con.open();\n</code></pre>\n\n<p>Please help me solve it. And when i click on edit and insert values in shown txtboxes and then click update it shows another error:</p>\n\n<pre><code>Specified argument was out of the range of valid values. in the line 74 of my code i.e.\n   EmailID = (TextBox)GridView1.Rows[e.RowIndex].Cells[7].FindControl(\"EmailID\");\n</code></pre>\n\n<p>The code i have used is-</p>\n\n<pre><code>using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\nusing System.Data.SqlClient;\nusing System.Data;\n\npublic partial class Admin_viewSalesmanDetails : System.Web.UI.Page\n{\n    SqlConnection con;\n    String strConnection = \"Data Source=HP\\\\SQLEXPRESS;database=MK;Integrated Security=true\";\n    SqlCommand cmd;\n    protected void Page_Load(object sender, EventArgs e)\n    {\n\n        if (!IsPostBack)\n        {\n            BindGrid();\n        }\n\n\n    }\n\n    private void BindGrid()\n    {\n          using (SqlConnection con = new SqlConnection(strConnection))\n        {\n            using (SqlCommand cmd = new SqlCommand())\n            {\n\n                cmd.CommandText = \"select * from salesman_details\";\n                cmd.Connection = con;\n\n\n                SqlDataSource1.DataBind();\n                GridView1.DataSource = SqlDataSource1;\n                GridView1.DataBind();\n\n            }\n        }\n    }\n    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)\n    {\n        Label EmpID = new Label();\n        EmpID = (Label)GridView1.Rows[e.RowIndex].Cells[2].FindControl(\"EmpID\");\n        cmd = new SqlCommand(\"delete from salesman_setails where EmpID=\" + EmpID.Text + \"\", con);\n        con.Open();\n        int k = cmd.ExecuteNonQuery();\n        con.Close();\n        if (k == 1)\n        {\n            Response.Write(\"&lt;script&gt;alert('Employee Deleted Successfully')&lt;/script&gt;\");\n            BindGrid();\n        }\n        else\n        {\n            Response.Write(\"&lt;script&gt;alert('Error Occured While Deleting')&lt;/script&gt;\");\n            BindGrid();\n        }\n    }\n    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)\n    {\n        GridView1.EditIndex = e.NewEditIndex;\n        BindGrid();\n\n    }\n    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)\n    {\n        Label EmpID = new Label();\n        TextBox PhnNo = new TextBox();\n        TextBox EmailID = new TextBox();\n        EmpID = (Label)GridView1.Rows[e.RowIndex].Cells[2].FindControl(\"EmpID\");\n        PhnNo = (TextBox)GridView1.Rows[e.RowIndex].Cells[5].FindControl(\"PhnNo\");\n        EmailID = (TextBox)GridView1.Rows[e.RowIndex].Cells[7].FindControl(\"EmailID\");\n        cmd = new SqlCommand(\"update  salesman_details set PhnNo='\" + PhnNo.Text + \"', EmailID='\" + EmailID.Text + \"' where EmpID=\" + EmpID.Text + \"\", con);\n        con.Open();\n        int k = cmd.ExecuteNonQuery();\n        con.Close();\n        if (k == 1)\n        {\n            Response.Write(\"&lt;script&gt;alert('Employee Updated Successfully')&lt;/script&gt;\");\n            GridView1.EditIndex = -1;\n            BindGrid();\n\n        }\n        else\n        {\n            Response.Write(\"&lt;script&gt;alert('Error Occured While Updating')&lt;/script&gt;\");\n            BindGrid();\n        }\n\n    }\n\n    protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)\n    {\n        GridView1.EditIndex = -1;\n        BindGrid();\n    }\n\n\n    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)\n    {\n        GridView1.PageIndex = e.NewPageIndex;\n        BindGrid();\n    }\n}\n</code></pre>\n","title":"Object reference not set to an instance of an object in delete option of my code and another error in update option of my code","tags":["c#","asp.net","sql-server","gridview","data-binding"],"view_count":15,"owner":{"user_id":2064016,"display_name":"Mayuri Koul","reputation":18,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/a5b5fa096ed75a35b26c451ec6e86651?d=identicon&r=PG","link":"http://stackoverflow.com/users/2064016/mayuri-koul","accept_rate":40},"link":"http://stackoverflow.com/questions/16668284/object-reference-not-set-to-an-instance-of-an-object-in-delete-option-of-my-code","is_answered":false},{"question_id":16665642,"last_edit_date":1369129417,"creation_date":1369125798,"last_activity_date":1369134153,"score":0,"answer_count":1,"body":"<p>I was trying to play with  <a href=\"http://railscasts.com/episodes/328-twitter-bootstrap-basics\" rel=\"nofollow\">Twitter Bootstrap Basics</a> using Rails 4.0.0.rc1 and ruby 1.9.3p392.</p>\n\n<p>Then I try to access \n<code>http://localhost:3000/products</code> </p>\n\n<p>I'm having error: </p>\n\n<blockquote>\n  <p>'twitter/bootstrap/bootstrap.less' wasn't found.</p>\n</blockquote>\n\n<p>Please see attached screenshot.</p>\n\n<p>Code available at <a href=\"https://github.com/tenzan/twitter-bootstrap.git\" rel=\"nofollow\">https://github.com/tenzan/twitter-bootstrap.git</a></p>\n\n<p><img src=\"http://i.stack.imgur.com/2GEmT.png\" alt=\"enter image description here\"></p>\n","title":"&#39;twitter/bootstrap/bootstrap.less&#39; wasn&#39;t found","tags":["ruby-on-rails","twitter-bootstrap","ruby-on-rails-4"],"view_count":20,"owner":{"user_id":1745902,"display_name":"oscar","reputation":52,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/a629f4656cabd0433729ab0c6523cedd?d=identicon&r=PG","link":"http://stackoverflow.com/users/1745902/oscar","accept_rate":60},"link":"http://stackoverflow.com/questions/16665642/twitter-bootstrap-bootstrap-less-wasnt-found","is_answered":false},{"question_id":16663848,"creation_date":1369119229,"last_activity_date":1369134148,"score":0,"answer_count":1,"body":"<p>I wrote the following code which sends a simple message to my mobile with GSM SM5100B. But it does not work. I would like to check the outputs of each printf line with c++ code. \nFor example</p>\n\n<pre><code>AT+CMFG=1\nok\nAT+CMGS=\"69******\"\nok\n</code></pre>\n\n<p>etc.\nIs there any why to implement this?</p>\n\n<p>My code</p>\n\n<pre><code>#include &lt;stdio.h&gt; // standard input / output functions\n#include &lt;string.h&gt; // string function definitions\n#include &lt;unistd.h&gt; // UNIX standard function definitions\n#include &lt;fcntl.h&gt; // File control definitions\n#include &lt;errno.h&gt; // Error number definitions\n#include &lt;termios.h&gt; // POSIX terminal control definitionss\n#include &lt;time.h&gt;   // time calls\n\nint open_port(void)\n{\nint fd; // file description for the serial port\nfd = open(\"/dev/ttyAMA0\", O_RDWR | O_NOCTTY | O_NDELAY);\nif(fd == -1) // if open is unsucessful\n{\n    printf(\"open_port: Unable to open /dev/ttyAMA0. \\n\");\n}\nelse\n{\n    fcntl(fd, F_SETFL, 0);\n    printf(\"port is open.\\n\");\n}\n\nreturn(fd);\n} //open_port\n\nint configure_port(int fd)      // configure the port\n{\nstruct termios port_settings;      // structure to store the port settings in\n\ncfsetispeed(&amp;port_settings, B9600);    // set baud rates\ncfsetospeed(&amp;port_settings, B9600);\n\nport_settings.c_cflag &amp;= ~PARENB;    // set no parity, stop bits, data bits\nport_settings.c_cflag &amp;= ~CSTOPB;\nport_settings.c_cflag &amp;= ~CSIZE;\nport_settings.c_cflag |= CS8;\n\ntcsetattr(fd, TCSANOW, &amp;port_settings);    // apply the settings to the port\nreturn(fd);\n\n}  \n\nvoid init_gsm()\n{\n printf(\"AT+CMGF=1\\r\\n\");\n sleep(3);\n printf(\"AT+CMGS=\\\"+34603****\\\"\\r\\n\");\n sleep(3);\n //printf(\"Hello\\r\\n%c\",26); \n printf(\"Hello\\x1A\");\n sleep(3);\n// printf(\"\\x1A\");\n\n}\nint main(void)\n{\nint fd = open_port();\nconfigure_port(fd);\nsleep(5);\n//query_modem(fd);\n    init_gsm();\nreturn(0);\n\n}\n</code></pre>\n","title":"output of AT command c++ code","tags":["c++","gsm","at-command"],"view_count":28,"owner":{"user_id":576998,"display_name":"dali1985","reputation":367,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/522e765e5e677cdfc5bbb7ce6b8c632d?d=identicon&r=PG","link":"http://stackoverflow.com/users/576998/dali1985","accept_rate":78},"link":"http://stackoverflow.com/questions/16663848/output-of-at-command-c-code","is_answered":false},{"question_id":15964854,"creation_date":1365749240,"last_activity_date":1369134148,"score":1,"answer_count":1,"body":"<p>My post-build event works, but in some situations I am quite sure it is showing an error in the console window. However, because the window closes immediately, I'm not able to read any of it.</p>\n\n<p>This is the build event:</p>\n\n<pre><code>if $(ConfigurationName) == Release start xcopy /y \"$(TargetDir)*.dll\" \"$(ProjectDir)../../bin\"\n</code></pre>\n\n<p>Basically it copies the built dlls over to another directory.</p>\n\n<p>Is there a way to force the console window invoked by <code>start</code> to remain open until I close it?  </p>\n","title":"Visual Studio post-build: keep console open?","tags":["windows","visual-studio-2010","console","postbuild-event"],"view_count":43,"owner":{"user_id":2214709,"display_name":"Arno Sluismans","reputation":618,"user_type":"registered","profile_image":"http://i.stack.imgur.com/mvj5V.jpg?g=1&s=128","link":"http://stackoverflow.com/users/2214709/arno-sluismans","accept_rate":90},"link":"http://stackoverflow.com/questions/15964854/visual-studio-post-build-keep-console-open","is_answered":false},{"question_id":16668291,"last_edit_date":1369134146,"creation_date":1369133695,"last_activity_date":1369134146,"score":0,"answer_count":0,"body":"<p>I have the following problem with inheritance (I would love to google it, but don't know the correct keywords it seems).</p>\n\n<p>I have a <code>Module</code> class that implements <code>IModule</code> interface with function <code>A()</code>. I also have <code>ClientModule</code> class that inherits <code>Module</code> class and implements <code>IClientModule</code> interface with function <code>B()</code> that inherits <code>IModule</code> interface. This is where I am starting to get ambiguity and <strong>double inheritance problems</strong>.</p>\n\n<p>Here is the class diagram that should tell a bit more about the problem:</p>\n\n<p><img src=\"http://i.stack.imgur.com/aRspO.png\" alt=\"enter image description here\"></p>\n\n<p>I need to have separated access to <code>Module</code> class with <code>IModule</code> interface and <code>ClientModule</code> with <code>IClientModule</code> interface that offers access to <code>IModule</code> interface as well.</p>\n","title":"Inheritance C++","tags":["c++","inheritance"],"view_count":47,"owner":{"user_id":410624,"display_name":"krizajB","reputation":93,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/02304b1bea41f5619a40fb95a2ce1d8c?d=identicon&r=PG","link":"http://stackoverflow.com/users/410624/krizajb","accept_rate":89},"link":"http://stackoverflow.com/questions/16668291/inheritance-c","is_answered":false},{"question_id":16667764,"last_edit_date":1369133685,"creation_date":1369132050,"last_activity_date":1369134143,"score":0,"answer_count":2,"body":"<p>Using javascript and node.js how to post the content to the text file through ajax.</p>\n\n<pre><code>&lt;html&gt;\n&lt;body&gt;\n     &lt;input type=\"button\" value=\"Click Me\" onclick=\"postContent()\"&gt;\n  &lt;script&gt;\n    function postContent(){\n        var req=new XMLHttpRequest();\n        req.open('post','addContent.js',true);//in this sample.txt file i want to insert some content\n        req.send();\n      }\n\n  &lt;/script&gt;\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n\n<p>addContent.js</p>\n\n<pre><code>  var fs = require('fs');\n  fs.writeFile(\"/tmp/sample.txt\", \"Hey there!\", function(err) {\n   if(err) {\n      console.log(err);\n   } else {\n     console.log(\"The file was saved!\");\n   }\n}); \n</code></pre>\n","title":"Using javascript and node.js how to post the content to the text file through ajax","tags":["javascript","ajax","node.js"],"view_count":27,"owner":{"user_id":2138629,"display_name":"sachin","reputation":166,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/7a44b1e0db3e3b2fc89a19f614eb96d5?d=identicon&r=PG","link":"http://stackoverflow.com/users/2138629/sachin","accept_rate":81},"link":"http://stackoverflow.com/questions/16667764/using-javascript-and-node-js-how-to-post-the-content-to-the-text-file-through-aj","is_answered":false},{"question_id":16668424,"creation_date":1369134140,"last_activity_date":1369134140,"score":-1,"answer_count":0,"body":"<p>I am developing a website where I have used one registration page...If a user registered first time then he can apply for that job..then after 6 months only he can apply so is there any way to capture user IP address and time for the website. I am using SPRING MVC and Glassfish server.</p>\n\n<p>Thanks</p>\n","title":"how to capture time and IP address of the visiters?","tags":["java","http","java-ee","spring-mvc","glassfish"],"view_count":3,"owner":{"user_id":1944816,"display_name":"Puneet Purohit","reputation":216,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/ff0105cb662a496eb5643fb2777a897e?d=identicon&r=PG","link":"http://stackoverflow.com/users/1944816/puneet-purohit","accept_rate":60},"link":"http://stackoverflow.com/questions/16668424/how-to-capture-time-and-ip-address-of-the-visiters","is_answered":false},{"question_id":16668423,"creation_date":1369134137,"last_activity_date":1369134137,"score":0,"answer_count":0,"body":"<p>I'm using spring integration file poller. Here is my configuration file. But service activator is called twice for each file found.</p>\n\n<pre><code>&lt;int:channel id=\"requestChannel\" &gt;      \n&lt;/int:channel&gt;\n&lt;int-ftp:outbound-channel-adapter id=\"ftpOutAdapterAutoCreate\"\n    session-factory=\"ftpSessionFactory\" channel=\"requestChannel\"\n     remote-directory-expression=\"remotedir\" charset=\"UTF-8\"  /&gt;\n&lt;int:service-activator requires-reply=\"false\" \n    input-channel=\"requestChannel\" output-channel=\"requestChannel\"\n    ref=\"OnlineOrderAPIController\" method=\"handleFTPMessage\" /&gt;\n</code></pre>\n\n<p>Can you please help me?</p>\n","title":"Spring Integration file poller - multiple times service activator is called","tags":["spring"],"view_count":2,"owner":{"user_id":1179726,"display_name":"Sayed Zahidul Islam","reputation":1,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/f43505b76ce46a7df92c6fd40d7f2f16?d=identicon&r=PG","link":"http://stackoverflow.com/users/1179726/sayed-zahidul-islam"},"link":"http://stackoverflow.com/questions/16668423/spring-integration-file-poller-multiple-times-service-activator-is-called","is_answered":false},{"question_id":16668412,"last_edit_date":1369134136,"creation_date":1369134091,"last_activity_date":1369134136,"score":1,"answer_count":0,"body":"<p>I'm trying to achieve something that I'm relatively sure has been done several times before, however I can't seem to find any documetation on it.</p>\n\n<p>I'm using the responsive bootstrap for this, and the affected functionality revolves around the \"tabbable\" component. (see below)</p>\n\n<pre><code>&lt;div class=\"tabbable\"&gt; &lt;!-- Only required for left/right tabs --&gt;\n   &lt;ul class=\"nav nav-tabs\"&gt;\n      &lt;li class=\"active\"&gt;&lt;a href=\"#tab1\" data-toggle=\"tab\"&gt;Section 1&lt;/a&gt;&lt;/li&gt;\n      &lt;li&gt;&lt;a href=\"#tab2\" data-toggle=\"tab\"&gt;Section 2&lt;/a&gt;&lt;/li&gt;\n   &lt;/ul&gt;\n\n   &lt;div class=\"tab-content\"&gt;\n      &lt;div class=\"tab-pane active\" id=\"tab1\"&gt;\n         &lt;p&gt;I'm in Section 1.&lt;/p&gt;\n      &lt;/div&gt;\n\n      &lt;div class=\"tab-pane\" id=\"tab2\"&gt;\n         &lt;p&gt;Howdy, I'm in Section 2.&lt;/p&gt;\n      &lt;/div&gt;\n   &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>What I am trying to achieve is a functionality that hides the content of the tab if it is already active. (in the example above, clicking the active <code>&lt; a &gt;</code> should remove the <code>\"active\"</code> class from both the button itself and the related div (<code>#tab1</code>) in a way that poses no threat for tabbable functionality)</p>\n\n<p>I would think that there is a very simple solution to this, being new to bootstrap however, I haven't been able to locate it yet and don't want to dig my own grave using some obsure javascript solution.</p>\n\n<p>Any ideas/input greatly appriciated!</p>\n","title":"Toggle &quot;tabbable&quot; - bootstrap","tags":["jquery","html","css","bootstrap"],"view_count":10,"owner":{"user_id":2405140,"display_name":"user2405140","reputation":6,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/e82c59176a4ecb63e2939539a2d35c16?d=identicon&r=PG","link":"http://stackoverflow.com/users/2405140/user2405140"},"link":"http://stackoverflow.com/questions/16668412/toggle-tabbable-bootstrap","is_answered":false},{"question_id":16668250,"creation_date":1369133597,"last_activity_date":1369134132,"score":0,"answer_count":1,"body":"<p>I have problem displaying two Datepickers on the same page. The one should be displayed with a hidden body like this </p>\n\n<p><img src=\"http://i.stack.imgur.com/2JJWV.png\" alt=\"enter image description here\"></p>\n\n<p>and the other one should be a regular datepicker. </p>\n\n<p>To achieve the first functionality I do this:</p>\n\n<pre><code>$('.date-picker').datepicker( {\n  changeMonth: true,\n  changeYear: true,\n  showButtonPanel: true,\n  dateFormat: 'MM yy'\n});\n</code></pre>\n\n<p>And then by using css i hide the body:</p>\n\n<pre><code>.ui-datepicker-calendar {\n    display: none !important;\n}\n</code></pre>\n\n<p>But when I want to display the second datepicker I cannot overwrite that css style.</p>\n\n<p>I tried</p>\n\n<pre><code>$('.ui-datepicker-calendar').css('display', '');\n</code></pre>\n\n<p>I tried even completely removing the style attribute but still with no luck.</p>\n\n<pre><code>$('.ui-datepicker-calendar').removeAttr('style');\n</code></pre>\n\n<p>Does anyone has an idea on how to achieve this?</p>\n\n<p>Thanks</p>\n","title":"Two Different Datepickers in the same page","tags":["jquery","css","jquery-ui","datetimepicker"],"view_count":9,"owner":{"user_id":1387157,"display_name":"MaVRoSCy","reputation":3389,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/a55f5a2411478fc1d107a08bbcba7ee4?d=identicon&r=PG","link":"http://stackoverflow.com/users/1387157/mavroscy","accept_rate":91},"link":"http://stackoverflow.com/questions/16668250/two-different-datepickers-in-the-same-page","is_answered":false},{"question_id":14534856,"last_edit_date":1369134123,"creation_date":1359185151,"last_activity_date":1369134130,"score":0,"answer_count":3,"accepted_answer_id":14535994,"body":"<ol>\n<li>I have a java class:</li>\n</ol>\n\n<pre class=\"lang-java prettyprint-override\"><code>    public Task {\n\n        private int id;\n        private Company sender;\n        private Company receiver;\n\n        //Getter and Setter\n        ...\n    }\n</code></pre>\n\n<p>As you can see, I have 2 other custom classes in the task class. And a company has for example Adress and Directory (see screenshot below).</p>\n\n<ol>\n<li>Now I have a form page with 2 sections (sender &amp; receiver) representing a company. I don't want to make 2 seperate markups and java code for those 2 sections. Any way to avoid this duplication? </li>\n</ol>\n\n<p><img src=\"http://i.stack.imgur.com/ECEsG.png\" alt=\"enter image description here\"></p>\n","title":"Wicket - Reusable panels with java-subclasses","tags":["forms","wicket","panel","reusability","subclasses"],"view_count":102,"owner":{"user_id":1750904,"display_name":"Dave","reputation":142,"user_type":"registered","profile_image":"http://www.gravatar.com/avatar/2edd16dfab0744ae4305a8b33cc2b0b4?d=identicon&r=PG","link":"http://stackoverflow.com/users/1750904/dave","accept_rate":67},"link":"http://stackoverflow.com/questions/14534856/wicket-reusable-panels-with-java-subclasses","is_answered":true}],"quota_remaining":297,"quota_max":300,"has_more":true}