My strings are of this kind: City (PR) from a Database, where PR stands for Province.
At the end I want two separate variables. City and PR.
I have to do this with C#. Any idea? Thanks.
I do this:
script/generate controller home index
And it says: "existing... " and a lot of stuff.
THen I go to mydomain.com:3000/home/index
But it says: sorry, something went wrong!
Why?
class HomeController < ApplicationController
def index
end
end
Suppose I have 500 rows of data, each with a paragraph of text (like this paragraph). That's it.I want to do a search that is not only based on words. (%LIKE%, not FULL_TEXT)
What would be faster?
SELECT * FROM ...WHERE LIKE "%query%"; This would put load on the database server.
Select all. Then, go through each one and do .find = 0 This would put load on the web server.
This is a website, and people will be searching frequently.
in active_admin partials created a form input:
<%= semantic_nested_form_for @item, :url => admin_items_path(@item) do |f| %>
<fieldset class="inputs">
<ol>
<%= f.input :category %></br>
<%= f.input :title %>
<%= f.input :photo1 %>
<%= f.input :photo2 %>
</ol>
</fieldset>
<%= f.fields_for :ItemColors do |i| %>
<fieldset class="inputs">
<ol>
<%= i.input :DetailColor %>
<%= i.input :size, :input_html => { :size => "10" } %>
<%= i.link_to_remove "remove" %>
</ol>
</fieldset>
<% end %>
<%= f.link_to_add "add", :ItemColors %>
<%= f.actions %>
<% end %>
to create a new Item okay creates and throws On the New Item, but if I do update an existing item is routed to an error occurs while such a path exists:
No route matches [PUT] "/admin/items.150" #150 is item_id
rake routes:
batch_action_admin_items POST /admin/items/batch_action(.:format) admin/items#batch_action
admin_items GET /admin/items(.:format) admin/items#index
POST /admin/items(.:format) admin/items#create
new_admin_item GET /admin/items/new(.:format) admin/items#new
edit_admin_item GET /admin/items/:id/edit(.:format) admin/items#edit
admin_item GET /admin/items/:id(.:format) admin/items#show
PUT /admin/items/:id(.:format) admin/items#update
DELETE /admin/items/:id(.:format) admin/items#destroy
help to solve this problem
UPD
I found the error, but not yet understood how to fix it
the upgrade is a request:
PUT "/admin/items"
but should:
PUT "/admin/items/some_id"
any ideas?
i have tables
profiles (id, name, deleted)
categories (id, name, deleted)
profiles_categories (id, profile_id, category_id, , deleted)
I have wrong query
SELECT p.id, p.name CONCAT_WS(', ', c.name) AS keywords_categories
FROM profiles p
LEFT JOIN profiles_categories pc ON p.id = pc.profile_id
LEFT JOIN categories c ON pc.id = c.id
WHERE p.deleted = FALSE
So, i want have result with all profiles with concan categories.name.
Thanks
I have 2 divs...each are float left, and each have a "width".
When I resize my browser, the right div goes down to the bottom of the left div. Why? I'd like it so that during resize, it stays there.
Suppose my code is like this:
<td class="apple">
<div class="worm">
text1
</div>
</td>
<td class="apple">
<div class="worm">
text2
</div>
</td>
<td class="apple">
<div class="worm">
text3
</div>
</td>
How can I loop through everything with "tr class apple", and then grab the text of the div inside with id "worm", and then set each of the .attr() as that text?
Result:
<td class="apple" title="text1">
<div class="worm">
text1
</div>
</td>
<td class="apple" title="text2" >
<div class="worm">
text2
</div>
</td>
<td class="apple" title="text3">
<div class="worm">
text3
</div>
</td>
Thank you
I have an inventory system, where a User has many inventory. We have a barcode column which needs to be sequential for each user. I run into a problem however when doing bulk association building. I end up getting several inventories for a user with the same barcode.
For example:
Inventory Table:
id | user_id | barcode
1 | 1 | 1
2 | 1 | 2
3 | 2 | 1
4 | 2 | 2
5 | 1 | 3
In the Inventory model I have
before_validation :assign_barcode, on: :create
def assign_barcode
self.barcode = (user.inventories.order(barcode: :desc).first.try(:barcode) || 0) + 1
end
It generally works, but ran into a problem when seeding my db:
(1..5).each do
user.inventories.build(...)
end
user.save
I end up with a bunch of inventories for user that have the same barcode. How can I ensure that inventories have unique barcodes even when adding inventories in bulk?
I'm writing a dictionary app and need to do the usual word suggesting while typing.
LIKE somestrin% is rather slow (~1300ms on a ~100k row table) so I've turned to FTS3.
Problem is, I haven't found a sane way to search from the beginning of a string.
Now I'm performing a query like
SELECT word, offsets(entries) FROM entries WHERE word MATCH '"chicken *"';
, then parse the offsets string in code.
Are there any better options?
Hi!
is it possible to install another IDE language to SQL Server 2008 Express like i can do in Visual Studio? In the options of Visual Studio, i can change the Environnement Language. Can i do the same with SQL Server 2008?
alex
Hi,
We are organizing a Linux 101 Workshop for undergrad and grad students. Can you share some ideas/topics that are must for people who are just starting with Linux.
Preconditions: No knowledge of Linux OS, philosophy and technical aspects (kernel, shell, commands)
Post conditions: A basic crash course of Linux which will give them a good start and answer some basic questions asked on it.
I'm trying to use a batch file to download a package off my FTP server.
echo username >ftp.txt
echo >>ftp.txt
echo cd directory >>ftp.txt
echo get filename >>ftp.txt
ftp -s:ftp.txt server.com
The server is set to allow anonymous logins on username but when I run the script I get an error: 331 Password required for username
If there is any other useful information let me know.
-Alex
debian4 linux
i have the following cmd line which works fine
rsync -avr -e ssh /home/dir [email protected]:/home/
but i need to setup it up now to rsync to a remote server that only has ftp on it
how do i go about that ?
i looked at the rsync help but quickly got lost (i don't do this stuff very often)
thanks
alex
What I'm trying to do is set up a udev rule for my HP headphones (usb) with the aid of several tutorials out there.
Created a file ( 90-local.rules ) in /etc/udev/rules.d and added the following:
ACTION="add",SUBSYSTEM="usb", ATTR{vendor}=="Hewlett-Packard", RUN+="sh /home/alex/Scripts/usb.sh"
The problem is nothing happens when I connect the headphones! What am I doing wrong?
note: I did restart udev and the script works also, so it's not that
Hi i just installed ubuntu 12.10 on my ssd(picture below) and i set up my home directory to
the 1 TB disc(picture below).
I want in general use the ssd as my root folder as u can see, and install only the apps which are necessary.
Games and other stuff goes to the 1 TB disc, but this disc shows me in gparted a usage of 14 GB on a freshly install, whats wrong?
What about the ssd, do i have to manually optimize things?
thx
Alex
PS: What if i want to install a Game to my home folder, i heard sth. of a symbol link, how to do that?
As I finish up the plans for Monday’s database design precon, I am getting pretty excited for the day. This is the third time I have done this precon, and where the base slides are very similar, I have a few new twists in mind. One of my big ideas for my Database Design Workshop precon has always been to give people to do some design. So I am even now trying to go through and whittle down the slides and make sure that we have the time for design. If you are attending, be prepared to be a team player....(read more)
If you’re looking for a DIY gift for this Father’s Day that really shows off your maker ethic, this roundup of 10 DIY gifts is sure to have something to offer–fire pistons anyone? Courtesy of Make magazine, we find this 10 item roundup for great DIY projects you could hammer out between now and Father’s Day. The roundup includes everything from the mini-toolbox (really, more of a parts box) see in the photo here to more dynamic gifts like a homemade fire piston and a spider rifle. Hit up the link below to check out all the neat projects which, intended as a gift or not, will prompt you to head out to the workshop. Top 10: Easy DIY Gifts My Dad Would Dig [Make] HTG Explains: What Is RSS and How Can I Benefit From Using It? HTG Explains: Why You Only Have to Wipe a Disk Once to Erase It HTG Explains: Learn How Websites Are Tracking You Online
This polished looking standing desk combines a stand alone bar-height counter with extra storage, cable management, and monitor riser. The end result looks like a $$$$ standing desk at a fraction of the price. Courtesy of IKEA hacker Marc Marton, the build combines the Billsta Bar Table, the Ekby Alex Shelf, and Besta legs to raise the shelf up off the desk and create a keyboard storage area. For more information about the build hit up the link below. Billsta Bar Table into Standing Work Station [IKEAHacker] 8 Deadly Commands You Should Never Run on Linux 14 Special Google Searches That Show Instant Answers How To Create a Customized Windows 7 Installation Disc With Integrated Updates
O Oracle WebCenter Suite consiste num conjunto integrado de soluções baseadas em standards de mercado, com o objectivo de criar aplicações de negócio, portais corporativos, comunidades de interesse, grupos colaborativos, redes sociais, consolidar sistemas aplicacionais web e potenciar as funcionalidades web 2.0 dentro e fora de uma organização. Toda a solução está em conformidade com os principais Standards de mercado e baseia-se numa arquitectura totalmente orientada ao serviço (SOA).
Venha conhecer nesta sessão as novas funcionalidades do Webcenter Suite 11g PS3.
Agenda
09.30h
Boas Vindas e Introdução
09.40h
Oracle & Enterprise 2.0 - João Borrego
10.00h
Introduction to Oracle WebCenter Suite as a User Experience Platform (UXP) - Monte Kluemper
10.40h
Coffee Break
11.00h
Building Rich UIs with Oracle WebCenter Portal - Monte Kluemper
12.00h
Interactive Q&A Session - João Borrego e Monte Kluemper
12.30h
Almoço
14.00h
Deep-dive into WebCenter Technical Architecture - Monte Kluemper
15.30h
Final da Sessão
Target: - Equipas de Venda e Comerciais (manhã)- Equipas Técnicas e de pré-venda (tarde)
Data e Local:19 de JaneiroLagoas Park Hotel
Para este Workshop os lugares estão limitados. Por favor aguarde um email de confirmação de sua inscrição.Inscrições : Email
Para mais informações, por favor contacte: Claudia Costa / 21 423 50 27
16 Java EE Workshops in 3 days:
Track: Java EE Core Technologies
· Core – JPA 2.x - Arne Limburg
· Core – EJB 3.1 und 3.2 - Jens Schumann
· Core – CDI 1.0 & 1.1 - Mark Struberg
· Core – JSF 2.x - Lars Röwekamp
Track: Best Practices
· Pitfalls in Java EE - Mark Struberg
· Java EE UI - Adam Bien
· Modeling meets Code - Arne Limburg
· Java EE Security - Adam Bien
Track: Java EE Kickstart
· Kickstart – Java-EE-Architekturen - Jens Schumann
· Kickstart – Java Web Profile - Lars Röwekamp
· Kickstart – Events und Messaging - Thilo Frotscher
· Kickstart – Services: REST und WS-* Thilo Frotscher
“Do it yourself” – Workshop Day
· Java EE Core – Putting together - Jens Schumann, Lars Röwekamp
· Java EE Core – Putting together: Extended Edition
· Java EE 6/7 – Productivity with Joy: Development - Adam Bien
· Java EE 6/7 – Productivity with Joy: Testing - Adam Bien
>> Night Session mit Matthias Weßendorf:
· Future: New School Web Apps
For more information and registration please visit www.java-ee-summit.de/zeitplaner.
WebLogic Partner Community
For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.
BlogTwitterLinkedInMixForumWiki
Technorati Tags: Java EE,Adam Bien,Java EE Summit,WebLogic Community,Oracle,OPN,Jürgen Kress
As you may know, the Silverlight Tour Training is coming to Vancouver in may. If you plan to attend, this might be interesting: you can win one free pass to this Vancouver Silverlight 4 workshop in May 3-6, 2010 ($1,995 CAD value) by visiting the SilverlightShow.net community website and participate in the draw! (the pass does not include travel and hotel, only the course). Take the chance to get an intensive course on Silverlight 4 in this four-day training! Learn the ins and outs of design, development and server-side programming with Silverlight in an exciting way, through a mix of lessons, demonstrations and hands-on labs. Enter the draw before April 1st, 2010! The winner will be announced on April 2nd, 2010 in www.silverlightshow.net. Good Luck! Technorati Tags: Silverlight training,Silverlight Tour
As you may know, the Silverlight Tour Training is coming to Vancouver in may. If you plan to attend, this might be interesting: you can win one free pass to this Vancouver Silverlight 4 workshop in May 3-6, 2010 ($1,995 CAD value) by visiting the SilverlightShow.net community website and participate in the draw! (the pass does not include travel and hotel, only the course). Take the chance to get an intensive course on Silverlight 4 in this four-day training! Learn the ins and outs of...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.
Join Oracle, September 16-21 in Boston, MA at the TDWI World
Conference Series. The TDWI is the premier provider of in-depth, high
quality education and research in the Business Intelligence and Data
Warehousing industry. This conference series focus on Agile BI. Learn
how BI/DW teams are building on the four pillars of agile development-
analytics, organizations, environments and architectures- to make their
business more nimble, intelligent and ultimately, more profitable.
Oracle will be hosting a workshop, Wednesday, Sept 19, 2012 - "Data
Discovery: Beyond Dashboards and Scorecards" from 7:00pm to 9:00pm, in
Back Bay-B.
For more information, visit the TDWI website:
http://events.tdwi.org/events/boston-world-conference-2012/home.aspx