Friday 15 June 2012

java - NetBeans IDE 6.7.1 Ant Script variables -


How do I get the location of rt.jar in my ant script with NetBeans without editing my project? Properties? $ {Java.home} is returning the JR folder's location and not the JDK folder.

I know that I can easily add value to the project. but I do not want. I also know that whenever I change the computer, I can easily modify the path, but I would not like to do this.

Edit: Maybe $ {Java. Home} is the best solution and I should just fix my computer environment variable properly

Edit 2: I realized that Java is not the same as JAVA_HOME. More info:

Do you have JAVA_HOME set? If so, does it matter on JDK? From the ant:

When you need the functionality of JDK (such as for Javak work or RMIC work), then tools.jar should be added. In the bin directory, the required JDK class will automatically add the scripts supplied with the ant if the JAVA_HOME environment variable is set.


java - GWT server-side interaction with database -


I am creating a project in GWT which pulls an RSS feed, using regular expression on feed (using JSNI Javascript), and then store it as a result of which data is based on database where the user can access it.

So far, I am writing all the code in the client-side .java file, hopefully I can just move it on the server side, how do I share the code side of the project server-side? Change? The code running on the client-side is now very heavy to me, like running the id server-side and storing the results in the database. Is it possible to write server-side code using GWT or is it some other framework or Probably should be done with PHP? I would like to fully develop the whole project with GWT because it worked really well for me till this point.

I still have trouble finding resources for which I need to connect to the database and update it, from GWT to server-side can I do with hibernate?

Thanks a lot!

I think you can run entirely on the server side and can not use GWT.

If you want to process your processing on the client, you will have to submit results on a server in HTTP, possibly as a text.

You can make an HTTP request using GWT RPC, RequestBuilder, or at the end, you can use a hidden field formation panel. GWT RPC means that you have to write your server side code in Java. The other two approaches can be any such platform that is HTTP: PHP, Python, .NET ...

NB: JSNI is powerful but it can be argued that you are throwing the power of GWT - This is the ability to write client side code in Java.


activerecord - help with rails associations -


I want to implement a messaging system for my app.

I have users

What exactly should I do? Can foreign users create a message model with foreign key ?? What would be the most accomplished way of doing this?

My concern is that if I ask "message.user" then I do not know what the id is the receiver of the message receiver receiving

Approprately use two different foreign keys by the name

Viewing a message model with the foreign key Sender_id and receiver_id you can:

/ P>

  class message & lt; ActiveRecord :: base is_to: sender, class_name = & gt; "User",: foreign_key = & gt; "Sender_id" is_to: receiver,: class_name = & gt; "User",: foreign_key = & gt; "Receiver_id" end  

You will now be able to refer to the sender of a message using message.sender and by using message.receiver Receiver .


.net - Where is the castle dynamicproxy repo? -


Can not I get a repo for a dynamic proxy in the palace?

I got it on the code

I need to fix it, so it works in moderate faith.

It seems that caste. Core assembly allows ... assembly cs Attribution in File


Deleting from arraylist and exporting back to .buab file(Java) -


I created an address book. I can currently write in the array list and save it back in the .buab file , But can I remove from the array list and export it back to .buab file?

Im too much got trapped on this. I was able to recover contacts from .buab and scrolled them using Jetextuffed and buttons.

For all the tasks, I have established septic classes (new contact, next contact etc.).

If you need a code posted to me, please tell me .. Cheers

P>

Dave

It's easy to add a deletion from a list:

  contact contact = new contact (); MyListOfContacts.add (contact); // Add a contact myListOfContacts.remove (contact); // contact away  

not necessarily more.

Edit

Please, and this is not Java, strictly separate three things, and your life will be very easy, will be very easy

  1. Models - Your contacts are stored in your array list
  2. Views - Your Jeffram is showing data from the model (list (list))
  3. Controller - The code behind your button that does something with the model (adding, removing, changing data in array list)

Maybe You've heard about the MVC pattern (Model-View-Controller).

So you do not export their 'Jeelaist: In your view on (Jefram), a button of your controller and press some code (actually may be in your button action listener) The file is executed for writing (your array list).

To do this, you do something to look for (GUI) to affect the removal, adding, importing model (list (list)).

As I said, it is not Java, it's different to try to find a very, very common pattern object view your code-oriented languages, models, views, controller and code Try. Promise, once you have done this, the next assignment will be a joke.


Do I need to require original file when overriding controller from Rails Engine? -


I am trying to override an action in a controller defined by a rail engine.

It seems like I need the original file before reopening the class, like:

  is a file needed. Joint (RRR_RO, 'vendor / Plugins / myopologins / apps / controllers / some_controllers' classes) Some Controller Def Indexing: Text = & gt; 'This is my index' end of the end  

It is understandable, but its requirement is very ugly. Is there any rail magic which can allow me to avoid the preliminary requirement?

It seems to be a complete ...

A load time problem Looks like your file is loading before the plug-in Where is your action located? Config / initializers? Liberalization?

I'm not sure when the train engines are loaded, play with this place (it should work in Lib).

Or, better yet, plug-in with the changes themselves and make sure it loads after the original.

And maybe you want something else:

  SomeController.class_eval def index ... and end  

python - merge background audio file -


I have 2 audio files for primary and background music that I want to merge (not included). The final audio file should be there until it is the primary file, and if background music is small, then it should be repeated.

If there is a Linux command or a Python library that can be used to do this? Supports merging, but the background audio is not allowed to be repeated.

As a possible solution, why not find out the length of the background file & lt; The length of the foreground file and then create a background file which is a loop, if necessary? Then you can pass it in socks.

You should be able to get the length (see frame count).

As far as python is the way to dissolve the streams, whatever you can do, however, if you are merging two full-volume sources, then you have one of them Try reducing the amount of 12 dB in the beginning), if you are mixing music and not

More audio libraries can be found.


c++ - Boost: what exactly is not threadsafe in Boost.Signals? -


I read Boost in many places. There is no signal thread but I have not got much information about it. This simple quote does not really say much in most applications today, threads are present - even if they try to be single-threaded, they may use some libraries threads (for example, libsdl).

I think there is no problem with the other threads in the implementation slot. So this is the least thread in this sense.

But what really works and what will not work? Will it work to use it with many threads, as long as I never access it at the same time? To wit. If I create my own mutex around the slot?

Do I have to use slots in that thread where I made it? Or where did I use it for the first time?

I do not think it's very clean, and a library reviewer:

I also did not like that only three times the word 'Thread' was given the name Boost.signals2 wants to be the 'Thread Safe Signals' library, hence some more details and more specifically about that area Example user Should be given to.

There is a way to detect it and see if they are using _mutex / lock () to protect. So just think what would happen if those were not in the calls? :)

Whatever I can collect, it is to ensure simple things such as "If a thread adds or disconnects, then it will not cause a separate thread to crash Those signals are running through the slots connected. " How does using a thread-safe version of a kind of library assure you that if two threads do valid call to printf at the same time, then crash will not be (not to say that The output will not make any sense to you & mdash; you are still responsible for high order semantic.)

It does not look like a QT, in which the thread runs a certain slot code, the target Slot's "Thread Announcement" (Junk This means that a signal can be triggered to run the slot in parallel on many different threads to emit). But I think it's not an estimate of supporting it. Promotion: The signs can be "coordinator".


c++ - Can't add static lib -


I am trying to create a DLL and it needs to be referred to the library libeay32.dll from the openssl package. I can not seem to add it as a reference under property page-> common property-> new reference because this error returns "could not add reference to the file 'C: \ OpenSSL \ libeay32.dll' It is neither a .NET assembly or registered Active X control. I can compile and run it when I use Linker-> Input-> additional dependencies and the static lib 'C: \ OpenSSL \ lib \ libeay32.lib' But I am IM results I am doing wrong?

You are doing everything correctly. NET relations ( And the COM component that is used through .NET COM interop) Add Reference "Add another reference." The other way that you have tried it is the right way for the original code, but Libeay32.lib is not a static library, it is the export library for DLL.


javascript - Google maps API can't get the longitude -


I am trying to get latitude and latitude for an address with google map api, but i do not know How to do it? This is an example of what I'm trying to do:

  GoogleObjectAdress ("New York") - & gt; And this should be the longitude and latitude back for me!  

Any solution?

Try the following code:

  & lt; Script src = "http://maps.google.com/maps?file=api&v=2.x&key=YourApiKey" type = "text / javascript" & gt; & Lt; / Script & gt; Var Geocoder = New GCL GuoCoder (); Geocoder.getLatLng ("New York", function (dot) {// code});  

For more information, read.


pointers - C++, manipulate 2d array -


I created a function to flip horizontally a square 2d array, so the first row was moved to the previous, second line Has been moved from second to last and so on.

Here's the function:

  Zero flip matrix (integer size, at matrix [ROWS] [COLS]) {int row, col; Int [ROWS] [COLS]; (Line = 0; line; lie; line; line ++) {for (col = 0; col & lt; shape; col ++) {temp [(size - 1) -row] [col] = matrix [Row] [col]; }} // A simple function that copies the temporary array for the matrix, so that // matrix array can be copied to the array (size, matrix, temp); }  

I know that this is very incompatible, but I am quite new to C ++. I was wondering how I would make it efficient, maybe an indicator would return? I am also thinking that this is a way to do without creating a temporary array?

I should also note that I am trying to do this without using STL.

Thanks for the help.

You can use and swap values ​​in the bus (for (int line = 0; row & lt; ROWS; ++ line) {For (col = 0; call and lieutenant; COLS / 2; ++ col) // half column, do not do that you do not return it {std :: Swap is defined in swap (matrix [ROWS - row - 1] [cola], matrix [row] [col]];}}}

if you actually have STL If you can not use, then enough head to implement swap

  template  zero swap (T & PA, T & PB) {T Temp = pA; PA = PB; PB = floating;}  

javascript - Exception line-number in Jscript-ASP -


I am developing a website with server side jscript engine on ASP server.

Many of my code are trying to try the try-breaking segments in this way:

  try {// do something} hold (mistake) {// It's a front end code ("exception caught" err.description); }  

I would like to display the line number that had the error. The filename would be a good bonus but it is not very important how can it be done?

Thank you!

error type (type ASPError) has line and file properties - just what you want (more Look for properties).


.htaccess passing domain name -


I am trying to rewrite the path in .htaccess

= - = - = - = - = - Edit = - = - =

Hello, I have not expressed your problem clearly. So this is a lively example of my problem.

  "http://fames.in/site/bollywoodhungama.com" - works fine "http://fames.in/site/bollywoodhungama.com/2" - error < / Code> 

The format of the URL is:

  http://fames.in/site/ (site name) / (page number)  < / Pre> 

I use the following code in .htaccess

  rewrite ^ site /(.*)$ sitelist.php? Q = $ 1 & amp; Page = 1 rewrite rule site / (. *) / ([0- 9] +) $ sitelist.php? Q = $ 1 and page = $ 2  

The first row works fine in the second line of code, passing the whole parameter 'Q' with HTX. Taking up the URL, it has been passed as "/sitelist.php?q=bollywoodhungama.com//2". I need to pass 'q' and 'page' separately like "/sitelist.php?q=bollywoodhungama.com&page=2"

The problem is that the first rule is always matched *. * Greedy is therefore part of the match / 2. The changes you need are similar to 'anything but slash':

  rewrite rules / site ([^ /] *) $ sitelist.php? Q = $ 1 and page = 1  

Then the second domain will fail in the match, and then match the second rule.

If you need more rules when this rule is implemented, but you want to add '' [L] to your end rule


sql server - Implement two filters in one condition - SQL -


I am creating a report in which I am not showing total clue, sent through fax and via SMS Is sent from I wrote a procedure to get the record. Here I will have to check a situation which should not be zero zero sales sent by fax and fax sent through SMS. If both are zero then I should not be brought to the record. If any of them have any value then I should get the record. It is possible to apply it through the SQL query.

astander the OP note

  Select as C.ClientID, C.ClientName, C.OrganizationName, C.FirstName, S SMSOverageRate, '' cost add calculated as TotalLeads (*), (case DeliveryViaFax when 'Y' is 1 and 0 at the end) of FaxCount, as the amount (in case DeliveryViaSMSEmail when 'Y' is 1 and 0 end) CMN_LeadSaleDetails s as SMSCOUNT Where join insider CMN_LeadClients C.ClientID = C S.BuyerID C.SellerTenantId = @TenantId and S.SellerJournalID = case @JournalId when 0 then S.SellerJournalID otherwise @JournalId end group C.ClientID, C.ClientName, C.OrganizationName By, C. .FirstName, SSM OverRate  
< / Div>

You can try something like this

 from  select from * table ( Total SMS Lide! = 0 or Total Fax Lids! = 0)  

Provide an easy-to-query query and we can further assist you.

Well, the comment you made, I will try to do something like this

  SELECT C.ClientID, C.ClientName, C.OrganizationName, C.FirstName, as S.SMSOverageRate, '' costs, as TotalLeads, count (*) add (case DeliveryViaFax when 'Y' is 1 and 0 end) FaxCount, add (case 'Y' when as DeliveryViaSMSEmail 1 0 end) where C.ClientID = on C consists of internal CMN_LeadClients CMN_LeadSaleDetails from SMSCOUNT S.BuyerID C.SellerTenantId = @TenantId and S.SellerJournalID = case @JournalId by C.ClientID when 0 then S.SellerJournalID otherwise @JournalId end Group, C.ClientName, C.OrganizationName, C.FirstName, S.SMS Having OverageRate (Addition (Case DeliveryViaFax when 'Y' then 1 and 0 End)! = 0 or Add (case DeliveryViaSMSEmail when 'Y' then 1 and 0 End)! = 0)  

.net - Create web service consumerprogram for test purposes automatically? -


I think that when I create many webservices, I try to make thousands of small "test programs" Which is the only purpose Websearchy Yes, if your webservice only takes integers and strings, then you can use the created test page which does the website service, but often you have to type in the booleans, userbases or typed strongly Has a dataset Which will be passed to the function and then create a dummy Bob you need to create a program and fill it to fill some default properties for you.

So my question is, is there a program or "add" out of there which can generate a test-winform program on the fly, just using the webservice as input, which tests the webservice Makes the code to do?

It would be nice, because its one (monkey) work is completely non-constructive, moving forward, taking time and boring to do. / P>

Although it is necessary to have "time consuming and boring" to write those test applications, this even more Must have more to manually use them again and again.

May I suggest that you write a suite of automated tests so that GUI-based applications you throw? Although this type of test is called Unity Test , you can use any unit test framework to implement such a test suite.

Since the web service provides the programmatic API, it is very easy.

This can save you a lot of time in order to be able to run the same test repeatedly without manual intervention.


Android google map myLocationOverlay disappears? -


I try to add myLocationOverlay to the map. This was not the first time, then when I send the GPS status to DDS, the blue shining dot is visible.

However, after a while, the blue points disappear and no where else is found. Why?

How can I see the blue dot in the map? Thx !!!

I had a similar problem: this is probably the reason.


php - Relative includes dont work anymore after moving to IIS? -


OK, I've seen a lot of glimpse of PHP () instructions here. It seems that it has also become a cause of sadness for me.

My site structure is something like this:

  public_html \ index.php public_html \ include \ content.inc .php public_html \ language \ language.inc.c.php Public_html \ classes \ db.inc.php  

No problems spread over the site Apache. It does not work on IIS (grr ... # @ !!!%)

Explain to me: What is done is that index.php is always called on the web browser and request, in it content.inc.php (many of these are content files and include the appropriate one based on logic in index.php)

  // - index.php - included (included / content.inc) .php);  

So far it works well on both Apache and IIS.

Now content.inc.php Lang Inc.php and db.inc.php in return.

It looks like:

  // - content.inc.php - include (language / n / language .php) (classes / db Inc.php)  

These lines work well on Apache but IIS complains that they can not file to include the file.

Why? Because Apache maintains the current folder "." public_html \ is where the script execution was started first. On the other hand, the meaning of "IIS" varies. Due to the file being currently being processed, after adding I.e content.inc.php, the interpretation of IIS is "." As it is included in public_html \

Now I know that there is a way to change the way that in some way the path is fully incorporated. But my question is, is it really an Apache / IIS problem as I think? Is there an IIS or PHP setting to behave in a right way without any kind of code?

Div class = "post-text" itemprop = "text">

Your included files should be completely outside your public_html tree

 // You should have the same setup: / public_html / index. Php / include / / include / languages ​​/ include / classes // If they are similar to your phsical drive; C: /wwwroot/public_html/index.php c: / wwwroot / include / c: / wwwroot / include / languages ​​c: / wwwroot / include / classes 

then settings in your PHP.INI file It can be converted into:

include_path = "; .c \ PHP \ pear; C: \ wwwroot \" contains

where I was guessing something like wwwroot That's the directory on which you change your html, as needed.

Restart the IIS service to select the new UI setting.

 echo ini_get ('include_path'); 

To maintain your discretion ...

Now PHP will always look inside wwwroot / contains it for your included files, so that you can do this by doing things like / languages Can be included;

Include 'language / engineering / language .info';

Which one do you want.


python - How much of NumPy and SciPy is in C? -


Are parts of NumPy and / or SciPy programmed in C / C ++?

And how to call Python from Java to Java and / or C # over overhead to call overhead C?

I am thinking that if the dragon is a better alternative than the Java or C # for the scientific app.

If I see, Python loses at a huge margin but my guess is because they do not use third-party libraries in those standards.

  1. I question any benchmark which is not a source for each implementation Shows (or did I miss something)? It is entirely possible that either the two solutions have been badly coded, resulting in both the improper evaluation of both the performance of the language. Oh, now I see the source. Although others have said that although this is not using NumPy / SciPy libraries, those standards are not helping to make your decision.
  2. I believe most NumPy and SciPy are written in C and wrapped in Python for ease of use.
  3. It probably depends on what you are doing in those languages, how high it is for a particular application. I have used Python for data processing and analysis for two years, so I would say that it is definitely fit for purpose.

    What are you trying to achieve at the end of the day? If you want a fast way to develop the readable code, then Python is an excellent choice and certainly for the first time, any thing is fast enough which you are trying to solve.

    Why not each a small group of your problem and benchmark results in terms of time and run time? Then you can make an objective decision based on some relevant data ... or at least I do this: -)


java - trouble with JNDI Data Source in Tomcat -


I have a hard time working with a JNDI data source. When connecting with Oracle with Tomcat5.5, I add the following instructions: I can connect properly in the code using a direct JDBC connection.

What do I have here: in my meta-INF / context.xml:

  & lt; Resource Name = "jdbc / mydb" auth = "container" type = "javax.sql.DataSource" driverClassName = "oracle.jdbc.OracleDriver" url = "jdbc: oracle: thin: Thaiserver: 1521 / MEDI" username " User "password =" password "maxactive =" 20 "maxidell =" 10 "/>  

Here's what's in web.xml:

  & lt; Resource-Rif & gt; & Lt; Details & gt; Please work & lt; / Description & gt; & Lt; Race-referee-name & gt; JDBC / mydb & lt; / Race-referee-name & gt; & Lt; Race Type & gt; Javax.sql.DataSource & lt; / Res-type & gt; & Lt; Race writing & gt; Container & lt; / Writing the race & gt; & Lt; / Resources Ref & gt;  

Here is the code:

  connection conn = null; Try {InitialContext ic = new InitialContext (); Datasource DS = (Datasource) IC .lookup ("java: comp / env / jdbc / mydb"); Conn = ds.getConnection (); } Hold ....... etc.  

I have tried many different configurations and have started a new, simple project to ensure that no additional jar Files disputed or nothing like that, but

Can anyone see something that does not look right?

error on the server when I try to use cone object then a NullPointerException indicates. I'm sorry, it provides first: org.apache.tomcat.dbcp.dbcp.SQLNestedException: PoolableConnectionFactory (Io Exception: Could not establish network adapter connection)

< Try div class =

  jdbc: oracle: thin: "post-text" itemprop = "text"> 

@Chaserver: 1521 / MyDB


php - If input name found in SQL then do else do… with an SQL query -


I am trying to write a SQL query that in column 'RNname' is a name in the table 'Individuals' Will check for "Jack" and if he exists, then update that row and enter a new row with the new RN.

I'm trying to make IF / ELSE statements, but how do they actually work or do I want to do without ALSE? (I did not do a lot of this SQL work, I used to update only, like INSERT, DELETE, ALTER ... stuff.

I still have this: (If found in Jack Go to the RNN line then update, otherwise select new line from INSERT)

  select from individuals if 'jack' == rName BEGIN [update statement] finally [INSERT statement] END  

Edit: I do not think I explained a lot which I wanted, R is not unique to everyone. There should be no, no one should be 2. I've tried on duplicate key updates, but this is just new line with a new data. But I update it with the existing RNName (jack) line with new data Want to be RNNAM (Jack) in the same way, but other fields in that row should be updated in the new data given.

In your case:

  (The `Arnam`,` Foo`) values ​​( 'Jack', 'bar') duplicate key Adytn` foo` = value ( `Bar`); It is a unique key to do this work if there is a 'jack' in the table, then it is field with the 'bar'  Foo  and if there is no 'jack', it inserts a new line with  rName  = 'jack' and  foo  = ' times'. 


hibernate - How can I use *.hbm.xml files as input in hbmtemplate for Maven? -


Hibernate In the ant function of hbmtemplate, * .hbm.xml files are possible instead of reading input Table details on JDBC

Is there a way to do this in the HBM template target from Codehaus?

In the ant, I can do this by adding a fileset to the configuration:

  & lt; Configuration Configuration = "hibernate.cfg.xml" & gt; & Lt; Fileset dir = "generated / xml" & gt; & Lt; Include name = "* .hbm.xml" /> & Lt; / Fileset & gt; & Lt; / Configuration & gt; & Lt; Hbmtemplate templateprefix = "pojo /" template = "Pojo.ftl" />  

Do you have your hbm.xml files in your < Code> src / main / resources or src / test / resources directory? Maven joins those folders in the classroom.


How to input realtime data to do realtime process in c/c++ -


I do not project about project realtime data from cyber gloves (virtual hand). So I have to write some applications that do not know how to deal with real-time data for some algorithms to get real-time data from gloves and feeds; Does anyone have some resources?

I'm sure how you can get data from cyber gloves using SDK and device, its Examples.

From there, I'm afraid we can not tell you much, I see that you have tagged your question with "accreditation", but what are you really trying to identify?


Accepting gestures generally will need to analyze a trajectory in the 3D space.

I have never worked with such a glove but I can imagine that it is broadcasting the sequence of data in a uniform way, similarly the Wacom tablet (X, Y, pressure) and Finally the proximity and pen tilt will flow the order of data.

Therefore, you will need to remove the proper features of this raw data in order to make commonly called "feature vector". For example, you can reproduce the data by using the interpolation scheme that ends with N Tulips, which includes each tube such as:

  • status
  • < Li> orientation
  • acceleration
  • curvature
  • etc.

You have to experiment to decide which Facilities are the best for the problem that you are trying to solve.

Once you are able to convert a normal 3D trajectory into a normalized vector vector, you want to use the method, for example:

  • A DTW
  • Neural Network Training
  • Support Vector Machines
  • <
  • Unfortunately, the pattern recognition is a huge subject and I You can not tell about everything in such a small answer. Now it is up to you to study literature.

    Good luck.


    php - How do I setup Symfony to create multiple database schemas? -


    I have 2 databases in my project Propell Build Model has already been set to work for 2 databases -

    If I make changes to any database, then I need a propell-build-schema command to rebuild the schema for both.

    I know that I can do this manually by modifying my own settings per schema, but is it possible to create both at the same time? If so, how can I adjust my propel.ini file for both connections?

    I am currently using Symphony 1.0

    propell -Build-schema command uses settings in the Propile.ini file which can only store the configuration of a single connection. However, you may possibly want to store your other connection settings by making a copy of your propel.ini file with a different name and doing whatever you want. Repeat Propell-Build-schema twice so that each orientation should use correct propel.ini (your script may also need to rename output schema.iml files). Then, whenever you want to rebuild schema files, just run the script.


    windows - Best Practices for Roaming Profile Support Testing -


    We need to ensure that a Windows app (which includes the Office plug-in) is a roaming profile environment Works fine when installed in >

    The fact is that we have got office plugins, of course, that we have COM objects .

    For proper configuration of the Active Directory, I see a post on ServerFault because it is a server configuration item Has more of

    From a test standpoint, your test operation is quite simple.

    1. Install it on a machine
    2. Validate that it is functional
    3. Login to another machine and confirm that the process is still working.

    Now, all this is limited to how roaming profiles are set up, how often, installed applications are not complete, their configuration / options will be obvious as they The user is stored in the roaming profile, but the application should be installed on each machine itself, once installed, then settings / options are present on the board.

    Note

    This test scenario assumes that users have the same permissions to access every machine on a domain with a roaming profile. If you are in an environment where users can have limited permissions set based on logging on the machine, you can modify the above criteria to include a test on each of the "limited access" machines in addition to a full access machine Will need to be


    .net - Any PostSharp alternative? -


    I have to stop using PostSharp because it will not work with ambiguous / merged assemblies. At least, I do not see any way to do this work (it crashes when Apple starts) when the assemblies are ambiguous.
    I have to stop some methods in my app (Basic methods Call Special Code instead - OnMethodInvocationAspect)
    Any advice?

    PostShop supports ILMerge to some extent. But there are problems with obfuscated assemblies

    1. As the facets are sorted in time of construction, they can not be deserialized if the aspect type has been obfuscated. The solution is not to remove any serial type. Another solution is not to serialize the aspects (see AspectConfigurationAttribute.SerializerType PostSharp 2.0, and use serializer MsilAspectSerializer.)

    2. There are problems when applied to normal methods and methods The normal type (The reason is that PostSharp uses reflection, based on method names, in this case, CLR to work around insects).

    -gael


    How to store timezone in SQL Server 2005 -


    I am creating a web application where users can enter events,

    • Event title
    • Start date / time
    • Description

    Users will want to enter start date / time with a timezone that accompanies that location accident. Events are all over the world, so the timezone can change from event to event.

    In the SQL Server backend database, I am using date time for the start date / time. Which column should I use to store the time zone? Int? Name? Decimal?

    The time zone is tricky, bad things. They are usually stored as UTC offsets, but even there are issues related to things like changing the time of daylight savings (if at all).

    If you are using SQL Server 2008, then you use a datetimeoffset type, which includes the UPS offset with the value otherwise you will need two columns.


    How to merge this two specific arrays in PHP? -


    I have this array:

      $ array ['apples'] [0] ['Name'] = 'some apples'; $ Array ['apple'] [0] ['value'] = 44; $ Array ['oranges'] [0] ['name'] = 'some orange'; $ Array ['oranges'] [0] ['value'] = 10;  

    How can I merge two arrays, so I get this:

      $ array [0] ['name'] = 'something Apple'; $ Array [0] ['value'] = 44; $ Array [1] ['name'] = 'some orange'; $ Array [1] ['value'] = 10; I do not have PHP to test, but this is not just:  

    $ array2 = $ array ['apple']; Array_merge ($ array2, $ array ['oranges']);

    It is valid, now in $ array2 from

    < / Html>

    java - Correct way to write a Tokenizer in Lucene -


    I am trying to analyze the content of a Drupal database for group intelligence purposes.

    So far I've been able to count down token after removing a simple example that works tokenizes out various content (mainly platform posts) and removing the word.

    StandardTokenizer should be able to supply with Lucene to tokenize host names and emails, but the content can also be embedded, such as HTML.

      Pubblichiamo La presentazione di IBM riguardante per db 2 i vari sistemi operativi linux, unix e windows \ r \ n \ r \ nQuesto documento station sulla piattaforma kilometer e lo potete do a questo & lt SCARICARE ; A href = \ 'https: //sfkm.griffon.local/sites/BSF%20KM/BSF/CC%20T/Specifiche/Eventi2008/IBM%20DB2%20for%20Linux%20UNIX%20e%20Windows.pdf \' Target = blank & gt; Link & lt; / A & gt;  

    This is badly marked like this:

      Pablachio -> 1 appearance - & gt; 1 IBM - & gt; 1st rigward - & gt; 1 db2 - & gt; 1 different - & gt; 1 system - & gt; 1 Operation - & gt; 1 Linux - & gt; 1 UNIX - & gt; 1 windows - & gt; 1 document - & gt; 1 Envelope - & gt; 1km - - & gt; 1 box - & gt; 1 Scratch - & gt; 1 href - & gt; 1 https - & gt; 1 sfkm.griffon.local - & gt; 1 site - & gt; 1 BSF - & gt; 1 20 km / BSF - & gt; 1 cc - & gt; 1 20t / specifiche / eventi2008 / ibm - & gt; 1 20db2 - & gt; 1 20for -> 1 20linux - & gt; 1 20unix - & gt; 1 20e - & gt; 1 20windows.pdf - & gt; 1 goal - & gt; 1 free - & gt; 1 link - & gt; 1  

    I have a link and HTML tags (such as

      or   ) Which are useless. 

    Should I write a filter or a different tokener? Tokenizer standard should be a place or can I mix them together? The most difficult way is to get the StandardTokenizerImpl and copy it to a new file, then add custom behavior, but I do not want to go too deep into the Lausanne implementation for learning (slowly learning).

    Edit: Seeing StandardTokenizerImpl makes me think that if I increase it by modifying the actual implementation So it is not so convenient compared to lex or flex and is doing it by itself ..

    < Div class = "post-text" itemprop = "text">

    This can be easily achieved before the text is processed so that it is useful to pre-tune it before Tunkenize Can be done. Use an HTML parser, as if you can not convert your content into text with any HTML, which do not care about you, and to remove text from the lessons you do, Jericho's Perfect for, and easy to use.

      String Text = "Linux" Pubblichiamo La presentazione di IBC riguardante per vari sistemi operativi db2 ", Unix e Windows. \ R \ n \ r \ nQuesto Documento Station Sulla piattaforma kilometers e Take potete "+" Do a quest & lt SCARICARE; a href = \ 'https: //sfkm.griffon.local/sites/BSF%20KM/BSF/CC%20T/Specifiche/Eventi2008/ IBM% 20DB2% 20for% 20Linux ,% 20UNIX% 20e% 20Windows.pdf \ 'target = blank & gt; Link & lt; / a & gt ;. "; TextExtractor te = new TextExtractor (new source (text)) {@Override Public Boolean excludeElement (STARTTAG STARTTAG) {return startTag.getName () = HTMLElementName.A; }}; Println (te.toString ());  

    This output:

    To install DB2 for IBM developers, use DB2 as well as operating Linux, Unix and Windows Could. Questo Documento STA Solana is a search link for Piaatopha pharma's AMA.

    You can use a custom Lusen tokenser with a custom filter, but this is not the easiest solution - you will be saved using the Jericho time for this task Lucen The existing HTML analyst might just want what you want because they will keep all the text on the page. The only warning on this is that you will finish the process of text two times instead of the same stream, but unless you are dealing with the terabytes of data, you are not careful about this performance, and You are best left to deal with the display. Your app has been flashed and it is somehow recognized as an issue.


    geometry - How do I draw a mysql polygon circle, and not a square? -


    The function below creates a polygon square out of 4 points and I believe the last 5th digit closed the square Given that, I need it at least 24 points and any ideas for creating a circle?

      function getRadius ($ point = "numeral (-29.8368 30.90 9)", $ radius = 2) {$ km = 0.009; $ Center = "GeomFromText ('$ point')"; $ Radius = $ radius * $ km; $ Bbox = "CONCAT ('Polygon ((', $ center) - $ radius, '' y ($ center) - $ radius, ',', x ($ center) + $ radius, '', y $ Center) - $ radius, ',', x ($ center) + $ radius, '', y ($ center) + $ radius, ',', x ($ center) - $ radius, '', y $ Center) + $ radius, ',', x ($ center) - $ radius, '', y ($ center) - $ radius, '))') "; $ Query = $ this- & gt; Db- & gt; Query ("SELECT id, asText (latLng) AS latLng, (SQRT (POW (ABS (X (latitude) - X ({$ center}), 2) + POW (Latgang, GeofromText ($ Bbox)) and SQL POS (AB (X (Litlang) - ABS (Y (Latleng) - Y ({$ Center}), 2)) 0.00 / X ({$ center}), 2) + POW (ABS (Y (Lat) - Y ({$ center}), 2)) & lt; $ distance from radius command "); If ($ query-> num_rows ()> 0) {return ($ query-> result ()); } Other {return false; }}  

    below JS version and it works correctly

      var findCirclePolygons = function (point, r) {var d2r = Math.PI / 180; This.circleLatLngs = New Array (); Num Points = 24; Var circle lat = R * 0.009; // change in km var circle leg = circleLat / Math.cos (point.lat () * d2r); (Var i = 0; i & lt; numpoints + 1; i ++) for (var theta = Math.PI * (i / (numpoint / 2)) Var vartex lat = point.lit () + (circle) Late * Math (Thita)); var vertexLng = parseFloat (point.lng ()) + parsflot ((circle lang * math kos (theta)); var vertextLatLng = new google.maps.LatLng (Vertaxlat, Vertax lung) ; This.circleLatLngs.push (vertextLatLng);} // set option var option = {path: circle layouts, stroke color: "# 0055ff", stroke opacity: 1, strokewhite: 1, fill: "# 0055ff", fillipcity : 0.35}; Return Return option;};  

    You A loop can (in the phonetic code):

     <$> $ radius * cos (i) "$. $ Radius for sin (i)  i <= ii = 0; I + = 360/24) {$ extra_point = "POINT (". ")"}  

    edit

    • However, if you just want a bounding box, using a square is the right way to do this, there is no need to find the Circle box. You can filter later with sorting.
    • To measure the distance, there is no need to use ABS. Squareing does this for you (as an additional, instead of computing the root of the square, instead of comparing the radius class,
    • Do not forget to add the spatial index or the display will be unusable

    2 ADIT Some pseudo-code In;) (This is the same age that I did not work with PHP did).

      $ lane = 42; $ Lat = 2; $ Radius = 0.01; $ Bbox = "Polygon ((; (i = 0; i & lt; = 360; i + = 360/24) {$ bbox. = $ Radius * cos (djrad (i)) $ lon." "$ Radius * Sin (deg2rad (i)) + $ latitude; if (i <360) "$ bbox. =", "} $ Bbox. =")) About " 

    In the distance, you have Pove (stomach (X), 2) == PAU (x, 2) for any x, you can just write (for simplicity):

      SQRT (POW (x (latleng) - x ({$ center}), 2) + pau (wai (lattelle) - y ({$ center}), 2)) & lt; To abandon the calculation of the radius of $ radius  

    or even square root (in this case it will change absolutely nothing and quick optimization is a bad thing, so whatever you want to do) POW (X (latlng)) - x ({$ center}), 2) + pow (wai (lattelle) - y ({$ center}), 2) pow ($ radius , 2)


    sql - MySQL error: key specification without a key length -


    I have a table with the primary key that is a varchar (255) in some instances where 255 characters are not enough I tried to convert the field to text, but I got the following error:

      Blob / Text column is used without the length of the 'message_id' key  

    How can I fix this?

    Edit: I should also indicate that this table has an overall primary key with multiple columns.

    The error occurs because MySQL can only point to N characters before a Blob or TEXT column . Therefore, error occurs primarily when there is a field / column type of text or blob, or those readers or blob types such as TINYBLOB, MEDIUMBLOB, LONGBOLOB, TINYTEXT, MEDIUMTEXT, and LONGTEXT such as the primary key or index form Let's try. With full blob or text without length, MySQL is unable to guarantee the specificity of the column because it is variable and dynamic size. Therefore, when using the BLOB or TEXT type as an index, the value of N should be given so that the MySQL key can determine the length. However, MySQL does not support a major length limit on TEXT or BLOB. Lesson (88) just will not work.

    When you try to change the non-TEXT and non-BLOB types such as VARCHAR and ENUM to the table column in text or Blob type, it will also pop up, already unique barriers with columns or The index was defined as. Eltter SQL SQL command will fail.

    The solution to the problem is to remove the index or Blob column from the index or unique barrier, or to set other fields as primary keys. If you can not do this, and want to set a limit on the text or blob column, use the VARCHAR type and set the length limit on it. By default, VARCHAR is limited to 255 characters and its announcement It should be specified within a bracket immediately after its manifestation, i.e. VARCHAR (200) will restrict it to only 200 characters.

    Occasionally, even if you do not use text or blob related type in your table, error 1170 may also be visible. In a situation where you specify the VARCHAR column as the primary key, but set its length or size of the letter incorrectly. VARCHAR accepts only 256 characters, so anything like VARCHAR (512) can force MySQL to auto-converge VARCHAR (512) into a SMARTTEXT datatype, which can later be used on key length with 1170 error If the column primary key or unique or non-unique index to resolve this problem, specify the figure of less than 256 as the size of the VARCHAR field.

    Reference:


    asp.net - Silverlight InitParams prompting to install Silverlight in Mozilla and Chrome -


    I have a problem with the behavior of a silverlight control in an asp.net page, control works fine within the control of IE , But in Mozilla, I get a message to install 'Microsoft Silverlight'.

    After some attempts / unsuccessful sessions, I came to the conclusion that I will receive that message in Mozilla only when I have my Silverlight control in & lt; Param name = "InitParams" /> Use the ultimate if I remove the ultimate, then it's all right.

    Anyone got this issue before?

    ASP.Net Page Code:

      & lt; Div style = "height: 100%; width: 100%;" & Gt; & Lt; Object Data = "Data: App / X-Silverlight-2," Type = "App / X-Relilite-2" width = "100%" height = "100%" & gt; & Lt; Param name = "source" value = "http: //server/domain/ClientBin/MyName.xap" /> & Lt; Param name = "onError" value = "onSilverlight error" /> & Lt; Param name = "background" value = "white" /> & Lt; Param name = "minRuntimeVersion" value = "3.0.40818.0" /> & Lt; Param name = "auto upgrade" value = "true" /> & Lt; Param name = "EnableGPU access" value = "true" /> & Lt; A href = "http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.0" style = "text-decoration: none" & gt; & Lt; Img src = "http://go.microsoft.com/fwlink/?LinkId=108181" alt = "get Microsoft Silverlight" style = "border-style: none" /> & Lt; / A & gt; & Lt; / Object & gt; & Lt; Iframe id = "_ sl_historyFrame" style = "visibility: hidden; height: 0px; width: 0 pixel; range: 0px" & gt; & Lt; / Iframe & gt; & Lt; / Div & gt;  

    It seems that I have solved this issue. At least I have detected this problem if my Silverlight object contains' /> param.

    The InitParams property works in the server side IE in any way. But in Mozilla, if InitParams property (which is a string) is zero or string. Momilla does not render silverlight application, only download silver frame.

    This is very strange, because the HTML result from the .asp page is the same in every browser, anyway, if Intel has value, then all are working great. So I think, for the moment, this is the right solution, just add some dummy value to it.


    asp.net mvc - organizing admin related controllers and viewpages -


    व्यवस्थापक अनुभाग www.example.com/admin पर है

    इसलिए मेरे पास एक व्यवस्थापक नियंत्रक है।

    लेकिन मेरे पास उपयोगकर्ता व्यवस्थापक संबंधित नियंत्रक और कॉन्फ़िगरेशन नियंत्रकों भी हैं, मुझे यूआरएल की तरह होना चाहिए:

    www.example.com/admin -> व्यवस्थापक नियंत्रक

    Www.example.com/admin/user/ -> adminUserController www.example.com/admin/user/edit www.example.com/admin/user/add

    1. मुझे नाम AdminUserController से नफरत है , किसी भी सुझाव?

    देखें पृष्ठ इस तरह संगठित होते हैं:

    / दृश्य / व्यवस्थापक / दृश्य / व्यवस्थापक / उपयोगकर्ता /

    इसलिए मैन्युअल रूप से

    "पोस्ट-टेक्स्ट" आइटमप्रॉप = "टेक्स्ट">

    आप एक ही प्रोजेक्ट में एकाधिक उपयोग कर सकते हैं (MVC 2 में)। आपके पास एक व्यवस्थापक क्षेत्र हो सकता है यह आपको सभी नियंत्रकों को एक समझदार तरीके से व्यवस्थित करने और नामकरण समस्या को हल करने देता है: "व्यवस्थापक" क्षेत्र में आपके पास "UserController" होगा।


    java - Compiler difference between IntelliJ and Eclipse -


    I have a class that looks like the following. This class punishes Eclipse Build 20090 9 20-1017:

      Public Squared Mercedes Exporter's Scheduled Expert Services ... ... Public & lt; T & gt; & Lt; Future & lt; T & gt; & Gt; InvokeAll throws interwanted exposure (collection & lt; callable & lt; T & gt; jobs, long timetable, time unit unit) {...} public & lt; T & gt; & Lt; Future & lt; T & gt; & Gt; InvokeAll throws interruptedException (collections & lt; callable & lt; T & gt; jobs) {...} public & lt; T & gt; T invokeAny throws (interceptedException, ExecutionException, TimeoutException {...} public & lt; throws at the time (
  • T & gt; Tasks & lt; T & gt; Task, Long End, TIMEUNIT unit) T & gt; T invokeAny throws (archive & lt; refundable & lt; t & gt; functions) InterruptedException, ExecutionException {...} ...}
  • However, if I intelliJ 9, I compile a compilation error, it will only be compiled in IntelliJ if I & lt; Callable & lt; T & gt; & Gt; With & lt;? Replace all references to callable & lt; T & gt; & Gt; Expands for example:

      public  
      name collision. The method is invokeAll (the collection is & lt;? Repatriated & lt; t & gt; & gt;); Retributable & LT; T & gt type SingleScheduledExecutor's invokeAll (The collection is & lt is the same extinction;; of the type executorService) but it does not dominate  

    Can you make that the applicable ScheduledExectorService that will compile under both the intelles and eclipse? Both IDEs have been configured to use Java 1.5, which is right for my deployment platform. 6 in Java, declares the following method (for example):

     

    > & lt; T & gt; InterruptedException, ExecutionException

    throws invokeAny (t & gt; is the collection & lt;; is repayable & lt; extends & gt; functions) but in java 5, declares this way in the same method Used:

      & lt; T & gt; Interactive Exception, execution exception  

    I do not have Java 5 installed and Eclipse Java EE Galileo 20090920- 1017 (I have been removed from the repository of personnel under Ubuntu and Sun-Java 5-JDK and I am very lazy to install it manually), but in reality, I think that Eclipse is correct.

    Are you sure you are using JDK5 in the Intelligent IDEA (and not JDK 6 with 1.5 level compliance)?


    C# - SQL Server - ? parameters and Oledb -


    I am writing a small frame in C # to import data to SQL Server.

    I have seen that if you try to use it? The placeholder of the parameter, if you use the System.Data.SqlClient namespace, then they do not work.

    However, if you use the System.Data.OleDb namespace to work with the database, then they work fine. (You just have to add provider = SQLOLEDB to your connect string)

    So I have some questions, because? Syntax is necessary for my solution:

    1. Is there a choice to use the named parameter with the system SQL Data Client? I want to use the command parameter.
    2. Can a namespace (ADO provider) be used on another?
    3. Is there any other reason that I have a namespace other?

    To expand what I am trying to do, my framework will take a class decorated with some custom features and will generate SQL as follows:

      myTable (col1, col2, ...) INSERT values ​​(?,?, ...)  

    This string is an IDbCommand and many IDataParameters and each Execution nonclaim can only be set for idata parameter.

    Any thoughts?

    EDIT: I tried to use the named parameter p0, p1, etc. as a responder is described and it is working very well on SqlClient, however if I use Olead So, errors saying this:

      must be declared "scalar variable @ p0".  

    My parameter is created like this:

      New OLDEPPMATOR ("p" + index, gettip); // GetType works to get the right SqlDbType  

    What's wrong? I tried to add and remove the @ symbol to get any benefit in the parameter name.

    Last Editing: Have I Used Oleb? And use the SqlClient nominal parameter. I can change back and forth for new providers.

    The behavior of those classes uses OleDb ?, the SqlClient parameter is named.

    Perfomance: I do not have a standard, but I think the SQL client should perform better with a SQL Server compared to OleDB. SQL client is clear for any type of data source (even excel) for SQL Server, ODDI. But pls try by trying it out.

    With SqlClient you can also have "Order of Parameter", just call the parameter @ Parama 1, @ Ultimate 2, @ Ultimate 3. ....


    php - Program capable of opening a large XML file in windows -


    I need to parse and process the XML feed, unfortunately the feed is in 110 MB size (and I have some But I need to see the framework to be able to parse it (or if someone has any other ideas that I would love to hear it).

    But for some reasons I am unable to edit the file Open. I am on a 64 bit Vista machine with 4GB RAM (and there is a lot to use) but the file crashes every program. I tries to open it.

    Does anyone have any idea how I can parse blindly (server runs Linux ...) ?! (Please PHP please ..!) Or a program that might be able to solve my problem?

    Cheers

    UPDATE

    I have managed to find the problem but I have accepted the answer. It seemed that the XML file was not only large, but it all happened in a row, which seemed to break line limits in most programs. The selected answer textpad + + detected it and broke the file in different lines so that it can be seen ... (anyone can help in the future!)

    < P>

    I have never had trouble opening a large file in TextPad:


    java - Image panel not repainted unless on system events -


    One of my friends asked me to help with the swing, and I reached a point where I got an issue Can not solve So, first I have an image panel

      public class ImagePanel JPanel {Private image img; Public Zero Setizes (String Image) {setImage (New Imaging (IMG) .getImage ()); } Public Zero Set Image (Image Image) {Int width = this.getWidth (); Int height = (int) (((double) img.getHeight (faucet) / img.getWidth (faucet)) * width); This.img = img.getScaledInstance (width, height, image. SCALE_SMOOTH); } @ Override PublicWhite Paint Comonant (Graphics G) {g.drawImage (IMG, 0, 0, empty); }}  

    and a file chooser , where the selected image should be opened in the image panel. It simply calls setImage to ImagePanel . But the image has not been painted.

    However, the image is depicted when the size of JFrame changes (using the mouse). Therefore, the question is, what method is called resizing (using the mouse), which successfully repainted the ImagePanel .

    The icon is using the image media tracker to load the image asynchronously. At that point where you are calling again, invalid, etc., the image is not loading.

    In your paint, replaced

      g.drawImage (IMG, 0, 0, faucet);  

    with

      g.drawImage (IMG, 0, 0, this);  

    In the component class, there is an implementation of Image Observer, which will re-color the image when it is loaded.


    c# - DataGridView CellFormatting event preventing form painting -


    I am using C #, Winforms and Net 3.5

    In my form a custom < Code> Datagrid view (Double buffer has been given to prevent spry during my cellforming events). When I search a database, I bind the resulting dataset to datagridview

    I take the cell formatting event to color the row to a certain color on my data.

    My DataGridview Code:

      resultsGridView.DataSource = results.DefaultViewManager.DataSet.Tables [0]; ResultsGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.AliceBlue; ResultsGridView.BorderStyle = Border Style. Fix 3D; ResultsGridView.CellFormatting + = New DataGridViewCellFormattingEventHandler (resultsGridView_CellFormatting);  

    My cell formatting code:

      zero results Gridview_Gel formatting (object sender, data grid visual formatting request e) {int rowIndex = e.RowIndex; Data GridviewerROOO = Results Gridview Ros [lineindex]; If ((bool) therow.Cells ["sealed"]. Value == true) {therow.DefaultCellStyle.BackColor = Color.Pink; } If (therow.Cells ["database"]. String == "PNG" as value) {torow.DefaultCellStyle.BackColor = Color.LightGreen; }}  

    Everything works great besides this, when I handle cell formatting, the paint event of the whole form stops. Blinking is turned off in the cursor text box, and the manstrip of the form looks like this:

    The top one is before the research, after the menu down until I click the mouse on the menu Yes, I will not redo it again, and then will be in the way to highlight the last item when I take the mouse out of the menubar. Due to the transfer of the form, it needs to be repainted, but then the problem remains.

    The database resolves the problem completely in the resultsGridView.CellFormatting line in the gridview code.

    Am I misrepresenting cells or do I need to handle some more?

    You are probably creating an exception inside this event. I'm not sure how the handling is defined, but with the catch of try, the code will be a first step around.

      try {int rowIndex = e.RowIndex; ....} (pre-exception) {System.Diagnostics.Trace.Error (ex.message); }  

    On the other hand, I do not think that therow.Cells ["sealed"] will work therow.Cells ["dataGridViewTextBoxColumn2"] The cell is indexed by the column name , not DataPropertyName .


    php - Setting cookie path to "/" does not make cookie accessible to entire site -


    Why does the php cookie path do not work for each sub-devices in the domain "/", but only for current Directory.

    Cookie is set:

      setkey ("name", "val", expire_time, "/");  

    It just does not want to work.

    Try domain parameters with:

      setcookie ("name" , "Val", expire_time, "/", ".domain.com"); // Do not forget the prefixing period: .domain.com  

    which will enable all sudomains of "domain.com"


    metaprogramming - python modify __metaclass__ for whole program -


    Edit: Note that this is a very bad idea in the output code. This was an interesting thing for me, do not do it at home!

    Is it possible to modify the __metaclass__ variable for the whole program (interpreter) in Python?

    This simple example is working:

      class chat type (type): def __init __ (cls, name, bases, dct): print "class init" , Name super (ChattyType, CLS) .__ init __ (names, locations, DCT) __metaclass __ = ChattyType class data: data pass = data () # print "class init data" print data   < P> But I would love to do the work in the subbold also to be able change of __metaclass__. For example (file m1.py):  
      class A: pass A = A () print  

    file main.py:

    I understand that Global __metaclass__ is no longer working Python 3.x, But this is not my concern (my code is proof of concept). So is there any way to complete it in Python -2.x?

    OK; IMO This is a gross, hairy, dark magic. You should never use it, but especially in the production code. It's just interesting to inquire, however.

    You can write a custom importer using the mechanism described in it, and further discussed in Doug Hellman it gives you the tools to complete the work you have done.

    I implemented such an importer, just because I was curious. Basically, for the module that you specify through the class variable __ chaty_for __ , it can be imported into the __ dict __ __ metaclass __ Will enter a custom type as the variable>, the first code has been evaluated. If the code in question defines its own __ metaclass __ , then the importer will replace the one already included.

    I have not written many importers, so I may have done one or more silly acts by writing this, it will not be inappropriate to apply any module before implementing this importer. . If anybody misses the mistakes / corner cases in execution, please leave a comment.

    Source file 1:

      # foo.py class Foo: pass  

    source file 2:

     # bar.py class bar: pass  

    source file 3:

      # baaz.py class falcon: pass  < / Pre> 

    and main event:

      # chattyimport.py import import import import import type class ChattyType (type): def __init __ (CLS, names, bases, DCT): print "Class init", name super (ChattyType, CLS) .__ init __ (names, locations, DCT) class ChattyImporter (object): __chatty_for__ = [] Def __init __ (auto, path_entry): def passed find_module (self , Full name, path = none): If the full name is not in itself .__ chatty_for__: try not to return: if path is not: self.find_results = imp.find_module (full name) and: self.find_results = imp.find_module (Full name, path) Previously imported error: None return (F, FN, (SIP, mode, type)) = self.find_results if typ == imp.PY_SOURCE: Returns self returns no DRH load_module (self, full name): # Print '% s loading module% S'% (type (self) .__ name__, absolute name) (F, FN, (SIP, mode, type)) = self.find_results data = f.read () Fullname: module = sys.modules [full name] in the sys.modules All other: sys.modules [full name] = module = types.ModuleType (full name) module .__ metaclass__ = ChattyType module .__ file__ = fn module. __name__ = full name codeobj = compilation (data, fn, 'executive') codeobj .__ dict__ return module class in the executive module. ChattyImportSomeModules (ChattyImporter): __chatty_for__ = 'foo bar'.split () sys.meta_path.append (ChattyImportSomeModules '')) Import foo # print 'class foo init' import bar # print 'class init bar' import barge  

    Review my Django Model - Need lots of suggestions -


    I am dragging various sources to create a person's profile once I do this, I want to have the flexibility to look at different ways. I do not have much expenditures in the DJG so I would like a criticism of my model. Of course, as I coded it, I am thinking about finely, but I would like to know what others think. FWIW - This data was not designed to be pulled - so maybe I should not keep all this but leaving data seems bad ..

    Especially I want to know if that is appropriate for the use of ManyToMany Or you just have to kiss and leave every entry because it is without any many businesses. Long time I think that kissing will make it simple (an original for loop), but to inquire a person In Is a means of being able (Sthan_vivrn or by job function). Anyway I appreciate some input

      class person (models.Model): "" "Other names = models.ManyToManyField (alias)" This simply makes a note user " Hmm this list .. have = models.CharField (MAX_LENGTH = 255, blank = true) cell_phone = models.CharField (max_lenth = 16, empty = true) city = models.ManyToManyField (city) country = models.ManyToManyField (county) department = models.ManyToManyField (department) departmeht_number = model .ManyToManyField (Department_Number) division_code = models.ManyToManyField (Division_Code) email = models.EmailField (MAX_LENGTH = 50) functional_area = models.ManyToManyField (Functional_Area) # jpeg = model. Job_classification = models.ManyToManyField (Job_Classification) job_classification_code = ModalToManyField (Job_Classification_Code) last_name = models.CharField (max_length = 255) location_description = models.ManyToManyField (Location_Description) location_path = Model. ManyToManyField (Location_Path) mail_address = models.CharField (max_length = 255, blank = true) MAIL_DOMAIN = models.ManyToManyField (MAIL_DOMAIN) mail_file = models.CharField (MAX_LENGTH = 255, blank = true) MAIL_SERVER = models.ManyToManyField (MAIL_SERVER) match_pct = models.CharField (max_lenth = 6) name = model. CharField (MAX_LENGTH = 255) name_reverse = models.CharField (MAX_LENGTH = 255) nickname = models.CharField (MAX_LENGTH = 32) notes_url = models.URLField () # object_class = model. office_phone = models.CharField (MAX_LENGTH = 255, blank = True) other_phone = models.CharField (MAX_LENGTH = 255, empty = true) position = models.ManyToManyField (status) section = models.ManyToManyField (stream) section_code = models.ManyToManyField ((code) = shift model. many Tom Mainifild (shift) state = model. many Tommanfidl (state) supervisor = model. many Maifild (supervisor) supervisor reverse = model. many Menifild (Suprwaijr_rewars) UID = Modlkkrifild (Max_long = 128) def __unicode __ (self): return str (self.name)   

    Here are some ideas.

    I think that you department and job_classification for example.

      class section (models.Model): name = Models.CharField (MAX_LENGTH = 100) Number = Models.IntegerField  

    And then there is a lot of organization for the department otherwise, if you have department = ['hr', 'finance'] and If someone is a person with department_number = [12, 5] , then I do not think there is any Defense Department does not show that represents what type of number is.

    If the fields I find are easy models to read alphabetically instead of being classified based on what they describe. EG I think that names , alias , last_name should be defined together.

    Finally, maybe aka should be a different model with foreign to person , because only one person has a special nickname needed.


    .net - Casting a list of objects to their interface type in C# -


    I know that I can remove an object from my own type of type in my own way like this:

      IMyInterface myValue = (IMyInterface) MyObjectThatImplementsMyInterface;  

    I IList to IList & lt; IMyInterface & gt;

    How do I put

    I answered the same question though For base classes instead of interface.

    How to make this work the list and elements inserted can be done using the Converted Around:

      IList & lt; A & gt; ListOfA = new list & lt; C & gt; (). ConvertAll (x = & gt; (A) x);  

    You can also use the link:

      IList & lt; A & gt; ListOfA = new list & lt; C & gt; (). Cast & lt; A & gt; (). ToList ();  

    popup - Javascript OnClick Event - 2 functions -


    मैंने इस js फ़ंक्शन के लिए एक onclick घटना का इस्तेमाल किया:

      window.opener.location Href = फोबोर;  

    मूल विंडो में फ़ॉबोर को लोड करने के बाद यह विंडो बंद होनी चाहिए। यह एक पॉपअप है (जे एस के साथ आइडेंट किया गया है)

      window.close ()  

    काम करना चाहिए।


    java - TreeMap only allowing one item to be put into it? -


    I am developing Java application and am new to using TreeMap. The program needs to keep track of the number of incidents of each word in the text file, however, I am having trouble putting my data in the treemark.

    When I use the same exact code to insert data in a hashmap, then I work properly, but I need value.

    I have been working on this for two days and completely stumped!

    The word class:

    Is applied to {this.tesdxt = s; Thnt = 1; } Public int coeTo (object x) {sd if (thiunt & lt; temp.count) {return return 1; } Sd} Public Zero inemnt () {this.cot ++; } Public spoken equivalent (object obj) {d temp = ((ls (temp.text) and this.unt == temp.count;} public int hashCode () {return.tshCode ()} + Integer.toSsdtring ( Calculation) .hashCode ();} public string toasting () {this.text return}}

    counting class:

      Public class calculation {public mathematics} () {} public iutTest () {for (int i = 0; i <5; i ++) {sortedCoun.put (new word ("testword #" + i) , 1);} Backdated wordcaves size ();}}  

    Commuter class:

      public class Sort appleter impleWord, integer & gt; c Sha} {this.map = map;} public int comparison (object o1, object o2) {if!! Map.consKey (o1) ||! Map.coninsKey (o2)) {return 0;} if (mapet OA1)) & lt; map.get (o2)) {retrn ap.get (o2)) {return 0; } E {Return -1; }}}}}  

    There are several problems with your code.

    First of all, a TreeMap has been ordered by its keys; Its not value.

    Second, you can not use something as a key if its value can be changed into a map or set (where the value corresponds to its equivalent () method.) < / P>

    Thirdly, you should not apply the same () without applying the hash code ().

    They should get you the way there!


    licensing - Things to consider w/microsoft technologies? -


    I am in the process of employing a public facing web application. I have not decided which platforms I / Will still use the device, but it is one of the asp.net or lamp flavors.

    My question is whether there are licensing or other issues on which I should consider whether I am a FP. The last thing to know is that I have missed some licensing issues or because I am using the net and I have learned that Microsoft has anything or anything to write.

    Thank you!

    "post-text" itemprop = "text">

    You can use the Studio Express Edition for free, SQL Server Express is the same but if anything, If you are going to use a non-express edition, you will need to buy a license for it, often, the license is covered in the web host (usually on a small increase in charge for you) Contact the host New best However, using Aspiknet is free to use can be used with MySQL so you go down that route. If you are thinking of starting a business with this, then you would like to take a look at this plan because it gives you 3 years worth of license for MS Developer products.


    javascript - disableing enter/return key from within Tiny MCE -


    Hello I have tried several "goggles" snippets to disable the login / return key but nothing is working is. Any ideas about deactivation of the entry / withdrawal key in the Tiny MEEE textile?

    Here is the code I used to disable on some inline elements. It works with TinyMCE 4:

      tinymce.init ({tinymce_jquery: true, selector: ".className", inline: true, toolbar: "undo", menubar: wrong , Setup: function (ed) {ed.on ('keydown', function (e) {if (e.keyCode == 13) {e.preventDefault ();}}};}});  

    ajax - jQuery, how to call a function while passing a variable -


    I want to use jQuery's .get method to send an AJAX call to the server.

    I using this line:

      $ Receive ("InfoRetrieve", {}, addContent (data));  

    As you can see, I want to call a function call addContent and pass it to the data that has been received from the server.

    The function addContent is below:

      function addContent {data} {$ ("# 0001"). Attachment (data); }  

    This does not seem to work, can you see why?

    Just change it:

      $. Get ("InfoRetrieve", {}, addContent);  

    This function will take care to pass data when calling.


    c - Library / Data Structure to store convex polygon with holes -


    I want to map a building. This area is a convex polygon in which there are several non-overlapping convex holes. As a simplification, the area can also be expressed as a rectangle. The hole can also be prepared as a rectangle.

    I tried to handle it with GOOS, a C ++ library, which comes with low level C API. But it appears GOOS is not capable of handling the amount of requests.

    What is the best data structure to handle the map? Maybe a Chaudhary? Is there a ready-to-use library (beyond the academic proof of concept stage)? Library should be C (not C ++)

    Store the map as a list of directed line segments (so that we can determine whether We are behind or behind a segment):

      Structure Segment {Pos2 p0; Pos2 p1; Ent Hole Index; // what division this segment divides};  

    Then divide the segments into one:

    struct BSPNode {Segment split; BSPNode * infront; BSPNode * Back; };

    Then you can find the hole with this code:

      int findHole (BSPNode * node, pos2 pos) {if (! Node-> Back ) {// This node is a leaf (if previous (pause2, node-> division)) {return node-> Partition- & gt; Hole index; } And {return -1; // Point is not in a hole}} If (is, (pause2, node-> division is)) {return search (node-> behind, position); } Else {return findHole (node-> infron, pos); }} Int hole = findHole (root, some POS); If it is  is  such a case that each hole has a single rectangle, then you can make a rectangular hole set by bisp by making a rectangle in each division.    struct BSPNode {union} rectangle rectangle; // Lead node guidedline splitter; // branch node}; BSPNode * infront; // If the tap indicates that it is a leaf node BSPNode * behind; }; Int SearchHole (BSPNode * Node, POS 2 Pauses) {if (! Node-> Back) {// This node is a leaf if (Inside (Pause 2, node-> Rectangle)) {return node- & Gt; Rectangle->; HoleIndex; } And {return -1; // Point is not in a hole}} (if (after 2, node-> splitter)) (return search hole (node-> behind, position);} Else {return findHole (node-> infron , Pos);}}  

    c# - How can you inject a session reference -


    Can you inject a session reference into your class through the structure class

    < P>

      & lt; & Gt; For HTPSessionStatbase (). TheDefault.Is.ConstructedBy ((= => New HTTP session on the webpage (HTTPCTX Current Session));  

    Now any class obtained through the StructureMap should take the HTTPTC installation box as its one constructor parameter.


    Javascript Div remote server cross domain populating -


    I want to place html pages around a JavaScript that calls a remote javascript file in my server, Give the detailed datas content back to the HTML page where JavaScript will populate a device from the ID with the given data.

    What is a possible way to do this? The data will be calculated in PHP.

    use


    iphone - How can I disable a UITabBar? -


    How do I deactivate the tab bar of UITabBarController? I want to disable UITabBar and click on a button to enable it.

      UIT bar administrators Tabbar UserInteractionEnabled = NO;  

    How do I profile stored procedures on Oracle? -


    There is an Oracle DB on which I have access. I can view my package using Aqua Data Studio and ask questions for it. I do not have access to the server's file system.

    There is also a binary that uses that database by calling stored procedures from it.

    I want to know which types of stored procedures and which parameters are used by this binary to do this, it is impossible to do this with "Oracle's Statement Monitor" - this is just a direct query call Logs in, not stored procedures.

    If I do not have access, can it be done with an underlying trace?

    You can use the DBMS_ PROFILER package:


    c++ - Default assignment operator in inner class with reference members -


    I have participated in a problem I did not understand and I was hoping that somebody here has some insights May be provided. Simplified code is as follows (original code was a custom queue / queue-iterator implementation):

      class B {public: b () {}; Class C {Public: int get (); C (B & B): B (B) {}; Private: B & amp; B; }; Public: C get_c () {return C (* this); }}; Int main () {B b; B :: cc = bgt_c (); C = b.get_c (); Return EXIT_SUCCESS; }  

    This, when compiled, I get the following error:

      foo.cpp: member function 'B :: C & amp; ; B :: C :: Operator = (Const B :: C & amp;) ': foo.cpp: 46: Error: Non-Static Reference Member' B & amp; B :: C :: B 'can not use the default assignment operator, foo.cpp:' int main () 'in the function: foo.cpp: 63: Note: The synthesized method is' B :: C & amp; B :: C :: Operator = (Const B :: C & amp;) 'First is required here  

    I can go around using two different variables Because they should be free 'C' objects, but it only hides the problem (I still can not understand why I can not do this).

    I think the reference can not be copied, why does T understand that I need to provide my own assignment operator and copy the constructor?

    Internal classes of this problem. In C ++ you can not only assign (re-assign) - they need to be started when defined.

    A simple example:

      class B {public: B (int and eye): IR (i) {}; Integer & amp; Ir; }; Int main () {int i; BB (I); // Constructor - Okay Int J; Bbb = b (j); // copy constructor - fine BB = b; // Assignment - Error 0; }  

    c# - WPF : Can I bind an enum to a combo-box? -


    I am trying to display a combo box which is a set of predefined values ​​- in this case an enum . For example:

      public enum protocol {UDP = 0, TCP, RS232}  

    Although I think it has failed to fulfill it. Is this possible at all? I have tried to use the database but Blend has received all the classes from the namespace only, no enum (the object is not clearly)

    Force your combo box :

      var name = Enum.GetNames (for typeof (protocol)  Name ;  

    c# - How can I format a nullable DateTime with ToString()? -


    How can I change the nullable DateTime dt2 to an empty string?

      DateTime = DateTime.Now; Console.lightline (dt.tostring ("yyyy-MM-dd hh: mm: ss")); // Does the date work? DT2 = DateTime.Now; Console.light line (dt 2.toString ("yyyy-MM-dd hh: mm: ss")); // returns the following error:  

    There is no overload for the method.

      console. WrightLine (dt2! = Null? Dt2.Value.ToString ("yyyy-MM-dd hh: mm: ss"): "n / a"); Edit: As mentioned in other comments, check that there is a non-empty value there. 


    Can you recommend a selectable Javascript Timetable widget? -


    Does anyone know of the JS "Time Table" widget?

    I need the following:

    • On weekdays column & amp;
    • Days of the day in rows
    • 1 hour time slot cells (or customizable)
    • The ability to select multiple times during the week Highlighting the mouse / Select Room
    • Select the time of the week (for example, highlighting on a 6-minute time slot with a mouse on Monday to Friday)
    • In one day many Select times (like with a mouse Monday at 10:00 on Monday)
    • One selected per day The time limit (such as 0800 to 0100 and 1300 to 1700)
    • The program is loading when the page loads (so they are already highlighted)
    • Widget inquiries for the selected time
    • The number of hours shown for each day, e.g. Just 6 hours to 11 o'clock
    • Customizable CSS / look and feel
    • Required to do something other than the time the user wants to choose (something like that is not useful)
    • "post-text" itemprop = "text">

      is a Jquery plugin called the full calendar, Those who are trying to do will work perfectly. There is a new view called "Agendaike" which will give you a one-week view from time to time for each day. Hope that help!


    wget - Confirmation of Successful HTTP Download in Python -


    Is it an easy and reliable way to ensure that a web download is for Python or WGET [big files]? I want to make sure that the file is fully downloaded before performing another action.

    practice, believe me) HTTP / 1.1 header section, expecting how long you have the institution body If you expect this, you can decide that you have got all the institution data. See for full details, but essentially:

    • Sometimes the content-length indicates the length of the correct entity entity
    • ever -Only the entity body is reacting to the response code or if the response is responding to a HEAD request
    • ; Sometimes the transfer request is encoded; And the HTTP data has some markers that 'I am now doing' ( transfer encoding: selected ) and occasionally, the message is officially done when The connection closes (in that case, you can not differentiate between getting the whole thing and the initial deduction)

    In all cases, but the last one, you can tell Whether you got the whole thing or not. I do not know that specially any device (wget or existing dragon library) gives you an easy explanatory signal that your reaction or deduction was not done.


    linux - Cake php Missing helper, working on local but not on remote -


    Faced with this issue and none of the following online solutions were really helpful: using all my project KP Doing was working perfectly on a local Windows machine but Linux is not working on the server and was presented with this error:

      missing helpful error: HTMLHelper met. Error: Create HTMLHelper file below: App / View / Helper / HTMLHelper.php  

    Finally I came to know that I did not remember any supporters, but this issue was in the Cpt file and Linux and Windows used that file in different ways Read from I will write the following answer

    By changing the way it was resolved:

      $ this-> HTML-> Script $ this- & gt; HTML-> Script  

    To do this:

      $ it-> HTML-> Script  

    winapi - adb: event when Android phone connects to Windows -


    Does the Android phone connect to via ADB when someone receives an event on Windows The easiest way?

    It should work in plain C with windows API (i.e. no java!) And do not trust voting. I.e., I do not want to call adb list in the loop. I have some small KB footprint running in the background which gets notified via a device or a window message when the device connects.


    javascript - json array disply in <li> using angular js -


    After receiving the JSON array I am receiving the API call, I am following the JSN response. "Audit": {"Source": "Medicare", "The": "Labels": "Labels": "Skin Amount"}, Date ":" "-" other - iodine "," other "-" "," label ":" 2015-03-02T18: 39: 23Z "," update date ":" 2015-03-02T18: 39 : 23Z "," version ":" 1 "}," label "end": "2007-10-28 T 00: 00-04: 00", "Start": "1993-01-01 to 00: 00: 00 -05: 00 "," Date ":" 2015-03-02T18: 37: 42Z "}".

    and I only need to display

    ": [{" seriousness ": {" label ":" in leak tag How can I do this?

    Send me & lt; Need to populate this json array in li & gt; In html5, how can I do this? I'm using logical.

    Angular JS File:

      Residential.one ('APIINAM', parameter_to_api) .get () Then (action (result) {$ Scope.datalist = result;}  

    HTML file

      

    Try it

      var app = angular module ('app', []); App.controller ('firstCtrl', function ($ Scope) {$ scope.datalist = {data1: [2, 3, 4], data2: [6, 7, 8,], data 4: [9, 10, 12]}});  
      & lt; script src = "https: // ajax. Googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> bodyng-app = "app" & gt; div ng-controller = " FirstCtrl ">  gt; & lt; li ng-repeat =" i in data "& gt; {{I}} & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; / Body & gt;  


    windows - How to compare two dates entered in format MM-DD-YYYY? -


    मुझे दिखाया गया प्रारूप में उपयोगकर्ता से StartDate और end date {/ code> प्राप्त होता है ।

    मैं इन दो तिथियों की तुलना कैसे कर सकता हूं और StartDate को EndDate से कहीं अधिक नहीं मिल रहा है या दूसरी तरह से?

      सेट / पी स्टार्टडेट = "स्टार्टडेट (एमएम-डीडी-वाई वाईवाईवाई) दर्ज करें:" सेट / पी एंडडाट = "समाप्ति तिथि दर्ज करें (एमएम-डीडी-वाई वाई वाई वाई):"  

    सरल < <>

    कृपया मुझे निर्देश दें और कोई मदद काफी सराहना की जाती है।

    Div class = "post-text" itemprop = "text">

    टिप्पणीकर्ता का मतलब क्या है जैसे बैच कोड का प्रयोग करना:

      @echo off setlocal set / p "StartDate = आरंभ तिथि दर्ज करें (एमएम-डीडी-वाई वाई वाई वाई): "सेट / पी" समाप्ति दिनांक = समाप्ति तिथि दर्ज करें (एमएम-डीडी-वाई वाई वाई वाई): "सेट" तिथिस्टार्ट =% स्टार्टडेट: ~ 6,4 %% स्टार्टःडेट: ~ 0,2% % StartDate: ~ 3,2% "सेट" तिथिईन्ड =% समाप्ति तिथि: ~ 6,4 %% समाप्ति तिथि: ~ 0,2 %% समाप्ति तिथि: ~ 3,2% "यदि% दिनांकस्टार्ट% जीटीआर% दिनांकएन्ड% (प्रतिध्वनि आरंभ तिथि %आरंभ करने की तिथि% अंतिम तिथि से अधिक है% समाप्ति% ) और यदि% तिथिस्टार्ट% ==% दिनांकएन्ड% (प्रतिधारा प्रारंभ की तारीख% प्रारंभ दिनांक% बराबर की समाप्ति तिथि% समाप्ति% है।) और (समाप्ति तिथि% प्रारंभ तिथि से गूंज प्रारंभ%% समाप्ति तिथि से कम है।) एंड्लोकल  

    स्ट्रिंग मैनिपुलन्स के स्पष्टीकरण के लिए प्रारूप में एमएम-डीडी- YYYY को YYYYMMDD में परिवर्तित करने के लिए संभव है जिससे कि दो तिथियों की तुलना करना पूर्णांक या तार एक कमांड प्रॉम्प्ट विंडो खोलें, सेट


    css - How to align input with a checkbox (pull-right) in the same row? -


    I have a text input and a checkbox in the same line if I add the checkbox to the pull-right square, then I How can I fill the rematch with the text input on the left? I'm using Bootstrap 3.

      & lt; Div class = "check box i-checks pull-right" & gt; & Lt; Label & gt; & Lt; Input type = "checkbox" & gt; & Lt; I & gt; & Lt; / I & gt; Fixed width labels & lt; / Label & gt; & Lt; / Div & gt; & Lt; Input class = "form-control" & gt;  

    This bootstrap is created in CSS.

    Use input-group, and use input-group-apon, insert it before or after input inside the input-group.

      & lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-lg-12" & gt; & Lt; Label = "input_name" & gt; My field & lt; / Label & gt; & Lt; Div class = "input-group" & gt; & Lt; Input type = "text" name = "input_name" class = "form-control" aria-label = "..." placeholder = "text to the left, check there on ==> & Gt; & Lt; Span class = "input-group-adon" & gt; & Lt; Label & gt; & Lt; Input type = "checkbox" aria-label = "here to the right" & gt; Title label & lt; / Labels & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt ;! - / input-group - & gt; & Lt; / Div & gt; & Lt ;! - /.col-lg-6 - & gt; & Lt; / Div & gt; & Lt ;! - /.row - & gt; & Lt; / Div & gt;  

    Error with cmake and jsonCPP static library target "jsoncpp_lib_static" -


    itemprop = "text">

    When I try to use cmake on jsonCPP I get the following error

      CMake error On lib_json / CMakeLists.txt: 73 (Instal): Targeted static library target given a collection destination for the target "jsoncpp_lib_static"  

    I use the command from readme:

    < Pre> cmake -DCMAKE_BUILD_TYPE = debug -DJSONCPP_LIB_BUILD_STATIC = on -DJSONCPP_LIB_BUILD_SHARED = G. "Unix Makefiles" ../ ..

    After

    error, it's like you're pointing CMake inside CMakeLists.txt look".

    Defines the variable ARCHIVE_INSTALL_DIR on CMakeLists.txt and it's the goal.

    is used in "/jsoncpp/src/lib_json/CemakeLists.txt" because you are leaving the root CMakeLists.txt, so this variable never sets.

    The path lib_js is mentioned in the error message at / CMakeLists.txt: 73 , and this is relative to the "main" CMakeLists.txt - that is what you used to execute it for the first time Had told the seamke on that, had done it. Then CMake thinks that the root "jsoncpp / src" is instead of the real root.

    Actually, to fix your error, clean your construction folder then re-run the CMake to point to the "/ jsoncpp" folder.


    By the way, though docs do not specifically mention this, I think this is case-sensitive. You must do -DCMAKE_BUILD_TYPE = debug .


    notepad++ - Keeping strings with wild cards intact while adding CRLF to begining of string -


    I want to change the string of each month in a horse racing program. For example, from January 1 to January 31, February 1 to February 28 and so on and insert a CRLF in front of it to create a new line. I need to keep the date intact when I create a new line. This is the part that I can not use on a wild card and retain the original date.

    Slal


    java - Increment counter as object is created not working -


    I just want to raise a variable, numOfBodies am, as has created a new body and use this value my main Is in the class. Why is not it working properly? Although I used to work it steadily?

      Int DeltaTime = 500 * body.DateName ();  

      public class physical {public static inte numOfBodies; Public body () {numOfBodies ++; } Public static int getNum () {return numOfBodies; }}  

    On the basis of this note:

    I do not think it was relevant to the question. I am pressed once after the program is started by pressing 'M'. I want Deltataim to update because I 'm' and press more often, namely to create more bodies

    It seems that my guess is right, you believe That DeltaTime has created a new body automatically, and it is not how Java works. To do this, you must update the Delta Time clearly. One way is to use a supervisor design pattern, perhaps whenever a new body is created, using the PropertyChangeSupport to update the deltaTime.

    Although it is being said, I never used to listen to a stable property without changing a property

    But for example:

      import java.beans.PropertyChangeEvent; Import java.beans.PropertyChangeListener; Import java.beans.PropertyChangeSupport; Import java.util.Scanner; Public Class TestBody {Private Stable Last String QUIT = "left"; Public static int deltaTime = 0; public static void (String [] args) {Body.addPropertyChangeListener (Body.NUM_OF_BODIES, new PropertyChangeListener () {@Override public void propertyChange (PropertyChangeEvent evt) {deltaTime = 500 * Body.getNum (); println ( "Deltataim:" + Delta time);}}); Scanner scan = new scanner (System.in); String line = ""; While (! Line.contains (QUIT)) {System.out.print ("Please enter to create a new body, or type \" Skip \ "to leave:"); Line = scan. NXtine (); Body of body = new body (); }}} Class physical {public static final string NUM_OF_BODIES = "number of bodies"; Private Static PropertyChangeSupport pcSupport = New PropertyChangeSupport (Body.class); Private static volatile int numOfBodies; Public body () {int oldValue = numOfBodies; NumOfBodies ++; Int newValue = numOfBodies; PcSupport.firePropertyChange (NUM_OF_BODIES, old fashion, newcomer); } Public static int getNum () {return numOfBodies; } Public static Zero addPropertyChangeListener (PropertyChangeListener) {pcSupport.addPropertyChangeListener (l); } Public static zero extraction Change the ChangeElaster (Property Change Listener) {pcSupport.removePropertyChangeListener (l); } Public static void addPropertyChangeListener (string property name, property change Listnr l) {pcSupport.addPropertyChangeListener (propertyName, l); } Public Static Zero Extracting ReplaceLearer (String Properties, Property Change Listener) {pcSupport.removePropertyChangeListener (propertyName, l); }}  

    java - Trouble Running simple JUnit Test through Ant on eclipse -


    I have the following juneet test in Eclipse:

      Package testing; Import org.junit.Test; Public square simpleJuynette test {@Test Public Zero () {System.out.println ("Tested"); }}  

    and the following build.xml in the same folder:

      & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Name of the project = "loggerast" default = "junket test" = "." & Gt; & Lt; Goal Name = "JUnitTest" & gt; & Lt; JUnit & gt; & Lt; Classpath location = "../../ lib / junit.jar" /> & Lt; Test name = "test.SimpleJUnitTest" /> & Lt; / JUnit & gt; & Lt; Echo & gt; Bu & lt; / Echo & gt; & Lt; / Target & gt; & Lt; / Project & gt;  

    If I run a test class under "Run as ..." and selects JUnit, it runs without error. If I run Build.xml under "Run edge ..." and select the ant build then I get the following output:

      Buildfile: C: \ Users \ 995868 \ workspace \ JUnit1 \ Tst \ Test \ build.xml JUnitTest: [junit] Test Test. SimpleJunetTest failed [Echo] Boo Boo succeeded Total time: 390 milliseconds  

    If I remove the classpath attribute under Janet, then I have a different error about the necessity of junior jar on classpath Message, so I think that using JUnate I can not understand what its error is here. I have tried to load the class to a system.out.println () by inserting static block code in class, and it does not appear, so it seems that I'm doing Am I wrong in the configuration

    Can anyone tell me what is wrong here?

    Edit:

      Directory structure: Genus1 - Bean - Test - SimpleUnited Test - Lib --junit.jar --scripts --build.xml - Src - tst - test --SimpleJUnitTest.java  

    I also copied build.xml to TST and participated in that directory from the command line, the same result.

    I have copied% ant_home% \ lib to junit.jar without any effect, though, when I took the fourth class out of the orbit, I got the message "Including Junit. Should not, if not in the ant of its ant "I'm not sure where" ant's own square "is specified. A class path block with a new error message is:

      & lt; Classpath & gt; & Lt; Pathelement location = "c: /users/995868/apache-ant-1.9.4/lib" /> & Lt; Pathhelp location = "../bin" /> & Lt; / Classpath & gt;  

    I am not using the Hamstrist feature anywhere, so I have not seen it and have put it. I was trying to make a simple example, at least not mentioned) that hamkelst is necessary.

    I think you are missing hamcrest-

    Edit: and you are missing the test file class from your classpath. You will need to update your classmap in the following way:

      & lt; Classpath & gt; & Lt; Pathhelp location = "bin" /> & Lt ;! - This is your test class - & gt; & Lt; Pathelement location = "lib / hamcrest-core-1.3.jar" /> & Lt; Pathelement location = "lib / junit-4.12.jar" /> & Lt; / Classpath & gt;