When moving files around in a project I ran into some pretty frustrating namespace collision issues. After the fact I learned a better way to move the files but I'm hoping to find a solution. Here is what I experienced: After moving files via cut/pas
I have this table: ------------------------------ |ID | name | employee_code | ------------------------------ |24 | Robert | 20234 | ------------------------------ AND ------------------------------------- |ID | job_code | team | --------------------
I'm still working on my rails 4 demo site, and I'm seeing an odd thing. In the controller it has a line like this: format.html { redirect_to @widget, notice: 'Widget was successfully created.' } This renders a flash message in the redirected page, wh
I'm studying about threads and slightly confused about 1 thing. If I have a single process with multiple threads running on a dual/quad core CPU, will different threads run concurrently on different cores? Thanks in advance.It Depends. At least on Li
I have string with several spaces, including double spaces and spaces at the start and end of the string: 12 345 67 89 I want to add just the numbers into array so used: explode(" ", $s); But this adds spaces to to the array as well. Is there a
Ive got a block of text, and i want to write the authors name and date bellow it in small italics, so i put it in a <span> block and styled it, but i want to space the name out a little bit so i applided margin (also tried padding) to the block but
I want to create a few PowerShell functions that create an item, or return existing item if it is already there. E.g. database login, folder, etc. What is a proper verb for this? There is no Ensure in Approved Verbs, and I am not sure what else would
This is my Backend JPA(ORM) Structure: MessageObject.java messageId messageName relatedMessageId // maps to NEXT message in chain Assume there is something in the message name that suggests it's the first message I should expect in the chain (i.e. th
I am trying to make use of Facebook SDK 3.5 to authenticate users for my android applicaiton following the link, https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android/. I am able to login to my application using facebo
As an easy example, consider the following command: $ sort file.txt This will output the file's data in sorted order. How do I put that data right back into the same file? I want to update the file with the sorted results. This is not the solution: $
When I write client side code, I use HTML/CSS/JavaScript and lately jQuery to both speed up coding, and use improved methods to achieve the same goal. In my text editor I use zen-coding to speed up the writing of code, and also to avoid errors. I was
I want to secure outgoing RDP connections from my AWS machines. When connecting from our company network to a machine running in a VPC via RDP all my company network drives (available on the machine within my company network) are mapped to the EC2 ma
Is there a way to find out what the ContentType of an image is from only the original bytes? At the moment I have a database column that stores only the byte[], which I use to display an image on a web page. MemoryStream ms = new MemoryStream(imageBy
Here's the method i want to write: public static IEnumerable<String> GetTableNames(this IQueryable<T> query) { //... } where the IQueryable is a linq-to-sql query (is there a more specific interface i should use?). then if i had a query like t
{ "_id": "581dc52e2c26be354164d528", "name": "vipin", "__v": 0, "post": [ { "like": "today", "_id": "581dc52e2c26be354164d529", "comment": [ { &q
I'm building a Website (PHP), API (PHP) and a native iPhone app. I want users to login with their Facebook account so they can post reviews / upload photo's via the Website or iPhone app to our server/database. This will also save me time to create a
The title probably didn't make much sense, so let me make it clear: I want to catch space characters that are not repeated one or three times. And replace them with nothing. For example, this; 'the quick brown fox jumps over the lazy dog' would becom
Hello I have a problem I have Column data in string format in this format: xxxxxxxx <***********> I want to pertain the xxxxxxx, but get rid of <***********>, where <***********> could be any type of string of any length. I have this com
I need to notice the network change in the android system and perform particular activities accordingly. 1) When WiFi is enabled, perform function A. 2) When Mobile network is enabled, perform function B. 3) When WiFi is disabled and Mobile Network i
I am saving binary files into a Sql Server 2005 Db using Fluent NHibernate. However, I am using SQLite to run my (pseudo) Unit Tests. I need to use a custom Sql type for Ms Sql, but it would throw an error on SqlLite. What strategies can I use? This
What is the best way to obtain the numeric value from a guid column? I am trying this line but i am getting: ORA-00904: "HASHBYTES": invalid identifier 00904. 00000 - "%s: invalid identifier" Query is below: SELECT HASHBYTES('MD5',CAST
Jquery is ignoring all Angular ng binds(ng-app,ng-controller,ng-bind..) on page change.They are working in index but when I navigate to other pages ng-s just aren't working.Is there a way to "rebind" angular when page dynamically changes? in fir
I have centos VPS hosting and installed WHM/cPanel . I want to run a php script using command line for unlimited time. My script is look like: <?php set_time_limit(0); while(true) { //code to send me email sleep(600); } ?> I know that this script sh
I am trying to take some xml code, a sample being below: <time_report> <project_ID>4</project_ID> <project_status>close</project_status> <client_ID>6001</client_ID> <time_record> <project_start_time>15
I am trying to fill this HTML Select <select id="list"> </select> With data from JSON (the actual JSON contains more keys and values than shown below): {"Group1": "TestGroup1", "Group2" : "TestGroup
In c++, "recvfrom" function is a blocking function (block thread till a packet arrive). How can i safely terminate a thread blocked in "recvfrom" ?Avoid the situation by only calling recvfrom once select/poll/epoll has returned success
In my application I work with criterias. I have one base Criteria interface and and other interfaces who inherits from this base interface: ICriteria | | ---------------------- | | ITextCriteria IChoices What I'd like to know is, what is the best way
I'm looking for a grunt plugin that will automatically change the references to static assets (js/css) inside an html file like this: <link rel="stylesheet" type="text/css" href="style.css?v=12345678" /> <script src=
I had done a Employee Profile in MVC. In a particular screen, i am having 8 tabs. All are working fine. What i need is, if the session expires, the page should be redirected to login page. How to write the JQuery for that. var sessionTimeout = 30 * 6
My html page has the correct encoding as follows: <meta http-equiv="content-type" content="text/html; charset=utf-8" /> And in the pages of my website this character is showing up correctly "ā" However in the title it i