Daily Archives

Articles indexed Tuesday May 25 2010

Page 15/118 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Is there any tool which can rearrange the css based on same type selector?

    - by metal-gear-solid
    I've big css where selector for same things are on different place. Is there any tool which can rearrange the css based on same type selector? This is just example. #main h2 { font-size: 2em; } #sidebar h3 { font-size: 2em; } #main h1 { font-size: 3em; } #sidebar h4 { font-size: 1.6em; } #main #box h2 { font-size: 2em; } #sidebar ul li { font-size: 1em; } it should arranged like this #main h1 { font-size: 3em; } #main h2 { font-size: 2em; } #main #box h2 { font-size: 2em; } #sidebar h3 { font-size: 2em; } #sidebar h4 { font-size: 1.6em; } #sidebar ul li { font-size: 1em; } if parent selector is same then all should be at same place.

    Read the article

  • Discussion - Allowing / blocking user access to pages (Client Side Only!) - Javascript / Jquery

    - by Ozaki
    TLDR Using plain HTML / Javascript (Client Side) I want to prevent viewing of certain pages. The user will have to type a username and password and depending on that they get access to different pages. Answers can NOT include server side whatsoever It does not matter if they can break it easily. There is no sensitive information etc. Also the target audience will not have access to internet OR probably know what a cookie is... At some point the user will have to type username / password.(I can define the cookie here) Currently I thought of using cookies to set a cookie for each page to say "true" / "false" but that would get messy with so many cookies. Or setting an array within a cookie for each page? I have div field "#Content" which as it looks encompasses all of my content on the page so blocking out content will be as simple as replacing it with ("sorry you don't have access") etc. For Example: $.cookie("Access","page1, page2, page3"{ expires: 1 }); I am looking for anyway to do this does not have to be with cookies. Would be nice to get a discussion of different ways this can be done. So the question is: What do YOU think would be a good way to go about doing this with client side validation?

    Read the article

  • multiple paramters type

    - by romerun
    I'm trying to write something like this: type 'a 'b xxx = {aaa: 'a: bbb: 'b: ccc: int};; It does not compile. Is it just syntax error, or they don't allow multiple paramters on type ? Then why ?

    Read the article

  • Why did this work? ( php dot notation )

    - by Daniel
    Hi, I was writing some php code after a long sint doing ruby and I accidently wrote this: [root@ip-10-160-47-98 test]# cat run.php <?php class MyTest { public function run() { var_dump(this.test); } } $object = new MyTest(); $object->run(); [root@ip-10-160-47-98 test]# php run.php string(8) "thistest" [root@ip-10-160-47-98 test]# Now, this.test should have been $this-test, but the compiler was actually happy to let this run. Does anyone know how (this.test) got converted into a string "thistest"? Compiled and run on php 5.3.2 amazon instance ami-e32273a6 (CentOS 5.4) -daniel

    Read the article

  • Sending url params and POST body to a MVC 2 Controller

    - by Luiggi
    Hi, I'm having some issues trying to make a HTTP PUT (or POST) using WebClient against a MVC 2 controller. The exception is: The parameters dictionary contains a null entry for parameter 'total' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Company(System.Guid, Int32, Int32, System.String)' The controller action is: [HttpPut] public ActionResult Company(Guid uid, int id, int total, string url) The route is: routes.MapRoute( "CompanySet", "job/active/{uid}/company/{id}", new { controller = "Job", action = "Company" } ); As you may see, what I want is to send the 'uid' and 'id' parameters via url, but the 'total' and 'url' parameters as part of the PUT or POST body. I've also tried to merge the latter parameters into a class (i.e., CompanySetMessage), doing it no longer raises an exception but I dont receive the values on the server side. Any ideas? Thank you!

    Read the article

  • Creating OpenSocial container for ASP.NET Site

    - by Admin
    hello, i run a social networking site written in asp.net and would like to open it to developers using the OpenSocial APIs. I have read information on opensocial.org as well as google's opensocial page and have a basic idea what it takes but still there is a lot of info missing to even get started. I know i gotta provide RESTful API as well as JavaScript API, authenticating using OAuth methods. Does my container has to provide all 3: JSON, XML, and AtomPub representations of data? I found Shindig but it runs under Apache, i need something for IIS. Are there any libraries that i could use as a base for my APIs to save time? Is it even recommended to write the entire container from scratch? thanks

    Read the article

  • C++ STL: How to iterate vector while requiring access to element and its index?

    - by Ashwin
    I frequently find myself requiring to iterate over STL vectors. While I am doing this I require access to both the vector element and its index. I used to do this as: typedef std::vector<Foo> FooVec; typedef FooVec::iterator FooVecIter; FooVec fooVec; int index = 0; for (FooVecIter i = fooVec.begin(); i != fooVec.end(); ++i, ++index) { Foo& foo = *i; if (foo.somethingIsTrue()) // True for most elements std::cout << index << ": " << foo << std::endl; } After discovering BOOST_FOREACH, I shortened this to: typedef std::vector<Foo> FooVec; FooVec fooVec; int index = -1; BOOST_FOREACH( Foo& foo, fooVec ) { ++index; if (foo.somethingIsTrue()) // True for most elements std::cout << index << ": " << foo << std::endl; } Is there a better or more elegant way to iterate over STL vectors when both reference to the vector element and its index is required? I am aware of the alternative: for (int i = 0; i < fooVec.size(); ++i) But I keep reading about how it is not a good practice to iterate over STL containers like this.

    Read the article

  • PRoblems with encondig in ASP.MVC

    - by George
    Hello experts! I'm having a weird issue here. I have a bunch of Views, in which i have characters like this: é, á, ó, etc. In one of my views I can fetch data from the database with accents just fine, but in another one I simply get the "weird" characters :P WHat can i be doing wrong? Do i need to configure something in order to this work? Thanks!

    Read the article

  • What are "Missing thread recordng" erros when running fsck -fy ?

    - by user32616
    There is some error reported when I run Disk Utility and verify the root volume on my OS X MacBook. So I boot and CMD-S into the shell mode and run /sbin/fsck -fy. Errors are like: ** Checking catalog file. Missing thread record (id = ...) In correct number of thread records ** Checking catalog hierarchy. Invalid volume file count (It should be ... instead of ...) ** Repairing Volume Missing directory record (id = ...) I'd like to know what is the cause of the above errors? Hopefully I will be more careful in the future to prevent them from happening again. p.s. I am using a SSD and so I assume mechanical hard disk error is less likely. Thanks!

    Read the article

  • Creating a C++ DLL and then using it in C#

    - by Major
    Ok I'm trying to make a C++ DLL that I can then call and reference in a c# App. I've already made a simple dll using the numberous guides out there, however when I try to reference it in the C# app I get the error Unable to load DLL 'SDES.dll': The specified module could not be found. The code for the program is as follows (bear with me I'm going to include all the files) //These are the DLL Files. ifndef TestDLL_H define TestDLL_H extern "C" { // Returns a + b __declspec(dllexport) double Add(double a, double b); // Returns a - b __declspec(dllexport) double Subtract(double a, double b); // Returns a * b __declspec(dllexport) double Multiply(double a, double b); // Returns a / b // Throws DivideByZeroException if b is 0 __declspec(dllexport) double Divide(double a, double b); } endif //.cpp include "test.h" include using namespace std; extern double __cdecl Add(double a, double b) { return a + b; } extern double __cdecl Subtract(double a, double b) { return a - b; } extern double __cdecl Multiply(double a, double b) { return a * b; } extern double __cdecl Divide(double a, double b) { if (b == 0) { throw new invalid_argument("b cannot be zero!"); } return a / b; } //C# Program using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace ConsoleApplication1 { class Program { [DllImport("SDES.dll")] public static extern void SimulateGameDLL(int a, int b); static void Main(string[] args) { SimulateGameDLL(1, 2); //Error here... } } } Anyone have any idea's what I may be missing in my program? Let me know if I missed some code or if you have any questions.

    Read the article

  • Help need to convert this code to C#

    - by Raj Aththanayake
    I 'm not familiar with VB.NET at all. I need to convert this function to C#. Can anyone please give me a hand? Public Function GetAppGUID(ByVal sectionId As String) As String Dim hexString As String = Nothing Dim i As Integer Dim guidlen As Integer guidlen = 16 If sectionId.Length < guidlen Then sectionId = sectionId & New String(" ".Chars(0), guidlen - sectionId.Length) End If For i = 1 To guidlen hexString = hexString & Hex(Asc(Mid(sectionId, i, 1))) Next GetAppGUID = hexString End Function

    Read the article

  • Grails beginner problem "Failed to invoke Servlet 2.5"

    - by A Lion
    I'm trying to get Groovy on Grails set up on a Snow Leopard machine. I followed all the grails.com install directions and am trying to start the application from Grails: A Quick-Start Guide by Dave Klein. I ran grails create-app TekDays with no apparent problems and was able to cd to the TekDays folder, but when I try to run grails run-app I get the following: Welcome to Grails 1.3.1 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: /grails Base Directory: /apps/TekDays Resolving dependencies... Dependencies resolved in 4469ms. Running script /grails/scripts/RunApp.groovy Environment set to development [delete] Deleting directory /Users/name/.grails/1.3.1/projects/TekDays/tomcat Running Grails application.. 2010-05-24 21:42:39,559 [main] ERROR context.GrailsContextLoader - Error executing bootstraps: Failed to invoke Servlet 2.5 getContextPath method java.lang.IllegalStateException: Failed to invoke Servlet 2.5 getContextPath method at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:164) at grails.web.container.EmbeddableServer$start.call(Unknown Source) at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:159) at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy) at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:282) at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy) at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:150) at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy) at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116) at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy) at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59) at RunApp$_run_closure1.doCall(RunApp.groovy:33) at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:427) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:415) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.executeTargets(Gant.groovy:590) at gant.Gant.executeTargets(Gant.groovy:589) Caused by: java.lang.NoSuchMethodException: javax.servlet.ServletContext.getContextPath() at java.lang.Class.getMethod(Class.java:1605) ... 23 more I've googled every derivative of "Failed to invoke Servlet 2.5" that I can think of, but have thus far been unable to find anything that helps me understand, yet alone resolve, the error. Any advice to help me resolve this would be very much appreciated!

    Read the article

  • class on td is causing tr not to respond

    - by Catfish
    I have this script and the rows that have td class "odd" will not toggle the blue color that the rows without the class "odd" do. anybody know why? //Used to make a row turn blue if available $('tr:not(theadtr)').toggle(function() { $(this).addClass("hltclick"); }, function() { $(this).removeClass("hltclick"); }); and this table <table> <thead> <tr class="border"> <td>Start Time</td> <td>End Time</td> </tr> </thead> <tbody> <tr class="border"> <td class="odd"><a href="#">7:00am</a></td> <td class="odd"><a href="#">8:00am</a></td> </tr> <tr class="border"> <td><a href="#">8:00am</a></td> <td><a href="#">9:00am</a></td> </tr> <tr class="border"> <td class="odd"><a href="#">9:00am</a></td> <td class="odd"><a href="#">10:00am</a></td> </tr> <tr class="border"> <td><a href="#">10:00am</a></td> <td><a href="#">11:00am</a></td> </tr> <tr class="border"> <td class="odd"><a href="#">11:00am</a></td> <td class="odd"><a href="#">12:00pm</a></td> </tr> <tr class="border"> <td><a href="#">1:00pm</a></td> <td><a href="#">2:00pm</a></td> </tr> <tr class="border"> <td class="odd"><a href="#">2:00pm</a></td> <td class="odd"><a href="#">3:00pm</a></td> </tr> <tr class="border"> <td><a href="#">3:00pm</a></td> <td><a href="#">4:00pm</a></td> </tr> <tr class="border"> <td class="odd"><a href="#">4:00pm</a></td> <td class="odd"><a href="#">5:00pm</a></td> </tr> </tbody> </table> and this css #calendar { -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px; padding:15px; clear:both; padding:15px; } body { color:#222222; font-family:sans-serif; font-size:12px; } table { border:1px solid white; border-collapse:collapse; margin:0 0 30px; width:100%; } .border { border:1px solid #333134; } thead tr { background:none repeat scroll 0 0 #B7EBFF; color:#333134; font-size:24px; font-weight:bold; } tr { background:none repeat scroll 0 0 #616062; font-size:16px; } thead td { font-family:"Century Gothic",Arial; padding:5px 0 20px 5px; } tr.border thead tr { color:#333134; font-size:24px; font-weight:bold; } tr { font-size:16px; }

    Read the article

  • selecting row among duplicated ones in VBA

    - by Elaine Kuo
    ArcGIS 9.3 Arcobject I wanna select one row of each duplicated SIDs in a field below. (an attribute table of a shape file) The priority is R S = I 0 Therefore, among SID 87, FID1 will be selected. (SID 88, STATUS will be S+I) (SID 89, FID 6 will be chosen) Please kindly advise VBA cord to run the selection and thanks. FID SID STATUS 1 87 R 2 87 O 3 88 I 4 88 S 5 89 I 6 89 R 7 89 I 8 89 S

    Read the article

  • Python - Checking for membership inside nested dict

    - by victorhooi
    heya, This is a followup questions to this one: http://stackoverflow.com/questions/2901422/python-dictreader-skipping-rows-with-missing-columns Turns out I was being silly, and using the wrong ID field. I'm using Python 3.x here. I have a dict of employees, indexed by a string, "directory_id". Each value is a nested dict with employee attributes (phone number, surname etc.). One of these values is a secondary ID, say "internal_id", and another is their manager, call it "manager_internal_id". The "internal_id" field is non-mandatory, and not every employee has one. (I've simplified the fields a little, both to make it easier to read, and also for privacy/compliance reasons). The issue here is that we index (key) each employee by their directory_id, but when we lookup their manager, we need to find managers by their "internal_id". Before, when employee.keys() was a list of internal_ids, I was using a membership check on this. Now, the last part of my if statement won't work, since the internal_ids is part of the dict values, instead of the key itself. def lookup_supervisor(manager_internal_id, employees): if manager_internal_idis not None and manager_internal_id!= "" and manager_internal_id in employees.keys(): return (employees[manager_internal_id]['mail'], employees[manager_internal_id]['givenName'], employees[manager_internal_id]['sn']) else: return ('Supervisor Not Found', 'Supervisor Not Found', 'Supervisor Not Found') So the first question is, how do I check whether the manager_internal_id is present in the dict's values. I've tried substituting employee.keys() with employee.values(), that didn't work. Also, I'm hoping for something a little more efficient, not sure if there's a way to get a subset of the values, specifically, all the entries for employees[directory_id]['internal_id']. Hopefully there's some Pythonic way of doing this, without using a massive heap of nested for/if loops. My second question is, how do I then cleanly return the required employee attributes (mail, givenname, surname etc.). My for loop is iterating over each employee, and calling lookup_supervisor. I'm feeling a bit stupid/stumped here. def tidy_data(employees): for directory_id, data in employees.items(): # We really shouldnt' be passing employees back and forth like this - hmm, classes? data['SupervisorEmail'], data['SupervisorFirstName'], data['SupervisorSurname'] = lookup_supervisor(data['manager_internal_id'], employees) Thanks in advance =), Victor

    Read the article

  • Prototype 'on show' Event.observe handler

    - by ryan
    I am trying to make an AJAX request that updates a div's content when that div is shown. My initial thought was to use an Event observer that watched for a div to be shown, but I cannot seem to find an appropriate handler. Is there an easy way to make an AJAX request for an element 'on show?'

    Read the article

  • Interface naming in Java

    - by Allain Lalonde
    Most OO languages prefix their interface names with a capital I, why does Java not do this? What was the rationale for not following this convention? To demonstrate what I mean, if I wanted to have a User interface and a User implementation I'd have two choices in Java: Class = User, Interface = UserInterface Class = UserImpl, Interface = User Where in most languages: Class = User, Interface = IUser Now, you might argue that you could always pick a most descriptive name for the user implementation and the problem goes away, but Java's pushing a POJO approach to things and most IOC containers use DynamicProxies extensively. These two things together mean that you'll have lots of interfaces with a single POJO implementation. So, I guess my question boils down to: "Is it worth following the broader Interface naming convention especially in light of where Java Frameworks seem to be heading?"

    Read the article

  • MSSQL 2008 FTS CONTAINSTABLE Not Returning More Than Five Rows

    - by Elijah Glover
    I have a single table called "Indexes", it contains one nvarchar and three ntext columns (all Full Text Indexes). Index is up to date. CONTAINSTABLE(Indexes, *), 'test', 5) //5 results No matter what I change the above keyword too, it only returns the first 3-5 results. It should roughly return 90-120 results, for the above query. SELECT count(*) FROM Indexes WHERE [Description] like '%test%' //122 results How would I start to troubleshoot this problem?

    Read the article

  • Updated to Android 2.2 and now my apps input-lines don't show well, do I need to update my SDK?

    - by Allan
    My Android app has a couple input-lines made to receive numbers, it's a calc app. I just updated my Nexus One to Android 2.2 and now my apps input-lines don't respond like the way they should. When I touch the input-line, the Android keyboard used to pop-up just enough to kind of 'lift' the input-line above the keyboard - into the users view. Then when I scrolled down to the next input-line, that input-line used to 'lift-up' into view also. Now, after I updated my N1 to Android 2.2 - the input-lines are not lifting into view all the way. Also, when I scroll down to the next input-line and type in numbers - they don't appear, but when I scroll left...there they are. It's hard to describe my problem but things have definitely changed in the way my apps input-lines respond since the 2.2 update I did. If I try to update my SDk stuff in Eclipse and then recompile my app, might that fix it? Whenever there's an Android update - developers don't always have to recompile all of their apps do they?

    Read the article

  • Delphi 7: how to execute shell command and check the result?

    - by mawg
    I'm using Delphi 7 and can't predict the target version of Windows. I need to create a database (probably MySql, but might be something else) and define some table structures. I do not need to populate any data. Unfortunately, all of the ADO components seem to expect that a database already exists and they will then allow you to manipulate it. So, since it's only a few simple commands, I thought that I might as well use ShellExectute(). Agree? Disagree? Can anyone give me a sample code which will attempt to run "MySql --version" and let me check the result? After that I should be able to figure it out for myself. Thanks.

    Read the article

  • Getting a list of all phone contacts?

    - by pcm2a
    Simple enough question. I need to know the best way to get the same list of contacts that show up when a user presses the Contacts button. You would think something like this would work: //For Contacts Intent pickIntent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); this.startActivityForResult(pickIntent, RESULT); //For Phones Intent pickIntent = new Intent(Intent.ACTION_PICK, Phones.CONTENT_URI); this.startActivityForResult(pickIntent, RESULT); The problem is that does not include secondary google accounts or Exchange contacts. By secondary accounts, in Android you can add additional gmail accounts to have the mail/contacts synced. The above intent will not list those additional contacts. I am also told that on the HTC Desire you can add contacts to the phone that do not get synced up to Google. These contacts also do not show up. So how do I get a real list of contacts so I can create my own list activity that works properly where the Google intent does not.

    Read the article

  • Back From Microsoft Web Camps Beijing

    - by Dixin
    I am just back from Microsoft Web Camps, where Web developers in Beijing had a good time for 2 days with 2 fantastic speakers, Scott Hanselman and James Senior. On day 1, Scott and James talked about Web Platform Installer, ASP.NET core runtime, ASP.NET MVC, Entity Framework, Visual Studio 2010, … They were humorous and smart, and everyone was excited! On day 2, developers were organized into teams to build Web applications. At the end of day 2, each team had a chance of presentation. Before ending, I also demonstrated my so-called “WebOS”, a tiny but funny Web website developed with ASP.NET MVC and jQuery, which looks like an operating system, to show the power of ASP.NET MVC and jQuery. Scott, James and me were joking there, and people cannot help laughing and applauding… You can play with it here: http://www.coolwebos.com/, if interested. I talked with Scott and James about Web and ASP.NET, and asked some questions. I also helped on some English / Chinese translation. At the end Scott gave me a fabulous gift, which I will post to blog later. Hope Microsoft can have more and more events like this!

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >