Daily Archives

Articles indexed Friday June 11 2010

Page 27/114 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • How to list my blog to google search

    - by messy123
    Hi, i had created a blog in blogspot.com, after few days later i updated. but my blog is not appearing in google search. even if i give the full link of blog its not coming.. i have some other blogs, it works well.. i dont no whats wrong with new one.. can any one know what to do

    Read the article

  • Convert between python array and .NET Array

    - by dungema
    I have a python method that returns a Python byte array.array('c'). Now, I want to copy this array using System.Runtime.InteropServices.Marshal.Copy. This method however expects a .NET array. import array from System.Runtime.InteropServices import Marshal bytes = array.array('c') bytes.append('a') bytes.append('b') bytes.append('c') Marshal.Copy(bytes, dest, 0, 3) Is there a way to make this work without copying the data? If not, how do I convert the data in the Python array to the .NET array?

    Read the article

  • Iterator for boost::variant

    - by Ivan
    Hy there, I'm trying to adapt an existing code to boost::variant. The idea is to use boost::variant for a heterogeneous vector. The problem is that the rest of the code use iterators to access the elements of the vector. Is there a way to use the boost::variant with iterators? I've tried typedef boost::variant<Foo, Bar> Variant; std::vector<Variant> bag; std::vector<Variant>::iterator it; for(it= bag.begin(); it != bag.end(); ++it){ cout<<(*it)<<endl; } But it didn't work.

    Read the article

  • Custom DateTime model binder in Asp.net MVC

    - by Robert Koritnik
    I would like to write my own model binder for DateTime type. First of all I'd like to write a new attribute that I can attach to my model property like: [DateTimeFormat("d.M.yyyy")] public DateTime Birth { get; set,} This is the easy part. But the binder part is a bit more difficult. I would like to add a new model binder for type DateTime. I can either implement IModelBinder interface and write my own BindModel() method inherit from DefaultModelBinder and override BindModel() method My model has a property as seen above (Birth). So when the model tries to bind request data to this property, my model binder's BindModel(controllerContext, bindingContext) gets invoked. Everything ok, but. How do I get property attributes from controller/bindingContext, to parse my date correctly? How can I get to the PropertyDesciptor of property Birth? Edit Because of separation of concerns my model class is defined in an assembly that doesn't (and shouldn't) reference System.Web.MVC assembly. Setting custom binding (similar to Scott Hanselman's example) attributes is a no-go here.

    Read the article

  • Join map and refer to its key/value in HQL

    - by alamar
    Suppose I have a map: <map name="externalIds" table="album_external_ids"> <key column="album_id" not-null="true"/> <map-key-many-to-many class="Major" column="major_id"/> <element column="external_id" type="string" not-null="true"/> </map> How do I make a HQL meaning "select entities where map key's id == :foo and map value == :bar"? I can join it using select album from Album album join album.externalIds ids But how would I then refer to ids' key and value? ids.key.id = :foo and ids.value = :bar doesn't work, and hibernate doc is silent on this topic. Naive approaches that didn't work: select album from Album album join album.externalIds externalId where index(externalId).id = :foo and externalId = :bar and select album from Album album join album.externalIds externalId join index(externalId) major where major.id = :foo and externalId = :bar

    Read the article

  • Best practices concerning view model and model updates with a subset of the fields

    - by Martin
    By picking MVC for developing our new site, I find myself in the midst of "best practices" being developed around me in apparent real time. Two weeks ago, NerdDinner was my guide but with the development of MVC 2, even it seems outdated. It's an thrilling experience and I feel privileged to be in close contact with intelligent programmers daily. Right now I've stumbled upon an issue I can't seem to get a straight answer on - from all the blogs anyway - and I'd like to get some insight from the community. It's about Editing (read: Edit action). The bulk of material out there, tutorials and blogs, deal with creating and view the model. So while this question may not spell out a question, I hope to get some discussion going, contributing to my decision about the path of development I'm to take. My model represents a user with several fields like name, address and email. All the names, in fact, on field each for first name, last name and middle name. The Details view displays all these fields but you can change only one set of fields at a time, for instance, your names. The user expands a form while the other fields are still visible above and below. So the form that is posted back contains a subset of the fields representing the model. While this is appealing to us and our layout concerns, for various reasons, it is to be shunned by serious MVC-developers. I've been reading about some patterns and best practices and it seems that this is not in key with the paradigm of viewmodel == view. Or have I got it wrong? Anyway, NerdDinner dictates using FormCollection och UpdateModel. All the null fields are happily ignored. Since then, the MVC-community has abandoned this approach to such a degree that a bug in MVC 2 was not discovered. UpdateModel does not work without a complete model in your formcollection. The view model pattern receiving most praise seems to be Dedicated view model that contains a custom view model entity and is the only one that my design issue could be made compatible with. It entails a tedious amount of mapping, albeit lightened by the use of AutoMapper and the ideas of Jimmy Bogard, that may or may not be worthwhile. He also proposes a 1:1 relationship between view and view model. In keeping with these design paradigms, I am to create a view and associated view for each of my expanding sets of fields. The view models would each be nearly identical, differing only in the fields which are read-only, the views also containing much repeated markup. This seems absurd to me. In future I may want to be able to display two, more or all sets of fields open simultaneously. I will most attentively read the discussion I hope to spark. Many thanks in advance.

    Read the article

  • Loop over array and set all vars to false or true in javascript

    - by Sixfoot Studio
    Hi All, I need to loop over my array and set all the vars to false or true. I have tried numerous options, none of which are working and it's clearly my lack of javascript syntax knowledge..Please take a look at this: var closeAllCells = [IncomeOpen = "false", RehabOpen = "false", AttendantCareOpen = "false", HomeMaintenanceOpen = "false", DependantCareOpen = "false", IndexationOpen = "false", DeathFuneralOpen = "false", ComprehensiveOpen = "false", CollisionOpen = "false", LiabilityOpen = "false", DCPDOpen = "false"]; So my thinking is that I can just loop over this as follows for (var i=0;i<closeAllCells.length;i++) { closeAllCells[i] = true; // or false if I wished }

    Read the article

  • scala REPL is slow on vista

    - by Jacques René Mesrine
    I installed scala-2.8.0.RC3 by extracting the tgz file into my cygwin (vista) home directory. I made sure to set $PATH to scala-2.8.0.RC3/bin. I start the REPL by typing: $ scala Welcome to Scala version 2.8.0.RC3 (Java HotSpot(TM) Client VM, Java 1.6.0_20). Type in expressions to have them evaluated. Type :help for more information. scala> Now when I tried to enter an expression scala> 1 + 'a' the cursor hangs there without any response. Granted that I have chrome open with a million tabs and VLC playing in the background, but CPU utilization was 12% and virtual memory was about 75% utilized. What's going on ? Do I have to set the CLASSPATH or perform other steps.

    Read the article

  • Disabling Copy/Paste in a Web Page

    - by 1s2a3n4j5e6e7v
    How Do I disable the copy paste feature in my webpage. To be precise, I don't want my users to copy any information from my website and use them for personal purposes. The previous question on the same topic doesn't give enough explanation. The onselect and ondrag aren't working. Please help.

    Read the article

  • writing javascripts function using jquery

    - by tazim
    Some template written using jquery is as follows . it is not working . Any suggestions to use jquery efficiently . <html> <head> <script type="text/javascript" src="/jquerycall/"></script> <script type="text/javascript"> $(document).ready(function() { self.setInterval("clock()",1000); $("button").click(function() { clock; }); function clock() { clock(); time=new Date(); var s = "<p>" + time + "</p>"; $(s).appendTo("div"); } }); </script> </head> <body> <form method="post"> <button type="button">Click Me</button> <div id="someid"></div> </form> </body> </html>

    Read the article

  • Import fixed width file to oracle

    - by Alex Blokha
    Is there an ability to import fixed width file to oracle? Preferably through .net(c#) for catching errors during import and showing them to user. P.S. File has 5 types of rows. For example 1 row has 5 columns, 2-nd has 50 columns.

    Read the article

  • Entity Framework 4 overwrite Equals and GetHashCode of an own class property

    - by Zhok
    Hi, I’m using Visual Studio 2010 with .NET 4 and Entity Framework 4. I’m working with POCO Classes and not the EF4 Generator. I need to overwrite the Equals() and GetHashCode() Method but that doesn’t really work. Thought it’s something everybody does but I don’t find anything about the problem Online. When I write my own Classes and Equals Method, I use Equals() of property’s, witch need to be loaded by EF to be filled. Like this: public class Item { public virtual int Id { get; set; } public virtual String Name { get; set; } public virtual List<UserItem> UserItems { get; set; } public virtual ItemType ItemType { get; set; } public override bool Equals(object obj) { Item item = obj as Item; if (obj == null) { return false; } return item.Name.Equals(this.Name) && item.ItemType.Equals(this.ItemType); } public override int GetHashCode() { return this.Name.GetHashCode() ^ this.ItemType.GetHashCode(); } } That Code doesn’t work, the problems are in Equals and GetHashCode where I try to get HashCode or Equal from “ItemType” . Every time I get a NullRefernceException if I try to get data by Linq2Entites. A dirty way to fix it, is to capture the NullReferenceException and return false (by Equals) and return base.GetHashCode() (by GethashCode) but I hope there is a better way to fix this problem. I’ve wrote a little test project, with SQL Script for the DB and POCO Domain, EDMX File and Console Test Main Method. You can download it here: Download

    Read the article

  • DRY'er Object Initialization in Ruby

    - by Trevoro
    Hi, Is there a more 'DRY' way to do the following in ruby? #!/usr/bin/env ruby class Volume attr_accessor :name, :size, :type, :owner, :date_created, :date_modified, :iscsi_target, :iscsi_portal SYSTEM = 0 DATA = 1 def initialize(args={:type => SYSTEM}) @name = args[:name] @size = args[:size] @type = args[:type] @owner = args[:owner] @iscsi_target = args[:iscsi_target] @iscsi_portal = args[:iscsi_portal] end def inspect return {:name => @name, :size => @size, :type => @type, :owner => @owner, :date_created => @date_created, :date_modified => @date_modified, :iscsi_target => @iscsi_target, :iscsi_portal => @iscsi_portal } end def to_json self.inspect.to_json end end

    Read the article

  • char array to LPCTSTR

    - by Yan Cheng CHEOK
    May I know how I can perform the following conversion? // el.strCap is char[50] // InsertItem is expecting TCHAR pointer (LPCTSTR) // How I can perform conversion? // I do not have access in both "list" and "el" source code // Hence, there is no way for me to modify their signature. list.InsertItem(i, el.strCap); And No. I do not want to use WideCharToMultiByte They are too cumbersome to be used.

    Read the article

  • values from different fields in matalb

    - by ariel
    Hi does anybody familiar with a way that I could implement a matrix with values from a field (not the real or complex number, but lets say Z mod p). so I could perform all the operation of matlab on the matrix (with the values of the chosen field) Ariel

    Read the article

  • Opening URL in New Tab doesn't work in existing, programmatically-opened New Window (Firefox)

    - by seth
    I am building a web app, for myself, to control some servers on my home network, and discovered what I think is very odd behavior in Firefox. If you open a pop-up, via javascript, in Firefox, is it then impossible to open a new tab, via javascript in that pop-up? If not impossible, how do you do it? Given a clean, default Firefox 3.6.3 installation... If I open a page in Firefox and then call var my_window = window.open('http://www.google.com','_blank','top=10'); A brand new "pop-up" window opens. However, if instead I call var my_window = window.open('http://www.google.com'); A get a new tab. HOWEVER... If I call the first version var my_window = window.open('http://www.google.com','_blank','top=10'); And then in the new "pop-up" that opens, I call var my_window = window.open('http://www.google.com'); It opens a new tab in the original window, not a new tab in the pop-up. This seems very odd, and not intuitive at all. Why would the call in the pop-up open a tab in the "parent" window?

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >