I need to copy the item that user just added (for example. myresume.doc or financial.xls) with the metadata (doc lib obtains the columns from content type, ct obtains the columns from site colum) and copy the item with metadata in a folder called "NativeFile". Every doc library has this folder.
I know itemadded can be used but then I heard itemadded fires before user have a chance to complete the metadata for the item they just added.
What are my options? (new to sp, so some sample code would greatly help. or some good link similar to this issue)
Sharepoint 2007, itemadded or itemadding or itemupdating or itemupdated....
Hi,
I'm doing a simple widget for WordPress that fetches the most recent tweets from the RSS feed provided by Twitter.
This widget parses any link posted on a tweet, it also parses mentions (ie: @username) and trending topics (ie: #nowplaying). For these 3 situations, it creates links pointing to some Twitter feature.
For instance:
"Hi @UserA, check out the song Foo from FooBar that I'm listening,
it's awesome. #nowplaying"
And it will parse into this:
Hi <a href="http://twitter.com/UserA">@UserA</a>, check out the song
Foo from FooBar that I'm listening, it's awesome.
<a href="http://twitter.com/#search?q=nowplaying">#nowplaying</a>
Now now I need to add a global link to the whole message, like this:
<a href="http://twitter.com/UserA/statuses/1234567890">
Hi <a href="http://twitter.com/UserA">@UserA</a>, check out the song
Foo from FooBar that I'm listening, it's awesome.
<a href="http://twitter.com/#search?q=nowplaying">#nowplaying</a>
</a>
But this code does not validate and it doesn't work anyways (the browsers don't really seem to know what to do with it).
Any suggestions how could I fix this?
I just want to know how other people set up their MX-entries for mail accounts used with google apps.
I work at a local web-hosting firm and we get a lot of tickets from clients who want to set up these settings.
I just set them up something like:
example.com. 14400 IN MX 10 ALT1.ASPMX.L.GOOGLE.COM.
example.com. 14400 IN MX 10 ASPMX4.GOOGLEMAIL.COM.
example.com. 14400 IN MX 15 ASPMX5.GOOGLEMAIL.COM.
example.com. 14400 IN MX 15 ASPMX2.GOOGLEMAIL.COM.
example.com. 14400 IN MX 30 ASPMX3.GOOGLEMAIL.COM.
I see another firm (rival one) who sets up way more MX-records ? Roughly, around 10-15 entries.
Am I doing something wrong ? More is better in this case ? Is there a secret that I'm not on too ?
assume that i have a BlogPost model with zero-to-many embedded Comment documents. can i query for and have MongoDB return only Comment objects matching my query spec?
eg, db.blog_posts.find({"comment.submitter": "some_name"}) returns only a list of comments.
edit: an example:
import pymongo
connection = pymongo.Connection()
db = connection['dvds']
db['dvds'].insert({'title': "The Hitchhikers Guide to the Galaxy",
'episodes': [{'title': "Episode 1", 'desc': "..."},
{'title': "Episode 2", 'desc': "..."},
{'title': "Episode 3", 'desc': "..."},
{'title': "Episode 4", 'desc': "..."},
{'title': "Episode 5", 'desc': "..."},
{'title': "Episode 6", 'desc': "..."}]})
episode = db['dvds'].find_one({'episodes.title': "Episode 1"},
fields=['episodes'])
in this example, episode is:
{u'_id': ObjectId('...'),
u'episodes': [{u'desc': u'...', u'title': u'Episode 1'},
{u'desc': u'...', u'title': u'Episode 2'},
{u'desc': u'...', u'title': u'Episode 3'},
{u'desc': u'...', u'title': u'Episode 4'},
{u'desc': u'...', u'title': u'Episode 5'},
{u'desc': u'...', u'title': u'Episode 6'}]}
but i just want:
{u'desc': u'...', u'title': u'Episode 1'}
I have a need to search a pdf file to see if a certin string is present. The string in question is definately encoded as text (ie. it is not an image or anything). I have tried just searching the file as though it was plain text, but this does not work.
Is it possible to do this? Are there any librarys out there for .net2.0 that will extract/decode all the text out of pdf file for me?
I want to Upload large file on Sharepoint.So i am uploading it in chunks.
But i am unable to give meta information at the time of Uploading file.
Is there any solution?
Hello everyone
I have this code below:
NSString *fileName = [[NSUserDefaults standardUserDefaults] objectForKey:@"recentDownload"];
NSString *fullPath = [NSBundle pathForResource:fileName ofType:@"txt" inDirectory:[NSHomeDirectory() stringByAppendingString:@"/Documents/"]];
NSError *error = nil;
[textViewerDownload setText:[NSString stringWithContentsOfFile:fullPath encoding: NSUTF8StringEncoding error:&error]];
textviewerdownload is the textview displaying the text from the file. The actual file name is stored in an NSUserDefault called recentDownload.
When I build this, I click the button which this is under, and my application crashes.
Is there anything wrong with the syntax or just simple error?
I was wondering if there is a way to easily see the tags of a specific file in Subversion using the command line and/or TortoiseSVN.
Most version control system allow you to see easily access the tags/labels of a file. When using TortoiseSVN I can do this when I access the "Revision Graph". This however is a operation that takes around 44 minutes. I consider this very hard work just to know what tags have been created for the file. Is there another way to do it? Or is there no way to instantaneously access tag information.
Thanks,
Onno
Hi,
I have a small issue with jQuery on Safari (Mac OSX 10.6) - the page loads fine under Firefox (Mac) and Internet Explorer (Win) but has to be refreshed to work properly in Safari...
http://7souls.co.uk/store/index.php?dispatch=products.view&product_id=29788
If you hover over the image it is meant to show a magnified version to the right hand side - which works on the first page load on all browsers except Safari on the Mac.
You have to refresh the page to get it to work under safari.
Any Ideas,
MM
Is there a way to use getElementsByName without starting from the DOM root.
For example I have a div element, and want to start searching from that element.
If not, then do I have to write my own function that recursively iterates through the child nodes, or is there a different way to do it.
Hello.
I have a folder with lots of doc-documents and I need to upload their context into database. The problem is that some of them are password protected and I don't know the password. I would like to skip them but I don't know how to detect if password protection presents.
If someone helps I'll appriciate it greatly.
P.S. Programming language is C#.
Hi,
I am creating a DataGridView Column. and it is working well. now I want to customise this column with AutoCompleteMode, and AutoCompleteSource properties to show the customised data. I made the properties for this columns, and these are also working well. but these properties are not working in the "ApplyCellStyleToEditingControl" subroutine.
Please help me to use these column properties in the "ApplyCellStyleToEditingControl" subroutine.
Public Class DataGridViewDataValueColumn
Inherits DataGridViewColumn
Dim m_AutoCompleteMode As AutoCompleteMode, _
m_AutoCompleteSource As AutoCompleteSource, _
m_AutoCompleteStringCollection As AutoCompleteStringCollection
Public Sub New()
MyBase.New(New DataValueCell())
End Sub
Public Overrides Property CellTemplate() As DataGridViewCell
Get
Return MyBase.CellTemplate
End Get
Set(ByVal value As DataGridViewCell)
' Ensure that the cell used for the template is a DataValueCell.
If (value IsNot Nothing) AndAlso _
Not value.GetType().IsAssignableFrom(GetType(DataValueCell)) _
Then
Throw New InvalidCastException("Must be a DataValueCell")
End If
MyBase.CellTemplate = value
End Set
End Property
Region "User Defined Properties"
'&*--------------------------------------*&'
<Description("Indicates the text completion behaviour of the combo box."), DefaultValue(AutoCompleteMode.None)> _
Public Property AutoCompleteMode() As AutoCompleteMode
Get
Return m_AutoCompleteMode
End Get
Set(ByVal value As AutoCompleteMode)
m_AutoCompleteMode = value
End Set
End Property
<Description("The source of complete strings used to automatic completion."), DefaultValue(AutoCompleteSource.None)> _
Public Property AutoCompleteSource() As AutoCompleteSource
Get
Return m_AutoCompleteSource
End Get
Set(ByVal value As AutoCompleteSource)
m_AutoCompleteSource = value
End Set
End Property
<Description("The autocomplete custom source.")> _
Public Property AutoCompleteCustomSource() As AutoCompleteStringCollection
Get
Return m_AutoCompleteStringCollection
End Get
Set(ByVal value As AutoCompleteStringCollection)
m_AutoCompleteStringCollection = value
End Set
End Property
End Region
End Class
'&*--------------------------------------*&'
Class DataValueCell
Inherits DataGridViewTextBoxCell
Public Sub New()
'
End Sub
Public Overrides ReadOnly Property EditType As Type
Get
Return GetType(PCLDataGridViewTextBoxEditingControl)
End Get
End Property
End Class
'&*--------------------------------------*&'
'&* Edit DataGridView Columns *&'
'&*--------------------------------------*&'
Class PCLDataGridViewTextBoxEditingControl
Inherits DataGridViewTextBoxEditingControl
Public Overrides Function EditingControlWantsInputKey(ByVal keyData As Keys, ByVal dataGridViewWantsInputKey As Boolean) As Boolean
Select Case ((keyData And Keys.KeyCode))
Case Keys.Prior, Keys.Next, Keys.End, Keys.Home, Keys.Left, Keys.Up, Keys.Right, Keys.Down, Keys.Delete
Return True
End Select
Return MyBase.EditingControlWantsInputKey(keyData, dataGridViewWantsInputKey)
End Function
Public Overrides Sub ApplyCellStyleToEditingControl(ByVal dataGridViewCellStyle As DataGridViewCellStyle)
With DirectCast(Me, TextBox)
'.AutoCompleteMode = DataGridViewDataValueColumn.AutoCompleteMode_Value
'.AutoCompleteSource = DataGridViewDataValueColumn.AutoCompleteSource_Value
'.AutoCompleteCustomSource = MyBase.AutoCompleteCustomSource
End With
End Sub
End Class
The question is.
If I use JSP Documents (or JSP 2.0) and If I put a TAG without a BODY it is automaticly closed I dont want that.
so If I have <div id=....> </div>
it is automaticly converted to <div id=.../>
How I can stop this ?
I am using tomcat is there any configuration about that ?
P.S. the reason to want to stop it is because it simple "fuckes" the JQuery stuffs that the designer company are using.
Hi,
i jus friend reference function so i pass the user id through url like below
www.example.com?fid=22
i need to set this as a session or cookie which access to all modules in drupal 6.
if i set session it return for tht particular module . set cookie is not workin at all.
$user-new_property works only on particular page where set if i move to another page no new_property in $user variable object list .
Thanxs in advance,
Gobi
I want to use selenium test to cover my rails project ! but i just find little documents on selenium test . I want someone to give me some documents for selenium test of all types !like website ,pdf ,text etc. you can sent them to my gmail [email protected] Thank you ,and best regards!
I've set my cookie using set-cookie as follows on the server's cgi scripts
print """Content-type: text/html\r\n""",
print """Set-Cookie: name=value\r\n\r\n""",
but when I reload the page I can't get the cookie as it doesn't appear
on
document.cookie
How do I get the cookies? and was Set-cookie : name=value
supposed to appear on document.cookie after I refresh the page?
Overall I want the client side to recognize the cookie if exists and act accordingly
Thanks
\documentclass{book}
\usepackage{amsmath}
\usepackage[german]{babel}
\usepackage{amssymb}
\usepackage{amsxtra}
\usepackage[dvips]{epsfig,psfrag}
\usepackage{listings}
....
this is how my file starts. I didn't even edit it, I received it like this. However, if I want to make a pdf, it gives me the undefined control sequence error at the first line... What is wrong??
I'm trying to download an InfoPath template that's hosted on SharePoint. If I hit the url in internet explorer it asks me where to save it and I get the correct file on my disk. If I try to do this programmatically with WebClient or HttpWebRequest then I get HTML back instead.
How can I make my request so that the web server returns the actual xsn file and doesn't try to render it in html. If internet explorer can do this then it's logical to think that I can too.
I've tried setting the Accept property of the request to application/x-microsoft-InfoPathFormTemplate but that hasn't helped. It was a shot in the dark.
Hi,
I've got a challenge that I am hoping that the SO community is able to help me with.
I trying to parse a lot of html documents in my PHP application to remove personal details, such as names, addresses and phone numbers. I can remove most of these details without too much trouble, however the phone number is a real problem for me.
My idea is to take the text from these documents and the use a regex to identify the phone numbers and replace them with another value such as 'xxxx'.
I've got 2 regex that I am using one for UK landline numbers and one for UK cell/mobile numbers.
However when I try and run them against the text it just returns an empty string.
I am using the following preg_replace code:
$pattens = array(
'/^(((\+44\s?\d{4}|\(?0\d{4}\)?)\s?\d{3}\s?\d{3})|((\+44\s?\d{3}|\(?0\d{3}\)?)\s?\d{3}\s?\d{4})|((\+44\s?\d{2}|\(?0\d{2}\)?)\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$/',
'/^(\+44\s?7\d{3}|\(?07\d{3}\)?)\s?\d{3}\s?\d{3}$/'
);
$replace = array('xxxxx', 'xxxxx');
//do the search for the numbers.
$updatedContents = preg_replace($pattens, $replace, $htmlContents);
At the moment this is causing me a lot of head scratching as I thought that I had this nailed, but at the moment I can't see what's wrong??
I am sure that it is something really simple.
Thanks,
Grant
Hello,
This might not be a hard core programming question, but it's related to some of the tools used by programmers I suspect.
So we're a bunch of people each with a bunch of documents and a bunch of different computers on a bunch of operating systems (well, only 2, linux and windows). The best way these documents can be stored/managed is if they were available offline (the laptop might not always be online) but also synchronized between all the machines. Having a server with extra reliable storage be a "base repository" seems like a good idea to me.
Using a SCM comes to my mind and I've tried Subversion, and it seems to be a good thing that it uses a centralized repository - but:
When checking out the total size of the checkout is roughly double the original size.
Big files or big repositories seem to slow it down.
Also I've tried rsync, which might work - but it's a bit rough when it comes to the potential conflict.
Finally I've tried Unison (which is a wrapping of rsync, I think) and while it works it becomes horribly slow for the big directories we have here since it has to scan everything.
So the question is - is there a SCM tool out there that is actually practial to use for a big bunch of both small and big files?
If thats a NO - does anyone know other tools that do this job?
Thanks for reading :)
I have a set of strings and I need to find all all of the occurrences in an HTML document. Where the string occurs is important because I need to handle each case differently:
String is all or part of an attribute. e.g., the string is foo: <input value="foo"> - Add class ATTR to the element.
String is the full text of an element. e.g., <button>foo</button> - Add class TEXT to the element.
String is inline in the text of an element. e.g., <p>I love foo</p> - Wrap the text in a span tag with class TEXT.
Also, I need to match the longest string first. e.g., if I have foo and foobar, then <p>I love foobar</p> should become <p>I love <span class="TEXT">foobar</span></p>, not <p>I love <span class="TEXT">foo</span>bar</p>.
The inline text is easy enough: Sort the strings descending by length and find and replace each in document.body.innerHTML with <span class="TEXT">$1</span>, although I'm not sure if that is the most efficient way to go.
For the attributes, I can do something like this:
sortedStrings.each(function(it) {
document.body.innerHTML.replace(new RegExp('(\S+?)="[^"]*'+escapeRegExChars(it)+'[^"]*"','g'),function(s,attr) {
$('[+attr+'*='+it+']').addClass('ATTR');
});
});
Again, that seems inefficient.
Lastly, for the full text elements, a depth first search of the document that compares the innerHTML to each string will work, but for a large number of strings, it seems very inefficient.
Any answer that offers performance improvements gets an upvote :)
I've got a content management solution where we present scanned images (TIFF), PDFs, word docs for viewing. While we can simply embed a PDF, sometimes depending on user preferences it's a bit fiddly and sometimes not user-intuitive.
I'd like a solution like scribd, embedit, etc, but not hosted. I want to run the application on our own servers and manage it that way (for legal reasons, and our clients won't buy the service if it's hosted somewhere else).
SWFtools looks a little basic for my needs, plus doesn't do doc, docx or ppt.
Any options? Doesn't have to be free, but would be ideal.
On the following website, www.josecvega.com, I have a navigation bar with years that link to sections on that same page. Unfortunately it is not working they way I hoped, when the user selects a year it moves to the section of the page, but puts that section on the top of the page. I have a fixed div on the top of the page that covers the sections and prevents it from properly displaying. What can I do for this to work?
It hard to explain my situation, but it can be seen by going to www.josecvega.com and clicking one of the years.