Sunday 15 January 2012

c# - SQL Injection filter method for ASP.NET -


I have fields that are free form text and allow about any combination of numbers / symbols. What is the best way to validate SQL injection? Can I run a simple place of tick marks? Is there a way I can plug to use?

Just use parameterized questions! Check out this article here:


delphi - How to return a record in a DataSnap method -


I want to be able to declare the data snap method with the following signature

  Type TLoginInfo = Record Username: string; Password: string; Lastlog: Datetime; End; GetLoginInfo function (CONSTORE UserID: integer): TLoginInfo;  

When I try to call it, it says that TloginInfo is not well known

If you are using the "new" datenet then look here:


encryption - iPhone SDK - CCATS required if using Keychain Access? -


Am I planning to use the key in an iPhone app to store some username / password information Do I still need to file for a CCATS?

If you use the already available crypto libraries in the iPhone SDK, If not, you will not need a CCATS The technically exporting of any encryption will be an encryption code for Apple and therefore you should be free and clear.

For more information, see this topic.


asp.net - Intermittent PolicyException: Execution permission cannot be acquired -


Text after "

We intermittently see the following exceptions shortly after an application pool recycle in ASP.NET applications: < / P>

  System.Configuration.ConfigurationErrorsException: The file or assembly could not load Microsoft.Web.Mvc, version = 1.0.0.0, culture = neutral, publicKeyToken = null 'or one of your dependencies. Failed to allow execution. (Exception with HRESULT: 0x80131418) --- & gt; System.IO.FileLoadException: Failed to allow file or assembly to execute 'Microsoft.Web.Mvc, version = 1.0.0.0, culture = neutral, public keypoint = faucet' or one of its dependencies could not be loaded. (Exception from HRESULT: 0x80131418) Name File: 'Microsoft.Web.Mvc, Version = 1.0.0.0, Culture = Neutral, PublicKeyToken = Nulled' --- & gt; System.Security.Policy.PolicyException: Permission can not be obtained for execution. On System.Security.SecurityManager.ResolvePolicy (proof proof, permission asset reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet & False, Boolean Check Exclusion Promotion) (Proof proof, permission Asset reqdPset, PermissionSet on System.Security.SecurityManager.ResolvePolicy OptPset, PermissionSet denyPset, PermissionSet & amp; on System Disclaimed, Int 32 and Security Special Flags, Boolean Check Execution Promotion). Reflections.exabilities._update (assembly name filename, string codebase, proof assembly security, assembly placeholder, stack crawl mark and stack marker, boolean throwoverflow knotfound, boolean for introspection). AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark & ​​amp; stackMark, Boolean forIntrospection) System.Reflection.Assembly.InternalLoad (string assemblyString, evidence assemblySecurity, on StackCrawlMark & ​​amp; stackMark on System.Reflection.Assembly.Load, Boolean forIntrospection) (S System.Web.Configuration.CompilationSection.LoadAssemblyHelper on Tring assemblyString) (string AssemblyName, Boolean starDirective)  

specific DLL fails to load varies for this event from the event, but always refers to a main assembly .

We are running on ASP.NET 3.5 on Windows Server 2008. It seems that this does not happen in batches affecting some sites on the same app pool. We have a large number of sites running the same code.

Once a site fails to load the DLL, it throws a yellow screen off death until the next app pool recycle. We have not been able to reproduce this behavior and sites work fine for days or weeks before the failure (and recycle multiple app pools).

Has anyone else seen such behavior?

Update:

We tried to reproduce a script written failure to hit the set of a few hundred sites and times Couple of minutes and even a few others were unable to complete the loading of the server's CPU straight for a few days.

We Aspi.ankti.al.al.al with copies to try to play the (locking of DLLs, the file is changed to allow). Does and succeeds in reproducing similar behaviors but not the only exception.

Does anyone have any idea how to adjust the security policy? is to throw the System.Security policy Ethics: Permission can not be obtained for execution. While loading a specific DLL? In

load

"process IIS application pool settings under the model" user right profile.

to


crystal reports : substring error -


I have developed a workaround because crystal reports do not have a substring function with the following formula:

P> What am I trying to do , Searches for the duration (".") In a string, and changes it with a comma. Then get the status of the comma in the Stram and print all the letters after the comma. Only 1 period in the string will be in the entire string.

Now when I try to do this, I get some weird letters that look like wings. any idea?

Thanks in advance

I do not know the whole issue that you have to complete Trying, but only for this question, the steps to replace the period with a comma seem unnecessary. If you know that there is only one string in it and you only want the characters of that period, then you should be able to do something (this is @first_formula):

  right ({_ V_hardware.groupname}, len ({_v_hardware.groupname}) - instr ({_ v_hardware.groupname}, "."))  

If for some reason you show comma So if I want to separate the formula. If you need a full screen coma space then just do this:

Change
  ({_ v_hardware.groupname}, ".", ",")  

And if you need a comma then it may be easy to do something like this:

  "," + {@first_formula} " > 

Hope it helps.


javascript - How to trigger Mouse-Over on iPhone? -


It may actually look like a dumb question, but I am writing an application and where I have come across my mouse over, mouse-click and mouse-hover need different events bound for them. Now all this works as expected on Internet Explorer, Firefox, and Safari

However, actions on my iPhone will not be triggered. Now my question is that when I hold my finger and trigger an event If I do, can mouse-over be compulsorily removed?

An example where this does not work is correct on this website when you hover a comment, it should display 1 or flag icon.

I am using jquery.

I think you need to reconsider your design for the iPhone (and that's what Any mobile for mobile) iPhone web interface should not be dependent on mouse over and zoom, because they make the interface very complicated.

I strongly recommend that you design a new interface that is optimized for viewing mobile, which is not required, show more options by clicking on the small and small arrows.


datagrid - wpf DataGridTextColumn refactoring -


I use a Dokgreed'm in a WPF app which a) column for each day of stay (only weeks A sample of XAML is below in its data index, which is only different.

Can I refactor in something more dry?

Cheers, Berryl

Sample XAML (Seven columns from either):

  & lt; DG: DataGridTextColumn header = "{Binding Source = {StaticResource detective} path = DataContext [0] .EventDate, Converter = {StaticResource DateConv}}" CellStyle = '{StaticResource DataEntryCellStyle} "width =" 60 "CanUserResize =" false " Binding = "{binding allocation [0] .mount, converter = {StaticResource amtConv}}" /> & Lt; DG: DataGridTextColumn header = "{Source = {StaticResource detective} path = DataContext [1] .EventDate, Converter = {StaticResource dateConv} Binding}" CellStyle = '{StaticResource DataEntryCellStyle} "width =" 60 "CanUserResize =" false " binding = "{binding allocation [1]. The amount, Converter = {static resource Amticonw}}" />  

edit == add'l info @ JALFP ===

The compiler complains that the goal type is not a framework element when creating

   & Lt; Setter Property = "CanUserSort" value = "wrong" /> & Lt; Setter property = "width" value = "60" /> & Lt; Setter property = "cell style" value = "{static resource data intergridcloth style}" /> & Lt; / Style & gt;  

I do not see anything that looks like a column style What property would I set this style to DataGridTextColumn in XAML?

Maybe you can create your own class that inherits from DataGridTextColumn and Add a new dependency Property Day Index (up to 0 to 6). And in this category, you can initialize are Aksamel ...

But I'm not sure that it will actually be better and more suitable solutions ...


haml - ruby - if string is not contained within an array -


I want to output only one anchor if the current_page is in the array then let me (.html and -nf.html) get. If this is not in the array then I will get many anchors because there are items in the array I

I am using.

- If page_f [[current_indix]]

    Edit:  

If you want your first search to be the only one, you can break each loop. But now it looks a bit weird because you are running on an array again and after breaking the first element, whatever it may be. Am I completely addressing your problem?

  option [: pre_flash] = ['string_one-nf', 'string_two-nf', 'string_three-nf'] Page_ Western [: pre_flash] .each Do | Every_string If current_page.include? Every_string% li% a {: href = & gt; "Page # {page_options [: current_index]} - nf.html" ,: class = & gt; "Next"} # this is the last anchor brake and% li% a {: href = & gt; "Page # {page_options [: current_index]} .HTML" ,: class = & gt; "Next"} # This is the last anchor brake end and  

r - Problems with Newton's Method for finding coefficient and Hessian -


I'm trying to write a function which is Newton's method (Coefficient ++ (Inverted hessian) * gradient ) To find a multiplier for a linear model, here and there

I am using the following code:

## Reading in data data & lt; -read.csv ('hw8.csv') Summary (data) # yi and xi with data file attached (dat) ## x of x and lt; -cbind (1, xi) mle & lt; -function (c) {gi & lt; - Making columns of 1-yi * exp (c [1] + c [2] * Xi) Hello & lt; - G-1H & LT; - -1 * (T (x)% *% high% *% x) G & lt; -T (x)% *% gi c & lt; -c + solution (h)% *

When I run the code, I get the following error:

previous> error in t (x )% *% Hi% *% x: Non-submissive arguments stopped at RMate line 29

Given that the formula has been designed with the problem of Green, set me not It seems that this is a thread problem, I think I am doing something wrong in passing my work.

How can I fix this? Any help with this function will be greatly appreciated.

As Jonathan said in the comment, you need a proper dimension:

  R & gt; X & LT; - Matrix (1: 4, Niacal = 2) R & gt; T (X)% *% X [, 1] [, 2] [1,] 5 11 [2,] 11 25 R & gt;  

But you should use the appropriate tool so that the log in function can be found in the stats package and / or MASS package in the> loglm function. Both will be installed by default with their R installation.


hibernate - What is the correct syntax for an ejbql query that traverses four levels of many to one relationships -


In JPA (Hibernate) I have a simple data model that has many relationships from one and the other to one:

/ P> <-> City -> State -> Governor -> Nation -> Continent

Where the state is for a state, there is one for the state governor;

I want to get an example of a single town with my unique ID and use it Nbndit state, governor, country and continent want to get the interest. I believe that proper isabil:

  choose from city to t Add to t.state s join fetch s.governor g fetch g.nation n Join fetch N.continent c where t.id =? Id  

The Hebrewman generates the right SQL from this ejbql, but when I do my town. GetState () GetGovernor () I bring a vacant object back to my governor. Why is not the hibernate governor coming? It seems that it does not want to populate the trees at more than one level. Anyone is watching what I am doing wrong?

Do not worry my syntax above really works my problem from some previous activity to hibernate The session was not trying to silence and was receiving a cached version of the object that was not too populated, after fixing that problem, everything is fine.


crystal reports - crystalreports in vs2005 -


I need to create a crystal report that shows the employee's address label, in 2005 using crystal reports I Created the Crystal Report and connected to the data source and everything is cured and the report was correctly generated, it displays

  named Father's name address 1 address 2 city state pin.  

The report was prepared in the above format.

But my client wants

  name (first employee) name (second employee) Father's name Father name address 1 address 1 address 2 address 2 city city state state PIN PIN  

The third employee should be generated from the address label of the staff and staff. Anyone can help me prepare reports in fashion.

Thanks in advance. Name (first employee) Name (second employee) Father's Name Father's Name Address 1 Address 1

I have to print two employee details in one section, but it was printing only one employee in a section description.


quotes - Escape backquote in a double-quoted string in shell -


कमांड के लिए: / usr / bin / sh -c "ls 1`" (1 के बाद का बैकक्वाइट)।

इसे सफलतापूर्वक कैसे चलाने के लिए? "` 'काम नहीं करने से पहले एक बैकस्लैश जोड़ना `एक विशेष वर्ण है जैसा हम जानते हैं, और मैंने इसके आसपास एक बोली के साथ भी प्रयास किया (/ usr / bin / sh -c" ls 1'` '"), लेकिन वह भी काम नहीं करता है।

त्रुटि हमेशा होती है:

 % / usr / bin / sh -c "ls 1 \`" बेमेल ` 

आपको बैकटीक से बचने की ज़रूरत है, लेकिन बैकस्लैश से बचें:

 $ touch1 \ '$ / bin / sh -c "ls 1 \\\ `` 1` 

इसका कारण "दो बार" से बचना है क्योंकि आप इस कमांड को एक पर्यावरण (जैसे कि खोल स्क्रिप्ट) में डाल रहे हैं जो कि डबल-उद्धृत स्ट्रिंग की व्याख्या करता है एक बार।

आप दोहरे उद्धरणों से भी बच सकते हैं, और इस प्रकार पहली व्याख्या से बचें:

 $ / bin / sh -c 'ls 1 \ `'1` 

फ़ाइल नाम किसी चर में संग्रहीत करने का दूसरा तरीका है, और उस मान का उपयोग करें:

 $ export F =' 1` $ $ printenv F 1` $ / bin / Sh -c 'ls $ F' # नोट कि / बिन / श $ एफ की व्याख्या करता है, मेरा वर्तमान शेल 1` नहीं 

और आखिरकार, आपने कुछ गोले पर काम करने की कोशिश की है (मैं बाश का उपयोग कर रहा हूं , जैसा कि ऊपर दिए गए उदाहरणों के लिए), सिर्फ अपने खोल के साथ नहीं:

 $ / bin / sh -c "ls 1 '\' '1` $ csh # csh दर्ज करें, अगली पंक्ति निष्पादित हो जाती है उस वातावरण में% / bin / sh -c "ls 1 '\`' 'बेजोड़' 

मैं दृढ़ता से सुझाव देता हूं कि आप ऐसे फाइलनामों में से बचें।


colors - Colorize negative/positive numbers (jQuery) -


I want to color the numbers in a table for better readability:

  • green positive (+00.00);
  • Red for negative (-00.00) and;
  • Black for default case (no sign)

Here then go:

  $ (document) .ready (function () {// The following "td" elements are selected "class_number_to_be_evaluated" // If the '-' in the TD element, Red 'class and also for green color. $ ("Td.of_number_to_be_evaluated: in (' - ')". AddClass (' red '); $ ("td.of_number_to_be_evaluated:" (' + ') ) AddClass ('green');}  

Then use CSS in the input elements in style:

  td.red {color: red; } Td.green {color: green;}  

iphone - Issue in solving the compilation error in xCode -


Hi all,

I have a problem when compiling the code. I got the code from svn. Error: '

Error: Syntax Error Error: 'Syntax Error Before' OBJC_STRING 'token

Error:' Other 'token on error before syntax error

< P> Error: syntax error on the '#' token error

error:} 'token

Fatal error: definition of method @ not in the implementation context

That The Nc, but I had no problem with the code.

I tried to remove the "-" sign in front of the law definition and added it again. I have "cleaned all the goals", but get a single error on the compilation.

Waiting for your response ...

Best regards, Mohammed Sadiq

I believe, when you do not get any problems with the code, but your compiler, the compiler is correct! Look back In 20+ years of professional writing I found a compiler error once .

More practically, try to comment on the code around the offensive line and post the code so that we can see all of us at once. And check any header file in which you can join, error can be there.


c - Set timeout for winsock recvfrom -


I am trying to set a blocking socket after trying 16 ms of recvfrom () on a port platform Windows I have seen so many examples online and it seems really simple that I can not seem to work for it, any help would be appreciated!

  #include & lt; Winsock2.h & gt; #include & lt; String & gt; #pragma Comment (lib, "ws2_32.lib") #define PORT_NUM 8001 int main (zero) {std :: string localIP; Sockaddr_in localAddr; Sockaddr_in Remote Edder; Host * localhost; Four buffers [1024]; WSADATA wsData; Favored Result = WSAStartup (MacWorld (2,2), & amp; wsData); // Winsock version 2 localhost = gatehostime (""); LocalIP = inet_ntoa (* (in_addr *) * localhost-> h_addr_list); LocalAddr.sin_family = AF_INET; LocalAddr.sin_port = htons (PORT_NUM); // set port number localAddr.sin_addr.s_addr = inet_addr (localIP.c_str ()); // Set IP address int mHandle = WSASocket (AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 0, 0); If (mHandle == INVALID_SOCKET) back 1; If (dam (mHandle, (SOCKADDR *) and local aid, size (local edge)) == SOCKET_ERROR 1 return; Timeline TV; Tv.tv_sec = 0; Tv.tv_usec = 1600; // Set timeout for RV call if settoopate (MHandle, SOL_COCK, SO_RCVTMOO, REINTERTP_CAST & lt; four * & gt; (& amp; TV), size (periodically) 1 return; inch length = psychof (remand Edd.); // Block here forever recvfrom (mHandle, buffer, 1024, 0, (SOCKADDR *) and remote adapter, and length); Return 0;} / * I also try to pass like time It is: int ms = 16; if (satochapet (mhindal, sol_cock, SO_rcvmeo, reinit_past & lt; four * & g T; (& amp; ms), size (int)) 1 returns; * /  

I looked at the selection ceremony and Laura said that I should and should get it to work smoothly thanks!

  fd_set fds; int n; structure timeline tv; / Set up / set the file descriptor set FD_Gero (and FDS); FD_SET (MHandle, and FDA); // Set up a straight time clock for Timetable Tv.tv_sec = 10; Tv.tv_usec = 0; // From time to time or Until the data is received Wait to N = select (mHandle, & amp; FDA, NULL, NULL, & amp; TV); If (n == 0) {printf ("timeout .. \ n"); Return 0; } And if (n == -1) {printf ("error .. \ n"); Return 1; } Int length = sizeof (RemoteAddad); Recvfrom (mHandle, buffer, 1024, 0, (SOCKADDR *) and remote adapter, and length);  

javascript function calling inside a page_load event of asp.net -


How can I call the javascript function in the page_load event of an ASP.NET c # web application

I also want to pass a variable in that Javascript function

Depending on your version of NAS you should

  ScriptManager. Registrar startup script  

Use the boycott of page level method


html - Fixing hidden png images in IE6 -


I am using the solution to fix the common problem of displaying PGG images in the IE6 browser and this view Works fine for PNGs.

I currently have a hidden JQuery dialogue, in which some PNG exists, when the user clicks on a link, the dialog appears, and inside that dialogue PNG is not fixed in IE6 is. Is there any way to fix hidden PNG in IE6 also?

Thanks,

It seems that you load the dialog After doing, you can call DD_belatedPNG.fix () .


php - Is it OK to allow sometimes dynamic SQL without sanitization? -


On my PHP project, my practice is always to make the integer values ​​in dynamic SQL always sanitary.

Whenever possible, Used queries but for the update and delete conditions, the Zend_Db_Adapter requires a non-parameterized SQL string. This is the reason why I always write something without thinking:

  $ db-> Delete ('table_foo', 'id ='. Intval ($ obj- & gt; get_id ()));  

Which is equivalent, but it has a smaller version (I have checked the ZF source code):

  $ db- & gt; Remove ('table_foo', $ db-> qouteInto ('id =?', $ Obj- & gt; get_id (), 'INTEGER'));  

My partner strongly recommends this intval () , saying that if the $ obj id is empty (the object is still hidden) DB is not saved), I will not report an error, and the DB operation will only be executed quietly. That's exactly what happened to them.

He says that if we sanitize all the HTML form inputs then there can be no way that an integer ID may possibly come in ; Drop table ... ', or ' or 1 = 1 ', or other dirty value, and put in our SQL queries. In this way, I am just crazy, and our life is becoming more complex than unnecessarily. "They say," Stop relying on values ​​of $ _ session . "

However, for the string values ​​of the terms it agrees:

  $ db- & gt; Update-> ('table_foo', $ column, 'String_column_bar ='. $ Db-> qoute ($ string_value)));  

I failed to prove it wrong, and he failed to prove me wrong. What can you do?

Why do you bother more:

  • After tracking a bug that did not cause the failed SQL query.
  • Saini After making a mistake in the ring, after restoring the data and using it to take advantage of it.

Whatever you choose, your answer is personally,

If anything, then you can do both: create your own function which first checks for zero and then intval () < / Code>, and instead use it then you both world .


java - understanding hibernate first level cache -


  session.open insertIntoTODB () getList () session.close सत्र। Open () getList (); Sesson.close ()  

1 लेवल कैश केवल सत्र में खुला और बंद होता है और द्वितीय बाद के सत्र के लिए खुला है, getlist () कैश के बजाय डीबी से प्राप्त होगा?

< / Div>

हां पहला स्तर कैश केवल सत्र के लिए है दूसरी मिलती-जुलती () कॉल डेटाबेस पर जाएगी।

संपादित करें: द्वितीय स्तर की कैश की अनुपस्थिति में दूसरी getlist () कॉल डेटाबेस पर जाएंगे, साथ ही उसके जवाब में mR_fr0g द्वारा नोट किया जाएगा ।


sql - char column converted to varchar still inserting padding -


I do not know how to explain this one, I have taken a table, making a copy of it, Instead of four attributes, I have copied the data from a table into a new one. However, when I add a new value to the table in the program, the first cell (200) is still being paded in space for up to 200 characters. I have tried to put one on inserting, converting one, and even aarti (as a nawarchhar in the form of a novel (CAST ([MynCharColumn]), as has been found on another question here, but no one It does not matter what I do, it is padded as if it is a wild guess: If you are using some form of ORM then the ORM code can still be done.


sql - How can I expand a PostgreSQL row into multiple rows for updating "custom fields"? -


I have a table that is used by a piece of a third party software (user_fields), in each row User_id, a field_id and a field_value that I know is messy.

I also have another user table of mine and user, except field_id it excludes "virtual" and matches custom field mapping.

How can I write a selected query that will turn it off:

  user_id | Company_name | First_name | Country ------------------------------------------------- - 1 | Naughty Choke Company | C. GB2 Lublinz's R Our | Pie | IT  

In this?

  user_id | Field_value | Field_id --------------------------------------- 1 | Naughty Choke Company | 10 1 C. 11 1 | GB 12 2 Lublinz's R Our | 10 2 Pie. 11 2 IT | 12  

I am using Postgresql 8.4, and I intend to query for the query to include.

Extend me to the fields rows, using unnecessary and using an array, but any other field in the selection has been unnosted after processing, and hence the value of unnecessary rows Duplicate.

Any thoughts?

Cheers, C

Edit: Formatting and explanation, which is a nasty name-value table third party.

I'm adding this as a different answer because it is different from the other that I posted is. You can try doing something like this:

  SELECT U.id, UF.id F Field_ID, Case UFDID when 10 UFirst_Name When 11UU CuTi 12V UNPPGN Name If you have user_field table (or whatever name can be given), then it is assumed that you get all the user's fields. Possible. You have to keep your case statement up to date. 


notepad++ - Regex: remove lines not starting with a digit -


I am fighting with this problem with the help of a RegEx cheat sheet, how it is known how to do it, But let me leave ... I have to open this long file in Notepad ++ and would like to delete all the lines that do not start with a digit (0..9). I will use the Find / Replace functionality of N ++, I am just mentioning this because I'm not sure what the implementation of reggax is ... thanks ...

Example from the following text:

  1hello foo 2world bar 3!  

I would like to remove

  1hello 2world 3!  

No:

  1hello 2world 3!  

Search / replace on a regular expression.

You can assign that line to ^ [^ 0- 9]. * , but it will leave blank lines.

Use notepad ++ scintilla, and also use its regex engine to match them.

\ r and \ n never match because in Scintilla, regular expression searches are made per line, line (end-line characters have been stripped).

To clear those empty rows, the only way to choose extended mode is to choose, and \ n \ nchange it \ N if you are in window mode. So \ r \ n \ r \ nto \ r \ n


c# - Change the doctype of an aspx page dynamically -


We use master pages in our web application, doctype is defined in masterpieces.

On pages where I need to change the methodology, otherwise a third-party control renders incorrectly.

How do I work only without affecting the rest of that page?

The easiest way to make a second copy of your master page is to change the doctype in it and Use this page new master.


installation - What concerns should I have when installing additional Perl modules on a server? -


I can access various Pearl modules such as Moose and data :: alias from my system administrator . The system is Red Hat Enterprise Linux 5, which is running Perl 5.8.8. The only problem is that I can think that some previously installed modules may need to be upgraded and thus the risk of breaking something can be run. I do not know the policy of your company, but it probably will be that what else I need?

perl and additional library and Install their prerequisites (and even a dedicated perl ) in a different location and use.

Also see.


c# - primitive types enum - does it exist -


I need to provide a list of all the primitive types to a user and wondering if there is enum in the NAT library . There are all primitive types in it, so I do not have to build one.

is getting closer.


java - How to scan remote host port that in used? -


This is the code that I still get ...

  import Java.net *; Public class portscanner {public static zero main (string agre []) {int startPortRange = 0; Int stopPortRange = 0; StartPortRange = integer Paracet (Argos [0]); StopPortRange = integer Paracet (Argos [1]); (Inti = StartPortronage; i & lt; = stopPortRange; i ++) {Try {Socket ServerOS = New Socket ("127.0.0.1", i); System.out.println ("Port in use:" + i); ServerSok.close (); } Hold (exception e) {System.out.println ("Port is not in use:" + i); }}  

} For example, on the SMTP server, the system uses port 25, and I need to scan the port on the remote client which is connected to the SMTP server.

Your code should look like this:

 for  (int I = startPortRange; i & lt; = stopPortRange; i ++) {try {socket server Sok = new socket ("127.0.0.1", i); System.out.println ("Port in use:" + i); ServerSok.close (); } Hold (exception e) {System.out.println ("Port is not in use:" + i); }}  

Sharepoint & Dynamics CRM Classroom Training -


I was wondering if any of you had some good MS SharePoint & amp; MS Dynamics CRM developer training classes which were available. I had seen a lot for SharePoint, but I was not quite sure how complete they could be, so I thought I asked them, who have taken something first. My company will pay for them is not really an issue. It would also be nice if the classes were located near Illinois, but this is not a priority.

Thanks

Provides these two courses:

< P>

.

I have taken the second time twice, and it is very useful, as the SP is such a big product located in O # Toronto, but can also provide onsite training.


asp.net - Interrupting POST request -


I am working on the asp.net file uploader and am currently trying to solve the following problem: something The server-side HTTP module at the moment determines that incoming data stream is too long and should be abrogated. So the code that handles this situation at first glance will be very simple. Like this:

  try {... if (size> = maximum size) throw a new invalid operation exception ("the file is too big!"); } Hold (invalid operation exception e) {HttpContext.Current.Response.Write (e.Message); HttpContext.Current.Response.End (); Return; }  

But unfortunately it does not work. It seems that the browser has not received a response and the data continues to be transferred to the server. Does anyone know why this does not work and how will it work?

Try calling the call instead () Close it immediately socket Will close the connection. response Flush () may need to be called before hand.


http - Web server - weird characters generated at the top of page -


When first goes to a detail page, 4 strange letters appear at the top of the page after refreshing the page These characters disappear.

This is not coming from any output code, and I'm pretty sure this is a server configuration problem. The closest thing I can find is to include HTTP 1.1 chunked encoding.

Example Letter:

8b2

8e4a

d878

8b50

reference page:

This looks as a chunk encoding where Until I know, this is not an optional feature in HTTP, so that your users Apply it to the agent.

Is your server-side code to get data from external web sites?


itextsharp - Importing existing pdf into new document -


Does anyone receive any information to point me in the right direction

< P> Do you need to add PDF to existing PDF? If so, check the class here:

You have to spend a little time in improving minor mistakes, but otherwise the classroom is working well for me.


javascript - Firefox Exension vs. Greasemonkey Script? -


I am working on a Firefox extension, but it is running slow (in part because I have to work There is no time to do this). I've got a basic skeleton, it has been verified that I can talk to external external JSON API, modify any webpage on load, and show any priority box. These are all necessary hello verses which I am writing (maybe I do not need the Preferences box).

Suddenly it happened to me that I was ignoring an easy way to do this.

  1. This can be easy (not sure)?
  2. It could be a cross-browser (at least Safari and Firefox)?
  3. Is the Greasemonkey script versus the 'original' FF extension created? Can Chrome UI be written? Can normal DIV pop up? Preferences are being stored (I think they can be)?

I'm looking for "native" Firefox extension vs. "GrySmany vs. comparison" Also, did anyone "Graduman script" in FIR extension (experience, problem) Have worked with "compilation"?

I would say, in general, if your purpose webpage is displayed / function If you have a bunch of window / UI displayed and you are actually going beyond the original intent of Greasmee, then it may be best to be with a more traditional extension .


c# - Changing some of COM "things" from external place -


This is a difficult question, we have an ASP. Net application, IIS 7 server (classic pipeline running, if it is relevant) and a fat ugly com object library.
This library is used in such a way: Call the function, get results, show it. The problem is: There is no function to change the language preference in the COM library - it starts with the "web .config" file and then there is no clear way to change it.
The problem is how to do this - the legal way I can do anything with the ASP.NET app and something on the server.
Actually, I think, I have to call SetThreadCultureUI () for any application pool thread. Also, of course, there is a chance that I can make some application domains for each language, and I can load them in COM, but it will be a lot of coding.

Su ... Any idea to do this is the fastest and easiest way? (Many app copies of an app copy are already used solutions, but one is bad)

You will need to do some tests if the COM application is actually reading language settings from web.config (and it will obviously be unusual that this is done) then you can not do this rewrite the web.config Hard to do, at least not because you have to save the file to the application pool The Nrarnb!

If it is checking the OS for a certain thread, then you can use a code in your code to close a new thread in a backgroundworker

Alternatively, you can set up the culture, and call your COM object (with the appropriate lock to ensure the third-security). Many Ape pools have a heavy weight but slightest answer to the problem. I think this is the only solution if the COM library web. Config reading.


url rewriting - How to elegantly handle ReturnUrl when using UrlRewrite in ASP.NET 2.0 WebForms -


I have a folder with several .aspx pages, which I want to restrict to access. I have the & lt; Deny users = "?" /> have added web.config.

The problem is that when I am using UrlRewrite, the ReturnUrl .aspx file is automatically generated with the physical path.

Is there a way to manipulate a return unit without manual authentication detection and redirection? Is there any way to return the URL - back-to-back or from the web? Configure?

Edit : ASP.NET 2.0 is using the webform. I can not use 3.5 routing.

Edit 2 : It appears that the 401 status code is never captured. It gives 302 for the protected page and redirects returns to the login page with ReturnUrl. It does not return 401 for the protected page. Hmm ... interesting ... ref:

This makes things harder ... I write reverse to regex match ReturnUrl to rewrite the mapping rule and replace it if it does not return 401 Maybe ... this 401 can either set the RawUrl to Response.RedirectLocation or if the replacement of the ReturnUrl with RawUrl is replaced.

Any other ideas?

Check it out Hopefully it will be helpful.

  #region [import] using the system; Using System.Web; Using System.Web.Security; #endregion namespace Foo.Handlers {Public category AuthModule: IHttpModule {#region IHttpModule Members Public Zero Init (HttpApplication Application) {application.PostReleaseRequestState + = Representative (Object, EventArgs e) {if (application.Response.StatusCode == 401 ) Application.Response.Redirect (FormsAuthentication.LoginUrl + "? ReturnUrl =" + HttpUtility.UrlEncode (application.Request.RawUrl), true); }; } Public Zero Settlement () {} #endregion}}  

; Module & gt; & Lt; Add name = "AuthModule" type = "Foo.Handlers.AuthModule, Foo" /> & Lt; / Module & gt;  

Is there a MySQL setting to ignore "time" portion of datetime constant when applied to "DATE" column? -


Disclaimer: This is an old and ugly codebase that I do not touch too much.

  • There is a table in the database that has a column of type (between many other people) at DATE .
  • There is a query (Auto-generated generated from the torque criteria) with the java.util.Date parameter; The torque formats it as a whole datetime.

So, the query is getting MySQL, something like this:

  SELECT * my_table from WHERE my_date = '20091201105320'; // 2009-12-01 10:53:20  

The problem is that the server that has MySQL 5.0.27-standard works just fine - as all records of returns From my_table to my_date is set to '2009-12-01'. On another server on which MySQL 5.0.45 does not work, the data is there - If I manually run the query after triming the part of the time then I get the right result.

The question is:

Is there a setting, either MySQL in the configuration file or per-session variable (connection string) or elsewhere to MySQL continuous time conversion During time forced to ignore part?

I can not explicitly use DATE () function changes without code which does not make me too much

Apparently I came out of luck Naseeb. From:

Before MySQL 5.0.42, when the DATE value is compared with the value of DATETIME , then DATETIME Price is ignored, or comparison can be compared to string starting with MySQL 5.0.42, a DATE value as DATETIME type format Adding time part in '00: 00: 00' .

  1. Anyone should meet someone in such a situation, I found that there is only one solution:

    1. Time zones (hours / Min / sec) Java.util.Date for example zero.
    2. Patch (and I mean "patch" - there is no way to plug in your adapter) getDateString () MySQL for the DB adapter of tarak ( org. Apache.torque.adapter.DBMM ) to verify that the time zone is zero and, if so, then use the "date-only" format.

c# - Change the comparer for a ListBox -


I have a list box that has a list of agenda (from TFS). I want to add items to be selected, but have failed to identify items as the same.

This is my code

  Public Zero SelectQueryResultItem (Work item) {lstQueryResults.SelectedItems.Add (item); }  

This works when the WorkItem was passed from the same query that is in the SelectedItems list. However, if it comes from a different query (i.e. the object reference is not the same) then it can not correctly identify the object

I think it is comparing the reference. I want to override it and compare it to the item. Is there any way to do this?

Note that I am using it,

Instead, have you tried to override the workmeam square to compare with the ID? This is not ideal because it is obvious that two examples with the same ID are not necessarily the same. But I'm not sure how you can convince the selector base class to use a custom iCompaimer.

Edit I dug a little deeply and found that you can get it from the collection (there is a wrap around a collection in WPF) and return a custom ICPPrier to its comparative asset Override. So you can create something like the Works Collection Weave which overrides comparative, and the worktime returns something like IP Compaipers.

Hope it helps.


rest - RESTful PUT and DELETE and firewalls -


In the classic "Race Web Services" book (O'Reilly, ISBN 978-0-596-52926-0) on page 251 "Some firewalls block http put and delete, but do not post."

Is it still true?

If this is true, then I am allowed to overload the order in place of the deletion

< P> Putting / blocking firewalls are usually blocking the incoming connection (server behind the firewall). Assume that you have control over protecting your application on the firewall, you do not have to worry about it.

In addition, firewalls are only deeply monitoring on network traffic, then only block put / delit. Analyzing the encryption url will prevent the firewall, so if you are using HTTPS (you are protecting your data with SSL, is not it?) Client is one of the standard four HTTP verbes to access your web service. Will be able to use.


c# - What is a good 2D graphics framework, for a drawing application? -


Using C #, I am trying to create a raster illustration application and so far I am not able to detect any versatile light weight 2D graphics framework , this guide.

I was hoping that some of you would be able to give me a good start because my choice is currently using GDI + or WPF and that's about it: (... < / P>

Actually, I need something simple that will give me the ability to import canvas, layers, brushes, and all these things to import / export. I have seen through many graphic applications that How do they Implement and look online and do not know where the book is starting.

Thanks, Andrew

If you want to create a vector editor or a raster editor, then you do not mention. I believe raster.

If you have a lot of graphics API experience Do not go, and just work as soon as possible, just go with GDI +. This is the concept of WPF It is very simple.

Both GDI + and WPF can do whatever you want. Working with WPF will probably give better performance because it uses direct X-celeration for AC. It also uses a stored-visual paradigm, which can easily simplify many drawing processes. The learning curve is significantly higher than GDI +, however.

You can always use OpenGL, DirectX, or Unmanaged GDI. They all have 2D performance good but you have to call the unmanaged code.


c# - how to get the normalize-space() xpath function to work? -


मैं वर्तमान में निम्नलिखित xpath कोशिश कर रहा हूं

  // tr [normalize-space (td / Code> 'उपयोगकर्ता नाम'  

सभी tr को प्राप्त करने के लिए जिसमें एक टीडी है जिसमें 'उपयोगकर्ता नाम' या 'उपयोगकर्ता शामिल है नाम ' या ' उपयोगकर्ता का नाम ' लेकिन इसका काम नहीं कर रहा है और मुझे नहीं पता कि क्वेरी में क्या गलत है :( मुझे लगता है कि डेटा को ढूंढना है जो निम्न प्रारूप में है

 <कोड> & lt; टीआर & gt; & lt; टीडी & gt; प्रयोक्ता नाम & lt; / टीडी & gt; & lt; / टीआर & gt; & lt; टीआर & gt; & lt; टीडी & gt; प्रयोक्ता नाम & lt; / टीडी & gt; & lt; / टीआर & gt; & lt; टीआर & gt; & lt; टीडी & gt; प्रयोक्ता नाम & lt; / टीडी & gt; & lt; / टीआर & gt;  

तो सही प्रारूप इस xpath क्वेरी लिखना है क्या

संपादित करें: यदि डेटा निम्न स्वरूप में है यह काम नहीं लगते

 <कोड> & lt; टीआर & gt; & lt; टीडी & gt; एक्स & lt; / टीडी & gt; & lt; टीडी & gt; प्रयोक्ता नाम & lt; / टीडी & gt; & lt; / टीआर & gt; & LT; टीआर & gt; & lt; टीडी & gt; एक्स & lt; / टीडी & gt; & lt; टीडी & gt; y & lt; / टीडी & gt; & lt; टीडी & gt; प्रयोक्ता नाम & lt; / टीडी & gt; & lt; / टीआर & gt; & lt; टीआर & gt; & lt; टीडी & gt; एक्स & lt; / टीडी & gt; & LT; टीडी & gt; y & LT; / Td & gt; & lt; टीडी & gt; z & lt; / टीडी & gt; & lt; टीडी & gt; उपयोगकर्ता का नाम & lt; / td & gt; & lt; / tr & gt;  

तो अब मैं कैसे xpath क्वेरी लिख सकता हूं? नोट: "// tr [normalize-space (td / text ()) = 'उपयोगकर्ता का नाम']" अभ्यस्त काम
लेकिन "// tr / td [normalize-space (text ()) = 'यूज़र नेम']" काम करेगा (लेकिन मैं tr को प्राप्त करना चाहता हूँ और टीडी तत्व नहीं)

अब जब आपने सवाल संपादित किया है, यह समझ में आता है के इस इनपुट पर विचार करें:

 <कोड> & lt; टीआर & gt; & lt; टीडी & gt; एक्स & lt; / टीडी & gt; & lt; टीडी & gt; प्रयोक्ता नाम & lt; / टीडी & gt; & lt; / टीआर & gt;  

और आपकी गैर-कार्यशील क्वेरी:

  // tr [सामान्य-स्थान (टीडी / पाठ ()) = 'उपयोगकर्ता नाम']   

अब, td / text () का अर्थ है "सभी नस्लों के सभी बाल पाठ नोड्स चुनें td वर्तमान नोड के नोड्स"। इस मामले में यह एक नोड-सेट प्रदान करेगा जिसमें दो पाठ नोड, x और उपयोगकर्ता नाम हो।

अब आप कॉल करें normalize-space () उस नोड-सेट पर सामान्य-स्थान () के एकमात्र तर्क का प्रकार स्ट्रिंग है? चूंकि नोड-सेट एक स्ट्रिंग नहीं है, एक्सप्रैथ 1.0 की सिफारिश के अनुसार रूपांतरण लाते हैं:

स्ट्रिंग () फ़ंक्शन को कॉल करके जैसे कि एक स्ट्रिंग को स्ट्रिंग में कनवर्ट किया जाता है।

अब खंड 4.2 में स्ट्रिंग () के को देखो:

एक नोड सेट की स्ट्रिंग-मूल्य वापस लौट कर एक स्ट्रिंग में बदल जाती है नोड-सेट में नोड जो दस्तावेज़ ऑर्डर में सबसे पहले है यदि नोड-सेट रिक्त है, तो एक रिक्त स्ट्रिंग लौटाई गई है।

हमारे उदाहरण में, "दस्तावेज़ ऑर्डर में" पहला नोड टेक्स्ट नोड x है, तो यह एक है जो इस्तेमाल किया जाएगा; दूसरा नोड पर ध्यान नहीं दिया जाता है। इस प्रकार, आप कॉलिंग को समाप्त कर देते हैं normalize-space ('x') स्वाभाविक रूप से, यह 'यूज़र नेम' के समान तुलना नहीं करेगा। यह काम करने के लिए, इसका प्रयोग करें:

  // tr [td [सामान्य-स्थान (पाठ ()) = 'उपयोगकर्ता नाम']]  

यह के रूप में "सभी tr नोड्स जो कि बच्चे को td नोड्स का चयन किया जाता है, उनका पहला बच्चा टेक्स्ट () नोड के रूप में लिखित किया जा सकता है, जिसमें से सामान्यीकृत स्ट्रिंग मान का उपयोगकर्ता नाम "- जो कि आप क्या चाहते हैं इसके अलावा, आप इसे इस प्रकार सरल कर सकते हैं:

  // tr [td [normalize-space () = 'उपयोगकर्ता नाम']]  

-रर्गमेंट सामान्य-स्थान () वर्तमान नोड पर लागू होगा (जो कि td होगा), और उसके भीतर सभी पाठ नोड्स को संसाधित करेगा।

< / html>

Storing/accessing user access roles C# Winforms -


I have created several client / server applications. I am working on a project that allows applications to access For a user logging is included. I am seeing the most effective and "simple" method of storing users' permissions after logging into the application which can be used primarily to limit access to fixed tabs.
I have created a "static class" for a user "detailed below:

  stable class user {public constant _USIDID; public static string _moduleName; public static string _userName; public static object [] Userdata (object [] _data row) {_userID = (int) _dataRow [0]; _userName = (string) _data rau [1]; _moduleName = (string) _data roll [2]; back _moduleName;}}  

When a user logs in and accepts them , I want to store _moduleName objects in memory so that I can control those tabs that can be accessed on the main form tab control, if; the user has been assigned the following roles in the database: "Sales laser "," Buy ", only after the entry form is hidden, you can see the relevant tab on the form using switch-case block only. For example, by saying for example, I can store the user ID and user name in the main form:

Here we process the logged data from the user: < / P>

  DataAccess _dal = New DataAccess (); Switch (_dal.ValidateLogin (txtUserName.Text, txtPassword.Text)) {case DataAccess.ValidationCode.ConnectionFailed: MessageBox.Show ("database server connection fail!"); break; Case DataAccess.ValidationCode .LoginFailed: MessageBox.Show ("Login failed!"); _dal.RecordLogin (errMsg, txtUserName.Text, workstationID, incorrect); break; Case DataAccess.ValidationCode. Successful Login: frmMain frmMain = new frmMain (); _dal.GetUserPrivList (errMsg, 2); // & LT; Here I reach my DB and get user permissions based on the current login. FrmMain.Show (); This.Hide (); break; Default: Break; } Private Zero frmMain_Load (Object Sender, EventArgs e) {int UserID = User._userID; }  

This works fine, however, _modules objects have many permissions / roles, which are defined in the database, how can I store more than one value and Can block access through switch-case?

If I understand correctly, you store permissions / roles as a value I want to be able to do a database per user

I believe you can write a database field such as integer such as: RolesID . You type the value of the flag to the database field, something like this:

  [flag] Public anonym ROLES {Administrator = 1, user = 2, otherroll 3 = 4, otherroll 4 = 8}  

You should be able to read that value and declare it as a field:

  ROLES userRoles = GetRoleValueFromDB ();  

I'm pretty sure I did it earlier.

HH ...


Problem calling MySQL stored procedure from php -


मेरे पास एक संग्रहीत MySQL प्रक्रिया है जो ग्राहक संख्या और एक मुद्रा को इनपुट के रूप में लेती है। यह एक चयन बयान का उपयोग करके एक सरणी का उत्पादन करता है आउटपुट सरणी में बैलेंस और नेटबैलेंस शामिल है,

यदि मैं MySQL से "कॉल कोड" कॉल प्राप्त करें, तो GetAccountBalanceByCurrency (500, 'USD') "मुझे सही परिणाम मिलते हैं I

हालांकि, अगर मैं इसे PHP के रूप में $ x = mysqli_multi_query ("GetAccountBalanceByCurrency (500, 'USD') कॉल करता हूं,") , मुझे निम्न त्रुटि संदेश मिलता है:

/ P>

  चेतावनी: mysqli_multi_query () पंक्ति 2 पर सी: \ ... \ ... \ call_proc_test4.php में दिए गए 2 सटीक पैरामीटरों की अपेक्षा करते हैं।  

मुझे लगता है कि यह कुछ आसान है, लेकिन घंटों के लिए मेरे सिर की पिटाई कर रहे हैं मैंने कोशिश की है $ x = mysqli_multi_query ("GetAccountBalanceByCurrency (500, 'USD')"); अन्य चीज़ों के बीच क्या कोई भी त्रुटि देख सकता है?

बहुत धन्यवाद।

मैन्युअल का हवाला देते हुए फ़ंक्शन को दो मापदंडों की आवश्यकता होती है, जब आप प्रक्रियात्मक शैली API का उपयोग कर रहे हैं:

  bool mysqli_multi_query (mysqli $ link, string $ query)  

कम से कम लिंक पहचानकर्ता को पहले पैरामीटर के रूप में पास करना होगा।

बीटीडब्लू: यह ठीक है कि चेतावनी संदेश आपको सूचित करने का प्रयास कर रहा है ;-)
" mysqli_multi_query () बिल्कुल 2 पैरामीटर, 1 दिए गए "


उम्मीद करते हैं, वही मैन्युअल पृष्ठ भी एक उदाहरण देता है पैरामीटर - लेकिन यह ऑब्जेक्ट ओरिएंटेड स्टाइल के लिए है (mysqli एक एक्सटेंशन है जो एक प्रक्रियात्मक और ओओ एपीआई दोनों को उजागर करता है)


How can I make Perl functions that use $_ by default? -


Then I have an array and a simple task that trim white spaces:

  my @ Ar = ("bla", "ha1") sub trim {my $ a = shift; $ A = ~ s / \ s + $ //; $ A}  

Now, I want to apply it to an array with map function. Why can not I do this in the name of the function like it is built in functions in one?

e.g. You can

  print map (length, @ r)  

but you can not do

  print Map (trim, @r)  

You have to do this:

  print map {trim ($ _)} @ar print map (trim ($ _), @r)  

if you are using version 5.10 or later , You specify _ for trim if you are using earlier versions, then use it :

As the last character of a prototype, or before a semicolon, you can use _ $ : if If this argument is not provided, instead of $ _ will be used.

  Use strict; Use warnings; My @ x = ("bla", "ha 1"); Sub trim (_) {my ($ x) = @_; $ X = ~ s! \ S + $ !!; $ X} Print map trim, @x;  

Incidentally, do not use $ a and $ b one sort outside the comparator: They are immune from the strict investigation.

However, I prefer not to use prototypes for primarily writing functions because their use makes it difficult to mentally parse the code. Therefore, I like to use it:

  map trim ($ _), @x;  

See also:

This is absolutely powerful, and it should be used to make the world a better place.


java - Is it ok by REST to return content after POST? -


I am using a restlate and I have created a resource. I handle the post while overriding the method of accepting the acceptance.

The customer should send me some data, then I store it in DB, send feedback on 201 (SUCCESS_CREATED) and I need to return some data to the customer, but the type of return accepted is zero submission. .

In my case, I need to return some identifier so that customers can reach that resource. For example, if I had a resource with url / resource and client, post request I would add new row to db and its address / resource / {id} should be. I need to send {ID}.

Am I doing something wrong? Are some principles allowed to return something after POST? If so, how can I do this, and if there is no way to handle this situation?

The rest simply say that you should be consistent with the same interface. In other words, it says what you should do that should be done according to the post. Here is the quote from that specific statement, which is relevant,

If a source is created on the original server, then the reaction should be 201 (manufactured) and there is an entity which is Describes requests and new resources, and location headers (see Section 14.30).

As you can see from it, you have two places where you can point to the client where the new resource is created, there should be a URL in the top of the place which will be the new resource And you can return a unit with details.

I'm not sure the overriding acceptance report () and override post () illustrates how to return a response to a POST.


php cron job every 10 minutes -


I am trying to run a cron job so that a php script can run on my server every 10 minutes. The script database updates now looks like my crankab:

  * / 10 * * * * / usr / bin / php /home/user/public_html/domain.com/private/update .php  

However, the PHP script does not run at all. I also tried to reload the cron tab after updating the cron:

  $ /etc/init.d/cron reload  
< P> But was not it either work or did my current cronat have been formatted correctly? Do there are specific permissions for which a script needs to be specified on the file to run?

There should be no space between "*" and "/ 10" It should be:

  * / 10 * * * * / usr / bin / php /home/user/public_html/domain.com/private/update.php  
< / Html>

How to find the total number of SQL queries made by a django application? -


There is a way to detect how many SQL queries made by the Disneyone app. When do I try to load a page? I like what I like to do while browsing the page from the page .. In the text file, record the following ... or see it in stdout.

  • Page URL
  • Total Query
  • Total Query Execution Time
  • Is such a tool / script?

    Cheers

    Use the app, it not only prints the number of questions But, to run for each and every one of them, they + showed very useful information. / P>

    Remembering one thing - this app uses DJGanga for a little more memory, so it is the best use only in test environment.

    There is a related question with good answer.


    asynchronous - How to call a function/procedure asynchronously in Delphi (Without components) -


    I am trying to run a function or process in Delphi asynchronous, but without using a component, One way is with Delphi Core Functions?

    You can execute your process on a thread. Use the onternant event to get results Yes, in these days of NAT and C #, we are easily and conveniently damaged to execute asynchronously, but it works on Delphi.


    social networking - Horizontal Database and Vertical Database -


    I am working on a social networking site with a family tree that is GEDCOM-compliant. We need to decide that we should use horizontal or vertical database structure for user profiles. Therefore, I would like to know that when using a horizontal database structure, and when the vertical database structure is used, no one can answer.

    I have received a few answers for shopping sites where the areas have not been decided: A vertical database structure should be used. But I am confused about what to use for family tree's site. Should I use vertical or horizontal?

    I think you can post MySQL, Ms sql, Sqlite, Postgrescale or Oracle for storage?

    Gedcom is a standard for information exchange so that you will know how many columns you have. Perhaps the standard is being extended with new qualities in the future but this will probably be used for many new qualities. You can easily expand the table with some new columns.

    I will use a 'horizontal' table and not a unit-attribute-value-system (vertical table). Workbench table systems are slow. The query optimizer can not be properly indexed and confused.

    It becomes a different story when your users can define new properties in their own profile such as eye colo (u) r or favorite colo (u). How do you want to make those profiles flexible?


    iphone sdk 3.0 - Is it possible to hide a UIToolbar with an animation? -


    I know this code is only available for UINavigationController .

      [self Navigation controller set navigation bar: yes animated: yes]; An example using blocks will hide a toolbar at the top of an iPad screen.  

    .

      [UIVive Animated Width: .7 Animation: ^ (Zero) {CGRact ToolbarFrame = Self Toolbar.frame; ToolbarFrame.origin.y = -44; // iPad Toolbar runs on the off screen. Tollbar Frame = toolbar frame; } Closing: ^ (BOOL Finish) {self.toolbar.hidden = yes; }];  

    Php trim string at a particular character -


    Is a php string function to trim a string after a particular character? I put a look at the php.net site and did a Google search, but found nothing. I could imagine that the only solution exploded and then grab the first part of the array, but this is not the most elegant solution.

    For example

      $ string = "/ Gallery / image? A = b"; $ String = Fictional _ work ($ string, '?'); Echo $ string; // echoes "/ gallery / image"  

    Does a php string detect a good cheat sheet for manipulation tasks? Thank you

    You can use:

      $ string = " / Gallery? / Image a = b "; List ($ url, $ querystring) = explosion ('?', $ String, 2);  

    java - Static variable initialization? -


    I want to know that the stabilized variable in C, C ++ and Java is started by zero at default ? And why is it not correct for local variables?

    Why are the fixed variables definitely initial and do not have local variables?

    See how stable variables are implemented Memory links for them are allocated on time, and the initial value for them is also made available at link time. There is no runtime overhead.

    On the other hand, the memory is allocated at run time for local variables. Stack should be increased. You do not know what was before. If you want, you can clear that memory (zero), but it will be a runtime overhead. C ++ philosophy "You do not pay for things you do not use", so by default it does not zero to that memory.

    OK, but why is the steady variable started to zero, and there is some other value?

    Well, you usually want to do something with that variable, but then how will you know if it has been started? You can make a steady Boolean variable, but then it will have to start with anything trustworthy (preferably incorrect). How about an indicator? You want it to start at NULL, rather than some random waste. How about a structure / record? There are some other data members inside it, it makes sense for them all to start their default values. But for simplicity, if you use the "Start with 0" strategy, then you do not need to check individual members and check their types. You can simply start the whole memory area in 0.

    This is not really a technical requirement. The initialization terminology can still be considered sensible if the default value is anything more than 0 but still is deterministic. But then, what should that value be? You can quite easily understand why 0 is used (though in fact it seems a bit arbitrary), but it also seems difficult to explain 1 or 1024 (especially this variable to capture that value Not enough, etc.).

    And you can always explicitly initialize the variable.

    And you have a passage of C ++ standard 8.5.6, which says, "Every object of static storage period will be zero-initial on program startup".

    For more information, please refer to these other questions:

    < / Html>

    zend framework - How do I go around this Zend_Form_Element_Select db error? -


    जब मैं Zend_Form_Element_Select एकाधिक विकल्प वाले तत्वों का उपयोग करता हूं, तो मुझे यह त्रुटि मिलती है जब मैं चयनित मान को पास करता हूं Zend_DB_Table डीबी में सम्मिलित करने के लिए

      संदेश: SQLSTATE [42S22]: कॉलम नहीं मिला: 1054 अज्ञात कॉलम 'accounts_status' 'फील्ड सूची' में  < / Pre> 

    मैंने कुछ कोड स्निपेट निकाला है जो मेरा मानना ​​है कि मेरी समस्या को स्पष्ट करने में लंबा रास्ता तय होगा। accounts_status क्षेत्र नहीं मेरी तालिका में मौजूद है

      $ optionsstatus = array ('सक्रिय' = & gt; 'सक्रिय', ' लंबित '= & gt;' लंबित '); $ Optionsrole = सरणी ('अतिथि' = & gt; 'अतिथि', 'उपयोगकर्ता' = & gt; 'उपयोगकर्ता', 'लेखक' = & gt; 'लेखक', 'व्यवस्थापक' = & gt; 'व्यवस्थापक'); $ स्थिति = नया Zend_Form_Element_Select ('accounts_status'); $ स्थिति- & gt; सेट लेबेल ('स्थिति') - & gt; सेटरूपेर्ड (सच्चा) - & gt; AddMultiOptions ($ optionsstatus); $ भूमिका = नया Zend_Form_Element_Select ('accounts_role'); $ रोल- & gt; सेट लेबेल ('भूमिका') - & gt; सेटरूइज्ड (सच्) - & gt; एड मल्टि विकल्प ($ optionsrole);  

    मैं अपने नियंत्रक से पोस्ट मानों को सम्मिलित करने के लिए Zend_DB_table का उपयोग करता है

      सार्वजनिक फ़ंक्शन addaccount ($ username, $ fullname, $ ईमेल, $ पासवर्ड, $ स्थिति, $ भूमिकाएं, $ टिप्पणियां) {$ data = array ('accounts_username' = & gt; $ उपयोगकर्ता नाम, 'accounts_fullname' = & gt; $ पूर्णनाम, 'accounts_email' = & gt; $ ईमेल, 'accounts_password '= & Gt; $ पासवर्ड,' accounts_status '= & gt; $ स्थिति,' accounts_roles '= & gt; $ रोल्स,' accounts_comments '= & gt; $ टिप्पणियाँ,); $ इस- & gt; डालने ($ डेटा); }  

    मेरे नियंत्रक में मुझे पोस्ट मान मिलते हैं और उन्हें मेरे मॉडल पर भेजते हैं

      $ username = $ form- & gt; getValue ('accounts_username') ; $ पूर्णनाम = $ फॉर्म- & gt; getValue ('accounts_fullname'); $ ईमेल = $ फ़ॉर्म- & gt; getValue ('accounts_email'); $ पासवर्ड = $ फॉर्म- & gt; getValue ('accounts_password'); $ स्थिति = $ फॉर्म- & gt; getValue ('accounts_status'); $ भूमिकाएं = $ फॉर्म- & gt; getValue ('accounts_roles'); $ टिप्पणियाँ = $ फॉर्म- & gt; getValue ('accounts_comments'); $ खातों = नया Model_DbTable_Account (); $ खातों- & gt; एडाकाउंट ($ उपयोगकर्ता नाम, $ पूर्णनाम, $ ईमेल, $ पासवर्ड, $ स्थिति, $ भूमिकाएं, $ टिप्पणियां);  

    यह दृष्टिकोण मेरे लिए काम करता है, जब कि Zend_Form_Element_Select तत्वों के साथ काम कर रहा है। बस सोच रहा है कि इस चुनिंदा तत्वों से निपटने का एक विशिष्ट तरीका है जब यह आता है CRUD संचालन के लिए।

      संदेश: SQLSTATE [42S22]: स्तंभ नहीं मिला: 1054 अज्ञात स्तंभ 'फ़ील्ड सूची' में 'accounts_status'  

    शायद मैं पागल हूं, लेकिन मुझे लगता है कि उस कोड के उस अंत में एक अतिरिक्त स्थान है- 'accounts_status' फ़ील्ड नाम।


    oracle - Tool for monitoring SQL query results needed -


    From time to time, I am looking for a tool to monitor the results of SQL queries and based on this fact I am giving a notification that the query returns any results (any other filter is welcome)

    I need to see a transaction table for errors, and it would be great if my SQL query Can move in the background, refresh yourself from time to time And when there are no results.

    I need to connect to Oracle DB and I am currently using PL / SQL Developer or Oracle SQL Developer.

    Update:

    Update:

    Preferably, I would not like to create / modify any database object, And they do not have the license to modify the Dibies where their Oracle applications run.

    Thank you in advance

    Using DBMS_Scheduler to run a stored procedure How about doing and then uses UTL_Mail to send emails in case of problem?


    ontology - How to Query Individuals using OWL DL Query in Protege 4? -


    Here is a description of what I would like to do (like SQL queries):

    I have three classes (components, attributes, and polarization), the value of polarity can be positive_polarity or negative_policy, both are sub-squares of polarity.

    I

    / Code>

    is provided, it has a feature that is described in some form of type:

    / P>

      The feature is that there are some negative_policies in it  

    objective c - how to show a alert when user click on use button after shooting a picture using uiimagepicker? -


    I want to show a warning when the user shoots the picture and clicks on the usage button. It's strange that when we shoot a photo in iPhone OS 2.0, it shows a loading message, but in iPhone OS 3.0, it does not show anything, how can I show a warning that there is no way to force the image plotting process is? Sometimes in my app it is slow and sometimes it happens faster so that I do not understand it yet. Does anyone know about this? In your method "imagePickerController" you want to display a UIAlertView.

    UIAlertView will be displayed for the period of time when it takes the photo to save it from the album.

     - (Zero) Image Picture Controller: (UIImagePickerController *) Picker didFinishPickingImage: (UIImage *) Selected Image EditingInfo: (NSDictionary *) EditingInfo {if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {saveImage = [[UIAlertView alloc] initWithTitle: @ "Saving Image ..." Message: Zero Rep: Auto CancelTotintitle: Any other Button Titles: Zero]; UIActivityIndicatorView * WaitView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle: UIActivityIndicatorViewStyleWhiteLarge] Autorelase]; WaitView.frame = CGRectMake (120, 50, 40, 40); [Waiting start-up startup]; [SaveImage addSubview: waitView]; [Save show]; [Save image release]; UIImageWriteToSavedPhotosAlbum (Selected Image, Self, @Selector (Image: Error saving didFinish: ReferenceInfo :), zero); } [Automatically deleted Model Vieux controlling permission: Yes]; } - (zero) Image: (UIImage *) Image FinishedSavingWithError: (NSError *) Error reference: (zero *) contextInfo {// was an error? If (error == NULL) {NSLog (@ "Image protected"); [Cleit button indices rejected with SaveImage: 0 animated: yes]; } Else {// error occurred}} 

    Paypal | Website Payment Standard | Adddress Override -


    I have established a website with integration with PayPal's payment standard. Includes Address_verride = 1 to send to PayPal.

    PayPal's "helper" feature is that it fills the address uploaded to the unregistered user in the billing address field.

    If a user fills his credit card details, his card will be clearly rejected because the billing address must match his card. If the user knows the error and replaces his uploaded address with his actual billing address, but the customer is working, it is disturbing that users will not realize this way ... I agree to some extent Have to be.

    Does anyone know of this solution? Some variables, which are missing in PayPal's Standard Variable Doc, say, "Thesis is an address override, but for delivery address only, there is no billing address"

    TIA

    < / Div>

    One year is too late for one answer, but I had only one problem.

    I can not separate the billing and shipping address In my case, users can purchase items in the form of gifts, so the billing and shipping address will be different ... and today, I recently come to know. Oh boy


    How to get free impartial code reviews / advice? -


    I could not find this question here, so here goes.

    Is there a website / service that offers free (or at least cheap) code reviews?

    There are a lot of people who write applications in their spare time, to know as new skills and as a recreational activity, how can these people ever know if they do something very bad Or are you using the wrong FTP to reach point A through B?

    Is there a site that can cover the following?

    • You can post your source code or link to hosted app
    • Other people can review it
    • You can comment on other people's comments, get the best possible solutions to problems.

    Yes, you can comment on other people's comments. The site can be such a reputation system, where you suggest Then, if the reviews are free then there must definitely be something

    Where can I get free advice on my applications that I Can I develop in my time?

    , so I know where I'm starting a bad practice, and how to improve the techniques?

    Edit: In my case, in my case my project is a Java web application, an example of a good review on Google Project Hosting will be DAO, maybe someone will know that I I am using a horrible hibernation query and I am doing it the other way. If you are doing this as a learning project then things picked up very well are very difficult. (Well, reading the appropriate tutorial will help)

    I suggest finding a coding friend or mentor You can also view your local user group meeting, ACM meeting, or post on Craigslist.

    Alternatively

    If this is open source, then a project group is going. Perhaps you can do business with an established project, that you take someone to see your project and you spend several hours setting up the bug and filtering feature requests.


    python - how can I save a form with ModelMultipleChoiceField? -


    I have a model calendar and in one form I want to be able to make it many examples.

    Here are my models:

      class events (models.model): user = model. Fabric (user) class group (models.Model): name = models.CharField (_ ('name'), max_length = 80) event = model. Many Tom Manfield (via Event = 'Calendar') Class Calendar (Model.Model): Event = Model. Forininki (event) group = model. Forwarding (group) class calendar inline (Admin tabular inline): Model = Calendar Extra = 1 Class Group Administrator (Admin.ModelAdamin): Inline = = (CalendarInline)  

    Here I want to code my form How do I try:

      class AddEventToGroupForm (ModelForm): Group = Model MultiTypeField (queryset = Group.objects.all), Widget = SelectMultiple ()) def Save (self): Live in self For: g.save () class meta: model = calendar field = ('group',)  

    and this Not a part of my thoughts:

      email = Event.objects.get (id = event_id) calentry = calendar (event = e) if requested. POST: f = AddEventToGroupForm (Data = Request.POST, Example = Calendary) If f.is_valid (): f.save ()  

    If I try to submit that form , Then I get:

      attributeError at / groups / add_event / 7 / 'BoundField' has no attribute in the object 'Save'  

    This status What is the correct way to create multiple instances of calendars?

    This form does not have to deal with many-to-many relationships. Can not read through again and save them, it does not really work in this way.

    In this form, there is only one field, which happens with many values, here's the thing to do again through the values ​​ of this area, Get code> cleaned_data dictionary (when the form is valid).

    So, in your opinion, you do something like this:

      if f.is_valid (): for group f.cleaned_data ['group']: calentry .groups.add (Group)  

    Note that you are not 'saving' AddEventToGroupForm form. I will make it a standard form. Form, instead of a model form, because you are not really dependent on any model form functionality.


    javascript - Jquery autocomplete not working from within a get ajax request -


    I am using the jQuery AutoComplete plugin (). I have an input field that is in my page. The following code works.

      & lt; Script & gt; $ (Document) .ready (function () {somedata = "Core selector features: Traversing Manipulation CSS Events Exciting Electronic Effects Ajax Utilities" .split (""); $ ("#by"). Autocomplete (somedata); & lt; / Script>  

    Now, when the focus is focused by the input field, I get an AJAX request that correctly obtains the data in which some strings " N ", and I want to Populate the fields with the collected data, but call it automatically within $ $. The job is not working, as shown below. Any way to fix this?

      $ (document) .ready (function) {Somedata = "Core selector features: Traversing Manipulation CSS Events Exciting Electronic Effects Ajax Utilities" .split ("") var url = "& lt; some URL here"; $ ( "#by"). Focus (function () {$. (URA , Function (result) {$ ( "#" by). Auto does not work integer (somedata); // $ ( "by" #). Autocomplete (result. Split ( "\ n")); // does not work}};});});  

    Thank you.

    Focus event too late to load values ​​for autocomplete plug- From the details of these:

    By giving or entering something in an autocomplete field, the plugin starts searching for matching entries and displays a list of values ​​to select from Does. By entering more characters, the user can filter the list for better matching.

    Focus event works automatically when you are triggered You are trying to load data from the same event. In fact you load the data after the event, since $ .get method The callback of is called asynchronous.


    jquery - Javascript Multiple File Upload, Sequentially One at a Time -


    हमारे पास पांच & lt; input type = "file" /> gt; के तत्व हैं उत्पादन में है और महान काम कर रहा है हमें अनुरोध समय समाप्ति मिलती है और अवसर पर अधिकतमसेवेंस्टैलेशन से अधिक त्रुटि मिलती है। इन त्रुटियों को रोकने के लिए, मैंने कुछ जावास्क्रिप्ट लिखने की योजना बनाई है ताकि फाइल को एक बार में एक-एक-एक-समय के बजाय अपलोड किया जा सके।

  • एक समय में एक फाइल अपलोड को सक्षम करें और फ़ॉर्म जमा करें
  • सर्वर से प्रतिक्रिया की प्रतीक्षा करें
  • जब सर्वर प्रतिक्रिया आईफ्रेम में छपी जाती है, तो अगला अपलोड शुरू करें
  • जब सभी अपलोड किए जाते हैं, तो पृष्ठ को ताज़ा करें, जो कुछ भी आमंत्रित करेगा सर्वर-साइड तर्क जो एक ग्रिड को पॉप्युलेट करता है।
  • मेरी समस्या संख्या 5 के साथ है। आम तौर पर मुझे लगता है कि मैं इसे बाहर कोई समस्या नहीं समझ सकता हूँ, लेकिन मैं उन दिनों में से एक रहा हूँ जहां मेरा दिमाग हड़ताल पर है यहाँ मेरा कोड है अब तक ...

      $ (फ़ंक्शन () {$ ("& lt; iframe / & gt;")। Attr ("src", "test.htm") Attr ("name", "postMe")। Hide ()। AppendTo ("body"); $ ("form")। Attr ("target", "postMe")। सबमिट करें (function (e) {e.preventDefault ("I", "I", "I", "I", "I $ ("अक्षम", "अक्षम"); $ ("# FileUpload" + i) .removeAttr ("अक्षम"); $ ("फ़ॉर्म") [0]। सबमिट करें (), // मदद !!! // मैं अगले आवृत्ति से पहले सर्वर का इंतजार कैसे करूँ?} Location.reload (true);});});  

    अगले अपलोड बंद करने से पहले सर्वर प्रतिक्रिया के लिए "प्रतीक्षा" करने के लिए मुझे किस प्रकार का निर्माण करना चाहिए?

    मुझे लगता है कि आपको आइफ्रेम की लोड इवेंट के लिए सुनना चाहिए और हेन्डलर में इनपुट का स्विच करना चाहिए। मैंने आज अपने खुद के अपलोडर के साथ पूरा किया और यह समाधान मेरे लिए काम किया।


    c# - How to tell what is passed when no value exists -


    For this code, how do you know that if there is no value in the querystring then zero is returned?

    HTTP CONTRACT REFERENCES = HTPCONTEX. On; String strValue = context.Request [name];

    I am asking because I never know what is being returned in many cases in the NAT framework when you do not expect it when it is not in existence.

    So if context.Request [name]; Called and the name is not present in the query string, how do you know that it gives blank or empty string so that I can handle the case properly where it is not present?

    Use String.IsNullOrEmpty () to check the empty string For:

      string strValue =! String.isnaloracty (reference request [name]) ?? Reference. Request [name]: "some default value";  

    Or if you do not have a default value that you want to set up, then you can check later:

      if (string. IsNullOrEmpty (StrValue)) {// it is null or empty} other {// it is not}  

    update

    Just look at the comment if you are trying to find out that the key is not present in the collection of para (which you are using through shortcodes) which is a key If you refer, then MSDN Check Stavejhikrn.

    In this case, the ultimate one is the system. compilation. Specialized. NavmeValueCollection Documentation According to the documentation, when a key is not found in the collection, then a zero value actually comes back.

    So you do not have to use String.IsNullOrEmpty ()) . You simply:

      string strValue = context.Request [name] ?? "Some default values";  

    If you want to set the default, or else check for null .


    sql server 2005 - SQL: Best practice to store various fields in one table -


    I want to create a table for the item There are several types of items, all the stock many fields near each type of item I want to store the unusual field in a different table. I thought something like this:

      ---- Item + Item_ID + Item snat_id + item side ... ... - --- Item_type + item snat_id + item_name ... ---- item_field + item_field_id + item_Type_Id + Field_Name ... ----file If you have the ability to add fields and values ​​without changing tables it is the value that you can see all the information for an item. For that I have to move area names and values.  

    Any better suggestions? Or maybe a simple (not stored procedure) way to get into the tables to get a flat information? I tried to use PIIT (I am using SQL 2005) but no luck.

    Thank you.

    I have written a stored proc to make PIVOT more useful. Here's the source:

    And some examples of using it:

    For your data, the query should be just one Raw statistics to join in the tables listed above:

      set @ myQuery = 'select item, item_name, field_name, by value ...';  

    Then your call will be on pivot_query:

      exec pivot_query @ myQuery, 'Item_Id, Item_Name', 'Field_Name', 'max (value)' < Like / code> 


    How do I create this reference mapping in Fluent NHibernate? -


    To use Fluent NHibernate, I need a clue how to map my invoice class. Public class buyer {public virtual id id (get; set;} public virtual string {get; set;} public virtual string tax reggae {not; set;} // more property ...} public class invoices {public virtual id id {get; set;} public virtual it idee {receives; set;} public virtual buyer buyer {get; set;} // more properties}

    The problem is that I have to be in the invoice class:

    • Buyer ID - Only one integer ID reference and foremost key relationships
    • A copy of almost all buyer properties (its accounting documents and properties can not be changed after confirmation) - As a component
    • I did the following mapping but this does not work

        public invoicemark () {id (x => x.Id); references (x = & Gt; x.IdBuyer); component (x = & gt; x. Buyer, buyer map, columnpix ("buyer_")); // .... more properties}  

    You usually have both foreign keys and If the child object maps to both of you, then do it in mapping (or similar):

      context (x = & gt; X.buyer); Map (x = & gt; x.IdBuyer). Columns ("Buyer ID"). No. Indrat (). Not.Update ();  

    Then you do not repeat the name of the columns in SQL statements, which results in the number of parameters which have mismatched errors.


    angularjs - Class not binding to ui-view before ng-enter -


    To get different animations between states - I am applying a class for UI-vis based on the current situation I:

      & lt; Div ng-class = "currentClass.current.name" UI-view & gt; & Lt; / Div & gt;  

    This works, however - when initially is entered into the scene, it appears that the ng-entry currentClass.current Name is bound, so my animation is ignored:

      .slide-right.ng-enter {z-index: 100; Left: -100%; Background color: green; }  

    I can apply animations to ng-leave - as before currentClass.current.name has been implemented.

    See. Any ideas?

    managed CSS classes in conflict with all the IIE-view animations of Nig-class has gone.

    Therefore, the issue is in this line

      & lt; Section ui-view ng-class = "stateClass" & gt; & Lt; / Section & gt;  

    Unfortunately, the NG-class is not compatible with ui-view here is complete.

    Then you can use the class = "{{stateClass}}" with the UI-view.

      & lt; Section ui-view class = "{{stateClass}}" & gt; & Lt; / Section & gt;  

    is working here

    Cheers!


    Strange Array Assignment In Javascript -


    मुझे निम्नलिखित मिल गया है:

      चेतावनी ("इससे पहले:" + JSON stringify (scenario_data)); // आउटपुट: {"1": {"राशि": {"value": "", "inputflag": false}, "संख्या समाप्त": {"मान": "", "इनपुटफ़्लैग": false}, "छूट ": {" मूल्य ":" "" inputflag ": झूठी}}," 2 ": {" राशि ": {" मूल्य ":" "" inputflag ": झूठी}," numberout ": {" मूल्य " : "इनपुट" "गलत": {"मान": "", "इनपुटफ़्लैग": गलत}}} परिदृश्य_डेटा [1] ['राशि'] ['मान'] = 1234; चेतावनी ("बाद:" + JSON.stringify (परिदृश्य_डेटा)); // आउटपुट: {"1": {"राशि": {"मूल्य": 1234, "इनपुटफ़्लैग": सच}, "संख्या समाप्त": {"मान": "", "इनपुट फ़्लैग": false}, "छूट" : { "मूल्य": "" "inputflag": झूठी}}, "2": { "राशि": { "मूल्य": 1234, "inputflag": सच}, "numberout": { "मूल्य": "  परिदृश्य_डेटा [1] दोनों क्यों हैं? ['राशि'] ['मूल्य']  और  परिदृश्य_डेटा [2] ['राशि'] ['मान']  को  1234  पर सेट किया जा रहा है? 

    क्योंकि परिदृश्य_डेटा [0] और परिदृश्य_डेटा [1] एक ही ऑब्जेक्ट को इंगित करें इसलिए, जब आप जेसन को परिवर्तित करते हैं, तो दोनों तत्व समान प्रतिनिधित्व करते हैं। आप परिदृश्य_डेटा [0] == परिदृश्य_डेटा [1]

    के मूल्य की जांच करके सत्यापित कर सकते हैं

    javascript - Having trouble accessing Object element with a variable -


    I have a different "session" that has been passed from a different function. I'm not sure how to format it so that I can use it as follows:

      function passed - // session = 'coverType_1') var tag = session.substring (Session.indexOf ("_") + 1); Document.write (dataBlock ['coverType _' + tag] ['coverage'] [1]);  

    Displays this as "undefined" ...

    As a comparison, though, it works:

      var i = 1; Document.write (dataBlock ['coverType _' + i] ['coverage'] [1]);  

    How can I format "session" to use this object element as a variable?

    I think the "session" has lost the scope of it from another function, it works within the previous function

    Thanks in advance, it has thrown me for about a week. .

    You can not find the correct tag , or data block < / Code> object.

    var tag = session.substring (instead of session.indexOf ("_") + 1; , use the split () operator Next, I'm not sure if you want your to be session.plit ("_") [1];

    DataBlock wants to be used as a 3-D array, but be careful if you have done so because you have a lot of data handling inside it. I use the console.log (dataBlock ['coverType _' + Tag]) first, then console.log (dataBlock ['coverType _' + tag] ['coverType _ '+ Tag]). To verify that you have the necessary data in it, if not, the "other function" that returns the data has been blocked.


    Connect to local sql database in c# -


    I am working on the C # .net application that needs to be connected to a simple database. This database is BTW in the same Visual Studio project and is called Playerdatabase.mdf .

    In the application, I want to connect to the database using the following code:

      string connection string = "data source = (locali) \ v11.0; attachment debufflenname = C: \\ User \\ User 1 \\ Document \\ Visual Studio 2013 \ Projects \\ ProractTest \\ Prorctor Test \\ Playerdatabase.mdf; Integrated Security = True; Timeout Connect 30 "; SqlConnection con = new SqlConnection (connectionString); Con.Open ();  

    But when I try to run the application and when it calls the open method, then I got an exception:

    Additional information: A network related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the example name is correct and SQL

    Inner exception: Network path can not be found

    I looked on the way (by browsing it) and it looks fine Used to be. I have also read that the firewall tried to disable the work, but it got the same exception.

    Is anyone's idea or suggestion? Any feedback is welcome!


    java - How to create a pagination system with Mysql and JSP? -


    I have created a simple ecommerce application in JSP. I have a database of stored products using MySQL, except for one thing everything is well set in the browser: I want to limit the number of pages per page and lets the user choose the number of products they display. You can navigate through the pages as well.

    All the tutorials that have come to me so far are in php ... which is a very different language from JSP, as you already know.

    Anything about doing this should be appreciated!

    There are so many tutorials available on Google that are easily available on this.

    Your question is very broad here.


    transfer html var to php -


    I'm new to PHP, if I write a piece of the html5 canvas code, and store the var attempts value in Want to transfer mysql to canvas PHP session, how to do it? Compatible codes are in Star, Thaks in advance

      & lt; Div id = "aside" & gt; & Lt; Canvas id = "microwave" width = "600" height = "500" style = "border: 1 px solid # c3c3c3;" & Gt; & Lt; / Canvas & gt; & Lt; Script & gt; Var bodystyle = document.body.style; BodyStyle.mozUserSelect = 'none'; BodyStyle.webkitUserSelect = 'none'; Var img = new image (); Var canvas = document.query selector ('canvas'); Canvas.style.backgroundColor = 'Transparent'; Canvas.style.position = 'Done'; Var imgs = ['p_2.jpg', 'p_3.jpg', 'p_4.jpg', 'p_5.jpg', 'p_6.jpg', 'p_7.jpg', 'p_8.jpg', 'p_9.jpg , 'P_11.jpg', ' 'P_18.jpg', 'p_19.jpg', 'p_20.jpg', 'p_21.jpg', 'p_22.jpg', 'p_23.jpg', 'p_24.jpg', 'p_25.jpg', 'p_26 .jpg ']; Var num = Math.floor (Math.random () * 24); Img.src = imgs [number]; Img.addEventListener ('Load', function (e) {var ctx; // var w = img.width, // h = img.height; var w = 600; h = 500; var offsetX = canvas.offsetLeft, offsetY = Canvas.offsetTop; var MouseDown = false; function layer (CTX) {ctx.fillStyle = 'gray'; ctx.fillRect (0, 0, w, h);} event eventDown (e) {e.preventDefault (); Muizidon = true;} function eventUp (e) {e.preventDefault (); mouseden = false;} function eventove (e) {e.preventDefault (); if (mooledown) {if (e.changedTouches) {e = e change Gone touch [e.changedTouches.length-1];} var x = (e.clientX + document.body.scrollLeft || e.pageX) - offset x || 0, y = (e.clientY + document.body. ScrollTop | | E.pageY) - Offset U. with 0 (ktx) {startPath () // R Reset (X, Y, 20, 20); Fill ();}}} Function Console (e) {e.preventDefau Liter (Var) = 0; var datas = canvas.getImageData (0,0, W, H); (Var i = 0; i & lt; datas.data.length; i ++) for (if (datas.data [i] == 0) {num ++;};}; ** Tryup = num / (w * h); **} canvas.wind = w; Canvas.height = h; Canvas.style.backgroundImage = 'url (' + img.src + ')'; Ctx = canvas.getContext ('2D'); Ctx.fillStyle = 'Transparent'; Ctx.fillRect (0, 0, w, h); // 绘制 矩形 layer (ctx); Ctx.globalCompositeOperation = 'Destination-Out'; Canvas.addEventListener ('TouchStart', EventDown); Canvas.addEventListener ('touchend', eventUp); Canvas.addEventListener ('touchmove', eventMove); Canvas.addEventListener ('Masudown', EventDown); Canvas.addEventListener ('mouseup', EventUp); Canvas.addEventListener ('mousemove', eventMove); Canvas.addEventListener ("click", mint); }); & Lt; / Script & gt; & Lt; / Html & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt; & Lt ;? Php ** $ _ session ["attempt"] = $ effort; **? & Gt;  

    This is not the best solution, however, you can use an AJAX request Call php script and pass Java from javascript to php script.


    c# - Load a ComboBox from Dictionary with BindingSource gives an ArgumentNullException -


    I am trying to start a combo box from the following:

      dictionary & Lt; String, int & gt; TestDictionary = New Dictionary & lt; String, int & gt; {{"Text1", 1}, {"text2", 2}, {"text3", 3}}; TestComboBox.DataSource = New binding source (TestDictionary, blank);  

    But it throws the following exception:

     Logic

    Why are you bound to make it a null? You want this man

      Binding source (iCotNair)  

    this is not a

      binding source (object, string Public Binding Source (Object Datasource, String Datamember)  

    From the

    Use your data base in Cambodia Done through.

      dataMember type:  

    to bind specific column or list names to the System.String data source or give it the proper name.

    UPD / Correction:

    According to the above comment, you need to map these two:

      testComboBox.DisplayMember = "value" ; TestComboBox.ValueMember = "key";  

    objective c - MPNowPlayingInfoCenter info doesn't work via USB accessory -


    मेरे पास एक ऐसा ऐप है जो AVPlayer (वास्तव में AVQueuePlayer ) का उपयोग करता है ऑडियो बजाना यह MPNowPlayingInfoCenter जानकारी सेट करता है, दूरस्थ कोडों के प्रबंधन के लिए MPRemoteCommandCenter का उपयोग करता है, और पृष्ठभूमि ऑडियो को अनुमति देता है यह सभी कार्यक्षमता नियंत्रण केंद्र और लॉक स्क्रीन के माध्यम से ठीक से काम करती है। जब मैं अपना फोन मेरी कार में लाता हूं तो यह मेरी कार के ब्लूटूथ इंटरफेस के साथ ठीक से काम करता है हालांकि, अगर मैं सीधे अपने कार के स्टीरियो में आईफोन 6 बिजली बंदरगाह के माध्यम से अपने फोन को प्लग करता हूं, तो यह बुरी तरह से टूट गया है। यह वास्तव में ऑडियो खेलता है, लेकिन ...

    (1) अब मेरी किसी भी गेम की जानकारी मेरी कार के डैशबोर्ड पर प्रदर्शित नहीं होती है (2) मेरी कार का स्टीरियो जब भी मैं कोशिश करता हूं तो कनेक्शन त्रुटियों का एक गुच्छा डाल देता है कुछ भी करें।

    मेरे फोन पर अन्य ऐप्स में यह समस्या नहीं है, इसलिए मुझे नहीं लगता कि यह मेरे स्टीरियो की गलती है मैं आधिकारिक ऐप बिजली केबलों का उपयोग कर रहा हूं, इसलिए यह संबंधित नहीं है।

    मैंने अपने ऐप्पल टीवी के माध्यम से एयरप्ले के साथ अपने ऐप की कोशिश की और यह इसी तरह से विलक्षण भी था मैंने देखा है कि AVPlayer को अनुमति देता है, एन्क्सिनेटल प्लेबैक नामक एक महत्वपूर्ण संपत्ति है, जिसे नहीं पर सेट करना पड़ता है, अगर आप केवल ऑडियो खेल रहे हैं उस संपत्ति को NO पर सेट करने के बाद, एप्पल टीवी के माध्यम से एयरप्ले ठीक से काम करता है मैंने यह माना था कि यह मेरी ऐसी कारिका थी जो मेरी कार को प्रभावित कर रही थी, लेकिन वह ऐसा नहीं लगता है। को नहीं पर सेट की गई अनुमति के साथ भी, मेरी कार पर यूएसबी कनेक्शन के माध्यम से ऑडियो बजाना अभी भी खराब है।

    ऐसा लगता है कि यह कैसे गलत है या तो (ए) AVAudio सत्र , या (बी) AVPlayer कॉन्फ़िगर किया गया है।

    मेरा ऑडियो प्लेयर कॉन्फ़िगरेशन बहुत आसान है ...

    <पूर्व> आत्म। आडियो प्रश्न = [AVQueuePlayer queuePlayerWithItems: शून्य]; Self.audioQueue.allowsExternalPlayback = नहीं; [स्व। आडियो क्यूई एडऑबर्वर: स्वयं केकेपाथ के लिए: @ "स्थिति" विकल्प: 0 संदर्भ: केएवीप्लेयरस्टैटस कंटेंक्स]; [Self.audioQueue addObserver: स्वयं केकेपाथ के लिए: @ "दर" विकल्प: 0 संदर्भ: केएवीप्लेयरआरएटीकॉन्टेक्स]; [Self.audioQueue addObserver: के लिए selfKeyPath: @ "त्रुटि" विकल्प: 0 संदर्भ: kAVPlayerErrorContext]; [Self.audioQueue addObserver: के लिए स्वयं केपैथ: @ "वर्तमान इटैम" विकल्प: (एनएसकेएवल्यूऑबसेबलऑप्शनऑल्ड | एनएसकेएवेवल्यूउज़नओवेशनओवेशननई) संदर्भ: केएवीप्लेयरकूरेंटइटम कॉन्टेक्स];

    ... मेरे ऑडियो सत्र के रूप में ...

    <पूर्व> AVAudio सत्र * ऑडियो सत्र = [एवाडियो शोशन साझाकरण]; NSError * त्रुटि; [ऑडियो सत्र सेटअक्टिव: हाँ त्रुटि: & amp; त्रुटि]; // त्रुटि संभाल कोड [ऑडियो सत्र चालू करें श्रेणी: AVAudio सत्र श्रेणी प्लेबैक त्रुटि: & amp; त्रुटि]; // त्रुटि संभाल कोड // ऑडियो सत्र अधिसूचना NSNotificationCenter * defaultCenter = [NSNotificationCenter defaultCenter]; [DefaultCenter addObserver: स्वयं चयनकर्ता: @ सिलेक्टर (ऑडियोसेशन इंटररेशन नोटिफिकेशन :) नाम: एवीएडियओसेशन इंटररक्शननोटेशन ऑब्जेक्ट: ऑडियोसेशन]; [DefaultCenter addObserver: स्वयं चयनकर्ता: @ सिलेक्टर (ऑडियोसेशनरआउट चेन नोटिफिकेशन :) नाम: एवीएडियोसेशनरआउट चेंज नोटिफिकेशन ऑब्जेक्ट: ऑडियोसशन]; [DefaultCenter addObserver: स्वयं चयनकर्ता: @ सिलेक्टर (ऑडियोसेशन मीडियासर्विसेज रीयरसेट नोटिफिकेशन) नाम: एविडियो सत्र मीडिया सेवाऐसे रीसेट नोटिफिकेशन ऑब्जेक्ट: ऑडियो सत्र];

    क्या अन्य गुण हैं जिन्हें इस उपयोग के मामले को संभाल करने की आवश्यकता है? यहां क्या हो रहा है इसे डीबग करने के लिए मैं क्या कर सकता हूं? यह मुझे मिला है।

    यहां खेलने के मुद्दे पर 2 मुद्दे थे ...

    1. मैं MPNowPlayingInfoPropertyPlaybackQueueIndex उसी तरह से स्थापित कर रहा था जिस तरह से मैं MPMediaItemPropertyAlbumTrackCount सेटिंग कर रहा था। प्रलेखन को देखने के बाद, मुझे एहसास हुआ कि MPNowPlayingInfoPropertyPlaybackQueueIndex शून्य-आधारित है, और मैं हमेशा क्यूई सूचकांक 1 और कतार संख्या 1 पर सेट कर रहा था। यह कार स्टीरियो को किसी भी सूचना को प्रदर्शित नहीं करने का कारण था ।

    2. AVPlayer के साथ एक ट्रैक खेलने के लिए, आपको केवल 0 के अलावा किसी अन्य चीज़ पर दर निर्धारित करने की आवश्यकता है। मैंने देखा कि मेरे पास एक अनावश्यक है कॉल करने के लिए [audioQueue play] मेरे प्लेबैक दर में दर निर्धारित करने से पहले मैंने इसे चलाने के लिए अनावश्यक कॉल हटा दिया, और यह मेरी अन्य समस्याओं को तय किया कुछ कारणों से, इस विराम के बटन को दबाए जाने के बाद, उस कॉल पर कार स्टीरियो के तुरंत प्रभाव से एक प्ले कमांड भेज दिया गया था।