w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
How to use NSNumber or CGFloat constant in Autolayout visual format language?
You need to pass kTopAndBottomPadding in the metrics dictionary, not the views dictionary. Also, you might want to just take advantage of the addConstraints: method instead of messing about with mutable arrays and for/in loops. CGFloat const SPMTVC_kTopAndBottomPadding = 5.0; // ... NSDictionary *metrics = @{ @"kTopAndBottomPadding" : @(SPMTVC_kTopAndBottomPadding) }; NSDictionary *views = @{ @"messageTextView" : _messageTextView, @"contentView" : self.contentView }; [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[messageTextView(==contentView)]-0-|" options:NSLayoutFormatAlignAllLeading metrics:metrics views:views]]; [self.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-kTopAndBotto

Categories : Iphone

pointer to function c language basic
this is wrong double essay(double* pfunc(double),double num, ... ) Here you're passing a function as a parameter which return a pointer to double, that not make sense, should be: double essay(double (*pfunc)(double),double num, ... ) Here you're passing a pointer to a function which returns a double and receive a double as a parameter

Categories : C

C language: Convert Pointer to String, what am I getting back?
The address isn't backwards. Printf shoudl always print big endian. If you print the address locations, if you get 589796 when an int, if you print it as hex, then you'll get 0x8FFE4 = 589796. Everything is working as it should, since no matter hwo you print it, its going to be the correct memory address, just with a different representation.

Categories : C

How to pass a pointer to a struct into a function using C Language?
This is caused by operator precedence, as the member access operator -> has higher precedence than the dereference operator *. Change: *query->queryS = queryString; to: (*query)->queryS = queryString; Other: Don't cast the return value from malloc(). The code is assigning the address of a string literal, which is read-only, to a char*. Use const char* or copy the string (using malloc()/strcpy() or strdup() if your implementation provides it. Remember to free() what was malloc()d.

Categories : C

function with a struct array pointer as an argument, C language
You cannot assign an array like that. You need to do strcpy ((*tvarr[0]).manufacturer, "Vizio"); Make sure that you don't go out of bounds when copying the string into the array. You can either check the size of the string in advance or use strncpy which will limit the maximum number of characters to be copied. An array is not a modifiable l-value. So basically you cannot have it on the left hand side of an assignment. Or may be you also might want to define manufacture as char *manufacture and then dynamically allocate the string. manufacturer = strdup ("Vizio"); //manufacturer is char * Or depending on the length first allocate the buffer manufacturer = malloc (sizeof (char) * needed_bytes); Whenever you dynamically allocate the buffer, whenever you have finished working with i

Categories : C

Problems with foreign language encoding in CSV in Visual Basic
Excel on Mac has severe deficiencies in this department. CSV files are assumed to be encoded in MacRoman – any encoding preamble is simply ignored. As far as I’m aware there’s no workaround for this, you have to encode the CSV file accordingly, or use the file open dialog in Excel to select the appropriate encoding.

Categories : Vb.Net

Visual studio in English to target DevExpress in another language
DevExpress uses satellite assemblies to handle localization. For a complete tutorial - go here. Visual Studio has nothing to do with the language beeing shown. By defualt the shown language is the same as the one specified your are currently using in your Windows Be awhare that the current culture (and available satellite assemblies) determines what language is show to end users.

Categories : C#

How to feed Visual Studio Clang-Format plugin with clang-format file?
Go to Tools->Options->LLVM/Clang->ClangFormat and put file in the Style option field. Then place you style file named .clang-format (this is the full filename, not an extension) either in the source file's directory or one of its parent directories. Windows Explorer won't let you create filenames with leading . so you need to go to the console for this.

Categories : C++

jsp expression language format negative numbers
You can try using absolute value. Or, in the case of negative values, meaning you'd have to check if lostTimeCost < 0, you can convert them to positive by: Using negation. <fmt:formatNumber value="${-list.lostTimeCost}" type="currency"/> Multiplying by -1. <fmt:formatNumber value="${list.lostTimeCost * -1}" type="currency"/>

Categories : Jsp

apache poi language version causes date format misinterpretation
You can customize your date format as following: HSSFCell cell = (HSSFCell) cellIter.next(); SimpleDateFormat DtFormat = new SimpleDateFormat("dd.MM.YY"); Date date=cell.getDateCellValue(); System.out.println(DtFormat.format(date).toString()); This will print the value as 21.01.13.

Categories : Java

Updating Date Time Format specified in the regional settings of the system(Region and Language)
CultureInfo data is cached first time it's requested, so it's required to call CultureInfo.ClearCachedData method to get updated format values. As a side note it's pretty strange that you assuming frequent settings changes during app runtime. If it's requred for app to have some sort of format changes it's better to make that an application option.

Categories : C#

Why does Visual Studio increment the loop pointer before dereferencing it?
Indeed this is a bit strange. Many compilers avoid to read a register in the instruction after it has modified because such code runs slower on some processors. Example: ; Code that runs fast: add ecx, 16 mov esi, edi cmp ecx, edx ; Code doing the same that may run slower: mov esi, edi add ecx, 16 cmp ecx, edx For this reason compilers often change the order of the assembler instructions. However in your case this is definitely not the reason. Maybe the optimization code of the compiler is not written 100% correctly and it therefore does this kind of "optimization".

Categories : C++

Smart pointer error in Visual Studio 2012
Type of the deleter is a part of the unique_ptr's type and must be specified as a template argument: std::unique_ptr<SDL_Surface, decltype(SDL_DestroyWindow)*> srf(SDL_CreateWindow(...), SDL_DestroyWindow); By default it's a std::default_delete, and a pointer to SDL_DestroyWindow is not convertible to it.

Categories : C++

Casting the void pointer and printing with format specifiers
current->arr = ((char *) array)[current->first]; There should be an & here. You want to assign the address of the byte to arr rather than its value. current->arr = &((char *) array)[current->first]; If you do that then arr will contain an address like it should, which will allow the casts & dereferences to work. printf("%ld ", *(long *) c->arr); printf("%d ", *(int *) c->arr); printf("%c ", *(char *) c->arr);

Categories : C

iOS: Visual format constraints are broken
A couple of thoughts: I'd set translatesAutoresizingMaskIntoConstraints to NO. You can probably simplify your VFL, too, and eliminate the >=0 stuff. You can also set the width and height right in your VFL. You also don't need to set the frame. Let the constraints set the width, height. Unless you're doing this in loadView, I'd suggest you add the map as a subview rather than trying to set self.view. Thus: _map = [[MKMapView alloc] init]; _map.delegate = self; // if you've implemented any `MKMapViewDelegate` methods, you should set your delegate [_map setTranslatesAutoresizingMaskIntoConstraints:NO]; [self.view addSubview:_map]; NSDictionary *views = @{@"map" : _map}; [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[map]|"

Categories : IOS

'invalid for creating a default constraint' error when trying to add a constraint to an existing table
As far as I'm aware there are two possible circumstances that might cause this error. Attempting to add a default constraint to: A computed column. A column that doesn't exist at all! For the table definition CREATE TABLE dbo.Register ( ID INT IDENTITY(1, 1) NOT NULL, Computed AS 'Foo' ) Both of the following statements fail with error 1752. ALTER TABLE dbo.Register ADD CONSTRAINT C1 DEFAULT 'X' FOR Computed ALTER TABLE [dbo].[Register] ADD CONSTRAINT [Register_StartDate] DEFAULT (GETDATE()) FOR StartDate There are various other conditions on which it is not permissible to add a default constraint to a column but these all have their own unique error numbers and messages. +------------------------------------+--------------+ | Reason

Categories : SQL

FK_dbo.TimeHoursWorked_dbo.Employee_EmployeeId' is not a constraint. Could not drop constraint. See previous errors
You do actually have tables called dbo.TimeHoursWorked and dbo.Employee.. dbo stands for Database Owner, and each table that does not have an owner specified, gets assigned to dbo. A fully qualified SQL table is <databaseName>.<owner>.<tableName> You can use SELECT * FROM Employee which assumes the current database or you can use SELECT * FROM Payroll.dbo.Employee which looks in the Payroll database for a table called Employee owned by the database owner

Categories : Asp Net

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
It just simply means that the value for column country on table comments you are inserting doesn't exist on table country_type or you are not inserting value for country on table user. Bare in mind that the values of column country on table comments is dependent on the values of ID on table country_type.

Categories : Mysql

Java Constraint Annotations: Passing Parameter Value To Composite Constraint
No, but your annotation can contain other annotations, e.g. @NotNull() @NotBlank() @Constraint(validatedBy = ValidStringValidator.class) @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER}) @Retention(RUNTIME) public @interface ValidString { String message(); Class<?>[] groups() default {}; Class<? extends Payload>[] payload() default {}; Size size() default @Size(/*enter default size arguments here*/); }

Categories : Java

Using Regex string constraint instead of custom constraint in Symfony2
The error is thrown for CepValidator not for PhoneValidator. You have another file ... src/Foo/Bundle/StackBundle/Validator/Constraints/CepValidator.php ... that's missing the validate() method.

Categories : Symfony2

Is there a best practice for using instance variables with NSLayoutConstraint's Visual Format?
constraintsWIthVisualFormat takes a views dictionary but it does not HAVE to come from NSDictionaryOfVariableBindings For example: UILabel *label = self.label; NSDictionary *views = @{@"label":self.label, @"_textField":_textField}; [self.contentView addConstraints: [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[label(==_textField)][_textField(==label)]-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:views]]; I have not tested that so please let me know if I have the order or the syntax wrong so I can fix it, but the point is your dictionary can be arbitrary.

Categories : IOS

Format value of data-win-bind attribute in Visual Studio
I'm not aware of anything like that built-in. You could write an add-in to do that though without too much trouble. I wrote a "few" years back an add-in that would reformat XAML code in Visual Studio 2010 so that it would be more sensible (sorted and formatted and always put the x:Name/Id first). Also, you could also build a command-line tool you run periodically to fix up the syntax to your desired style.

Categories : HTML

Pass a pointer to a derived class pointer as a parameter to a constructor expecting a pointer to a base class pointer
Do either Derived* d = new Derived; Derived** d_ptr = &d; Manager* m = new Manager(*d_ptr); or Derived* d = new Derived; Derived** d_ptr = &d; // not needed ? Manager* m = new Manager(d);

Categories : C++

When opening a .resx file in Visual Studio 2012, gives "The operation could not be completed. Invalid pointer" error
I ran into this exact same issue and it turns out I had some invalid xml in my resx file. I had the following: <data name="UNIT_MEASURE_CUBE_S1" mimetype="ZONE"> <value>U/M for Cube</value> </data> In the above mimetype was the invalid xml. I removed this so I was left with this: <data name="UNIT_MEASURE_CUBE_S1"> <value>U/M for Cube</value> </data> The way I was able to narrow this down was to remove half of the resources within the resx file save it and try to load it in visual studio. If that worked I knew the problem was in the last 1/2 of the xml. I continued to do this until I could narrow it down to a small section of the resx file. Eventually I found my issue.

Categories : C#

Visual studio and string.format in new line parameters issue
The only thing I can think of this is as follows: public override string ToString() { return String.Format( "{0}, IsAccessible = {1}, NetworkAddress = {2}, Manufacturer = {3}," + " Model = {4}, Firmware = {5}, Driver = {6}, MacAddress = {7}," + " Scenes count = {8}", base.ToString(), IsAccessible, NetworkAddress, Manufacturer, Model, Firmware, Driver, MacAddress, Scenes.Count); }

Categories : C#

Constraint subset higher-order constraint
First note that Enum and c are not constraints by themselves: They have kind * -> Constraint, not kind Constraint. So what you want to express with Enum ⊆ c is: c a implies Enum a for all a. Step 1 (explicit witnesses) With :- from Data.Constraint, we can encode a witness of the constraint d ⊆ c at the value level: type Impl c d = forall a . c a :- d a We would like to use Impl in the definition of succSome as follows: succSome :: Impl c Enum -> Some c -> Some c succSome impl (Specimen a) = (Specimen $ succ a) \ impl But this fails with a type error, saying that GHC cannot deduce c a0 from c a. Looks like GHC chooses the very general type impl :: forall a0 . c a0 :- d a0 and then fails to deduce c a0. We would prefer the simpler type impl :: c a :- d a for the type var

Categories : Haskell

Xcode Autolayout - Constraint equal to another constraint
You can create UILayoutGuide objects (or, for iOS versions before iOS 9, UIView objects) for D1, D2, D3, and D4, e.g., spacer1, spacer2, etc., and then define their heights to be equal to each over. In Visual Format Language (VFL), the vertical constraint would look something like: @"V:|-[button1][spacer1][separator1(4)][spacer2(==spacer1)][button2][spacer3(==spacer1)][separator2(4)][spacer4(==spacer1)][button3]-|" I don't know how you're representing your separator lines (here I'm just using a 4 point tall UIView, but you can do it any way you want). But hopefully this illustrates the idea. If you were doing this in Interface Builder, you can add UIView objects in between the visible controls, and then select all of the spacer views (e.g. by shift-clicking) and then add a constraint t

Categories : Iphone

Can I format $CALLER like $FUNCTION (with full signature) in a Visual Studio "When Hit" Breakpoint?
A good way to collect this information with Visual Studio is to use the Visual Studio Profiler in 'Instrumentation mode'. For more information, refer to MSDN. You should be able to configure the profiler to collect the entire call-graph and C++ collection is supported.

Categories : Visual Studio

Format of the initialization string does not conform to specification starting at index 0 visual web developer
You must use same name in web.config and code behind to ConnectionStrings name. string ConStr = ConfigurationManager.ConnectionStrings["SRM_MetricConnectionString"].ToString(); using (SqlConnection conn = new SqlConnection(ConStr)) { // ...

Categories : Asp Net

ios autolayout visual format to set a subview the same size as parent view, but offset vertically
There are two approaches that I might suggest: Rather than making it full size and largely off screen, it can be easier to make it 65 pixels and constrained to the bottom: [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[menuview]|" options:0 metrics:nil views:views]]; self.verticalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[menuview(65)]|" options:0 metrics:nil views:views]; [self.view addConstraints:self.verticalConstraints]; That way, when you change orientation, it stays pinned to the bottom, 65 points tall. Then, when you want to animate it into place, you could: [self.view removeConstraints:self.verticalConstraints]; self.verticalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[menuview]|" options:0 metri

Categories : IOS

Crystal report .rpt file in visual studio 2012 shows binary format instead of design
I had the same problem after installing visual studio 2012 and found no answer on the forums. I uninstalled CR yesterday and downloaded again the CRForVS 13.0.5 from http://scn.sap.com/docs/DOC-7824 just in case there was a bug in the previous version I downloaded in may and installed it. Then I installed update 3 for Visual studio and everything works fine now. Cheers Michael

Categories : Visual Studio 2012

When assigning pointer to pointer I get warning: assignment makes integer from pointer
uint8_t* buffer, curr, next; The way you wrote it, buffer is a pointer and curr and next are mere uint8_ts. You probably meant: uint8_t *buffer, *curr, *next; Even better (less prone to errors) would be to have each field on its own line.

Categories : C

QLocale detects system language incorrectly on Windows with language pack installed
When I was working on Localization in Qt, I used QString locale = QLocale::system().name(); When I tested getting the locale, I found it was dependent on the Format in the Region and Language settings: Control Panel > Region and Language > Format Hope that helps.

Categories : Windows

Serving a language file depending on language preference settings
The way I'm doing it is to keep several separate language files, figure out the browser's language setting and then load the appropriate file. Here's the function I'm using (most likely not perfect, but it does what you'd expect): function loadLanguage() { "use strict"; if (window.navigator.language) { LocalLanguage = window.navigator.language; } else if (window.navigator.userLanguage) { LocalLanguage = window.navigator.userLanguage; } else { LocalLanguage = "en"; } var fileref = document.createElement('script'); fileref.setAttribute("type", "text/javascript"); switch (LocalLanguage) { case "cs-CZ": case "cs": LocalLanguage = "cs"; fileref.setAttribute("src", "Language/cz-CZ.js"); document.getElement

Categories : Javascript

How can i fix language for the grammar does not match the language of the speech recognizer error in vb
I have worked this out. You can fix this by using this code before declaring the recogniser First import this Imports System.Threading Imports System.Globalization Secondly add this Thread.CurrentThread.CurrentCulture = New CultureInfo("en-GB") 'or your current language and country' Thread.CurrentThread.CurrentUICulture = New CultureInfo("en-GB") 'or your current language and country'

Categories : Vb.Net

Get keyboard language or detect user input language in Android
No. There's a phone locale, but the keyboard may ignore it by design (many keyboards allow you to switch languages just within the keyboard for bilingual users). There's no API for the keyboard to report it has done so to the OS.

Categories : Java

Retrieve tweets language or filter by language with TwitterStream
I don't think you can rely on iso_language_code - I couldn't find reference to it in the REST or streaming APIs. Tweets do have a lang attribute which indicates the language that the Tweet was written in. This was recently added to the API and, unfortunately, Twitter4J does not yet provide you with access to it. There is a task to add it in version 3.0.4 but the work does not to appear to have started yet. Unfortunately you'll need to wait until they add it or perhaps you could give them a hand and submit a pull-request.

Categories : Java

2 menus in different language points to same menu in main language
I did the same thing in the last week. You should have something like this: Two articles in different languages, or one common article. Then you choose in menu the type (e.g. single article) and set the title of the first menu item to loginasEN, and the second to loginas. Both are child of pages menu. For each submenu you choose the article in the specific language (en/lt), or the same article (e.g in your case english) to both sub-menus of pages. This is the common procedure. And it works perfectly. Joomfish is a great help.

Categories : Joomla

Confusion on when should we use "single-pointer" and when "pointer-to-pointer" regarding datastruture
In this case, the pointer to pointer is used so that it is possible to change the pointer to the first node. You keep a pointer which points to the beginning of the list. If you add a new item, that pointer might need to change since the new item may be added at the beginning of the list. void insertAtBeginning(struct node **first_ptr,int value) { struct node *first = malloc(sizeof(struct node)); first->value = value; first->next = *first_ptr; *first_ptr = first; } void test() { struct node *first = 0; insertAtBeginning(&first,5); freeAll(first); } If you are doing something like searching through the list, there is no need to change the pointer to the first node, so there is no need to pass a pointer to pointer. But note that there are other us

Categories : C

Joining a pointer and member pointer into a function pointer
You can't create a function pointer from a member pointer and an object pointer. What you can get is a function object with the same call notation using, e.g., std::bind(): std::bind(member_func_ptr, class_ptr, _1) You can the use this function object to initialize, e.g., a std::function<void(int)>.

Categories : C++



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