on-internet

Overlap DIV with another DIV

I have a DIV .text in a .main parent in my website. I would like to overlap some part of the header and "hide" a bottom part of it. In the example below, i would like the blue .text square to move 20px higher (up), overlapping partially the bottom of the yellow header. <div class="header" style="height: 200px;width: 100%;background: yellow;"></div> <div class="main" style="height: 800px;background: orange"> <div class="text" style="height: 100px;width: 50px;background: blue;"></div> </div>

Join the discussion →

Android GooglePlayServicesUtil.getErrorDialog() does not show the dialog

I am trying to check the availability of Google Play Services APK prior to using it. I have got a device where the package is out of date (the log reads "...Google Play services out of date. Requires 3225100 but found 3136134"). The below code shall handle this situation and show a dialog prompting the user to do the update. For a reason unknown to me the line GooglePlayServicesUtil.getErrorDialog(resultCode, this, PLAY_SERVICES_RESOLUTION_REQUEST).show(); returns immediately showing no dialog (and not blocking the UI thread on an UI event). Could you please shed a light of what is possible go

Join the discussion →

How should I check if a user is authenticated in ASP.NET MVC 5?

I have seen the following two accessible Booleans: System.Web.Mvc.Controller.User.Identity.IsAuthenticated System.Web.Mvc.Controller.Request.IsAuthenticated Is there a difference between these. They both seem to do the same thing so I am not sure which to use. What I would like to do is: @if (User.Identity.IsAuthenticated) { if (User.IsInRole("Admin")) { @Html.ActionLink("Admin", "AdminController") } } or @if (Request.IsAuthenticated) { if (User.IsInRole("Admin")) { @Html.ActionLink("Admin", "AdminController") } } Would either of the above work equally well?

Join the discussion →

C# Sending Hex string to tcp socket

I'm trying to send a hex string to a tcp socket. I have some problems with the format or conversion of this string, cause I'm not very sure what the format its using. I've written a WindowsPhone app which is working fine based on Socket Class. This app emulates request, that are normaly send from a desktop program to a device which hosts a webservice. Via wireshark, I found out, that the webservice will accept an input stream (think its in hex) and returns a 2nd. hex stream which contains the data I need. So the desktop app is sending a stream and Wireshark shows when : Data (8 bytes) Data: 62

Join the discussion →

IOS MDM-Managed Settings Command return CommandFormatError

I receive "CommandFormatError" on Managed Settings commands. That's what I'm sending as a Settings command: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CommandUUID</key> <string>123456</string> <key>Command</key> <dict> <key>RequestType</key> <string>Settings</string> <key>Settings</key> <array> <dict> <key>Item</key> <string>VoiceRoaming</string> <key>Enabled</key> <true/> </dict> </array> </dict> </dict> </plist> Thank you in advance!

Join the discussion →

How to synchronize iCalendar with Outlook

I store my .ics calender on a webdav server. With Thunderbird/Lighning I can read and write the calendar. But how to deal with Outlook? Outlook can only read the ics file remotely. Synchronization using google calender is not an option for me.

Join the discussion →

Rock, paper, scissors game does not handle invalid input correctly

I am using Python, and I am trying to write a simple program that simulates a rock, paper, scissors game. Everything works except for when I enter an invalid response (something other than rock, paper, or scissors) when I get this error: Traceback (most recent call last): File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 88, in <module> main() File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 14, in main number = user_guess() File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 48, in user_guess return number UnboundLocalErro

Join the discussion →

Python rock, paper, scissors game

I am using Python, and I am trying to write a simple program that simulates a rock, paper, scissors game. Everything works except for when I enter an invalid response (something other than rock, paper, or scissors) when I get this error: Traceback (most recent call last): File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 88, in <module> main() File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 14, in main number = user_guess() File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 48, in user_guess return number UnboundLocalErro

Join the discussion →

how to detect screen mirroring

I have been wondering if there is any way in the android API (or any other lib/framework) that can help me to detect if my device screen is mirrored using WiDi,Miracast or MHL or basically any other technique for mirroring your screen. Br, Inx

Join the discussion →

PhoneGap Android app not displaying pdf data

I have a PhoneGap app for Android which I am trying to run in the Android emulator. The app has a simple html page which has a button. On click, the button calls a RESTful webservice using javascript XMLHttpRequest and the service returns back base 64 encoded data for a pdf. Then from the javascript function, I try to load the pdf data in my html page in the app as below document.location.href = 'data:application/pdf;base64,' + pdfData.childNodes[0].data; But this does nothing. The data is returned correctly and I checked the logs for it. But the pdf is not displayed at all. Any idea what is c

Join the discussion →

Valgrind - memory leaks

Need to find memory leaks in code? Does Valgrind indicate memory leaks as they happen during run time? How can I integrate Valgrind into my code base that runs on a proprietary tool chain.

Join the discussion →

Print specific lines after a text present in another text file

I have two text files. Text-file-1 contains strings (one string per line); C 010 C 020 C 024 . . . Text-file-2 contains data in following format; C 005 Carbon D Carbon 1 D Carbon 2 D Carbon 3 D Carbon 4 C 010 Hydrogen D Hydrogen 1 D Hydrogen 2 C 017 Oxygen D Oxygen 1 C 020 Nitrogen D Nitrogen 1 D Nitrogen 2 D Nitrogen 3 C 024 Sulphur D Sulphur 1 D Sulphur 2 . . . Text-file-1 contains 30 lines but Text-file-2 contain huge data, and in the same format as I mentioned. I can grep the text in Text-file-2 found in Text-file-1 using following command; awk 'NR==FNR { A[$2]=1; next }; A[$2]' Text-file-

Join the discussion →

Changing the Git remote 'push to' default

I want to change the Git default remote branch destination so I could just git push Instead of: git push upstream Currently this is set to the origin remote and I want to set it to a different remote. I tried to remove the original (cloned from) remote git remote rm origin Which did remove the original remote. But doesn't solve the git push problem. I still get: fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository using... I also tried to play with: git remote set-url --push myfork origin and other options but none seem to work (m

Join the discussion →

How to extract array Keys to String in an array PHP

I need to extract a associative array keys into a string and implode with "/" or any character/symbols. For eg: $array = array([key1] => array([key11] => array([key111] => 'value111', [key112] => 'value112', [key113] => 'value113', ), ), ); I need an output as below array: array([0] => 'key1/key11/key111',[1] => 'key1/key11/key112', [2] => 'key1/key11/key112');

Join the discussion →

Creating a select box with a search option

I am trying to replicate what you can see here in this image. I want to be able to either type in the text field above the box or just click on the option directly. What would be the best way to go about that? Is there anything bootstrap related that exists already?

Join the discussion →

Copy data from HTML

I am trying to learn how to parse data from HTML using Excel VBA. So I found one example online which works fine but when I change URL address from www.yahoo.com to local HTML file on C it gives me error i.e. Method 'busy' of object 'IwebBrowser2' failed. Code is: Sub GetBodyText() Dim URL As String Dim Data As String URL = "file:///C:/test.html" Dim ie As Object Dim ieDoc As Object Set ie = CreateObject("InternetExplorer.Application") ie.navigate URL Do Until (ie.readyState = 4 And Not ie.Busy) DoEvents Loop Set ieDoc = ie.Document Data = ieDoc.body.innerText 'Split Data into separate lines '

Join the discussion →

SVN Showing question Mark(?) With each file in eclipse

In eclipse Kepler i have took the project from SVN and when i am doing Right Click on Project->Team->Sychronised With repository it is showing 10000 changes while few hour back i took the whole project from svn, but still it is showing ? with all the files . Can any one tell what is the issue and how can i resolve it? One more thing i have to add in eclipse my project look like projectName[/trunk/workspace/projectname] it mean my project well connected with SVN. Even i Have done Team->Update to Head and Team->Update to Version but no any success.

Join the discussion →

Uncaught TypeError: Cannot read property 'Constructor' of undefined

I am getting this and a couple other weird error messages on my main ASP MVC 3 layout page. I am using the following scripts <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-1.8.3.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/typeahead.js")" type="text/javascript"></script> And trying to get the typeahead.js to work in our nav bar. Below is the code I currently have on my machine. I had this

Join the discussion →

Kendo UI add DropDownList into Grid (MVC)

I'm Binding to a Grid class (UserId,FirstName,LastName,Choice). Does anybody know how to put this code in a column (Choice) in a Kendo Grid in MVC 4: @(Html.Kendo().DropDownList() .Name("Test") .DataTextField("Text") .DataValueField("Value") .Events(e => e.Change("change")) .BindTo(new List<SelectListItem>() { new SelectListItem() { Text = "Option1", Value = "1" }, new SelectListItem() { Text = "Option2", Value = "2" } })) <script> function change() { var value = $("#Choice").val(); } </script> .... columns.Bound(p=> p.FirsName); columns.Bound(p => p.LastName); //How to Bind Choice??? I also n

Join the discussion →

Database Server is not found. Please verify the login, password and server fields

I have 2 gears in OpenShift configured as follows: application gear, scalable, running PHP 5.3 database gear, non scalable, running MySQL Database 5.1 and phpMyAdmin I am running PrestaShop's installation code on my application gear, and it failed on this code: install/models/Database.php: Db::checkConnection($server, $login, $password, $database, true) returns 1. I am new to OpenShift and not sure if I should use port forwarding, etc. I run env | grep OPENSHIFT_MYSQL on my database gear, get: OPENSHIFT_MYSQL_DB_PORT=3306 OPENSHIFT_MYSQL_DB_HOST=127.xx.xx.x OPENSHIFT_MYSQL_DB_PASSWORD=XXXXXXX

Join the discussion →

Exception in thread "main" org.hibernate.exception.ConstraintViolationException: could not execute statement

What the reason of my mistake? I have to entities. Their relation is many to many. prepod: @Entity(name = "prepod") public class Prepod { private Long id; List<Student> students = new ArrayList<Student>(); @ManyToMany public List<Student> getStudents() { return students; } public void setStudents(List<Student> students) { this.students = students; } @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") public Long getId() { return id; } public void setId(Long i) { id = i; } } student: @Entity @Table(name="Student") public class Student { private Long id; private String n

Join the discussion →

Jquery string concatenation

I might be overlooking the obvious but I am trying to do a basic string concatenation and it does not seem to play to well I have the following variables var plug = "myPlug"; var pdiv = "<p></p>"; var tab_id = "#someID"; $(tab_id + "p:contains('" + plug + "')").parent().next().append(pdiv); For some reason tab_id does not get substituted. Any help would be appreciated.

Join the discussion →

CSS selectors How to get the index of a particular element

I am trying to use a css selector to select and item but only work for xpath. What would be the equivalent of this xpath to css. driver.findElement(By.xpath("(//img[@alt='Authorise this row'])[2].click(); If I use the css img[alt='Authorise this row'] I get a lot of results through say firefinder. Is there a way like xpath where you can get a particular index of the result

Join the discussion →

Configuration failures resulting into Test skip in TestNG with no information in XMLs

I am experimenting with TestNG and it is working from eclipse. I created a test suite and trying to run it from command line. Build fails with error saying Final output during build says: [testng] =============================================== [testng] Suite [testng] Total tests run: 1, Failures: 0, Skips: 1 [testng] Configuration Failures: 1, Skips: 2 [testng] =============================================== [testng] [testng] The tests failed. testng-results.xml and index.html don't have any failures reported. testng-failed.xml is like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE su

Join the discussion →

In SSRS, how do I compare a value of a parent report item with report items in a child group?

I am using SSRS 2008. I have 3 different groups above my report details that are calculated sums. I am trying to color the limit red if any of the invoice sums(A) in a child group is above the limit(B). I am currently using this expression, but it is only looking at the first or last invoice amount. The limit report item is in a parent group just above the invoice's group. =IIF(ReportItems!Invoice_DueDate.Value>ReportItems!Limit.Value,"Red","Black") My Solution: I decided to use SQL to get the sum of the invoice amount grouped by due date. I then called that field in the parent group.

Join the discussion →

Character encoding of GET request parameter

Hello fellow Stackoverflowers. I have an issue that i need some help with: We're making an http GET web service call from a smartphone app to a Java/Spring MVC application. We're on a Tomcat application server that is fronted by an Apache server with a mod_proxy proxy setup. One of the parameters imbedded in the URL is the word "Männen", which is the organization name that's one of the parameters. The app makes a Jquery Ajax GET request and the parameter leaves the app as "M%E4nnen", which to my understanding means the "ä" has been properly URL-encoded. When it arrives to the Spring controller

Join the discussion →

$post_id or $post->ID in wordpress meta box construction

Can someone explain why when creating meta boxes the callback needs the post id to be passed via $post->ID, however with the action hook 'save_post', the function can pass $post_id. A general explanation of when to use which one would help clear up some issues I've been having, thanks. ex: function show_custom_meta_box($post) { $meta = get_post_meta($post->ID, 'custom_meta_class', true); // Use nonce for verification echo '<input type="hidden" name="custom_meta_box_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />'; // Begin the field table and loop echo '<table class="form-table">'; e

Join the discussion →

Equivilent to where() on a Associations::CollectionProxy

How would you go about having a where condition in an association? Since it's returning a CollectionProxy which there's barely any information, even in the DOCS, about it. I can't figure out what to do, why wouldn't something like this work? @new_notifications = self.notifications.where({:seen => false}) Figured it out! For some reason, passing a hash into the where statement was the problem. This works: @notifs = self.notifications.where(:seen = false)

Join the discussion →
Older stories