Thursday, 15 March 2012

caching - FIFO cache vs LRU cache -


I'm really sorry for such a simple question. I just want to make sure that I understand the fifo cache model correctly and I hope someone will help me: The LRU cache removes the entry that was recently used if cash is full. FIFO removes the entry that compares to the other entries (?) If the cache requires an empty space (for example if 'A' - 'V' - 'F' - 'in' cache Entries are and 'A' is the oldest entry, then the cash will remove 'A' if it will need an empty space).

Am I right?

You're right.

Think of FIFA, the first car going to the tunnel will be the first to go out on the other side.

Think of LRU cache as a garage cleaning. You will throw things that you have not used for long periods of time, and keep them often used. The development of that algorithm (Improvement in simple LRU) will have to throw those items which have not been used for long periods, and if you require it is not expensive to replace them.

google apps script - How to use timeZone of calendar to set timeZone for date object -


I want to use the calendar timezone to set the time zone of the date object. I am looking for proper technology We have many bases around the country, and each has its own calendar for journal and daily activities. There are many of our scripts that post on the calendar. I want to use the calendar timezone to set the date object time zone, because users travel around different bases, and their computers can not be set to the right time zone, we want to avoid wrong timing settings.

  1. Does the script's timezone be set to UTC?

  2. This is where I am currently: Function submits UITT (e) {var app = UiApp.getActiveApplication (); Var cal = CalendarApp.getCalendarById ('CalendarID'); Var timezone = cal.getTimeZone (); Var ss = SpreadsheetApp.getActiveSpreadsheet (); Var Letter = ss.getSheetByName ('Sheet1'); Var startTime = e.parameter.startDate startTime.setHours (e.parameter.startHour, e.parameter.startmin, 0) startTime = formatTime (starttime, time zone); Logger.log (startTime) var endtime = e.parameter.endDate endTime.setHours (e.parameter.endHour, e.parameter.endMin, 0); Endtime = formatting (end time, timezone); Logger.log (endime) cal.createEvent ('timezone test', new date (starttime), new date (end time)); Ss.appendRow ([startTime, endtime]); Return app; } Function Format Time (Time, Timezone) {Return Utilities.Format (Time, (Timezone-TimeGetMonthon Offset), 'M / D / YY HH: MM'); Edit: Currently there are 3 calendars, they are not user calendars, only for individual air stations. A different calendar has been created. Air stations are each in different time zones, since the crew members have worked at these stations, they post daily activities for the calendar, and there are many u scripts that we have before the same calendar. . A flight log When an entry is posted on any calendar in any calendar, the time is only related to the timezone set on the scheme, not the time zone on the calendar. When the date or timestamp object is created, how can I use the time the calendar itself has been set up.

    What is the best practice for scripts that have been recorded for different time zones? Set the script timezone in UTC and do the conversion? What do you use to get a user's timezone or in this case, I do not care what the user's time zone is also set, I need to use the timezone of the calendar.

    Date, datestring, scriptTimeZone, sessionTz; Var testMonth = "march", testDayOfMnth = "26", testYr = "2016", hour = "10:00", time ZoneDiff = 0; Logger.log ("script time zone:" + session .getScriptTimeZone ()); DateString = testMonth + "+ testDayOfMnth +", "+ testYr; Logger.log (" datestrings: "+ datrustring); date = new date (date string); calories = CalendarApp.getDefaultCalendar (); CalTimeZone = cal.getTimeZone ( ); CalTimJon = Utilities Format (Date, CalTimejone, 'Z'); ScriptTimeGen = Utilities Format (Date, Session, Gate Time Zone (), 'Z'); Calgary = Number (CalTimezone, Salis (0,3) ); SessionTz = Number (ScriptTimJon.Solis (0,3)); // If both time zones are equal signs, then two / two Find the difference between 4 and -2 is the difference 2 / / If each time zone is a different mark, then add absolute values ​​together. - should be between -4 and +1 5 (CALTUS & lt; 0 & amp; ; Amp; amp; amp; amp; semester;> 0; celts & gt; 0 & amp; amp; amp; session; session & lt; 0) {timeZoneDiff = Math.abs (Math.Calitz) + Math. BAS (session tees);} other {timeZoneDiff = Math.abs (mathematics.babs (calculats) - Math.Seb (session)); hour = number (hour slice (0,2)); return time + TimezoneDiff;};

    excel - How to convert a list of cell references to cells in other worksheets into hyperlinks -


    I have an abstract worksheet that contains references to other worksheets within a single workbook. These references are simple form (i.e. = Sheet2! D23). I want to convert them to hyperlinks I want hyperlinks to display the value of the referenced cells.

    I can do this personally but the spreadsheet is large and these are hundreds of references.

    Can someone suggest an easy way for batch to convert these references to hyperlinks?

    If you want to link, then run this macro.
    It will only link the values ​​located on a separate sheet, it will not link to the cells present on the current sheet. If you want to link all the cells, even if the value comes from a single sheet, then only replace if..End if wrapcode around rng.Hyperlinks.Add rng (Rng) formula, "=", "") .

      Sub-makeLinks () Select RNG for RNG as the Range for each RNG in the selection. If rng.Formula "= *! *" Then RGG Hyperlink.Add RNG, "", Change (RNG. Formula, "=", "") End if the next RNG and sub    

    Jquery Get longdesc Prop -


    I need to get longdesk from an image.

    I have tried: <> $ (this) .prop ('longdesc') ex;

    But it undefines.

    Just one answer for:

    attr () instead of prop ()

    node.js - Scanning Mongo databases with Javascript and setting off events when strings are not identical -


    I am trying to work on a JavaScript algorithm so that through my Mongo DBB the loop has two identical urls Can be searched, and header objects

    Below is a snippet of an example of this object:

      {"url": "www.professionalsupplementcenter.com", "Date": "Mars March 26 2013 15 : 08: 31 GMT-400 (EDT) "," Header ": {" Server ":" Microsoft IIS / 7.5 "," X-ASPnet-version ":" 4.0.3031 9 "," X Specifically, my There are two collections of "SAP.Net")}   

    In addition to two collections, there are two databases in the MongodiBi of HTTP Header scraps, let's call them today's scraps And two silence forms Call me on . Through these two collections, I want to compare their header items, therefore, server , x-aspnet-version , And x-powered-by and see if there are any upgrades in these numbers, eg IIS / 7.5 to IIS / 8.0 (in future ).

    I do not have any code to display, because I do not know how to implement this system at all I do not know Where is the beginning, I want to compare the first two URLs, then when the program recognizes that both the URLs are present then it will make a specific comparison of the three header objects. This can then be reported when some of these attributes are set in order by scanning them and some event such as console.log ("a change has been made") is set. Are not the same.

    Can someone give me some suggestions from where? I have been stuck on this issue for some days and have been stunned, disappointing. I would really like to start implementing it, but I need some help.

    Firstly you need install npm mongodb (if you have Not already) Then in your app.js file:

      var mongodb = is required ('mongodb'); Var Server = Mongodb Sir's ('127.0.0.1', 27017, {}); New Mongodb DB ('ScrapperAp', Server, {W}: Open (function (mistake, dB) {var scrap = New Mongodb compilation (db, 'scrap') var scrap futures = new mangaodb.selection db, 'Scrapefuture'); Scrape.find ({url: {$ exists: true}}). ToArray (function (err, today_docs) {if (today_docs) return; var scrapeFn = function (i) {var today_doc = Today_docs [i]; scrapeFuture.findOne ({url: today_doc.url}, function (mistake, future_doc) { If (! Future_doc) returns; if (today_doc.adders.server! Future_doc.headers.server) console.log (Today_doc.url + ': server isolated'); if (today_doc.holder ['X-ASPnet-version'] ! = Future_doc.eards ['x-espanet-version']) console.log (today_doc.rest + ': X-aspnet-versions different'); if (today_doc.advertisers ['x-power-by']! = Future_doc.headers ['x-powered-by']) console.log (today_doc.url + ': x-supported by different'); if (today_desk [i + 1]) Rapfn (i + 1);});} Skrepfn (0);});});    

    sql server - How do I add columns to a view? -


    Is there a way to add a new column and update them in the view?

    Columns are not in a table; I want to select some columns from a table, then add some new columns and update them.

    I tried ALTER VIEW to add columns, but he gave me an error:

    Change to 'viewName'

    See the documentation.

    You can not add columns for a new view, you can just include the full query in your view.

    For exmaple, if I was:

      View MyView as User ID, Users Username   

    And then wanted to add DateCreated to my selection list, I will write:

      ALTER VIEW MyView as UserID, UserName, Date dated by users   

    Alternatively, you can simply see DROP and create it with the new column as well.

    objective c - osx switch between two nsviews -


    I want to switch between two NSView controls by pressing the button. Basically, I have a .xib file that has NSWindow control, in the window there are two subviews and some buttons I have dragged the item into the NSViewController list and another There are references to NSView in xib NSViewController from NSWindow and see that the xib file is floating in.

    The question is, how do I press the NSWindow button between nsview1 and nsview2? Is this the right way to do it?

    sketch

    Define an NSView outlet for placeholders where there is property to use in the context of the use of current view controller along with swappable view.

      @ Property (assign) IBotlate NSVU * Main Viv; @ Property (strong) NSViewController * currentViewController;   

    I use a common method for visual swapping (using autolay to see full placeholder view)

      - (zero) SetMainViewTo: Remove (NSViewController *) controller {// Existing subviews ([[self.mainView subviews]] gt; & gt; {[self.mainView.subviews [0] deletedFrosporiviv];} NSView * view = [controller view]; [View set transclusions atorizingismask intactstationes: no]; [Manuewe ed sbewview: view]; ns Dictionary * viewDictionary = NSDictionaryOfVariableBindings (view); [Add the self-add menuSeventions: [NSLUT Constant Handicap Specially: @ "V: | [View] |" Option: 0 Metric: Zero View: viewsDictionary]]; [Add Self.mainView Adjustment: [NSLoot Constant Handicap Specially: @ "H: | [View] |" Option: 0 Metric: Zero View: ViewsDictionary]]; Self.currentViewController = Controller;}   

    IBOutlets are defined to immediately and swap the view controller Can

      - (IBAction) showView1: (id) sender {View1Controller * controller = [[View1Controller alloc] init]; [Self setmanView: controller]; } - (IBAction) showView2: (ID) sender {View2Controller * controller = [[View2Controller alloc] init]; [Self setmanView: controller]; }    

    unix - Visual Studio 2012: run executable (or addon) on save -


    So I have started using Visual Studio 2012 as a new programmer, and I'm going to do this one The way to get the VS 2012 automatically (or at least automatically convert) files save in the Unix line end.

    I was found as a means of making executables that can be integrated with VS2010 as a macro. Since VS2012 no longer uses macros, how can I set it so that it can be executed on my files when saving? I do not want to save every file every time I want to save (I save every 30 seconds or out of the deformity).

    I started trying to make a pair for this to handle it, but as a start I am afraid that it is a little bit of me.

    Thanks in advance for help.

    You can do this,

    file Click Save, select Save , then save the file, select to prevent encoding, select , another dialog appears, you can choose the Unix format Are there.

    javascript - Targeting an ID that is rendered by a script -


    I am using a nifty short script called tabfire ()

    Now, long Less story, this script, which I play in my head tag, and and ; & Gt; s with & lt; Ul & gt; In addition, in the head tag, it is in these & lt; A & gt; s creates an ID when I inspect the loaded site, then I can clearly see the ID tag. However, I can not call them using getElementById. I

      & lt; Script & gt; I am using Document.getElementById ('rightpanelnav1') = '200px' style.padding & Lt; / Script & gt;   

    In the different parts of my code as a sample script, but no benefit. I am thinking of weather that this is a placement or order in which these things are defined in my code which is not being identified by ID. What do you think?

    EDIT: I received a great reply below, but I still can not find 'rightpanelnav1' to register on-club events ...? This is one, there should be no problem, is not it? And when I click it, the whole page has been loaded for several seconds ...

    < P> First, in order to use an element in the DOM, the element must be a part of the DOM ( document ). So if you put your code <; Script & gt; With the getElementById in the place where the element is loaded, it will not see the element in the DOM.

    Secondly, it is highly likely that this library will be used by you, its amendment on page load will mean, that would mean that you have your & lt; Script & gt; It does not matter at the place of , look at these elements before walking.

    As a result, you should also wait for your script, and do this:

      window.onload = function {document .getElementById ('rightpanelnav1') = ' 200px 'style.padding. };   

    or for click event

      window.onload = function () {document.getElementById ('rightpanelnav1'). Onclick = function () {alert ("clicked!"); }; };    

    multithreading - How are threads implemented in Windows 7? -


    Microsoft introduced that Windows 7 has improved the threading subsystem that started the Hybrid (N: M User-Space / Kernel Space Thread Mapping). <<

    / p>

    Does anyone know the characteristics of threading implementation though there are many content (and clearly open source for Linux NPTL implementation) and some information on the implementation of Mac OS thread , I did not get any information on the Windows 7 Threading implementation features.

  3. Thread queue policies
  4. Thread data structure
  5. Thread local storage Implementation
  6. Memory Allocation and Delocution
  7. ... I forgot to mention attributes related to other threading

    Any rendering would be appreciated About information and / or links made

    Nothing was changed in Windows 7, only a slight improvement "thread mapping" (alias) In the thread connection) the scheduler improves those obstacles, which is determined by a thread on a special core and does not jump from one core to the other. It's good for power consumption, reducing cache threshing and supporting Intel Neelam and AMD Phenom II, architecture which supports low-power states per-core. No software idea applies, I can think anyway.

c++ - STL priority queue and overloading with pointers -


This is my first time using the priority queue. I am trying to implement Djextra's algorithm for school and I felt that I needed a minimum pile to do this. Right now my nodes are pointers and I want to compare their weight, but I do not think I have overloaded & gt; And & lt; With indicators? Is there any way I can accomplish this?

Remove this code:

  priority_key < Node *, vector and lieutenant; Node *>, node_comparion & gt; MinHeap;   

And then I have a structure to compare the weight of the node

  struct node_comparison {bool operator & lt; (Const node * a, const node * b) const {returns a-> Kulwait & lt; B & gt; TotalWeight; }};   

Although it says that there are too many parameters for this operator function. I was trying to explain how I could manage a minimum heap preference queue with my nodes for a while and was stuck. Any ideas?

If I understand your question correctly, then I believe what you really want node_commerce A Factor (more specifically, a binary pocket):

  struct node_comparison {bool operator (cn node * a, cant node * b) CONST {Return to A-> Kulweit & lt; B & gt; TotalWeight; }}; A fun physician is a class whose object provides the surcharge of the call operator ( operator) ), and therefore, can be implemented with the same syntax to apply a function: < / P> 
  node * p1 = ...; Node * p2 = ...; Node_compression vibrate; Bool res = comp (p1, p2) // & lt; == Adds your overload off operator ()   

internally, std :: priority_queue Your interpretation is more or less like I snippet the code above, And implemented that method to compare between its elements.


The advantage of the fonts on regular tasks is that they position information (some you probably will not need for the moment, but which are often desirable):

  #include & lt; Cmath & gt; Struct my_comparator {my_comparator (int x): _x (x) {} bool operator () (int n, int m) const {return abs (n - _x) & lt; Stomach (m - _x); } Int _x; };   

The above-mentioned determination, for example, compares to the integer how far they are from the second integer given at construction time. How can this be done:

  #include & lt; Queue & gt; # Include & lt; Iostream & gt; Void foo (int pivot) {my_comparator mc (smoke); Std :: priority_queue & lt; Int, std :: deque & lt; Int>, my_comparator & gt; Pq (mc); Pq.push (9); Pq.push (2); Pq.push (17); While (! Pq.empty ()) {std :: cout & lt; & Lt; Pq.top (); Pq.pop (); }} Int main () {foo (7); Std :: cout & lt; & Lt; Std :: endl; Foo (10); }    

java - in VisualVM/OQL how can I get the total size of all instances of objects from a certain package -


I am using VisualVm for a web application profile running in Tomcat. Tomcat is crashing out of memory errors, so I am trying to figure out what this is in my application. When I run MemoryViewer from VisualVm, it seems that the majority of the memory is raised by string / four [], but as long as I can not understand the high level containers of those stars which makes me a little less good In the research I have found Ocul and rsizeof () , so I can do my.package.class o for example SELECT rsizeof (o) for example but not me Know the class I want, so I really I would like to do something like SELECT it.name, rsizeof (o) filter for example (heap.classes), "/my.package./(it.name)"); Instead it does not work.

So what will happen to the OQL? Ideally, I would like to limit to the top 10 or so big, and I would like to be sorted by size.

I'm not sure I fully understand but ... < P> OQL uses a Javascript based expression language, so that you can use the following statement, it will find all the items that are inside java.util. I Regex package (recursively) The sum of the size, it will return a single number:

  sum (filters (heap.objects), "/^java.util Regex./ (slassof (it) .name)"), 'Rsizeof (it)')   

It will take only one time, I only have small piles Tested on the same. Think ^ at the beginning of the package name.

arrays - php get youtube user subscription channel videos -


How can I use PHP to get YouTube user membership channel videos and display all channel feeds? I want to create a square or a function where I pass a username, php class will retrieve the latest uploads / activities in the channels subscribed to the user and will display the URL and the title and image, I also have the title and URL un I want to be able to pass in these tasks so that I can save it to the database on any other page I found it, but only for a specific channel

Relevant requests are in the YouTube GDITA API v2 or the new YouTube Data API v3.

Newsblication can not possibly be supported (I do not mention it in), so if you go that route, then you might have to alt = jsonc to bring back an easy-to-parse JSON feed of data E.g.

Option <3> is to use V3 to call. Activities.list () .

ios - Json Accelerator and AFNetworking -


After

When the operation is in progress, I can not access the data created by the JSON model ACCELERATOR. Can you tell me what I am doing?

  {[super viewDidLoad]; NSLog (@ "You are in a Table View Controller"); Self.title = @ "Navigationordini"; NSURLRequest * Request = [NSURLRequest requestWithURL: [NSURL URLWithString: @ "http://www.stampa6x3.com/json.php?azione=ordini"]]; AFJSONRequestOperation * Operations; Operation = [AFJSONRequestOperation JSONRequestOperationWithRequest: Request Success: ^ (NSURLRequest * Request, NSURLResponse * Feedback, ID JSON) [[[ordiniModel alloc] initWithDictionary: JSON]; } Failure: ^ (NSURLRequest * request, NSURLResponse * response, NSError * error, ID JSON) {[self setTitle: @ "dictionary"]; NSLog (@ "Failed!% D", [Error Code]); }]; [Start operation]; OrdiniModel * testing; NSLog (@ "el vulor è% @", test.ordini.description); } Text after " 

AFJSONRequestOperation is asynchronous, which means that while the rest of the code is executed Continues for the app runs the complete block is complete when the code actually completes.

Then try:

  NSLog (@ "You are in a Table View Controller"); Self.title = @ "Navigationordini"; Audienymold * Examination; // & lt; - Create variables here NSURLRequest * Request = [NSURLRequest requestWithURL: [NSURL URLWithString: @ "http://www.stampa6x3.com/json.php?azione=ordini"]]; AFJSONRequestOperation * Operations; Operation = [AFJSONRequestOperation JSONRequestOperationWithRequest: Request success: ^ (NSURLRequest * request, NSURLResponse * response, ID JSON) {test = [[ordiniModel alloc] initWithDictionary: JSON]; // & lt; - Assign NSLog (@ "IL Velor è% @", test.ordini.description); } Failure: ^ (NSURLRequest * request, NSURLResponse * response, NSError * error, ID JSON) {[self setTitle: @ "dictionary"]; NSLog (@ "Failed!% D", [Error Code]); }]; [Start operation];    

python - Django STATIC_FILE doesn't work as i thought? -


I have searched the answer to this question, but I have found a solution for my problem. Want to link, but still STATIC_URL

  & lt; Head & gt; Load steady% from {Staticfiles%} & lt; Link rel = "stylesheet" type = "text / css" href = "{% static" css / style.css "%}" & gt; & Lt; / Head & gt;   

This is a lot of code for posting here, so here are the links: settings.py:

and I with context_instance = RequestContext (request) Introducing the code> course parameter. I found this type of file:

  Django_project ... AppName Templates Fixed   

I tried to install a stable directory in the application too in many projects And even in templates too Can anyone explain to me how to see my project?

Biltin use constant , static To staticfiles no:

    

DJZo ships with a static template tag. Whether or not using RequestContext

Note

Staticfiles contrib app also ships with a static template tag StaticFiles uses the ' STATICFILES_STORAGE to create a path URL If you have an advanced usage case, such as using the cloud service to run static files ... < / Em>

c# - PushStreamContent sends results back in chunks? -


I am using a new pushstream content unit in MVC4 so that multiple listeners from my web server can stream notifications to iOS customers . NSURLConnection). The messages being sent are JSON. When I send messages less than 1024 bytes, the message sends as expected, a larger message is being sent from this size, but the client causes the message to be received in several segments, each is 1024 bytes.

I wonder what is the best way to get all these messages back for my iOS customers? Is NSURLConnection the only way of results for me, or if I need to implement something that results, if it is a valid json, do not wait for the next result and add the last, and continue till Till it is not valid? What is a better way to do this?

I've found that you are able to adjust the size of the buffer that writes the data to the stream PushStream uses content, however, tricking the figures is the right thing and there are many advantages to keeping this small. To finish collecting data flowing on the client side, I ended up typing my method. For more details, see the following questions:



Use Block in Objective C to find out if a BOOL has been set? -


I'm new to OBJ-C. I have a class that sets a var boolean for YOS if it Successful (Game Center Login = Successful), so what would be good to do this, in any way, there is a listener for the listener who hears when it is yes and then executes some code for what I do Use a block? I am also using Sparrow Framework

My code in my GameCenter.m file

  - (zero) setup {gameCenterAuthenticationComplete = NO; If (! IsGameCenterAPIAvailable ()) // // Game Center is not available NSLog (@ "Game Center is not available."); } And {nslog (@ "game center is available."); __Week type (self) weak Self = self; // Maintaining cycle error GKLocalPlayer * localPlayer = [GKLocalPlayer localPlayer]; // localPlayer public GKLocalPlayer __weak GKLocalPlayer * Vulnerable Player = Local Player; / Maintaining cycle error deletes weak player AuthenthenticateHandler = ^ (UIViewController * viewController, NSError * error) {if (viewController! = Null) {[weakSelf showAuthenticationDialogWhenReasonable: viewController]; } And if (weak player. Authentic) {[weak self certified player: weak player]; } And {{Weak gameman disabled]; }}; }} - (void) showAuthenticationDialogWhen appropriate: (UIViewController *) controller {[[UIApplication shared application] delegate] window] root view controller] PresentViewController: controller animated: Yes Full minus]; } - (void) certified player (Jikelokelpleyr *) Player {Anselog (@ "% @% @% @" player. Pleyraidi player. DisplayName, Kiladhiklias); GameCenterAuthenticationComplete = Yes; } - (zero) disableGameCenter {}   

But I should know from a different object that if that game center entrepreneurship is low then yes.

You can use a representative pattern, it is easy to use from KVO or local information and its There is a lot to use in Objec-C.

Information should be used only under specific circumstances (like when you do not know who wants to listen or when more than 1 listeners).

One block will work here but the representative actually does the same.

Working Form Validation with Jquery -


I try to roll my own form validation using a visible checkmark or next to the form field with X I am doing One problem was whether I was at fault or not, after generating this keyboard, it would generate a new span. So I tried to remove all the elements after each key so that I could find a period with success or error message. It currently works, but I was thinking that there is a better way to do this:

  jQuery ('input # firstname'). Keyup (function () {var text = jQuery (this) .val (); if (check_text) === incorrect || text === '') {$ (this) .nextAll (). ); JQuery (this). After ('& lt; span class = "form-error"> error ;);} and {$ (this) .nextAll (). ); JQuery (this) .after ('& lt; span class = "form-success" & gt; success & lt; / span & gt;';)}}); / * Function * / function check_text (text) {var regex = / ^ [a-zA-Z0-9-] * $ /; Return regex.test (text); }   

Task example:

I suggest you to add I give each input

   & Lt; Span class = 'msg' & gt; & Lt; / Span & gt; & Lt; Br> & Lt; Input ID = "Last name" /> gt; & Lt; Span class = 'msg' & gt; & Lt; / Span & gt;   

And in this way your script set message:

  if (check_text (text) === false || text === '') { JQuery (this) .next (".mssg") Html ('& lt; span class = "form-error"> Error ;); } Other {jQuery (this) .next (".mssg"). Html ('& lt; span class = "form-success" & gt; success & lt; / span & gt;'); }   



Upload xml files in a folder to Mysql using Php using glob and array -


I have many XML files in a folder on my webserver

  • in the folder < Li> Get the XML file name
  • Enter the filenames in the array
  • Loop those names
     $ files = glob ('* .xml ') contains the contents of all XML files included  
  • files in the form of foreign currency ($ file $) {mysql_query ("load data INFILE". $ File. '' '' In the table);}

    In I have spent a few days looking for an example or tutorial but nothing can be found online.

    Above all I can come to the top.

    Any help appreciated :)

    There is nothing wrong with your code but to do so; < P> 1 - The XML files must be located in the MySQL Data folder. Otherwise, you can not use the load data.

    2 - PHP Script requires that the root The user may have to start with the MySQL server. Otherwise, scripts will not be able to access and process files.

    If you are trying to do this on shared hosting, then I can say that you can not do this due to many restrictions.

  • heroku - What is the best way to drop a table & remove a model in Rails 3? -


    I have a model & amp; A table which is no longer needed in my app, I can leave them there but I would like to remove them to keep them clean.

    I'm trying to figure out the best way to get them out of my migration & amp; DB / Schema RB files & amp; This can be any side effects in my production environment, my app is on Heroka, I am using PostgreSQL on my local machine and on both;

    So far, I have found two ways to do this, but I am not sure who is the best way?

    Method 1

    I thought about going to my database; Leaving the table & amp; Then destroyed the model.

      Rail DB drop table table_name \ q Removing rail model model_name   

    If I do this then what will happen to me for migration? Table? I have two migration for this model, a timestamp_create_model name & amp; An add_attribute_to_table name

    Will this method be updated in the DB / SchemaRb file?

    When I put the app in Harkaku, I suspect that the model will be removed, but the table will remain in place, there is a command to leave the table.

    Method Two

    In another way I have read that to leave the table was to create a new migration & amp; Then destroy the model.

      Rail Migration drop_base name   

    & amp; Then update the file below:

    db / migrate / timestamp_drop_tablename (reply to Dan Witch's reply has been updated in response)

      class DropTablename & Lt; ActiveRecord :: Migration def up drop_table: tablename end def to create_table: tablename do | T | T.string: table_column t.references: other tables t.timestamps end add_index: tablenames, anothertable_id end and   

    & amp; Then in the terminal:

      rake db: delete the migrated rail model model ram db: migrate git add git commit -m "deleted table / model_name" git has its Koku master Heroku run rake db Pushed: migrate to restart   

    This is the best way, but what happens to old migration files? Will they stay & amp; Update DB / SHAMA Every time I run Rake DB: is to migrate only to DB / migrate / timestamp_drop_tablename override?

    I am happy to experiment with the second method, but someone should experience with someone in & amp; Tell me the railway route to do this

    The other way is the ideal way to handle: Your migration files Your database has to be changed over time The old migration file will be in your project (if you want to roll back to an earlier version, you hypothetically), but when you rake db: migrate will not run because the railways know Received that they are already running the same (based on data Skima_magreshn table of the database) is.

    Your schema. RB will be updated only once that your database is no longer in that table.

    One minor changes to your code: Your migration file should leave the table in the above method, and recreate it in the down method. The "above" indicates that your migration leaves the table to advance in time, and if the migration is brought back, then the down method will run.

    How to duplicate all inner columns of a matrix and sum pairs of columns in Matlab -


    मान लीजिए मेरे मैट्रिक्स

      1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5   

    मैं आंतरिक स्तंभों का डुप्लिकेट कैसे करूं > एक एक नया मैट्रिक्स प्राप्त करने के लिए B

      1 2 2 3 3 4 4 5 1 2 2 3 3 4 4 5 1 2 2 3 3 4 4 5 1 2 2 3 3 4 4 5 1 2 2 3 3 4 4 5   

    <कोड> ए का पहला और अंतिम कॉलम अकेला छोड़ दिया गया था। फिर मुझे एक और मैट्रिक्स सी :

      3 5 7 9 3 5 7 9 3 5 7 9 3 5 7 9 5 प्राप्त करने के लिए एक साथ पंक्तियों की जोड़ी जोड़नी होगी मेरे मैट्रिक्स का आकार हमेशा  5x5  नहीं होगा और तत्व हमेशा इतने अच्छे नहीं होंगे, लेकिन मैट्रिक्स हमेशा वर्ग बनें।   
  • मैं नहीं को उत्पन्न या मैट्रिक्स आउटपुट B की आवश्यकता है। यह सिर्फ इतना था कि मैं कैसे शुरू में अपने अंतिम मैट्रिक्स C प्राप्त करने के बारे में सोचा था।

  • मेरा लक्ष्य काफी कुशल होना है, इसलिए मैं यह बिना a लूप को पूरा करना चाहूंगा। < / Ol>

    मैं मनमाना मैट्रिक्स आकार nxn के लिए यह कैसे पूरा कर सकता हूँ?

    बहुत सरल ।

      सी = ए (:, 2: अंत) + ए (:, 1: अंत -1)    

  • php - how to sort SQL result in an existing sorting function -


    Hello, I have a template of this sorting function CMS. I would like to add if the situation is second:

      if (is_array ($ array)) {foreach ($ line as line $) {if ($ row [photos] == 1) { If ($ isMobile) {included ($ basepath. '/ Templates / mobile.content_item_photo.php'); } Other {include ($ basepath. '/ Template / template.content_item_photo.php'); }   

    I want to add the following MySQL result to show also

      $ result = mysql_query ("select niches.name, niches.record_num" from niches ASC name by ORDER ");   

    which is used for sorting this template:

     Include  ($ basepath. '/ Templates / template.channel_item_title.php') ;   

    Any idea how the first code function can be integrated inside?

    Here is the code of the main index template:

         

    I do not think I am getting your question, but we have to start somewhere else. ($ Line [photo] == 1) {if ($ isMobile is)

        

    Next block of code:

      & lt ;? Php $ result = mysql_query ("select niches.name, niches .record_num by name niches ORDER ASC"); If (is_array (result)) {foreach ($ result as $ line) {if ($ row [photos] == 1) {if ($ isMobile) {include ($ basepath. '/ Templates / mobile.content_item_photo Php '); } Other {include ($ basepath. '/ Templates / template.channel_itm_title.fp'); }    

    c# - Attached Property collection inside a Panel -


    When I try to add property collection attached to a panel;

      & lt; Grid X: Name = "Main Content" grid. Line = "1" & gt; & Lt; StackPanel x: name = "main content sp" & gt; & Lt; Is: AttachCollection.Col> & Lt; Do: Attachit x = "y" /> & Lt; Do: attachite x = "z" /> & Lt; / Work: AttachCollection.Col> & Lt; TextBlock x: name = "tb1" text = "xx" /> & Lt; TextBox x: name = "TB2" text = "or" /> & lt; / StackPanel & gt; & Lt; / Grid & gt;   

    This is specifying the grid instead ... How can I attach it to a panel?

    It has been found that the associated property was sharing a list example with each UI element, So I had to use a laugh way instead of giving each element its list frequency. > First stable

      Dependency Property Exprotity = Dependency Property for public static reading. Registration Attached ("X", Typef (List & lt; X & gt;), Typef (X), New Property Matadata (New List & lt; X & gt; ());   

    after

      public static read-only DependencyProperty XProperty = DependencyProperty .RegisterAttached -> ("XInternal", type (list & lt; X & gt;), typef (x)); - & gt; (Deleted)   

    is now creating a new list example for each UI element with the recipient:

      public static list & lt; X & gt; GetX (UIElement element) {var list = ((list & lt; X & gt;) (element.GetValue (XProperty)); If (list == null) {list = new list  () ; Setx (element, list);} return list;}    

    mysql - Is it always a terrible idea to store semantic data in IDs? -


    Here are some (incomplete) database tables that store information about hotel rooms, the information that they store Is similar, but their design is different:

    1. Information about store flows in a separate column:

        | ID | Floor | ---- | ------- | 1 | 1 | 2 | 1 | 3 | 2 | 4 | 2    
    2. Store flow information in ID.

        | ID | ----- | 101 | 102 | 201 | 202         To correct this ?   

      If you want to use a natural key, use a natural key to use a natural key Do not name id .

      If you use synthetic keys, consider it as an arbitrary value that should be unique, but it has no other meaning.

    scrum - Does the TFS Web Access task board display only the top 20 work items? -


    Using TFS 2012 Web Access to run Sprint using MSF Scrum 2.1, I think the Work Board It is difficult to use. In Web Access, Navigate Work | Backlog | Product Backlog | Board, it is only the top 20 PBI & amp; All PBIs & amp; Worms in all areas outside of a query of bugs & amp; Iterations A complete list of these PBI and worm is visible on the WORK. Product Backlog | Backlog items, but only top 20 in the work board

    No way to allow more than 20 work board items or to configure each group of 20 to appear on the page or to display the top 20 from any other query is? On further investigation, it only marks 20 items as new, while all approved and committed tickets are provided.

    android SharedPreferences or sqllite -


    If I want to save large apps like RSS feeds or topics in my app

    To use Sqlllite or sharePreferences

    Share information as SharePreferences shared information? Like any other app you can use?

    In this case you have the SQLite option, which is a large amount of data , While shared preferences were designed to store the key in relatively small amounts in a size pair of pairs.

    No more name is a bit confused but it means that those preferences are shared with all your app activities and not for other applications.

    windows - Auto-run Reg Key for the PS Terminal -


    सभी शाम,

    त्वरित एक, उम्मीद है ...

    इन- CMD.exe के संबंध में HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Command प्रोसेसर पर एक विन कुंजी है जहां अनुप्रयोग को लॉन्च करने के दौरान / v autorun और कमांड चलाना होगा ...

    अच्छी तरह से PowerShell टर्मिनल के लिए क्या है?

    धन्यवाद

    एक भी नहीं है । Powershell.exe autorun कार्यक्षमता प्रदान नहीं करता है जैसे cmd.exe करता है।

    android - Measure Bluetooth Signal Strengths (RSSI) in Real Time -


    I want to be able to walk around a room with an Android device in my hand, click a button 1 and then start exploring the Bluetooth device around me and get your RSSI value. I then want to save this information as a text file. Then repeat for a different room.

    This is a simple part.

    The part I am having trouble with is to know that (or, if possible) to do this, strong> a timer set so that the discovery process must end itself Do not, but by the time I do not pay, I can start it and stop the search again and again ... Most of the values ​​are usually around 5 seconds or more, which is what I am trying to do at this time, I am very happy. I got the question but there is no answer.

    This will be a simple example to make it a little clearer:

    • Press the "Room1" button
    • Start Discovery
    • After 5 seconds, start discovery and start over again
    • Do this for more time ...
    • Press the "Pause" button

      Does anyone know that this is possible? And if so, what would be the best way? I have looked at Timer and Timersk, and they look useful.

      Before I started it very deeply before asking something as I did before, :

      Thanks

      You can use something like this: < / P>

        Private Zero Start () {mBluetoothAdapter.startDiscovery (); Handler handler = new handler (); Handler Post Delayed (New Runable) {@Override Public Zero () (if (mBluetoothAdapter.isDiscovering ()) MBluetoothAdapter.cancelDiscovery (); if (repeat) start ();}}, 5000);}   

      Repeat a variable that is set to false by the stop button. Repeats the set and the call begins ().

      As far as I know that Bluetooth discovery runs indefinitely, you do not have to stop it and restart it.

    elasticsearch - How to exclude a filter from a facet? -


    I came from a solar background and am trying to find the equivalent of Elslasschurch.

    The following example, how can I exclude value filter from the calculation of values ​​ facet? In other words, all filters except value aspect should be kept in mind except value . {"Match_all": {}}, "filter": {"and": [{"word": {"color": "red" } "," "": {"Feature": "square"}}, {"word": {"feature": "shiny"}}, {"category": {"value": {"with": "" "{" Word ": {" word ": {" field ": {" field ":" color "}}," attributes ": {" terms ": {" field "" Value ": {" statistical ": {" field ":" value "}}}}

    You can apply a price filter to your query as a top level filter and add it to all aspects such as And "facet_filter":

      {query: {"filtered": {{"Match_all": {} match_all: {}}, "filter": {"and": [{"word": {"Word": {"feature": "bright"}}}}}}, "facet": {"color": "red"}}, {"term": {"feature": "square"}}, {"word" : {"Color": {"field": "color"}, "facet_filter": {"category": {"value": {"to": "10", "to": "20"}}}} , "To": "20" "" {"" ":" to "," to "," to "," to "," attribute ": {" field ":" feature "}," facet_filter ": {" category ": {" value " Field ":" value "}}}," filter ": {" category ": {" value ": {" with ":" 10 "," ":" 20 "}}}}    

    java - Using spring-configuration without creating a spring dependency for your clients -


    If I use spring configuration to make an object, will it be for me to import this object to customers Is it possible to institute my spring configuration without the need?

    If this can not be done, then does a client always need to use spring to use any client who uses Spring?

    If this can be done, then what is the right way to do it? Something like this ...

    Library Code:

      Public MyFactor () {@Autowired InitializedObject obj public getInstance () {obj; }}   

    Customer Code: Import com.code.package.something.myfactory.MyFactory; ... initial object obj = MyFactory.getInstance ();

    One option is to completely avoid spring annotations, Working with Constructor or Setter-based injection In this way, your classes become independent of the Spring Code and your customer can use your code as long as it provides dependency using the factory or whatever.

    c - When to free node in linked list -


    When I am inputting data in curr-> data , I first assign the memory crru = (noed *) molk (size of node); . Then I'm making the list and eventually finally print it, in a program, I have to free the memory that I have used, but I do not know when to do it. After the list is created, or after printing the list? Or can I do this?

      printf ("How many elements do you want to create?"); Scanf ("% d", and NumElem); Head = null; For (i = 0; i   

    Can I insert data inside the current node?

    Assume that you are reserving a local living room where you are planning a meeting And then when a party will release your reservation ... immediately after the reservation, after the meeting, but before the party, or after both the meeting and the party? > malloc and open are similar ... malloc reserves an area of ​​memory for your use and Free Reservations Reservation If you continue to use memory after canceling the reservation, then the behavior is undefined.

    In your case, you need to free your entire list of nodes. You can do this in a loop, but there is a common trap: release a node before reaching your next indicator. The danger is that it almost always works in practice, but it is undefined and sometimes it will not work ... possibly some software control life-important machinery to learn best to control it right now To:

      zero free_list (NODE * list) {while (list) {NODE * next = list-> next; Free (list); List = next; }}   

    Or in a slightly more compact form,

      zero free_list (NODE * list) {for (NODE * next; list; list = next) {Next = list-> next; Free (list); }}   

    If your node has pointers for strings or other objects, which were malloc and they need to be free, free calls to Free_list will be done before auto-node free.

    parsing - email parser or php imap functions? -


    I am a very reliable way to recover data from email titles. Should I use an e-mail parser like, for example, or the php imap function is enough? What is the best practice? Have any experience? I can imagine that there is a lot of difference in the formatting of email headers created by many email clients, this is why I want a reliable solution.

    I used the built-in IMAP functions for the project processing emails by their dates and actually There was no need for anything else you could try and see if they are useful to you with the code given below;

      & lt ;? Connect to Php / * gmail / / hostname = '{imap.gmail.com: 993 / imap / ssl} inbox'; $ Username = 'user@gmail.com'; $ Password = 'pass123'; / * Try connecting * / $ inbox = imap_open ($ hostname, $ user name, $ password, OP_READONLY, 1) or die ('Can not connect to Gmail:'. Print_r (imap_last_error ())) ; $ Email = imap_search ($ inbox, 'ALL'); / * If emails are returned, cycles through each ... * / if ($ email) {foreach (Email $ email_number as email) {echo imap_fetchbody ($ inbox, $ email_number, 0); Echo imap_fetchbody ($ inbox, $ email_number, 1); Echo imap_fetchbody ($ inbox, $ email_number, 2); }} Imap_close ($ inbox); ? & Gt;   

    The hard part imap_fetchbody ($ inbox, $ email_number, 0) is. This part will return headers once you receive them, you can choose it or use it.

    Hope this will be helpful.

    javascript - Check if several points are in path - JS Canvas -


    I am working on a project and I have to check that several points on the canvas, XY coordinates, are defined paths . Actually I want to use something like .isPointInPath (x, y) , but check out what I am trying to do with several pixels 20, 30 - 26, 30 .

    • Is this an existing method to complete?
    • If not, does that mean that I have to check every individual point? Using the bus, you must check each point in the built-in function.

      You can only check the end, but the half-way-shaped path (unsuccessful) will fail.

      Things are a little bit better if you apply the Segment-Enterresects-Path algorithm (or line-intercept-path ) if you Remove the points that are not on the segment you want).

      Then you examine path intersections between (20, 30) and (26, 30) . If they are in two point paths and there are zero line / segment intersections along the path, then you are in the (20, 30) to (26, 30) in the path.

    jquery - javascript-being-dumb experience of the day -


    It seems that changing the abbreviation of 3 characters to represent a number will be an easy task. Javascript says, "NOPE!"

      $ (selector) .each (function () {// short name numerical representation var monthStr = $ (this) .text (). / [^ \ /] * /) [0]; Var months = {Jan: 1, FEB: 2, March: 3, APR: 4, May: 5, June: 6, July: 7, August: 8, SEP: 9, OCT: 10, NOV: 11, DEC: 12}; Var month = months [months] .ststring (); Var date = $ (this) .text (). Replace (month month, month); $ (This) .text (date);});   

    Although the code is valid and works, my console still messes with the following error:

    Unkit type error: method 'toString 'Can not call

    There is no point in this because the text of the selector is correct Has changed (according to the least eyes).

    Month STR 'variable if I have set it as an example in a static' MAR 'and removes' .toString ()' from 'my' variable definition, then error is no longer is.

    In addition, the '.toString ()' has been mentioned before, if the conversion for my month variable was not so, then I would end up with an 'undefined' value.

    Just wanted to share your javascript-dumb experience and hoped why someone could explain this error was thrown, even when the code works at no time.

    The problem should be most of:

    $ (selector) .each (function () {...});

    What is the selector, and how many dome objects are being selected? It seems that a DOM object is being selected, which does not have text.

    Here is an example that repeats your error: (View Console)

    Console: 'Uncount Type Error: Undefined' toString 'Can not Call Method'

      & lt; P & gt; March / 26/2013 and lt; / P & gt; & Lt; P & gt; Hello World! & Lt; / P & gt; $ ('P') each (function () {var month = $ (this) .text (). Match (/ [^ \ /] * /) [0]; var months = {MAR: 3}; alert ( Month [months] .toString ());});   

    The reason for this is that we will not allow two & lt; P & gt; elements are selected, and there is only one date as one.

    If we limit our code to DOM objects as text, then it works fine:

      & lt; P & gt; MAR / 26/2013 & lt; / P & gt; Var month = $ ('P'). Text (). Match (/ [^ \ /] * /) [0]; Var months = {MAR: 3}; Warning (months [month] .toString ());   

    You should use a CSS class for those elements which are text in the form of a date, and for these elements, you know what you are choosing like this .

    Python - Convert epoch time with nanoseconds to human-readable? -


    इस सवाल का पहले से ही एक उत्तर है: < / P>

    • 1 उत्तर

      मेरे पास युग में एक टाइमस्टैम्प है नैनोसेकंड के साथ समय - उदा 1360287003083988472 1 9 01-01-01 के बाद से नैनोसेकंड।

      पायथन डैट टाइम ऑब्जेक्ट्स और रूपांतरण पद्धतियां केवल मिलीसेकंड की सटीकता का समर्थन करती हैं।

      क्या कोई आसान तरीका है इस युग का समय मानव-पठनीय समय में परिवर्तित कर सकता है?

      चीयर्स, विक्टर

      पहले , इसे दूसरे ऑब्जेक्ट के साथ दूसरे परिशुद्धता में परिवर्तित करें (फ़र्श, गोल नहीं):

        & gt; & gt; & gt; दैट-टाइम आयात datetime से & gt; & gt; & gt; Dt = datetime.fromtimestamp (1360287003083988472 // 1000000000) & gt; & gt; & gt; डीटी datetime.datetime (2013, 2, 7, 17, 30, 3)   

      फिर इसे मानव-पठनीय बनाने के लिए, उस वस्तु पर विधि का उपयोग करें, जिसे आप वापस प्राप्त करते हैं:

        & gt; & gt; & gt; S = dt.strftime ('% Y-% m-% d% H:% M:% S') & gt; & gt; & gt; '2013-02-07 17:30:03'   

      अंत में, नैनोसेकंड परिशुद्धता में वापस जोड़ें:

        & gt; & gt; & gt; S + = '।' + Str (int (1360287003083988472% 1000000000))। Zfill (9) & gt; & gt; & gt; S '2013-02-07 17: 30: 03.083988472' '   

    random - Walk randomly through a binary tree? -


    I am creating a program that takes a tree and randomly selects a branch (left or right) and A list of those values Is it not working for any reason any help? Example:

      ~ (RandWalk (tree 1 (leaf 2) (address 3)) (1 2)   < P> This is what I have done so far:  
      (define (rand-walk tr) (if (empty-tree? Tr) '() (if (pana? Tr) Tr (if (equals? (Random 1) 0 (opposition (root-value tr) (original-value (left-subtree tr)) '()) (opposition (root-value tr) (root-value (Right-subtitles tr))) '()))))    

    There are several problems with your code here, there is a proper implementation:

      (Par Speak (Rand-watt tr) (code (empty-tree? Tr) '()) ((address? Tr) (list (root-value tr ()) ((equals? (Random 1) 0) (Opposition (root-value tr) (rand-walk (left-subtree tr)) (and (opposition (root-value tr) (rand-walk   

    if I am writing this So I use the tail's recursive approach:

      (define (rand-walk (walk (walking (('l' ()) (tr () (( Value (root-value tr)) (if (tree? Tr) (reverse (opposition value l)) (walking (opposition value l)) ((if Nothing? (Random 1)) left-subtitle right-subtree)))))))    

    php - how to read multi-levels json format using jquery -


    मेरे पास एक JSON प्रारूप है जैसे

      [{id: 15, diemdung: "a "{{Lancan:" d ", kc:" 333 "}, {lancan:" e "}, {आईडी:" 16 ", डायमडंग:" बी ", खांगकैक:" 300 ", pho:" c ", दा: [ ", केसी:" 322 "}]}, ...]   

    मैं php जैसे प्रिंट json_encode ($ पंक्तियों) का उपयोग कर रहा हूं;
    और मैं कोशिश करता हूं इसे jquery जैसे ग्राहक पर पढ़ने के लिए

      $। GetJSON (url, फ़ंक्शन (जेसन) {$ .each (जेसन, फ़ंक्शन (कुंजी, वैल) {$ .each (this.da, फ़ंक्शन () {चेतावनी (this.kc);});});});   

    लेकिन यह काम नहीं कर रहा है मैं वह कैसे करता हूं? धन्यवाद

    यदि आपका कोड अन्यथा काम कर रहा है, तो आपको निम्न त्रुटि मिल रही है: < पूर्व> प्रकार त्रुटि: obj अपरिभाषित है

    यह इसलिए है क्योंकि बाह्य सरणी में पहला ऑब्जेक्ट "da" संपत्ति के लिए कोई मान नहीं है "दा" प्रॉपर्टी द्वारा आयोजित सरणी पर लूप करने से पहले, आपको जांचना चाहिए कि यह मौजूद है या नहीं।

    कोशिश करो:

      $। GetJSON (url, function ( Json) {$ .each (जेसन, फ़ंक्शन) (यदि (this.da) {$ .each (this.da, फ़ंक्शन) {अलर्ट (this.kc);})}}});});    

    jquery - Keep position for a row when sorting -


    In my table (JQuery Datatables), there is a line (the last one) that should always be in the end (this is

      & lt; td & gt; & lt; span class = "last-row"> my VALUE  

    / span & Gt; & lt; / TD & gt;

    How can I always create sorting functions at the end of this row, no matter which column is being ordered It does not matter if the sorting is ASC or DESC?

    only To exclude you for suggesting the hanging, you can use the element tfoot to define the footer lines in your table.

      & Lt; Table & gt; & lt; thead & gt; & lt; tr & gt; & lt;! - Modern browsers know how to render this, this screen reader and other helpful techniques - & gt; & lt; Td> Header 1  & lt; td & gt; Header 2 & lt; / td & gt; & lt; Td> Header 3 & lt; / Td> & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tfoot & gt; & Lt; -! Ditto - & gt; & Lt; TR & gt; & Lt; Td colspan = "3" & gt; Footer text & lt; / Td> & Lt; / TR & gt; & Lt; / Tfoot & gt; & Lt; Tbody & gt; & Lt ;! - Regular HTML Rows & amp; Here Colonel - & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;    

    vb.net - Why does New With {} work but New With {} doesn't? -


    I have always used with new {} without any problem, why is it different?

    Razor VB.NET code

      Using Ajax. BeggiForm (with new AjaxOptions {.httpMethod = "Post"}) @ * No problem * @And using   
      Using Ajax Begieform (with new {.ttpMethod = "Post"}) @ * Price Type '& lt; Anonymous type & gt; ' Can not be changed in 'System.Web.Mvc.Ajax.AjaxOptions' * @ end use    

    One does not extend / inherit new from {} ) AjaxOptions and AjaxOptions is an object accordingly Required BeginForm . >

    c++ - Updating a class attribute through a callback -


    I am creating an application that needs to load different settings depending on the active window / program ( Eg using Chrome, setting associates with Chrome are loaded when you switch to MS Word, MS Word settings are loaded).

    Right now I am working on a class that will get the right settings from a database that changes in the active window every time there will also be a "lookup" method in this class, which were last received Returns a value based on the setting.

    What I'm trying to implement in the phishing code:

      class RecipeBook {public: RecipeBook (); HWINEVENTEVENTHOOK hEvent; String current program; Static void callback WindowCallback (HWINEVENTHOOK hWinEventHook, DWORD dwEvent, HWND hwnd, long idObject, long idChild, DWORD dwEventThread, DWORD dwmsEventTime); // Actual callback zero message check (zero *); } RecipeBook :: RecipeBook () {This-> hEvent = SetWinEventHook (EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, zero, & amp; WinEventProcCallback, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS); Start Message (Zero *) in separate thread) Zero Message Check (Zero *) {MSG msg; While (GetMessage (& msg, NULL, 0, 0)) {translation message (& amp; msg); DispatchMessage (& amp; msg); }} Void callback WindowCallback (HWINEVENTHOOK hWinEventHook, go DWORD dwEvent, HWND hwnd, long idObject, long idChild, DWORD dwEventThread, DWORD dwmsEventTime) is working & RecipeBook- active program Name handle // This update {HWND gt; CurrentProgram}   

    I'm having problems with:

    1) Message check can not be found to run in a separate thread. If I sequentially code runs like it works fine when I tried using to messageCheck eggs in a formula (

      AfxBeginThread (& amp; messageCheck, & amp; currentProgram , THREAD_PRIORITY_NORMAL, 0, 0, zero)   

    )

    It does not seem that the second thread is created.

    2) I do not know how to modify values ​​from callback in the reChipbook. I have thought about returning the callback, but I have not succeeded in working it. It would be nice if I could edit the string from within the callback. 3) When I was called the Lookup method, I was still asking for the current active program, but I was able to find only those methods which receive the calling ID, but not Active window process id

    This is a big question but any advice would be greatly appreciated!

    Thank you!

      GetForgroundWindow ()   

    That's what I What was watching!

    As long as there is a good explanation can not provide how multitasking, callback stuff, I'm just going to use this function and when is also a lookup ask the current window. This should not happen often and this process will not take long.

    In the window you use in the handle, you get the name of the process from the active window / PID, For, how am I doing this:

      DWORD process ID; LPTSTR process name = new TCHAR [MAX_PATH]; DWORD name size = MAX_PATH; Hwnd activationH = gearfindwondo (); DWORD threadID = GetWindowThreadProcessId (active WindowH, and processID); Handle process suspend = open process (PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_QUERY_INFORMATION, FALSE, processID); BOOL nameSuccess = QueryFullProcessImageName (Process Shell, 0, Process Name, & Name Seas);   

    Cheers!

    vb.net - Add item to comboBox from SQL query -


    Hey guys, I want to add items to vb.net in my combo box. But the data I want is on my database.

    I have a statement of SQL query here:

      "Choose from Legal_Records (Tag)"   

    What do I do I want to add the result of this SQL query in this combo box.

    Anyone can help me with this, make it simple TNX people! :)

    You can create a contraband view.

    Remove Row and Column Header .. You can repeat the dropdown action by adding an "arrow down" button. Add an event on the arrow button button. This should show the grid view. And if you click on a cell on the DataGrid view. You should copy the contents of the selected cell and copy it to your textbox, etc. It will hide the datagrid wich afterwards.

    It takes only 3 controls * and with it you can easily manage your datasource. Datagridview). <

    iphone - How to animate CAShapeLayer path and fillColor -


    How to alert the passport path and fillcolor?

    How to alert the stroke the way the path is being pulled? And how to animate fillcolor?

    To animate the path

      // CAShapeLayer myShapeLayer Strokecolor = setup [[UIColor blueColor] CGColor]; MyShapeLayer.lineWidth = 5; MyShapeLayer.fillColor = [[UIColor yellowColor] CGColor]; // Display it! [Self.view.layer addSublayer: myShapeLayer]; // Animate path CABasicAnimation * PathAnimation = [CABasic animation with animation: @ "strokeend"]; PathAnimation.duration = 1.5f; PathAnimation.fromValue = [Flow with NSNumber Number: 0.0F]; PathAnimation.toValue = [NSNumber Number explosion: 1.0F]; PathAnimation.repeatCount = 10; PathAnimation.autoreverses = Yes; [MyShapeLayer addAnimation: pathAnimation forKey: @ "Strokeend"]; // Cheat color filler CABasic animation * Fillation animation = [CABasic animation with animation: @ "Phil Collar"]; FillColorAnimation.duration = 1.5f; FillColorAnimation.fromValue = (id) [[UIColor clearColor] CGColor]; FillcolorAnimation.toValue = (id) [[UIColor yellowColor] CGColor]; FillColorAnimation.repeatCount = 10; FillcolorAnimation.autoreverses = yes; [MyShapeLayer addAnimation: fillColorAnimation forKey: @ "fillcolor"];   

    I hope this helps :)

    c++ - No idea where seg fault is occuring -


    For some reason, when I run this code, I get a mistake when I-for-loop. The value of this is 7654319. However, the strange thing is that when I'm not checking that the value is pan-digital, then it normally works without a default font, it works even when I'm checking That this is just a pandigital; But not for both, I used GDB to move through the code and here is the output I received:

      Program received signal SIGSEGV, Segmentation fault 0x00000000004007d3 main () . If CCI 81 81 (If Ipadigital (I) and Prings [I]) 6: Prime [i] = & lt; Error: Address 0x7ffefffffff4 & gt; 5: i = & lt; Error: 0x7ffefffffff4 is unable to access memory at address & gt; 4: Prime [7654317] = & lt; Error: Address 0x7ffefffffff8 & gt; 3: Prime [7654321] = & lt; Error: Address 0x7ffefffffff8 & gt; 2: prime [765431 9] = & lt; Error: Address 0x7ffefffffff8 & gt; Can not access storage at address. 1: Primes = & lt; Error: Address 0x7ffefffffff8 & gt; Can not use memory at address   

    By output, it seems that by adding i value to the isPandigital (int) function, it mainly I affects the value of i. It did not matter to me, but I went ahead and used a different variable to represent it in the isPandigital (int) function, but still me Receives the same error.

    Can anyone help me? These types of errors are very upset because everything seems like this should work, but it is not and its solution is merely hiding under the layers of the implementation. Any help is appreciated!

      #include & lt; Cstdio & gt; # Max 7700000 has been typed, not realized; Bool * GetPrimes () {int int = MAX; Bull * sieve = new hair [need]; For (int s = 0; s  (& gt; 1) is true: wrong); W = = 2; } Return sieve; } Bool's pedigital (intuum) {int arr [] = {1,2,3,4,5,6,7}, g, count = 7; Do {g = number% 10; If (ARR [G-1]) -count; ARR [G-1] = 0; } While (num / = 10); Return (count!); } Int main () {bool * prime = GetPrimes (); Int i; For (i = 7654321; i> 2; i- = 2) {If (Prime [i] & amp; amp; amp; Andapply (i) break; } Printf ("% d \ n", i); Return 0; }    

    In your isPandigital function. Note that if there is a honor of num ten or correspond to 8 or 9 mod 10 , then your Some problems near are often out of off-the-ceism array access.

    The first prime for which this happens is 19 (or 7654319 if you go back from 7654321):

      bool IsPandigital (int num) // num ( 76543) 19 {int arr [] = {1,2,3,4,5,6,7}, g, count = 7; Do {g = number% 10; // if G9 is (ARR [G-1]) / G1 is 8; G is only indexed from 0 to 6. - Number; ARR [G-1] = 0; // G-1 is 8; G is only indexed from 0 to 6.} while (num / = 10); Return (count!); }   

    Note that although the solution does not have 8 or 9 in it, any primary test can be done.

    android - Eclipse SDK crash -


    Every time I use any properties of the Android project , and Go to Android Options, SDK seems crashing, the strange thing about it is that when I try to use that option it only crashes, it works great on other selections. .. such as Android Lint Properties , Builders Java Build Path ... ... etc ... help please.

    What is the Eclipse Error Log?

    Two ways:

    Help & gt; Eclipse & gt; About Configuration Details & gt; View error log

    The location of the file workspace ollo / .metadata / .log

    iphone - Resign keyboard of textfield present in alertview -


    I have three text fields on a alert view, I set the keyboard as decimal type,

      - (IBAction) heightMethod: (id) sender {self.utextfield = [[UITextField alloc] initWithFrame: CGRectMake (12.0, 45.0, 260.0, 25.0)]; Utextfield.placeholder = @ "Centimeter"; Self.utextfield.delegate = self; Self.utextfield.tag = 3; [Self. Tutestyle setbackgram color: [UIColor whiteColor]]; [Self. Add Alert Add Add] // Adds a password field self.ptextfield = [[UITextField alloc] initWithFrame: CGRactack (40, 80.0, 80, 25.0)]; Ptextfield.placeholder = @ "Fit"; Self.ptextfield.delegate = self; Self.ptextfield.tag = 4; [Self.ptextfield setBackgroundColor: [UIColor whiteColor]]; [Self. Alert hight add sueview: self.ptextfield]; Self.ptextfieldInches = [[UITextField alloc] initWithFrame: CGRectMake (140, 80.0, 80, 25.0)]; PtextfieldInches.placeholder = @ "" inches "; self.ptextfieldInches.delegate = self; self.ptextfieldInches.tag = 5; [PtextfieldInches Setbakgram color: [UIColor whitecolor]]; [itself. Alrthait add Swuwu: ptextfieldInches]; [Self. Tutstfild Setkiboard type: UIKeyboardTypeDecimalPad]; [Self.ptextfieldInches set keyboard type: UIKeyboardTypeDecimalPad]; [Self.ptextfield setKeyboardType: UIKeyboardTypeDecimalPad]; [itself. Alrthait show];}   

    as I have The text area is tapped, the keyboard can resign only twice, but did not resign in the third time Also I added resignfirst responsible method within the warning delgate method, see here

      - ButtonAtIndex the (zero) Warning Views: (UIAlertView *) alertView click: (NSInteger) button index    

    UITextField and the UITextFieldDelegate method textFieldShouldBeginEditing . Hope this should work.

    or down:

      - (BOOL) textFieldShouldBeginEditing: (UITextField *) textField {textField = iVar; }    

    c# - Get return value after invoking a method from dll using reflection -


    I am loading a DLL with reflection and trying to use a method which is List & lt; CustomType & gt; . How do I open a method and get return value? I tried it but say that entry point not found exception .

      MethodWho [] info = classType.GetMethods (); MethodInfo method = mInfo.FirstOrDefault (c = & gt; c.Name == "GetDetails"); Object value = method.Invoke (classInstance, new object [] {param1}); Exception to   

    value entry point not found .

      assembly assembly = assembly.LoadFile (@ "assembly location"); // You can change the type of assembly you type type = assembly GetType ("mynamespace.NameOfTheClass"); ConstructorInfo constructor = type.GetConstructor (Type.EmptyTypes); Object classObject = constructor.Invoke (new object [] {}); MethodInfo methodInfo = type.GetMethod ("GetDetails"); Var returnValue = (list & lt; customType & gt;) methodInfo.Invoke (classObject, new object [] {param1});   

    Based on some changes it may be necessary whether your class is stable and if your constructor takes any parameters.

    .net - Visual c++ CLR how to send windows message? -


      निजी: # परिभाषित WM_SETTEXT 0x000C void doSomethinggToolStripMenuItem_Click (सिस्टम :: ऑब्जेक्ट प्रेषक, सिस्टम :: EventArgs ^ e) {SendMessage (इस-> संभाल, डब्लूएम_एसईटीटीएटी, (वाईपीएआरएएम) "कुछ विंडो शीर्षक", 0); }   

    निम्न त्रुटियों में परिणाम:

      त्रुटि C2065: 'wPARAM': अघोषित पहचानकर्ता त्रुटि C2143: वाक्यविन्यास त्रुटि: गायब ')' पहले 'स्ट्रिंग 'त्रुटि C2059: वाक्यविन्यास त्रुटि:') '  

    यह-> संभाल & lt; --- (त्रुटि) सिस्टम :: इंटेस्पट्र से HWND Div>

    आप की जरूरत के प्रतीक WPARAM (सभी अपरकेस) हैं, नहीं 'wPARAM'।

    यह भी ध्यान रखें कि WM_SETTEXT वास्तव में स्ट्रिंग पैरामीटर को lParam मान के रूप में लेता है, नहीं wParam :

      भेजें संदेश (यह-> संभाल, डब्लूएम_एसईटीईटीएक्ट, 0, (एलएआरएपीएएम) "कुछ विंडो शीर्षक");    

    parsing - How can I efficiently and conveniently parse a simple message in Go? -


    Here is an example of a message:

      User: tbone Location: / Anyone Time: 23:23:23 This is a small message   

    This is a way HTTP- and other protocols- ish: The header followed by a blank line and message body.

    What is the easiest way to parse it? I like the standard if I can work a bit better than the white spot, it would be very easy for me. That is, in the header, it should ignore the white space around a colon, but let me know about the spaces between the words and the Newlines. I should also know when the message body starts.

    Maybe the scanner might be the right tool for the job? Is there a better strategy? Should I just write my own small parser, which at one time does a character (or sometimes two) and builds my data structure? This is the inconvenience that I would like to save, but I can do it.

    By the way, I control the message format. Is there a better message format that will simplify the job?

    The text / scanner will be overhead (in programmer time) to use for this format for.

    Using net / http, you may also be able to use MIMEHeader to search and.

    If you need anything more complex than MIMEHeader, then I would just consider using JSON.

    Relation between Pixel intensity values of Image and values returned by read_imagef in OpenCL -


    Values ​​returned by read_imagef in OpenCL are in the range of 0 to 1, while the pixel intensity range 0 to 255. .. I want to process the intensity values ​​for image segmentation which is based only on intensity values ​​(the operation is done to find differences between two intensity values, sorting, finding the minimum, shuffling e.t.c). How to get these values ​​in the integer form of 0 to 255 (for convenience) ...? Can I multiply every value with 255 or do I have to do something else ...? read_imagef

    float4 , And channel data types can be used for images created with UNORM_INT8, UNORM_INT16, SNORM_INT8, SNORM_INT16, HALF_FLOAT and Flat. The conversions are part of the rule, and are given in section 8.3.1.

    To answer your question, yes, if your image data type is UNORM_INT8, then you can multiply only by 255.

    GPUs are usually faster with UNORM_INT8 with UNSIGNED_INT8 images.

    python - How come i need to make another file handle to read the same file again? -


    I was playing around the file with Python, so I wrote it:

       

    prints the second loop file, if I do not handle the second file. Why is this?
    Should not it work without another one?

    That's because the first loop ends, the current ifh At that point at the end of the status file, read and do not have data.

    To read data again, you need to use to return to the beginning of the file.

    login - how do i make an IF statement on xcode that makes a UIButton work? -


    I want to create an IF / Else statement that will provide the user only when it has the right code input - for example , A log - If John Smith is put in the Username text box, he will press the login button, otherwise, this will not work.

    I have the code

      if ([usernameText.text suffix = @zagerate]] {(code which gives the functionality in the "login button" ) And ([Insertion code that does not provide functionality "Login button"])   

    I also want to do this with a password which is made up of points

    Try it out:

      if ([usernameText.text equalitestring: @ "jejert" ]) {YourButton.enabled = YES; } And {yourButton.enabled = NO; }    

    javascript - Raphael.js irregular path around a center point -


    I have a focal point with every 18 digit 20deg outgoing. I will point any point from any point of the next path How to overcome the path, all the way around. As the center starts out from 20px at 0deg, then pulls 40px out at 20deg, then pulls 100px out at 40deg, etc.

    I started going down some paths (sorry) but nothing can be found in what I have to do (at least not clearly) I thought maybe found point Atlanta answer Will be there, but could not go there.

    Define the path in which you specify the string, in which some trigonometry will be required Take that you have an array of (cx, cy) and radius:

      var command = 'm'; Var radii = [20, 40, 100, ...]; Var cx = 200; Var cy = 200; For (var i = 0; i & lt; 18; i ++) {var theta = mathematics.pi * i / 9; Var x = cx + redi [i] * math kos (theta); Var y = cy + radii [i] * monastery; sin (theta); Command + = x + '' + y + ''; } Var p = paper.path (command);    

    dojo - Worklight 5.0.5 generates unalterable inline CSS -


    I had a problem while using Vertical 5.0.5 for an Android mobile project today. If this helps, then this project uses Apache Cordova, Dojo Mobile and Varklite Libraries.

    The problem is that in some cases, Varkalite automatically generates unwanted inline css during building time. I do not know which component of the varkalite is responsible for it, nor how can I find out how to change this behavior or when it is necessary to stop it may seem like a small problem , But the fact is that it is inline CSS and during construction it means that it is preventing me from affecting it!

    A search through Javascript and CSS, both I have built and which are imported for both sides, do not show anything that adds CSS.

    Example:

    I have the following tags: my HTML:

      & lt; Ul Data-Dojo-Type = "dojox.mobile.TabBar" Bar Type = "Segment Control" Category = "Center Block Container" & gt;   

    After creation, it shows in a webkit-based browser (Google Chrome) as:

      & lt; Ul bartype = "segmentedControl" class = "mblTabBarSegmentedControl MblTabBar Center section container mblTabBarNoIcons" data-dojo-type = "dojox.mobile.TabBar" id = "dojox_mobile_TabBar_0" widgetid = "dojox_mobile_TabBar_0" style = "padding-left: 78px;" & Gt;   

    The final inline CSS, "padding-left", is what I'm trying to find and destroy. Does anyone know what is responsible for this behavior, and how can I change it? There is not much information about the technologies, but if you can not get rid of CSS then you can use the Important in your own CSS. For example:

      .segmentContainer {padding-left: 0px! Important; }   

    This priority gives priority to the padding-left statement going out of priority order, generally I think it is inline, i But ! Important gives your class priority

    Play videos retrieved from youtube api v3 -


    Using YouTube API V3, I can remove the thumbnail of a user's activity feed (using the list from APIs).

    What am I trying to achieve, when the user clicks on the video, the video must be played. I've seen iframes, though how does the list of activities on the API do not get the URL for the video, but a different resource shows the player. Embed HTML field, though I am confused, how do I integrate it into my code? var activityID, next pagetoken, prepaytocon, videocypet; // API Load Upload Playlist ID to get a function call after handlingloadloaded () {requestUserUploadsactivityId (); } // Upload Upload Playlist ID Function Request USERUploadsactivityId () {// https://developers.google.com/youtube/v3/docs/channels/list var request = gapi.client.youtube.activities.list ({/ / My: '' indicates that we want the certified user to retrieve the channel. Home: 'true', part: 'snippet'}); Request.execute (function (feedback) {// structure.details of the structure //https://developers.google.com/youtube/v3/docs/channels#resource console.log (feedback); activity ID = feedback.Items [ 0] .id; requestVideoPlaylist (activityId);}); } // Replay the playlist of the video function requestVideo playlists (Home, PageToken) {$ ('#VideoContainer'). Html (''); Var requestOptions = {home: 'true', section: 'snippet', maximum result: 12}; If (PageToken) {requestOptions.pageToken = pageToken; } Var request = gapi.client.youtube.activities.list (requestOptions); Request.execute {var activityItems = response.result.items; if (activityItems) {// shows a thumbnail for each result. JQuery.each (activityItems, functions (index, item) {createDisplayThumbnail (item Snippet);});} and {$ ('# video-container'). Html ('Sorry, there is no action on your feed');}}); } // Create a thumbnail for the video snippet. Function CreationTableNote (VideoSynipate) {var titleEl = $ ('& lt; h4 & gt;'); TitleEl.addClass ('Video Title'); $ (TitleEl) .html (videoSnippet.title); Var thumbnailUrl = videoSnippet.thumbnails.default.url; Console.log (videoSnippet); Var div = $ ('& lt; div & gt;'); Div.addClass ('Video Content'); DivCss ('background image', 'url ("' + thumbnailUrl + '")'); Div.append (titleEl); . $ ('# Video Container') attached (div); }

    There are several types of activities in the list of activities: < P> upload, like, favorite, comment, subscription, playlist item, recommendation, bulletin, social ..

    and only some types of activities are related to a video then you can only re-send the video ID Now when the type of activity is related to the video, you can watch the video. You can use the Yo ID.

    There is a good example of you in "YouTube Theme Explorer". In this app you can retrieve social activities and you can recover the video ID from such activities.

      $ scope.social = function () {$ rootScope.topicResults = []; $ RootScope.spinner.spin ($ ('#spinner') [0]); YouTube ({method: 'GET', service: 'activities', parameters: {part: 'id, snippet, content description', home: true, maximum result: static. YOUTUBE_API_MAX_RESULTS}, callback: function (feedback) {if ( In the 'item' response) {$ scope.videoIds = []; $ scope.personalizedTopics = []; pre-rectangle for angular.teams, function (activity) {if ((activity. Snippet.type == constant. Social Livype) & amp; Amp; (activity.contentDetails.social.resourceId.videoId)) {$ scope.videoIds.push (activity.contentDetails.social.resourceId.videoId)}}})}} getTopicsForVideoIds ();} }); }   

    And you have an example of showing the video:

      function play video (container, video id) {var Width = container.offsetWidth; Var Height = Container Offsite; New YT.Player (Container, {videoId: Video ID, width: width, height: height, player wars: {autoplay: 1, control: 2, minor branding: 1, rel: 0, showInfo: 0}});    

    c++ - Boost threads - passing parameters by reference -


    In my application there is a code that is similar to the following code

      zero some class :: Other method (Std :: vector & lt; std: string & gt; & amp; g) {g.pushback ("something"); } Zero SomeClass :: SomeMethod () {std :: vector & lt; Std :: string & gt; V; Promotion: Thread T (Promotion :: Tie (and some class :: Other method, This, V) T. Joint (); std :: cout & lt; v [0]; // Why is it empty When created on vector stack} I wanted to know that vector v is empty when the vector is made on a heap and when it is made on a heap, it works. The code above was hoping for the vector to remain in the field, even if it was made on the stack.   

    Bind copies its parameters. Use the Promotion :: Reference :

      boost :: thread T (boost :: bind (& SomeClass :: OtherMethod, Promotion: Ref (V))    

    indexing - Does single index have benefits when selecting on several columns? SQL Server -


    For example, there is a table with columns: Column A, Column B, Column C, Column D < P> and selects with many people there:

      column A, column B, column C column A, column C, column D column A, column B, column D   

    target questions. But I do not want to create multi column indexes for all column combinations, because it can take a lot of space and slow down the system.

    Is there just one index for column A? Will this improve the performance of the questions?

    Thanks

    One way to reduce the index "table scanning" Is used in the form. Any combination of columns or columns that you index should be used most often if it means to use 2 columns, then it is okay.

    Also remember that a clustered index is a physical page of data. Not non-CLUSTERED. Therefore, a package index is going to be more efficient. You can always make the most used fields a compiled index and often can not place a non-clustered index on that area which is not often used.

    In the end, it is all about data that I used to work with healthcare tables which were more than 1b records, indexing is very important in such an environment.

    javascript - Highcharts: Change hover style in line chart when hovering over legend -


    The default behavior of the line chart is to provide a hover state, when hovering over the legend. Hover action affects the style of the series related to the current legend item. When hovering on the legend, what is the method of controlling the styles applied to the series? I would like to control the width of the series in the chart when the mythology will end. Any suggestions?

    Perhaps this API can help you.

    API: plotOptions.line.states.hover.lineWidth link:

    JasFeed Link:

    javascript - Using nvd3.js to draw a chart having stacked bar and line? -


    For the nvd3 library, I can find the bar and line combo, but not a stacked bar and line combo. Actually, I have not found any examples with the JavaScript library other than Google Visualization, which I also try to avoid. Any advice, sample code will be appreciated thanks

    For all those people who answer this question In the future, I was able to do this using the prescribed code in this discussion.



    ios - Rotate and Scale with auto-layout in iOS6 -


    This is an issue that I am doing well now. My gesture detector "game" with new iOS6 and auto-layout is no longer working

    I have created an app using the storyboard and there is a small game application on one of the tabs where the user can scale, rotate and pan a picture at the top of another image It should be within 5 pixels, 5% size, and 5 degrees I am running with automatic layout. The issue is that when the game image is rotated and scaled, the image "jumps" back to status start turns strangely and around the center O.

    Rotate

    Strong>

      // rotation gesture identifier response - (zero) answerstroke tester: (URTestationStoreRejector *) gestures {if (gesture .state == UIJsterArchiveer State brinjal} gesture.state ==UigesterstericizerStateChanged) { Image.transform = CGAffineTransformRotate Gesture.view.transform, gesture.rotation); } If (gesture.state == UIGestureRecognizerStateEnded) [did it self]; // Question is not important for signaling. Implant = 0; } Pinch gesture identifier - (zero) antiprofropicizer: (UIPinchGestureRecognizer *) Alert {if (gesture)   

    Pinch

     .state == UIGestureRecognizerStateBegan || gesture.state == UIGestureRecognizerStateChanged) {image.transform = CFE Refined Transforms (Image Transform, Gesture Scale, Hint Scale); } If (gesture.state == UIGestureRecognizerStateEnded) [did it self]; // Not important for the questionnaire gesture.scale = 1; }   

    I know that the easiest solution should be to close auto-layout , but this can cause issues in the rest of the storyboard because you're turned on in the storyboard Can not auto layout for one component, but you have to turn it off for the entire storyboard.

    Can someone advise me what to do? I have read that this is a major issue and some are calling it a "bug" with the new auto-layout.

    I am having trouble with this and I need some help.

    If someone has any suggestions or can point me in the right direction, then it would be highly appreciated. Thanks!

    - Henry

    The easiest way to create an image was to auto-layout Use the code below to remove the program. Since you can not set the image.translatesAutoresizingMaskIntoConstraints = Yes , if you add an image using the IB to see the applet with the "bug" auto layout. Because you get an error, " Unable to satisfy the hassles together "

    So you need to program this because IB added obstacles and no one wants you .

      UIImageView * image = [[UIImageView alloc] initWithFrame: CGRectMake (20, 20, 100, 100)]; Image.image = [UIImage imageNamed: @ "gorilla_red.png"]; Image.translatesAutoresizingMaskIntoConstraints = Yes; [Self.view addSubview: image];    

    asp classic - How can I get the background color of one HTML/ASP row to change when a boolean is set true? -


    I have a table on the page-load that loads the data when the user clicks on an ID, then Row is required to highlight. Right now, I have found that when the user clicks on the ID, the boolean is set correctly, and then there is some other stuff. I have set that when boolean is correct, that line will be highlighted. However, this is not happening Can you help me?

      & lt;% if RS Record count & gt; 0 then RS ("ROLL_ID") = IntRollID then boolDetailTable = real end if%> & Lt; TR & lt;% if boolDetailTable = true then% & gt; Bgcolor "# CCFF00" & lt;% End if% & gt; & Gt; & Lt; One goal = _top href = "" OnMouseOver = "window.status = 'Click to get information'; Back to true;" OnMouseOut = "window.status = ''; Back to true;" & Gt; & Lt; TD style = "width: 9%; cursor: hand; border-right: none; align: center; vertical-align: center;" Title = "click to get information" & gt; & Lt; Font color = "navy" & gt; & Lt;% = RS ("ROLL_ID")%> & Lt; / Font & gt; & Lt; / Th & gt; & Lt; / A & gt; & Lt; TD style = "width = 25%" style = "font-size: 12pt" align = "center" & gt; & Amp; Nbsp; & Lt;% = RS ("ROLL_FINISH_DESC")% & gt; & Lt; / TD> & Lt; TD style = "width = 20%" style = "font-size: 12pt" align = "center" & gt; & Amp; Nbsp; & Lt;% = RS ("ROLL_DIAMETER")%> & Lt; / TD> & Lt; TD style = "width = 20%" style = "font-size: 12pt" align = "center" & gt; & Amp; Nbsp; & Lt;% = RS ("ROLL_CROWN")% & gt; & Lt; / TD> & Lt; TD style = "width = 10%" style = "font-size: 12pt" align = "center" & gt; & Amp; Nbsp; & Lt;% = RS ("ROLL_LOCKOUT_YN")% & gt; & Lt; / TD> & Lt; / TR & gt; & Lt;% RS.MoveNext () Loop End if% & gt; For beginners, you will need to change one of your code into the code below - you need    

    & lt; Th & gt; or & lt; / Td> As you begin with , you have a mismatch.

    For this example, I changed & lt; / TH> to

    You will also see that I onClick (this.parent); to by

      & lt; TD onclic = "set collar (this.parent);" Style = "width: 9%; cursor: hand; border-right: none; align: center; vertical-align: center;" Title = "click to get information" & gt; & Lt; Font color = "navy" & gt; & Lt;% = RS ("ROLL_ID")%> & Lt; / Font & gt; & Lt; / TD & gt; Parents send   

    OnClick elements - in this situation, the row is the same ( & lt; tr & gt; ) function To SetColor (elem)

    In this way your page has a JavaScript function:

      function SetColor (elem) {elem.style. BackgroundColor = "# ff0000"; }   

    This row should be changed to red for you.