w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Update-Database fails due to Pending Changes, but Add-Migration Creates a Duplicate Migration
I see this all the time also. I don't know why, wish i did, but my solution is to do a add-migration which will make a duplicate. Now this duplicate opens in the editor and then i edit it, so that the Up and Down methods are empty. So the result is a migration file that does nothing! VS is happy and you can do the update-database without errors (until next time). I hope this helps :)

Categories : C#

Running One Massive Migration in Rails. Deleted Migration File by Mistake
You don't need to drop all your tables in prod. Instead, create the big migration file you described, but then manually record it as applied in prod. After all, the point of a migration is to apply changes to the DB. In your case that's only needed outside of your production environment. Manually recording the migration is as simple as inserting the migration timestamp into the schema_migrations table: mysql> select * from schema_migrations; +----------------+ | version | +----------------+ | 20120504193548 | | 20120508160150 | | 20120518135330 | | 20120523163509 | ... So just execute the appropriate INSERT and rails will ignore the migration. PS - In the future, use source control so you can just simply restore the file from a prior version!

Categories : Ruby On Rails

Generating a rails migration, how can I get the migration filename into my clipboard automatically?
I figured out a way to do this in each, (Windows requires you are using rails command line from cygwin for this) For OSX to clipboard rails g migration add_something_to_table | grep -oP 'db/.*.rb' | pbcopy For any linux + X rails g migration add_something_to_table | grep -oP 'db/.*.rb' | xclip For Windows (with cygwin) rails g migration add_something_to_table | grep -oP 'db/.*.rb' > /dev/clipboard

Categories : Ruby On Rails

remove a migration from south migration history
delete from south_migrationhistory where app_name='robots'; south_migrationhistory table just keeps track of what migrations have been applied and what are yet to be applied. Since 0.8 of robots doesn't have any migration files any entries for it from table south_migrationhistory can be removed and it won't affect anything else.

Categories : Django

Possible EF6 beta 1 Migration bug. Codefirst migration deadlock
Try explicitly specifying the migrations with Update-Database one at a time. If that doesn't work, try applying the InitialCreate by itself, then re-creating/Adding the ChangePegawaiToTPT. Be sure to have a backup copy first... There are some cases where many-to-many relationships are being named differently in rc1 than in the beta, which causes some headaches.

Categories : C#

Database Migration Error: Sqlite3 to Postgres Migration error
Basically - a dump from a DBMS is not supposed to work to another DBMS. Sometimes, it might work, but that's an exception. Generally, DBMSs have standard SQL for manipulating data, but they don't share the same language for creating and organizing data. There is no PRAGMA instruction in PostgreSQL. Check the following link: http://www.postgresql.org/docs/7.1/static/plpgsql-porting.html#CO.PLPGSQL-PORTING-PRAGMA

Categories : Ruby On Rails

MySQL - question marks
Your database table column should be created with proper charset and collation. You can define theit while creating or altering a table: col_name {CHAR | VARCHAR | TEXT} (col_length) [CHARACTER SET charset_name] [COLLATE collation_name] Here is the mysql link to help you learn more about it: http://dev.mysql.com/doc/refman/5.0/en/charset-column.html

Categories : Java

C++ spanish question mark
this character is simply not included in basic ascii. Try using wstring http://www.cplusplus.com/reference/string/wstring/

Categories : C++

Flowplayer question mark
A question mark URL encodes as %3F. But you should use a proper encoder for the whole thing rather than manually encoding a specific character. Depending on the server-side technology you're using to build the Urls, tyhere should be a function like UrlEncode() which should handle all this for you. Failing that, Javascript has encodeUriComponent()

Categories : Misc

How to match a question mark?
Use quotemeta for the regex pattern. use warnings; use strict; my $search = quotemeta 'http://shorturl.com/detail.cfm?color=blue'; my $replace = 'http://shorturl.com/detaila.aspx?color=red'; my $file = '<a href="http://shorturl.com/detail.cfm?color=blue" class="news">HI</a>'; $file =~ s/$search/$replace/gis; print $file; __END__ <a href="http://shorturl.com/detaila.aspx?color=red" class="news">HI</a>

Categories : Regex

Can't read a file that contains a question mark in name
As long as the file exists, there is no problem opening a file like this: folder_file = './temp directory/file-?.txt' File.open(folder_file, 'r').close This works fine. See Tin Man's suggestion about how to actually open the .tif file. As you can see, I created the following file myster-file_char?.txt $: ls get_listing.rb myster-file_char?.txt You can get this stored in a variable, though I only use Dir.glob here to view it. puts Dir.glob("**.*").inspect Everything is now revealed in what character it is. Though I should be able to use it directly as is to open and edit the file in Ruby. Though like The Tin Man stated, you are asking about a binary file. $: ruby get_listing.rb ["myster-file_charu0016.txt", "get_listing.rb"] The character that is actually there is a CTRL

Categories : Ruby

R - how does the "question mark" function works?
You can make functions and variables with arbitrary names, via use of the backtick `. `~` <- `+` y <- 5 x <- 10 y ~ x # 15 I wouldn't mess with ~ though, unless you don't intend to do any statistical modelling....

Categories : R

How to remove question mark in a JOptionPane?
Use the PLAIN_MESSAGE message type JOptionPane.showConfirmDialog(null, "Help", "Please Enter X and Y Values", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);

Categories : Java

What may cause question marks instead of non-ASCII symbols?
You need to change the character set of the database to UTF-8 or a character set for Cyrillic characters. Latin-1 can't encode Cyrillic characters and that's why they're appearing as question marks in the database. edit: I just saw you're declaring the table with UTF-8 character set, so I'm stumped.

Categories : PHP

hr content shows question mark
The probable explanation is that although the HTML document is declared to be UTF-8 encoded, it actually isn’t. It might be windows-1252 encoded, and when the windows-1252 encoded representation of “§” is encountered when processing presumed UTF-8 data, it constitutes a character data error. A common, and recommended, way in which browsers indicate the error is “�” REPLACEMENT CHARACTER. To fix this, make sure the declared and actual character encoding match. It is less relevant which encoding you use, but other things being equal, it is best to use UTF-8. So you would need an editor or other authoring tool that can actually save the data as UTF-8 encoded. If you absolutely cannot fix the encoding issue, replace "§" in CSS by the escape notation "A7". Much less readable, bu

Categories : HTML

.htaccess rewrite URL with a question mark "?"
RewriteRule ^component/users/?view=registration$ registration.html$ [R=301,L] You need a because ? is part of a regular expression. To Use it as a string u need to escape it with a Linktip: http://ole.michelsen.dk/tools/regex.html

Categories : Htaccess

URLRewrite rule for a URL that only contains one value after the question mark
Try this code. Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} ^([a-z0-9-]+)$ [NC] RewriteRule ^$ /#!/videos:%1? [L,R=301,NE]

Categories : Htaccess

Check if last character is a question mark
if (substr(rtrim($link), -1) != "?") { // Do stuff } Giving a negative start value to substr() makes it count from the end instead of the beginning.

Categories : PHP

mod rewrite question mark and ampersands
I think the issue here is that in your RewriteRule you're trying to match a part of the query string, which isn't possible. If I understand your problem correctly, you want requests to http://example.com/category/general?type=pages&v=1 to be interpreted by the server as http://example.com/category.php?c=general&type=pages&query=1? To match a query string, you need to prefix your rule with a condition. The following should work: RewriteCond %{QUERY_STRING} type=([^&]+) RewriteCond %{QUERY_STRING} v=([^&]+) RewriteRule ^category/([^/]+) /category.php?c=$1&type=%1&query=%2 The first two lines are pre-conditions that state that the requested URL needs to have both type= and v= as part of the query string. The final line rewrites the request. This means that

Categories : PHP

What to do with Question Marks in HTAccess Redirects
If it's a single link you want to change you don't need a htaccess rule for that you can just do a redirect. redirect 301 /wordpress/?p=250 http://www.othersite.com/blog If the URL parameter changes you can use this rule. RewriteEngine on RewriteRule ^wordpress/(.*) http://www.othersite.com/blog [R=301,QSA,NC,L] Note that when you use the QSA flag it will append the URL with the query parameter so if that's what you want the resulting URL will be. http://www.othersite.com/blog?p=250 Otherwise if you remove the QSA flag, then it will just redirect to this http://www.othersite.com/blog

Categories : String

Arabic turn to strange Question marks
Looking at your screen shot it looks as though you already have some unicode data but as I rough top-down walk through. You should be using nvarchar to store your strings as it is unicode it will record Arabic or extended characters without issue. You also need to check that your character encoding is setup (UTF8 is usually a good bet) and passed through all various places correctly. If you are using SqlConnection and SqlCommand then it would be best to pass the value as a parameter to ensure that everything is being handled correctly and avoid injection attacks. If you are using Entity Framework there should be no additional steps to my knowledge.

Categories : C#

Getting Arabic Query String in Question Marks
Your Apache server probably doesn't accept UTF-8 URL encoding. See this answer to solve your problem. Hope it will help :)

Categories : PHP

Rewrite Urls with question mark and ampersand
Ok, assuming the file handling the queries is index.php and foo and bar don't change to something else, you could start like this: RewriteEngine On RewriteBase / RewriteRule ^foo$ foo/ [NC,R] RewriteRule ^foo/$ index.php?foo [NC,L] RewriteRule ^foo/([A-Za-z0-9_-]+)$ foo/$1/ [NC,R] RewriteRule ^foo/([A-Za-z0-9_-]+)/$ index.php?foo&group=$1 [NC,L] Now you should be able to do the bar part on your own! Btw. if you really want your query string to only be ?foo (without a value, like so: ?foo=somevalue) you'll have to check for foo's existence differently than you would for e.g. the somegroup part.

Categories : Htaccess

PHP Regular expression: Get all urls with question mark
Don't try to make everything happen in one regex. Use your existing method, and then separately check the URL that you get back to see if it has a question mark in it. That said, don't use regular expressions to parse HTML. You cannot reliably parse HTML with regular expressions, and you will face sorrow and frustration down the road. As soon as the HTML changes from your expectations, your code will be broken. See http://htmlparsing.com/php for examples of how to properly parse HTML with PHP modules that have already been written, tested and debugged.

Categories : PHP

what does a question mark in a file path mean, like ?/filename
Well, it depends on what matching syntax your shell is using, but glob syntax (see http://en.wikipedia.org/wiki/Glob_(programming)) is relatively standard. In glob syntax, a question mark matches any one character.

Categories : Unix

301 redirect with ? (question mark) not working in htacces
You can't match against the query string in a Redirect statement, use mod_rewrite and match against the %{QUERY_STRING} var: RewriteEngine On RewriteCond %{QUERY_STRING} ^AddID=1078&Rand=666171759380936096$ RewriteRule ^order/order.html$ http://www.domain.nl/? [L,R=301] But since you have like 8000 URLs that start with the query string ?AddID=, then you can just match against that: RewriteEngine On RewriteCond %{QUERY_STRING} ^AddID=[0-9] RewriteRule ^order/order.html$ http://www.domain.nl/? [L,R=301]

Categories : Htaccess

I want to remove question mark & .php extension from the url using .htaccess
How about this? It requires mod_rewrite. RewriteEngine On RewriteRule ^test/([0-9]+)$ test.php?id=$1

Categories : PHP

mapping for question mark for backwards search
Due to the way that the keyboard input is handled internally, this unfortunately isn't generally possible today. Some key combinations, like Ctrl + non-alphabetic cannot be mapped, and Ctrl + letter vs. Ctrl + Shift + letter cannot be distinguished. (Unless your terminal sends a distinct termcap code for it, which most don't.) In insert or command-line mode, try typing the key combination. If nothing happens / is inserted, you cannot use that key combination. This also applies to <Tab> / <C-I>, <CR> / <C-M> / <Esc> / <C-[> etc. (Only exception is <BS> / <C-H>.) This is a known pain point, and the subject of various discussions on vim_dev and the #vim IRC channel. Some people (foremost Paul LeoNerd Evans) want to fix that (even for console Vi

Categories : Vim

How do I create URL's in ASP.NET Web Forms without the question mark for querystrings?
You do not have to convert entire application to MVC just for the sake of pretty URL. You can easily achieve it by using urlrewriter. Something like this in web.config - <rewriter> <rewrite url="~/Product/(d+)" to="~/default.aspx?productID=$1"/> </rewriter> Note: I did not test the above code. I hope you get the idea. If your application uses .Net 4.5, you might also want to look at URL Routing of ASP.Net.

Categories : Asp Net

Removing question mark ? from subfolder URL in htacces wp
How about something like this: RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /(.+)?( |$) RewriteRule ^(.*)$ /$1? [L,R=301] You'd put those rules in the htaccess file in your document root.

Categories : Htaccess

Have an irremovable question mark at the end of html input
You could do this : $('#a').keyup(function(){ var v = this.value.replace(/?/g, '') + '?'; if (this.value != v) this.value = v; }); Demonstration But users don't really like when the content of the input changes of its own. I'd avoid this if possible. This second version puts a space before the ? : $('#a').keyup(function(){ var v = this.value.replace(/ ??/g, '') + ' ?'; if (this.value != v) this.value = v; }); Demonstration

Categories : Javascript

How to POST question mark to a web service? Objective-c
I tried to do this again some time after I posted this question. Previously, I used a web service that was written by someone else. I suspect it has something to do with some custom escaping character function. This time, I wrote my own web service, and it works perfectly. I don't even need to use the "NSString_URLEncoding"

Categories : IOS

Can a Rails `where` query with question marks be done more elegantly?
Personally I will use a find by with a in condition such as: Klass.find_all_by_column([1, 2, 3]) Replace 'column' with column name you wish to search in. Replace 1,2,3 by your value, it's an array you can add or remove values from it. My example will generate a SQL query such as: SELECT * FROM Klass WHERE Klass.column IN (1,2,3) More on this on Active record documentation.

Categories : Ruby On Rails

Charset converting to question mark with diamond even though utf-8
These are two questions, so two answers: The only logical answer to your problem displaying �, is that somewhere along the line, you are not correctly storing this as UTF-8 and it did get converted to something else. The second problem, (fatal error in eval()'d code.) You should post the code that's triggering this error and preferably not even use eval for anything remotely important. Especially not dynamic eval() code, which you appear to be doing.

Categories : PHP

Python Mysqldb Returns Question Marks
MySQLdb.connect takes a use_unicode parameter, which may solve the problem. If not, you may also need to set charset to whatever your table uses: MySQLdb.connect(host="localhost", user="root",passwd="*****", use_unicode=True, charset='xxxxx') http://mysql-python.sourceforge.net/MySQLdb.html

Categories : Python

htaccess - regex - question mark in address
I have modified your regular expression. I hope that i have understood your challenge correctly. I have also provided a permalink to my test. Both of the URLs you provided in the comments passed. RewriteRule ^(.+)/article/(.+)/(.+).html(.*)$ index.php?content=article&id=$2&alias=$3 [L] Here is a link to my regular expression test.

Categories : Regex

What does the ? (backslash question mark) escape sequence mean?
? in regex is a quantifier, it means 0 or 1 occurences. When appended to the + or * quantifiers, it makes it "lazy". For example, applying the regex o? to the string foo? would match o. However, the regex o? in foo? would match o?, because it is searching for a literal question mark in the string, instead of an arbitrary quantifier. Applying the regex o*? to foo? would match oo. More info on quantifiers here.

Categories : Objective C

Russian character render as question mark in Classic ASP
Firs part: recover from DB When you use aVarWChar, the W is for "Wide", which means that this parameter is an Unicode string. Unicode support all languages without problem, so it's the way to go. When you use aVarChar, the string is encoded in some other way, but not in Unicode (It could depend on the server configuration, or something else. I don't know if you can control it. ASP it's such old technology!!) SO your best bet is to recover Unicode from the DB and let ASP encode it for the browser. Second part: show in ASP page Look at this: Classic ASP: How to write unicode string data in classic ASP? This shows how to get ASP to encode the Unicode string in a way that the browser will show it correctly.

Categories : Sql Server

Regex/Php: Cannot match question mark in live site
try \? instead of ? ; if that doesn't work, you might run a regex engine version which doesnt support negative lookahead. In that case you could reform your preg_replace to preg_replace('/([?&]p=1)([^d])/', '$2', $url) . '<p>'; which would consume the non-digit, but put it back in again. There might be edge cases where this differs from your regex, but I don't think you'd be able to encounter those with urls (and I can't think of any from the top of my head) of course, there are other non-regex solutions to this, but as regex is a very powerful tool, it's always good to learn something about it ;)

Categories : PHP

How do I fix error TS1015: Parameter cannot have question mark and initializer?
If you look in the TypeScript Language Specification document you can find a wealth of detail about the language syntax. Section 3.7.2 describes call signatures i.e. the syntax used to call functions and constructors etc. Section 3.7.2.2 is specifically about the parameters associated with a call. It defines optional parameters as: PublicOrPrivateopt Identifier ? TypeAnnotationopt PublicOrPrivateopt Identifier TypeAnnotationopt Initialiser We can see see that either using '?' OR providing a default value will mark the parameter as being optional. So to fix the compiler error you can simply remove the '?' and leave the default value and it will remain as an optional parameter as you intend.

Categories : Typescript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.