Hello.
How can I define shared keys in my config/locales/lang.yml ?
For example I want to use
f.label :date
and to see translated word "date" in all forms for all models.
My JSON looks like this:
{
"[email protected]":"Person1",
"[email protected]":"Person65",
"[email protected]":"Person24"
}
It's returned in various number of elements, and various keys. How do I traverse the data if my code is like this:
$.post("includes/ajax.php", {
group_id : $('#group').val()
}, function(data) {
//how do i traverse data here?
}, "json");
Any help will be appreciated :)
Thanks!
Is it possible to get all keys in a column family using SimpleCassie?
I looked at SimpleCassie's google code, but do not figure out.
Another issue is that I used following code to access column value.
$price = $cassie-keyspace('ToyStore')-cf('Toys')-key('Transformer')-column('Price')-get();
echo $price;
It always complains "object of cassandra columnorsupercolumn cannot be converted to string".
Is it possible to print out the column value?
Array(0= blabla
1 = blabla
2 = blblll) etc..
Is there a way to change all the numeric keys to "Name" without looping through the array (so a php function)?
Session[Constant] vs Session["String Literal"] Performance
I'm retrieving user-specific data like ViewData["CartItems"] = Session["CartItems"]; with a string literal for keys on every request. Should I be using constants for this?
If yes, how should I go about implementing frequently used string literals and will it significantly affect performance on a high-traffic site?
Related question does not address ASP.NET MVC or Session.
I keep getting "Unknow Error occurred" when i try this in my XSLT:
<table class="TEDtalks">
<xsl:for-each select="/rss/channel/item">
<tr>
<td><xsl:value-of select="title"/></td>
<td>
<xsl:value-of select="media:content/@url" />
</td>
</tr>
</xsl:for-each>
</table>
The XML
<rss>
<channel>
<item>
<title>TEDTalks : Karen Armstrong: Let's revive the Golden Rule - Karen Armstrong (2009)</title>
<itunes:author>Karen Armstrong</itunes:author>
<description>Weeks from the Charter for Compassion launch, Karen Armstrong looks at religion's role in the 21st century: Will its dogmas divide us? Or will it unite us for common good? She reviews the catalysts that can drive the world's faiths to rediscover the Golden Rule.<img src="http://feeds.feedburner.com/~r/TEDTalks_video/~4/th6FBgvV22o" height="1" width="1"/></description>
<itunes:subtitle>Karen Armstrong: Let's revive the Golden Rule</itunes:subtitle>
<itunes:summary><![CDATA[Weeks from the Charter for Compassion launch, Karen Armstrong looks at religion's role in the 21st century: Will its dogmas divide us? Or will it unite us for common good? She reviews the catalysts that can drive the world's faiths to rediscover the Golden Rule.]]></itunes:summary>
<link>http://feedproxy.google.com/~r/TEDTalks_video/~3/th6FBgvV22o/647</link>
<guid isPermaLink="false">http://video.ted.com/talks/podcast/KarenArmstrong_2009G.mp4</guid>
<pubDate>Tue, 29 Sep 2009 12:46:00 -0500</pubDate>
<category>Higher Education</category>
<itunes:explicit>no</itunes:explicit>
<itunes:duration>00:09:54</itunes:duration>
<itunes:keywords>TED</itunes:keywords>
<media:content url="http://feedproxy.google.com/~r/TEDTalks_video/~5/XT8k_DqlzGc/KarenArmstrong_2009G.mp4" fileSize="33726021" type="video/mp4" />
Hibernate criteria, using DB2 dialect, generates the following sql with
composite keys in the IN clause, but DB2 answers that the query is incorrect:
select * from tableA where (x, y) IN ( ( 'x1', y1) )
but, DB2 throws this:
SQL0104N An unexpected token "," was found following ", y) in
( ('x1'".
Expected tokens may include: "+". SQLSTATE=42601
If I have flash media server and apache installed on windows, How do I go about implementing this? I have built my own player to handle http and rtmp streaming. I've searched all over and have not been able to find a solution.
Hello, I have two tables that are connected via a join table in a many-to-many relationship in the Entity Framework. I need to add a composite primary key in the join table for the two columns that are related to the joined tables via standard foreign keys but I'm sure how to do that.
Here is a code snippet from DirectShowNet library, used to open a video file:
this.graphBuilder = (IGraphBuilder) new FilterGraph();
// Have the graph builder construct its the appropriate graph automatically
hr = this.graphBuilder.RenderFile(filename, null);
but the RenderFile method fails. At the same time, Windows Media Player opens the same file nicely. What can be the problem.
I got the same behavior without DirectShowNet, but using native C++ code...
I'm trying to set up the NERDComment plugin in vim, but I'm having some trouble with the keys. I'd like to set the basic toggle functionality (comment a line if it's uncommented, uncomment if it's commented) to be c. The problem is that I've remapped the Leader to be ,, which is the same key that NERD wants for all of it's hotkeys. Anyone have any idea as to how to set this up?
Hi,
If I delete every keys in a ColumnFamily in a Cassandra db using remove(key), then if I use get_range_slices, rows are still there but without columns. How could I remove entire rows?
Thanks
Tobia Loschiavo
i have media player in my form and the following code...
If TimeOfDay >= "11:00:00 AM" AndAlso TimeOfDay < "12:00:00 AM" Then
toplay = "D:\videos\video5.avi"
Player_Preview.URL = toplay
Player_Preview.Ctlcontrols.Play()
End If
now i want to play multiple files in this time how can i do that...
Hi,
I am looking for an open-source iTunes style media player that I can use as a base for functionality I would like to develop. I am quite keen on Flex/Air, or C# or Java will do for languages.
Does anyone know of any projects?
Is it possible to navigate an NSTableView's editable cell around the NSTableView using arrow keys and enter/tab? For example, I want to make it feel more like a spreadsheet.
The users of this application are expected to edit quite a lot of cells (but not all of them), and I think it would be easier to do so if they didn't have to double-click on each cell.
According to their documentation, you should use Array hydration rather than record hydration when retrieving data for read-only purposes.
However, this means I have to access the attributes of the retrieved object using arrays and string keys:
$user['Phonenumbers'][0]['number']
instead of the OO style:
$user->PhoneNumbers[0]->number
Now I'm kinda new to PHP, but in other languages I've worked with the 2nd notation would be preferable because typos would be caught at compile time while typos in string literals would not be noticed until runtime. Does this apply to PHP/Doctrine?
Hi, I just want to delete cached data, but I have many keys, for example:
user_54_books
user_54_movies
user_54_comments
user_54_foobar
I can write $cache-delete('user_54_books'); but I have to do it with all "user_ID_objects", can I say to memcache, something like delete-('user_54_*'); ? how? thanks :)
I am making an example app of a game. I have a folder i set as the current directory from within visual studios which includes pngs,ogg,config.json,etc.
When i 'publish' these files are not included. How do i properly add a media files/folders into the project?
Hi, I have an NSArray of NSDictionary objects which I would like to be able to return a new array of NSDictionaries from, where every NSDictionary has "Area == North" (for example).
The closest example I have found so far is http://stackoverflow.com/questions/958622/using-nspredicate-to-filter-an-nsarray-based-on-nsdictionary-keys but this just returns the unique values for a given key, not the dictionary that has that key. Is there any way to perform a similar operation, and to return the entire dictionary?
Are there any repercussions using Negative Primary Keys for tables (Identity Increment -1, Identity Seed -1 in SQL Server 2005)?
The reason for this is we're creating a new database to replace an existing one. There are similar tables between the two databases and we'd like the "source" of the information to be transparent to our applications. The approach is to create views that unions tables from both databases. Negative PKs ensures the identities don't overlap.
How do I bind the mediakeys (play pause stop forward .. ) to corresponding functions in the vlc player. For now, I have to use the spacebar for play/pause and stuff like that. I'd prefer being able to vlc even when it is minimized!
I have an ASP.NET web application for data entry, and we have big lists of radiobuttons, and long lists of checkboxes, in some sections.
The client wants to be able to be able to navigate and manipulate these controls with their keyboard, like the tab/space/enter/right-left-up-down-arrow-keys. Are there any ASP.NET controls that I can use?
Currently I've been working with Entity Framework 1.0 which is located under a service façade.
Below is one of the save methods I've created to either update or insert the device in question.
This currently works but, I can't help feel that its a bit of a hack having to set the referenced properties to null then re-attach them just to get an insert to work. The changedDevice already holds these values, so why do I need to assign them again.
So, I thought I'll update the model to EF4. That way I can just directly access the foreign keys. However, on doing this I've found that there doesn't seem to be an easy way to add the foreign keys except by removing the entity from the diagram and re-adding it. I don't want to do this as I've already been through all the entity properties renaming them from the DB column names. Can anyone help?
/// <summary>
/// Saves the non network device.
/// </summary>
/// <param name="nonNetworkDeviceDto">The non network device dto.</param>
public void SaveNonNetworkDevice(NonNetworkDeviceDto nonNetworkDeviceDto)
{
using (var context = new AssetNetworkEntities2())
{
var changedDevice = TransformationHelper.ConvertNonNetworkDeviceDtoToEntity(nonNetworkDeviceDto);
if (!nonNetworkDeviceDto.DeviceId.Equals(-1))
{
var originalDevice =
context.NonNetworkDevices.Include("Status").Include("NonNetworkType").FirstOrDefault(
d => d.DeviceId.Equals(nonNetworkDeviceDto.DeviceId));
context.ApplyAllReferencedPropertyChanges(originalDevice, changedDevice);
context.ApplyCurrentValues(originalDevice.EntityKey.EntitySetName, changedDevice);
}
else
{
var maxNetworkDevice = context.NonNetworkDevices.OrderBy("it.DeviceId DESC").First();
changedDevice.DeviceId = maxNetworkDevice.DeviceId + 1;
var status = changedDevice.Status;
var nonNetworkType = changedDevice.NonNetworkType;
changedDevice.Status = null;
changedDevice.NonNetworkType = null;
context.AttachTo("DeviceStatuses", status);
if (nonNetworkType != null)
{
context.AttachTo("NonNetworkTypes", nonNetworkType);
}
changedDevice.Status = status;
changedDevice.NonNetworkType = nonNetworkType;
context.AddToNonNetworkDevices(changedDevice);
}
context.SaveChanges();
}
}
I created a Windows Forms Application to which I added a DataGridView and LINQ to SQL Classes from one of my databases. I can successfully bind one of my database's tables to my DataGridView:
var dataSource = from c in _db.NetworkedEquipments
select c;
dataGridView1.DataSource = dataSource;
However, the foreign keys get duplicated, that is, the columns appear twice. How can I prevent this?