Recently I came across a character range that was the following:
[/-+]
My very simple question is, is this even a valid charectar range? If so, what range of charectars would it match?
Recently I came across a character range that was the following:
[/-+]
My very simple question is, is this even a valid character range? If so, what range of characters would it match?
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
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
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.
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?
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'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
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
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
Hi all,
I'm looking for a way to automate the deployment of a custom CAS policy in SharePoint.
What i would like to achieve is the following:
All assemblies that have been built and signed by our build server (with a secret key) should run in SharePoint under the 'higher than normal' trust level.
Now I can manually edit the cas policy files to include something like this:
<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="MyPermissionSet" Name="[My Company public key]" Description="Grants all ">
<IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="[public key goes here]" />
</CodeGroup>
And that works great. However, we have several huge sharepoint farms, with many applications running on it. I'd like to avoid having to manually edit all policy files to include this xml snippet.
Is there a way to automate this? For example, from a feature?
With kind regards,
Erwin van der Valk
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?
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
Hello ! I am currently reading a book named "3D Graphics with XNA Game Studio 4.0" by Sean James and have some questions to ask :
If i create a effect parameter named lets say SpecularPower and have in my effect a variable named SpecularPower , if i do something like
effect.Parameters["SpecularPower"].SetValue(3)
That wil change the SpecularPower variable in my effect ?
And a second question, not regarding the book :
If i have a spaceship and i've created a "boost" functionality that speeds up my spaceship, what effects should i implement to create the impresion oh high speed ? I was thinking of making everything except my spaceship blurry but i think there would be something missing . Any ideas ?
Regards,
Alex Badescu
This is really two questions. Im doing a project for the university for storing baseball players statitics, but from baseball data I have to calculate the score by year for the player who is beign displayed. The background is, lets say 10, 000 users hit the player "Alex Rodriguez", the application have to calculate 10, 000 the A-Rod stats by years intead of just read it from some where is temporal saved. Here I go:
What is the best method for caching this type of data? Do I have to used the same database, and some temporal values on the same database, or create a Web Service for that?
What reading about web caching so you recommend?
Whether in a cup, a can, or a little bottle, millions of us slug back caffeinated beverages everyday. Check out this video to see how it effects your brain and why it keeps you alert. Courtesy of Alex Dainis at Bite Sci-zed, we’re treated to a rather energetic look at the function of caffeine in the body. Caffeine!! – Bite Sci-zed [via Geeks Are Sexy] How To Delete, Move, or Rename Locked Files in Windows HTG Explains: Why Screen Savers Are No Longer Necessary 6 Ways Windows 8 Is More Secure Than Windows 7
I want to collect bank account information from my customers on my website.
I'd like to do that trough a form, then I will download it to a PC, print it, and then delete it from the website. Or eventually, send it somewhere external right after the user submitted the form so it never gets stored on the website.
The goal is to recieve the payment information without having to ask the customer to print, fill manually, and send it over fax. And accomplish this without having to use an external payment gateway.
Thank you,
Alex.