pid
int64 2.28k
41.1M
| label
int64 0
1
| text
stringlengths 1
28.3k
|
---|---|---|
29,123,729 | 0 | <p>You are supposed to initialize the array to a non null value in order do use it :</p> <pre><code>String systems[][] = new String[n][5]; </code></pre> <p>where <code>n</code> is the max capacity of the array.</p> <p>If you don't know in advance how many rows your array should contain, you can use an <code>ArrayList<String[]></code> instead, since the capacity of an <code>ArrayList</code> can grow.</p> <p>For example:</p> <pre><code> Statement st = con.createStatement(); List<String[]> systems = new ArrayList<String[]>(); String item = "SELECT ram, cpu, mainboard, cases, gfx FROM computer_system"; ResultSet rs = st.executeQuery(item); while (rs.next()){ String[] row = new String[5]; row[0] = rs.getString("ram"); row[1] = rs.getString("cpu"); row[2] = rs.getString("mainboard"); row[3] = rs.getString("cases"); row[4] = rs.getString("gfx"); systems.add(row); } </code></pre> |
33,548,768 | 0 | Jackson coercing to zero <p>Using JAX-RS (GlassFish 4) and Jackson as serializer, I encountered a problem during deserialization of POJO properties of type <code>Double</code> (same with <code>Integer</code>).</p> <p>Lets say I have simple POJO (excluding bunch of other fieds, getters and setters):</p> <pre><code>public class MapConstraints { private Double zoomLatitude; private Double zoomLongitude; } </code></pre> <p>When a user send request to API in format <code>{ "zoomLatitude": "14.45", "zoomLongitude": ""}</code>, value of <code>zoomLatitude</code> is set to <code>14.45</code>, but value of <code>zoomLongitude</code> is set to <code>0</code>. </p> <p>I expect value of <code>zoomLongitude</code> to be <code>null</code> if no value is presented. I tried configure <code>ObjectMapper</code> with <code>JsonInclude.Include.NON_EMPTY</code> but without success.</p> <p>Same results with genson.</p> |
9,951,480 | 0 | TouchUtils and ActivityInstrumentationTestCase2 user event Unit test case not working <p>Currently I am struggling a little with the Unit test framework...</p> <p><strong>what I am trying to do</strong></p> <ul> <li>I need to simulate 2 clicks on the screen (100,100) and (400,400) at a small duration difference.</li> <li>I need to simulate a longPressClick on the screen Let's say ( 200, 200 )</li> <li>Upon User click the native code runs and performs pixel manipulation on Bitmap.</li> <li>This test is going to run for multiple pair-sets of points, for analysing the runtime performance of the system</li> </ul> <p><strong>Here's where I am stuck</strong></p> <ul> <li>I am using activityInstrumentationTestCase2 and touchUtils for the user click events.</li> <li>TouchUtils.longClickView(InstrumentationTestCase test, View v) works fine ; I'm able to detect the long pressing event propely , But test-case finishes even before the calculation / rendering is complete in my UI thread ; how do I stop the test from exiting in this case ?</li> <li>How do i simulate 2 / 3 user clicks @ particular location on screen ? cause TouchUtils.clickView(InstrumentationTestCase test, View v) would only simulate the user click in the center of the screen ... How to do it properly ?</li> </ul> <p><strong>These are the things I have tried and seems I'm missing out something:</strong></p> <ul> <li>TouchUtils.longClickView(InstrumentationTestCase test, View v) works fine...for creating longClickView .. Even I was able to create longClickView() at particular screen location by introducing the timedelay between ACTION_DOWN and ACTION_UP event.. please refer to the code attached </li> <li>I was able to achieve the user clicking event at particular screen location , But I faced a strange issue .. When I am displatching the MotionEvent(100,100) from the test-case.. The framework would always add "-76" in the Y event .. not sure why there was this deviation ... I worked around the issue by adding 76 to my input data (100,176) for time being .. did anyone face a similar issue ? </li> <li>Even seems with this approach timing is very critical .. as If i place more delay between ACTION_DOWN and ACTION_UP , the event is detected as longClickPress ... and if I put a little less ... the "second" single click events ( ACTION_DOWN + ACTION_UP ) gets detected as DoubleTapEvent .. </li> </ul> <p>What should be the right timing combination for ACTION_UP and ACTION_DOWN .. for a single user click event simulation .. ????????</p> <pre><code> @Test public void testClick(){ List<Points> pointSequence = new ArrayList<Points>(); Log.d(TAG, "FirClick Start Timing : " + SystemClock.uptimeMillis()); pointSequence.add(new Points(100f,176f)); pointSequence.add(new Points(100f,176f)); singleClickSimulation(pointSequence,false); } private void singleClickSimulation(List<Points> pointSequence, Boolean addDelay) { long downTime = SystemClock.uptimeMillis(); long eventTime = SystemClock.uptimeMillis(); // NOTE : If I do not place this then the event is detected as doubleTap. eventTime += 100; Instrumentation inst = getInstrumentation(); MotionEvent event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_DOWN, pointSequence.get(0).getX(), pointSequence.get(0).getY(), 0); inst.sendPointerSync(event); //eventTime = SystemClock.uptimeMillis(); pointSequence.remove(0); //This delay I have added just to test; whether there is enough time for pixel manipulation or not, actually it would be used only at the end of the run of all the test cases for single user click if(addDelay){ eventTime = SystemClock.uptimeMillis() + 3000; } eventTime += 25; event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, pointSequence.get(0).getX(), pointSequence.get(0).getY(), 0); inst.sendPointerSync(event); pointSequence.remove(0); } </code></pre> |
28,482,087 | 0 | Use Regex to Match relative image URLs and then use string replace to make them absolute using Javascript <p>I want to use javascript regex to find all relative URLs and then make them absolute using the string replace function in javascript. I tried to following but it didn't work:(Note: i have tried searching this site but couldn't find the perfect solution)</p> <pre><code>data = data.replace(/\/\.(jpg|png|gif|bmp)$\/i/gi, "http://example.com" + "$1"); </code></pre> <p>What I am trying to achieve is replace the relative image URLs with their absolute forms in an external data pulled using YQL and JSON. I also found another script that would do the job, but it would only apply to the on page HTML element, and NOT to the content inside the div containing the externally loaded content. </p> <p>Any method other than the data.replace doesn't seem to work in my case, i tried another script that worked perfectly but only on the on page html, not externally loaded HTML.</p> <p>This is my first post here. Any help would be appreciated. </p> |
35,691,121 | 0 | No ad in AdMob example (Android Studio) <p>I downloaded an ad example: <a href="https://developers.google.com/admob/android/start" rel="nofollow">https://developers.google.com/admob/android/start</a> but when I run it on a device it shows no ad (online mode of the project). In logs it tells that it is failed to load ad.</p> <p>Here are some lines from log:</p> <pre><code>02-29 05:18:26.923 33-33/? E/Zygote: setreuid() failed. errno: 2 02-29 05:18:27.802 33-33/? W/MediaProfiles: could not find media config xml file 02-29 05:19:10.883 78-84/? W/zipro: Unable to open zip '/data/local/bootanimation.zip': No such file or directory 02-29 05:19:10.905 78-84/? W/zipro: Unable to open zip '/system/media/bootanimation.zip': No such file or directory 02-29 05:19:25.492 67-79/system_process W/PackageManager: Package com.example.android.apis desires unavailable shared library com.example.will.never.exist; ignoring! 02-29 05:19:25.662 67-79/system_process W/PackageManager: Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.contacts 02-29 05:20:51.480 336-336/com.google.samples.quickstart.admobexample W/Ads: Failed to load ad: 3 </code></pre> |
3,040,041 | 0 | <p>It might be showing in the "Immediate Window" instead due to a setting:</p> <ul> <li>Go to Tools/Options/Debugging/General. Uncheck "Redirect all Output Window text to the Immediate Window"</li> </ul> <p>Or somethig like that.</p> |
39,299,156 | 1 | On LOAD DATA LOCAL INFILE integer required error <p>I have a data file containing data in following format</p> <pre><code>asd,12,asd,asd,12,adsd,,asdas,None </code></pre> <p>I have a table in mysql which is has an <code>auto increment</code> int <code>id</code> and the rest of the columns as in data file.</p> <p>Now i am trying</p> <pre><code>query2 = """LOAD DATA LOCAL INFILE 'tmp.txt' REPLACE INTO TABLE mytable FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n' (a1,a2,a3,a4,a5,a6,a7,a8,a9) """ conn = mysql.connector.connect(user=self.db_config.dbusername, password=self.db_config.dbpassword, host=self.db_config.dbhost, database='something', client_flags=[ClientFlag.LOCAL_FILES]) cursor = conn.cursor() cursor.execute(query2) conn.commit() cursor.close() conn.close() </code></pre> <p>the error i get is </p> <blockquote> <p>class 'mysql.connector.errors.InterfaceError'> Failed executing the operation; an integer is required</p> </blockquote> <p>because of presence of auto increment id i tried appending <code>SET ID=None</code> as suggested by some posts,but the result was same.tmp.txt is in the same location as the script.This response is being sent by mysql server.</p> <p>The <code>MYSQL Server is on amazon</code> is that makes a diff.</p> <p>Any idea what could be causing this or how we can debug it?</p> <p>Digged in deep.</p> <p>The error comes when </p> <pre><code>execute method in /usr/local/lib/python2.7/site-packages/mysql/connector/cursor.py is called with the query as parameter cmd_query in /usr/local/lib/python2.7/site-packages/mysql/connector/protocol.py is called _handle_resultset in /usr/local/lib/python2.7/site-packages/mysql/connector/protocol.py is called read_lc_int in /usr/local/lib/python2.7/site-packages/mysql/connector/utils.py is called which return (buf,None) </code></pre> <p>and so <code>_handle_resultset</code> function fails.So this definitely has something to do with the response coming from server when <code>LOAD DATA</code> query is sent.</p> |
3,259,002 | 0 | Need a Perforce DVCS recommendation: git-p4, hg Perfarce, or Something Else? <p>We're getting migrated from Subversion to Perforce at work. I've been using git-svn and it's kept me very productive. I want to keep using a DVCS for my own development.</p> <p>Which works best with Perforce in your experience, git-p4, Perfarce (hg) or something else I've never heard of?</p> <p>What works well (and what doesn't)?</p> |
14,556,216 | 0 | <p>try this (-1D to get 27 of next month otherwise it would be same of today date):</p> <pre><code>$(function() { $( "#datepicker" ).datepicker({ minDate: 0, maxDate: "+1M -1D" }); }); </code></pre> |
21,986,939 | 0 | Hovering menu doesnt resizing <p>I have a menu and a submenu , that will show only on mouse hover. But I cant resize it . </p> <p>This is my javascript:</p> <pre><code>$('#menu li').hover(function() { $(this).find('ul').show(); }, function() { $(this).find('ul').hide(); }); </code></pre> <p>HTML part: </p> <pre><code> <ul id='menu'> <li> <a href="#"class="current">Marketing</a> <ul style="display:none; border-bottom-color:#F00;"> <li style="margin:-350px 294px 0px"> <a href="#" >ForSale</a> </ul> </li> <!-- <li></li>--> </ul> </nav> </header> </code></pre> <p><a href="http://jsfiddle.net/manojmcet/wfXZ4/1/" rel="nofollow">Demo is here.</a></p> <p>Thanks.</p> |
4,087,024 | 0 | <p>use the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Capabilities.html" rel="nofollow">Capabilities</a> class. You can get the OS, also there are many other details you can get.</p> |
39,118,657 | 0 | <p>You can use Command Design Pattern</p> <p>for more info :</p> <p><a href="https://en.wikipedia.org/wiki/Command_pattern" rel="nofollow">https://en.wikipedia.org/wiki/Command_pattern</a> <a href="http://www.tutorialspoint.com/design_pattern/command_pattern.htm" rel="nofollow">http://www.tutorialspoint.com/design_pattern/command_pattern.htm</a></p> |
23,144,691 | 0 | Get the value of the textbox on c# <p>I'm working on a wpf app and i want to get the value of textbox i want to use KeyDown & KeyPress to check if the text is a numeric value but when i write KeyPress the compilator underlined the proprity so i can't use it . </p> <pre><code>private void sb_KeyDown_1(object sender, System.Windows.Input.KeyEventArgs e) { nonNumberEntered = false; // Determine whether the keystroke is a number from the top of the keyboard. if (e.KeyCode < Keys.D0 || e.KeyCode > Keys.D9) { // Determine whether the keystroke is a number from the keypad. if (e.KeyCode < Keys.NumPad0 || e.KeyCode > Keys.NumPad9) { // Determine whether the keystroke is a backspace. if (e.KeyCode != Keys.Back) { // A non-numerical keystroke was pressed. // Set the flag to true and evaluate in KeyPress event. nonNumberEntered = true; } } } //If shift key was pressed, it's not a number. if (Control.ModifierKeys == Keys.Shift) { nonNumberEntered = true; } } </code></pre> <p>and it underlined also e.KeyCode and e.KeyNumPad0 .... what should i do ?</p> |
4,439,509 | 0 | <p>I hit the same link error using boost version 1.44 and the pre-built installer. I unzipped "libboost_data_time_vc100-mt-gd-144.zip" which contains only the missing .lib and this seems to have solved the problem.</p> |
36,260,142 | 0 | <p><b>Q1.What should be the resolution of the image for supporting all screen sizes for iPhone and iPad in landscape or portrait?<br> Regarding to @heximal <br></b> You can set "Scale to fill" mode for your image view and provide any image size (size of you xib, for example). <br> <b>Q2.Should I be again providing images of different resolutions for different screen sizes and orientations for iPhone and iPad like LaunchImage asset?</b><br> Create new image set in assets and provide just 3 images for your launch screen -@1x @2x @3x</p> |
23,178,824 | 0 | Error: Failed to build native gem extension <p>I've tried following some of the advice to uninstall libv8 and reinstall it, then run bundle, but it doesn't seem to work. I'm trying to install twitter-bootstrap-rails with less.</p> <pre><code>> gem install libv8 -v 3.16.14.3 -- --with-system-v8 Done installing documentation for after 0 seconds > bundle update Updating git://github.com/seyhunak/twitter-bootstrap-rails.git Fetching gem metadata from https://rubygems.org/......... Fetching additional metadata from https://rubygems.org/.. Resolving dependencies... Installing rake (10.3.1) Using i18n (0.6.9) Using minitest (4.7.5) Using multi_json (1.9.2) Installing thread_safe (0.3.3) Installing tzinfo (0.3.39) Using activesupport (4.0.2) Using builder (3.1.4) Using erubis (2.7.0) Using rack (1.5.2) Using rack-test (0.6.2) Using actionpack (4.0.2) Using mime-types (1.25.1) Using polyglot (0.3.4) Using treetop (1.4.15) Using mail (2.5.4) Using actionmailer (4.0.2) Using activemodel (4.0.2) Using activerecord-deprecated_finders (1.0.3) Using arel (4.0.2) Using activerecord (4.0.2) Using bcrypt (3.1.7) Using bundler (1.5.2) Using coffee-script-source (1.7.0) Using execjs (2.0.2) Using coffee-script (2.2.0) Installing thor (0.19.1) Using railties (4.0.2) Using coffee-rails (4.0.1) Using orm_adapter (0.5.0) Using warden (1.2.3) Installing devise (3.2.4) Using hike (1.2.3) Using jbuilder (1.5.3) Using jquery-rails (3.1.0) Using json (1.8.1) Using kaminari (0.15.1) Using libv8 (3.16.14.3) Using tilt (1.4.1) Using sprockets (2.11.0) Using sprockets-rails (2.0.1) Using rails (4.0.2) Using rdoc (4.1.1) Using ref (1.0.5) Installing sass (3.2.19) Installing sass-rails (4.0.3) Using sdoc (0.4.0) Using simple_form (3.0.2) Using sqlite3 (1.3.9) Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb checking for main() in -lpthread... yes checking for main() in -lobjc... yes creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling accessor.cc clang: warning: argument unused during compilation: '-rdynamic' compiling array.cc clang: warning: argument unused during compilation: '-rdynamic' compiling backref.cc clang: warning: argument unused during compilation: '-rdynamic' compiling constants.cc clang: warning: argument unused during compilation: '-rdynamic' compiling constraints.cc clang: warning: argument unused during compilation: '-rdynamic' compiling context.cc clang: warning: argument unused during compilation: '-rdynamic' compiling date.cc clang: warning: argument unused during compilation: '-rdynamic' compiling exception.cc clang: warning: argument unused during compilation: '-rdynamic' compiling external.cc clang: warning: argument unused during compilation: '-rdynamic' compiling function.cc clang: warning: argument unused during compilation: '-rdynamic' compiling gc.cc clang: warning: argument unused during compilation: '-rdynamic' compiling handles.cc clang: warning: argument unused during compilation: '-rdynamic' compiling heap.cc clang: warning: argument unused during compilation: '-rdynamic' compiling init.cc clang: warning: argument unused during compilation: '-rdynamic' init.cc:11:20: warning: empty parentheses interpreted as a function declaration [-Wvexing-parse] v8::Locker lock(); ^~ init.cc:11:20: note: remove parentheses to declare a variable v8::Locker lock(); ^~ init.cc:11:16: warning: 'lock' has C-linkage specified, but returns user-defined type 'v8::Locker' which is incompatible with C [-Wreturn-type-c-linkage] v8::Locker lock(); ^ 2 warnings generated. compiling invocation.cc clang: warning: argument unused during compilation: '-rdynamic' compiling locker.cc clang: warning: argument unused during compilation: '-rdynamic' compiling message.cc clang: warning: argument unused during compilation: '-rdynamic' compiling object.cc clang: warning: argument unused during compilation: '-rdynamic' compiling primitive.cc clang: warning: argument unused during compilation: '-rdynamic' compiling rr.cc clang: warning: argument unused during compilation: '-rdynamic' compiling script.cc clang: warning: argument unused during compilation: '-rdynamic' compiling signature.cc clang: warning: argument unused during compilation: '-rdynamic' compiling stack.cc clang: warning: argument unused during compilation: '-rdynamic' compiling string.cc clang: warning: argument unused during compilation: '-rdynamic' compiling template.cc clang: warning: argument unused during compilation: '-rdynamic' compiling trycatch.cc clang: warning: argument unused during compilation: '-rdynamic' compiling v8.cc clang: warning: argument unused during compilation: '-rdynamic' compiling value.cc clang: warning: argument unused during compilation: '-rdynamic' linking shared-object v8/init.bundle clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future] clang: note: this will be a hard error (cannot be downgraded to a warning) in the future make: *** [init.bundle] Error 1 make failed, exit code 2 Gem files will remain installed in /Users/****/.bundler/tmp/63501/gems/therubyracer-0.12.1 for inspection. Results logged to /Users/****/.bundler/tmp/63501/extensions/universal-darwin-13/2.0.0/therubyracer-0.12.1/gem_make.out An error occurred while installing therubyracer (0.12.1), and Bundler cannot continue. Make sure that `gem install therubyracer -v '0.12.1'` succeeds before bundling. </code></pre> <p>I'm not sure what else to do at this point. Should I try uninstalling the gems and reinstalling them?</p> |
10,301,547 | 0 | How to update multiple rows with multiple values? <p>Well, I have a table as this </p> <pre><code>id | idtable2|value | code |name | 1 | 3 |983 | 10 |Total | 2 | 4 |89 | 10 |type 4 | 3 | 5 |299 | 10 |type 5 | 4 | 6 |0 | 10 |type 6 | 5 | 7 |72 | 10 |type 7 | 6 | 8 |523 | 10 |type 8 | 7 | 4 | | 11 |percentaje4| 8 | 5 | | 11 |percentaje5| 9 | 6 | | 11 |percentaje6| 10 | 7 | | 11 |percentaje7| 11 | 8 | | 11 |percentaje8| </code></pre> <p>where I have my values and I need to have theirs percentages. These percentajes are based on values you could see. To get for example my rows with id 7 i could do it</p> <pre><code>declare @total int set @total=(select value from table where name='total') update table set value=(select value from table where code=1' and name='type 4')/@total </code></pre> <p>and I'll need do it for all my rows which are percentages, but this is a dinamic table. In another table I have a id, and a name (<code>table1.name it's equals to table2.name</code>) and table1 for every code (10,11) is going to have a name (from table2)</p> <p>How can I get this values? I tried with a query as it.</p> <pre><code>update ce set valor=valor/@total from #table1 ce inner join table2 m on ce.t2id=m.id where codigo=10 </code></pre> <p>but i got it update values with code 10, and not values with code 11. How could i do it?</p> |
24,739,755 | 0 | hibernate with annotations in java, exception at runtime <p>I am new to hibernate and I'm creating a sample program with hibernate annotations. While running the program I'm getting the exception:</p> <pre><code>Java.lang.NoSuchMethodError: org.hibernate.util.ReflectHelper.classForName(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Class </code></pre> <p>Can anyone please suggest how to resolve this issue? </p> <p>Stack Trace : </p> <pre><code>SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.util.ReflectHelper.classForName(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Class; at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:800) at com.hibernate.tutorial.EmployeePersistor.main(EmployeePersistor.java:12) </code></pre> |
1,015,743 | 0 | <p>I did use <a href="http://search.cpan.org/~robertmay/Win32-GUI-1.06/docs/GUI.pod" rel="nofollow noreferrer">Win32::GUI</a> once for such a simple project. The main window had a menu, a text-box and a few buttons and checkboxes. It worked.</p> <p>Excerpt from the method that sets up the GUI (just to give you an idea):</p> <pre><code>my @menu_items = ( '&File' => 'File', ' > &Open' => { -name => 'FileOpen', -onClick => sub { $self->onFileOpen(@_) }, }, ' > &Close' => { -name => 'FileClose', -onClick => sub { $self->onFileClose(@_) }, }, ' > E&xit' => { -name => 'FileExit', -onClick => sub { $self->onFileExit(@_) }, }, '&Help' => 'Help', ' > &About' => { -name => 'About', -onClick => sub { $self->onHelpAbout(@_) }, }, ); $self->set_main_menu( Win32::GUI::MakeMenu(@menu_items) ); my $window = $self->set_main_window( Win32::GUI::Window->new( -menu => $self->get_main_menu, -name => 'Main', -sizable => 0, -resizable => 0, -hasmaximize => 0, -maximizebox => 0, -title => $self->get_program_name, -onTerminate => sub { -1 }, -onTimer => sub { $self->onTimer(@_) }, ), ); $self->set_log_field( $window->AddTextfield( -name => 'Log', -font => Win32::GUI::Font->new( -name => 'LogFont', -face => 'Courier New', -size => 9, ), -multiline => 1, -wantreturn => 1, -autovscroll => 1, -vscroll => 1, -readonly => 1, ), ); $self->get_log_field->MaxLength(40000); $self->set_status_bar( $window->AddStatusBar( -name => 'Status', -text => $self->get_program_name, ), ); </code></pre> |
13,742,775 | 0 | Save and load elements from webpage <p>I have in my webpage a series of elements, for example videos or other media:</p> <pre><code><div id = "text"> </div> <video height="240" width="412" id="video" controls="controls"> </video> </code></pre> <p>I change with JavaScript the original status of these elements and I use Popcorn.js for create a synchronization events, for example:</p> <pre><code>var video = document.getElementById('video'); video.src = $("#url").val(); //Change src value var popcorn = Popcorn( "#video" ); popcorn.footnote({ //Create a synchronization event; I add a footnote start: 2, stop: 5, text: 'Hello World!!!', target: 'text', }); </code></pre> <p>So now, my problem is that I want save these elements with their events. And after I want to have the possibility to load (in the my webpage) this elements for continue to change them again. How can I save/load in this case?</p> |
25,344,150 | 0 | Post to mini-profiler-results gives a 404 but only on live deployed site <p>I'm having some problems getting the POST results from MiniProfiler after the page has loaded. </p> <p>I've tried a GET, and that works. But the POST returns a 404 error as if it were looking for a static file.</p> <p><img src="https://i.stack.imgur.com/KtgCL.png" alt="shot of error"></p> <p><em>Any help or hints as to what I can try next would be much appreciated.</em></p> <p>Here's what I've looked at so far:</p> <p><strong>It's Not My Routes</strong></p> <p>The GET/POST issue would lead me to suspect a problem with my routes - except... </p> <p>This problem only occurs on the live server. Locally, the routing runs fine. </p> <p><strong>It Might be: runAllManagedModulesForAllRequest?</strong></p> <p><a href="http://stackoverflow.com/a/8011182/1778169">Most things I've read</a> suggest setting this to true. However my problem seems to contradict this. </p> <p>The problem occurs when <code>runAllManagedModulesForAllRequest="true"</code> set to true, and is fixed when set to false. I would like to keep it set to true because I'm not knowlegable enough to change that from the default setting. </p> <p><strong>Adding a Handler Didn't Help</strong></p> <p>Other resources, <a href="http://miniprofiler.com/" rel="nofollow noreferrer">like this one (at the bottom of MP's home page)</a>, suggest adding this line to system.webServer.handlers in web.config. </p> <p>As I understand it, this should allow MP to run even if runAllManagedModulesForAllRequests is set to false. For me, it has had no effect either way.</p> <pre><code><add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" /> </code></pre> <p><strong>But Could The handlers Section in Web.Config be Related?</strong></p> <p>I have no particular reason to think it is... </p> <p>I just don't fully understand what it's doing and wonder if this could account for the difference between local and deployed versions. </p> <pre><code><handlers> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" /> <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" /> <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" /> <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="" /> </handlers> </code></pre> |
2,009,441 | 0 | <p>Assuming you are talking about the creation of dynamic objects:</p> <p>You'll obviously need a library to support this, unless you want to get into <code>Reflection.Emit</code> yourself - LinFu supported this in version 1:</p> <p><a href="http://code.google.com/p/linfu/" rel="nofollow noreferrer">http://code.google.com/p/linfu/</a></p> <p>However, it's a feature that was dropped before version 2 I seem to remember.</p> |
29,435,822 | 0 | settting keyspace for replication strategy <p>Hi i am pretty new to Cassandra so forgive me when i have some fundamental misunderstanding of the concept of keyspaces. What i am trying to do is to set up a multi datacenter ring in different regions with data replication NetworkTopologyStrategy endpoint_snitch set to GossipingPropertyFileSnitch hence as explained in the docs i need set the replication strategy for a keyspace</p> <pre><code> CREATE KEYSPACE "mykey" WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'dc1' : 2, 'dc2' : 2}; </code></pre> <p>i also read that in cql i can do "use mykey" to set the keyspace</p> <p>would that be persistantly set then in the cassandra configurtation? As far as i understand each application client in a cluster uses its own keyspace right. Hence i would need to set this in the application?? </p> <p>The examples only show how to create a keyspace for configuring replication strategy options. I i think i managed to understand the basics behind it. What i am looking for is examples how i would tell cassandra to use a certain keyspace strategy (consistently and/or application dependent). </p> <p>I digged some more in the cassandra docs and think i got a better aubderstanding about the use of keyspace. Am i correct in that for telling cassandra to use a certain keyspace i can create keyspace like so</p> <pre><code>CREATE KEYSPACE "MyKey" WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; </code></pre> <p>and then create tables in this keyspace like so</p> <pre><code> CREATE TABLE "MyKey"."TableName" ( ... </code></pre> <p>Would this make cassandra to always use the configured replication strategy in the "MyKey" keyspace for that table?</p> |
27,746,239 | 0 | <p>You need to actually perform the query against your DB:</p> <pre><code>$stuidcheck="SELECT status FROM valid_stuid WHERE id='".$stuid."'"; if($stuidcheck == "used") </code></pre> <p>All this does is to give the string <code>$stuidcheck</code> the value "SELECT...", but you need to do something like:</p> <pre><code>$result=mysql_query($stuidcheck); $row=mysql_fetch_assoc($result); if ($row['status'] == "used") </code></pre> <p>Or something like that (my PHP is a bit rusty, but you'll find thousands of code examples for this).</p> |
30,322,841 | 0 | Sticky Footer out of place with Image Slider <p>I am trying to add an image slider onto my homepage, however whenever I do so, the Sticky Footer moves out of place and I don't understand why.</p> <p>I want the Slider to stay where it is and the footer just to be in its right position and should move according to when content is added</p> <p>HTML:</p> <pre><code><body> <div class="navbar navbar-inverse navbar-static-top"> <div class="container"> <div class="logo"> <center> <a class="navbar-brand" href="#"><img src="Final.png"/></a> </center> </div> <div class="navbar-header"> <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="index.html">Home</a></li> <li><a href="Services.html">Services</a></li> <li><a href="Prices.html">Our Prices</a></li> <li><a href="#">About Us</a></li> <li><a href="Contact.html">Contact Us</a></li> </ul> </div> </div> </div> <div class="main"> <div id="slider1_container" style="position: relative; margin: 0 auto; top: 0px; left: 0px; width: 1300px; height: 500px; overflow: hidden;"> <!-- Loading Screen --> <div u="loading" style="position: absolute; top: 0px; left: 0px;"> <div style="filter: alpha(opacity=70); opacity: 0.7; position: absolute; display: block; top: 0px; left: 0px; width: 100%; height: 100%;"> </div> <div style="position: absolute; display: block; background: url(../img/loading.gif) no-repeat center center; top: 0px; left: 0px; width: 100%; height: 100%;"> </div> </div> <!-- Slides Container --> <div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 1300px; height: 500px; overflow: hidden;"> <div> <img u="image" src="../img/1920/red.jpg" /> <div u="caption" t="NO" t3="RTT|2" r3="137.5%" du3="3000" d3="500" style="position: absolute; width: 445px; height: 300px; top: 100px; left: 600px;"> <img src="../img/new-site/c-phone.png" style="position: absolute; width: 445px; height: 300px; top: 0px; left: 0px;" /> <img u="caption" t="CLIP|LR" du="4000" t2="NO" src="../img/new-site/c-jssor-slider.png" style="position: absolute; width: 102px; height: 78px; top: 70px; left: 130px;" /> <img u="caption" t="ZMF|10" t2="NO" src="../img/new-site/c-text.png" style="position: absolute; width: 80px; height: 53px; top: 153px; left: 163px;" /> <img u="caption" t="RTT|10" t2="NO" src="../img/new-site/c-fruit.png" style="position: absolute; width: 140px; height: 90px; top: 60px; left: 220px;" /> <img u="caption" t="T" du="4000" t2="NO" src="../img/new-site/c-navigator.png" style="position: absolute; width: 200px; height: 155px; top: 57px; left: 121px;" /> </div> <div u="caption" t="RTT|2" r="-75%" du="1600" d="2500" t2="NO" style="position: absolute; width: 470px; height: 220px; top: 120px; left: 650px;"> <img src="../img/new-site/c-phone-horizontal.png" style="position: absolute; width: 470px; height: 220px; top: 0px; left: 0px;" /> <img u="caption" t3="MCLIP|L" du3="2000" src="../img/new-site/c-slide-1.jpg" style="position: absolute; width: 379px; height: 213px; top: 4px; left: 45px;" /> <img u="caption" t="MCLIP|R" du="2000" t2="NO" src="../img/new-site/c-slide-3.jpg" style="position: absolute; width: 379px; height: 213px; top: 4px; left: 45px;" /> <img u="caption" t="RTTL|BR" x="500%" y="500%" du="1000" d="-3000" r="-30%" t3="L" x3="70%" du3="1600" src="../img/new-site/c-finger-pointing.png" style="position: absolute; width: 257px; height: 300px; top: 80px; left: 200px;" /> <img src="../img/new-site/c-navigator-horizontal.png" style="position: absolute; width: 379px; height: 213px; top: 4px; left: 45px;" /> </div> <div style="position: absolute; width: 480px; height: 120px; top: 30px; left: 30px; padding: 5px; text-align: left; line-height: 60px; text-transform: uppercase; font-size: 50px; color: #FFFFFF;">Touch Swipe Slider </div> <div style="position: absolute; width: 480px; height: 120px; top: 300px; left: 30px; padding: 5px; text-align: left; line-height: 36px; font-size: 30px; color: #FFFFFF;"> Build your slider with anything, includes image, content, text, html, photo, picture </div> </div> <div> <img u="image" src="../img/1920/purple.jpg" /> <div style="position: absolute; width: 480px; height: 120px; top: 30px; left: 30px; padding: 5px; text-align: left; line-height: 60px; text-transform: uppercase; font-size: 50px; color: #FFFFFF;">Touch Swipe Slider </div> <div style="position: absolute; width: 480px; height: 120px; top: 300px; left: 30px; padding: 5px; text-align: left; line-height: 36px; font-size: 30px; color: #FFFFFF;"> Build your slider with anything, includes image, content, text, html, photo, picture </div> </div> <div> <img u="image" src="../img/1920/blue.jpg" /> <div style="position: absolute; width: 480px; height: 120px; top: 30px; left: 30px; padding: 5px; text-align: left; line-height: 60px; text-transform: uppercase; font-size: 50px; color: #FFFFFF;">Touch Swipe Slider </div> <div style="position: absolute; width: 480px; height: 120px; top: 300px; left: 30px; padding: 5px; text-align: left; line-height: 36px; font-size: 30px; color: #FFFFFF;"> Build your slider with anything, includes image, content, text, html, photo, picture </div> </div> </div> <div u="navigator" class="jssorb21" style="bottom: 26px; right: 6px;"> <!-- bullet navigator item prototype --> <div u="prototype"></div> </div> <span u="arrowleft" class="jssora21l" style="top: 123px; left: 8px;"> </span> <span u="arrowright" class="jssora21r" style="top: 123px; right: 8px;"> </span> <a style="display: none" href="http://www.jssor.com">Bootstrap Slider</a> </div> </div> <footer class="footer navbar-static-bottom"> <div class="container"> <h6 class="text-center">Copyright &copy; Soni Computer Repairs</h6> <p class="text-center">www.SoniRepairs.com</p> </div> </footer> </body> </code></pre> <p>JavaScript/JQuery:</p> <pre><code><script> jQuery(document).ready(function ($) { var _CaptionTransitions = []; _CaptionTransitions["L"] = { $Duration: 900, x: 0.6, $Easing: { $Left: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["R"] = { $Duration: 900, x: -0.6, $Easing: { $Left: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["T"] = { $Duration: 900, y: 0.6, $Easing: { $Top: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["B"] = { $Duration: 900, y: -0.6, $Easing: { $Top: $JssorEasing$.$EaseInOutSine }, $Opacity: 2 }; _CaptionTransitions["ZMF|10"] = { $Duration: 900, $Zoom: 11, $Easing: { $Zoom: $JssorEasing$.$EaseOutQuad, $Opacity: $JssorEasing$.$EaseLinear }, $Opacity: 2 }; _CaptionTransitions["RTT|10"] = { $Duration: 900, $Zoom: 11, $Rotate: 1, $Easing: { $Zoom: $JssorEasing$.$EaseOutQuad, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInExpo }, $Opacity: 2, $Round: { $Rotate: 0.8} }; _CaptionTransitions["RTT|2"] = { $Duration: 900, $Zoom: 3, $Rotate: 1, $Easing: { $Zoom: $JssorEasing$.$EaseInQuad, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInQuad }, $Opacity: 2, $Round: { $Rotate: 0.5} }; _CaptionTransitions["RTTL|BR"] = { $Duration: 900, x: -0.6, y: -0.6, $Zoom: 11, $Rotate: 1, $Easing: { $Left: $JssorEasing$.$EaseInCubic, $Top: $JssorEasing$.$EaseInCubic, $Zoom: $JssorEasing$.$EaseInCubic, $Opacity: $JssorEasing$.$EaseLinear, $Rotate: $JssorEasing$.$EaseInCubic }, $Opacity: 2, $Round: { $Rotate: 0.8} }; _CaptionTransitions["CLIP|LR"] = { $Duration: 900, $Clip: 15, $Easing: { $Clip: $JssorEasing$.$EaseInOutCubic }, $Opacity: 2 }; _CaptionTransitions["MCLIP|L"] = { $Duration: 900, $Clip: 1, $Move: true, $Easing: { $Clip: $JssorEasing$.$EaseInOutCubic} }; _CaptionTransitions["MCLIP|R"] = { $Duration: 900, $Clip: 2, $Move: true, $Easing: { $Clip: $JssorEasing$.$EaseInOutCubic} }; var options = { $FillMode: 2, //[Optional] The way to fill image in slide, 0 stretch, 1 contain (keep aspect ratio and put all inside slide), 2 cover (keep aspect ratio and cover whole slide), 4 actual size, 5 contain for large image, actual size for small image, default value is 0 $AutoPlay: true, //[Optional] Whether to auto play, to enable slideshow, this option must be set to true, default value is false $AutoPlayInterval: 4000, //[Optional] Interval (in milliseconds) to go for next slide since the previous stopped if the slider is auto playing, default value is 3000 $PauseOnHover: 1, //[Optional] Whether to pause when mouse over if a slider is auto playing, 0 no pause, 1 pause for desktop, 2 pause for touch device, 3 pause for desktop and touch device, 4 freeze for desktop, 8 freeze for touch device, 12 freeze for desktop and touch device, default value is 1 $ArrowKeyNavigation: true, //[Optional] Allows keyboard (arrow key) navigation or not, default value is false $SlideEasing: $JssorEasing$.$EaseOutQuint, //[Optional] Specifies easing for right to left animation, default value is $JssorEasing$.$EaseOutQuad $SlideDuration: 800, //[Optional] Specifies default duration (swipe) for slide in milliseconds, default value is 500 $MinDragOffsetToSlide: 20, //[Optional] Minimum drag offset to trigger slide , default value is 20 //$SlideWidth: 600, //[Optional] Width of every slide in pixels, default value is width of 'slides' container //$SlideHeight: 300, //[Optional] Height of every slide in pixels, default value is height of 'slides' container $SlideSpacing: 0, //[Optional] Space between each slide in pixels, default value is 0 $DisplayPieces: 1, //[Optional] Number of pieces to display (the slideshow would be disabled if the value is set to greater than 1), the default value is 1 $ParkingPosition: 0, //[Optional] The offset position to park slide (this options applys only when slideshow disabled), default value is 0. $UISearchMode: 1, //[Optional] The way (0 parellel, 1 recursive, default value is 1) to search UI components (slides container, loading screen, navigator container, arrow navigator container, thumbnail navigator container etc). $PlayOrientation: 1, //[Optional] Orientation to play slide (for auto play, navigation), 1 horizental, 2 vertical, 5 horizental reverse, 6 vertical reverse, default value is 1 $DragOrientation: 1, //[Optional] Orientation to drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value is 1 (Note that the $DragOrientation should be the same as $PlayOrientation when $DisplayPieces is greater than 1, or parking position is not 0) $CaptionSliderOptions: { //[Optional] Options which specifies how to animate caption $Class: $JssorCaptionSlider$, //[Required] Class to create instance to animate caption $CaptionTransitions: _CaptionTransitions, //[Required] An array of caption transitions to play caption, see caption transition section at jssor slideshow transition builder $PlayInMode: 1, //[Optional] 0 None (no play), 1 Chain (goes after main slide), 3 Chain Flatten (goes after main slide and flatten all caption animations), default value is 1 $PlayOutMode: 3 //[Optional] 0 None (no play), 1 Chain (goes before main slide), 3 Chain Flatten (goes before main slide and flatten all caption animations), default value is 1 }, $BulletNavigatorOptions: { //[Optional] Options to specify and enable navigator or not $Class: $JssorBulletNavigator$, //[Required] Class to create navigator instance $ChanceToShow: 2, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 1, //[Optional] Auto center navigator in parent container, 0 None, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1, //[Optional] Steps to go for each navigation request, default value is 1 $Lanes: 1, //[Optional] Specify lanes to arrange items, default value is 1 $SpacingX: 8, //[Optional] Horizontal space between each item in pixel, default value is 0 $SpacingY: 8, //[Optional] Vertical space between each item in pixel, default value is 0 $Orientation: 1 //[Optional] The orientation of the navigator, 1 horizontal, 2 vertical, default value is 1 }, $ArrowNavigatorOptions: { //[Optional] Options to specify and enable arrow navigator or not $Class: $JssorArrowNavigator$, //[Requried] Class to create arrow navigator instance $ChanceToShow: 1, //[Required] 0 Never, 1 Mouse Over, 2 Always $AutoCenter: 2, //[Optional] Auto center arrows in parent container, 0 No, 1 Horizontal, 2 Vertical, 3 Both, default value is 0 $Steps: 1 //[Optional] Steps to go for each navigation request, default value is 1 } }; var jssor_slider1 = new $JssorSlider$("slider1_container", options); //responsive code begin //you can remove responsive code if you don't want the slider scales while window resizes function ScaleSlider() { var bodyWidth = document.body.clientWidth; if (bodyWidth) jssor_slider1.$ScaleWidth(Math.min(bodyWidth, 1920)); else window.setTimeout(ScaleSlider, 30); } ScaleSlider(); $(window).bind("load", ScaleSlider); $(window).bind("resize", ScaleSlider); $(window).bind("orientationchange", ScaleSlider); //responsive code end }); </script> </code></pre> <p>CSS :</p> <pre><code>@media screen and (max-width:700px) { } .footer { position: relative; bottom: 0; width: 100%; height: 60px; background-color: #f5f5f5; margin-top: 10px; } .jssora21l, .jssora21r { display: block; position: absolute; width: 55px; height: 55px; cursor: pointer; background: url(../img/a21.png) center center no-repeat; overflow: hidden; } .jssora21l { background-position: -3px -33px; } .jssora21r { background-position: -63px -33px; } .jssora21l:hover { background-position: -123px -33px; } .jssora21r:hover { background-position: -183px -33px; } .jssora21l.jssora21ldn { background-position: -243px -33px; } .jssora21r.jssora21rdn { background-position: -303px -33px; } .jssorb21 { position: absolute; } .jssorb21 div, .jssorb21 div:hover, .jssorb21 .av { position: absolute; width: 19px; height: 19px; text-align: center; line-height: 19px; color: white; font-size: 12px; background: url(../img/b21.png) no-repeat; overflow: hidden; cursor: pointer; } .jssorb21 div { background-position: -5px -5px; } .jssorb21 div:hover, .jssorb21 .av:hover { background-position: -35px -5px; } .jssorb21 .av { background-position: -65px -5px; } .jssorb21 .dn, .jssorb21 .dn:hover { background-position: -95px -5px; } </code></pre> |
18,763,433 | 0 | I need a very basic understanding of what static means <p>I am a java newbie, and despite searching everywhere, I cannot find a basic definition for what static actually does. Could somebody please tell me what it means? Also, please phrase your answer as if I do not even know what java is, no programming language examples please? Huge thanks. EDIT: so my understanding is that when you have a static variable inside of a constructor, </p> <pre><code>i.e. you have class test{ static int a = 5; public test(){ } } </code></pre> <p>and then</p> <pre><code>test test1 = new test(); test test2 = new test(): </code></pre> <p>, <code>test1.a</code> would equal 5, and <code>test2.a</code> would also equal 5. If you changed <code>test1.a = 6</code> however, <code>test2.a</code> would also equal 6?</p> |
12,513,219 | 0 | <p>I know no-one is asking for a jQuery solution here, but might be worth mentioning that with jQuery you can just ask for:<code>$('#selectorid').val()</code></p> |
2,936,377 | 0 | <p>Important point: always call function on super when you reimplement. This solved my problem:</p> <pre><code>- (void)layoutSubviews { [super layoutSubviews]; self.contentView.frame = CGRectMake(50, 0, self.frame.size.width - 100, sub.thumbnail.size.height + 20); } </code></pre> |
150,915 | 0 | <p>The first 3 characters are missing in the corrupted one - compare</p> <pre><code>// Your correct version 00000BC0 0D 0D 0D 41 // Their corrupted one 00000BC0 D0 D4 1... </code></pre> <p>Either their mail server, mail program, anti-virus or some such program has removed the first few chars, which seems to be causing the confusion when Word tries to open it.</p> <p>The fact that the file is still garbled when they send it back to you confirms that something is altering the file on their side once received.</p> |
11,828,354 | 0 | merge socket.io and express.js sessions <p>I want to merge express.js and socket.io sessions together. Below is my code (socket.io part)</p> <pre><code>var io = require('socket.io').listen(app); io.set('log level', 1); io.sockets.on('connection', function (socket) { console.log('client connected'); client.send(client.id);//send client id to client itself socket.on('connect', function(){ console.log(socket.id + ' connected'); }); socket.on('disconnect', function(){ console.log(socket.id + ' disconnected'); }); }); </code></pre> <p>My express.js Session settings:</p> <pre><code>app.configure(function() { //app.use(express.logger()); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(express.static(__dirname + '/static')); app.use(express.cookieParser()); app.use(express.session({store: MemStore({ reapInterval: 60000 * 10 }), secret:'foobar', key: 'express.sid' })); </code></pre> <p>My main problem is in my terminal when user travels from one url to another, the session id changes also: But I don't want it to be changed.</p> <pre><code>info - socket.io started client connected client connected 4Z0bYHzfWCEFzbbe4WUK disconnected e_uSvxhSLbLAC9-F4WUL disconnected client connected bKDy90gsrWWTRJDD4WUM disconnected client connected RJ5qqCL2wfmXbd7U4WUN disconnected client connected wjN5Sqx4rucRtWL_4WUO disconnected </code></pre> |
16,794,191 | 0 | <p>The bug is fixed in commit <a href="https://github.com/FooBarWidget/passenger/commit/4ad928da840663e1933c4557c9e79a3166b48304" rel="nofollow">4ad928d</a> on GitHub.</p> <p>You can try to use a clone from the GitHub repository, or wait for version 4.0.5 which will include this fix.</p> <p><strong>Edit:</strong> As of this moment version 4.0.5 is available.</p> |
23,277,387 | 1 | Redis publish from a csv. No error but No data received <p>Below is my script which inserts data from a csv located on one server into Redis on another server. If it worked..</p> <p>I don't get an error but I don't show any data received on the redis side either. So Iam not sure which is worse.</p> <pre><code>#!/opt/python/bin/python import csv import redis from redis import StrictRedis reader = csv.reader(open("/opt/xyzxyz.csv")) header = reader.next() client = redis.StrictRedis(host='XXXXXXXXX.XX.XXX.X.XXX', port=6379, db=0) for row in reader: key = "xyzxyz:%s" % (row[0], ) doc = dict(zip(header, row)) client.publish(key, doc) </code></pre> <p>Any thoughts on what I am missing from the above process? Or if there is something I am not doing on the redis side?</p> <p>This is my first time working with Redis so it is kinda new to me.</p> |
5,455,549 | 0 | Web based RTF editor solution <p>I've been researching on how to do this for about a week now and I guess I am looking for the best way to go about doing what I am trying to accomplish.</p> <p>I am trying to build a module in my website that will allow users to create forms (letters) in a wysiwyg type of editor with the ability to insert variables where needed from a list. The site is written in MVC 2 using C# for the backend. I have started writing this module in Silverlight and have some of the functionality already created such as loading a list of variables from a DB using a WCF service and copying them to the selected text in the RichTextBox that comes with Silverlight by selecting them.</p> <p>I have written this module before using PHP and ckeditor but the biggest problem I had with this is after the form was written and edited it would never come out looking exactly like it did in the wysiwyg editor. Because of this I've decided to move toward something that can handle RTF or DOC type files. I am trying to stay away from PDF because the user base that will be using the application will be more use to using Microsoft Word/Open Office than using Adobe Acrobat.</p> <p>I started using the built in RichTextBox with Silverlight 4 but the only problem I came across is the issue with saving UI elements such as images or tables and for what this is used for this can be a "show stopper" for me. I have found some paid libraries that seem to be able to overcome this save issue and add a lot more functionality such as Teleriks RichTextBox or DevExpress's RichTextBox but I guess I'm looking for the best solution for this type of module before I commit to purchasing a Silverlight Control suite.</p> <p>I have looked into VectorLights RichTextBox plugin and was able to get something going but im not sure if their save does more than just a XAML export and I had issues replacing the selected text with their library. They also don't have any documentation and I'm trying to avoid spending all my time on a forum asking questions about how to use their library.</p> <p>So my question to you is for an app that needs to create RTF type documents, retain the exact or very close to the exact format of what you see in the editor, and allow you to replace your selected text with a variable by selecting it out of a list. How would you go about writing and what plugins/input formats would you use for this module. I will have to eventually pull this form out of a database, replace variables with information out of the db, and have the ability to print or email this form.</p> <p>I've added a link below that the basics of what I have currently written in Silverlight.</p> <p><a href="http://slaglesoft.dyndns.org/TestPage.html" rel="nofollow">Test Page</a></p> <p>Any suggestions would be greatful.</p> |
3,379,344 | 0 | <pre><code>$url = "http://www.mydomain.com/assets/Image/......./image.jpg"; $filename = basename($url); echo $filename; </code></pre> |
5,805,673 | 0 | <p>You forgot the quotes around the title.</p> <pre><code> $.each(json, function(i, item) { template += '<p><a href="javascript:void(0)" onClick="formatDescrip(' + i + ',\"' + json[i].title + '\")">' + this.title + '</a></p>'; }); </code></pre> <p>Instead of setting up the handlers that way, however, why not use jQuery's ".delegate()"?</p> <pre><code> $.each(json, function(i, item) { template += '<p><a class="dynamic" data-index="' + i + '" href="#">' + this.title + '</a></p>'; }); containerList.delegate("a.dynamic", "click", function(ev) { formatDescrip($(this).data('index'), $(this).text()); }); </code></pre> <p>Or something like that; if the list is extended multiple times then the ".delegate()" call should probably be done once, outside the handler.</p> <p><em>edit</em> — if the "formatDescrip()" function needs access to the original "event" object (whatever those things are that you use to make the list of <code><a></code> tags), you can pass it in to "formatDescrip()" instead of the index, and then modify the other function as necessary:</p> <pre><code> containerList.delegate("a.dynamic", "click", function(ev) { formatDescrip( json[$(this).data('index')] ); }); // ... function formatDescrip(eventObj) { alert(eventObj.title); // // ... more code here ... // } </code></pre> |
30,885,116 | 0 | Adding labels to pie chart in R... Radiating "spokes"? <p>Is there a way (using ggplot or some other package maybe) to angle the labels of a pie chart in R? For example, this code (using R defaults):</p> <pre><code>data <- c(4,9,2,5) names <- c("alpha","beta","gamma","delta") pie(data,names) </code></pre> <p>Creates this pie chart: <img src="https://i.stack.imgur.com/egwBZ.png" alt="enter image description here"></p> <p>What I want is a pie chart like this (which I created very roughly in PhotoShop): <img src="https://i.stack.imgur.com/BzIFv.png" alt="enter image description here"></p> |
37,734,874 | 0 | <p>Try using this method to get the running service. The Path gives the service MySQL..</p> <pre><code>ManagementClass mc = new ManagementClass("Win32_Service"); var Instances = mc.GetInstances().Cast<ManagementObject>().ToList(); foreach (ManagementObject o in Instances) { if (o.GetPropertyValue("PathName").Contains("mysqld.exe")) /// is a mysql service } </code></pre> |
1,642,548 | 0 | <p>I'm not sure if I expressed my problem very well, but now I've found the solution.</p> <p>In my .proj file, I reference my custom task with the following syntax...</p> <pre><code><UsingTask AssemblyFile="..\lib\MyCompany.MSBuild\MyCompany.MSBuild.dll" TaskName="CreateDatabase" /> </code></pre> <p>My CreateDatabase task relies on various 3rd-party assemblies. However, some of these are only referenced via reflection, so weren't included by default in the folder "..\lib\MyCompany.MSBuild".</p> <p>I had been trying to get the task to work by placing the required assemblies in the same directory as the .proj file invoking the task.</p> <p>However, what I should have been doing was putting the assemblies in the referenced task directory "..\lib\MyCompany.MSBuild\".</p> <p>Simple!</p> |
25,893,575 | 0 | <p>Java has a pool of Integer constants between -128 and 128. Integer values in that range don't take up any additional space.</p> <p>Integer values outside that range take as much space as an object header + 4 bytes. How big that is depends on your JVM and settings. Look at <a href="http://sourceforge.net/projects/sizeof" rel="nofollow">http://sourceforge.net/projects/sizeof</a> or <a href="https://code.google.com/p/memory-measurer" rel="nofollow">https://code.google.com/p/memory-measurer</a> if you want to programmatically measure the size.</p> <p>Edit: Note that <code>Integer i = new Integer(10);</code> will <strong>not</strong> use the object constant pool. That's why you should always use <code>Integer.valueOf(x)</code> instead of <code>new Integer(x)</code> when instantiating. Note also that autoboxing already does the right thing, so <code>Integer i = 10</code> will also use the constant pool.</p> |
31,391,100 | 0 | <p>You can <em>scale</em> the image by creating a <a href="https://msdn.microsoft.com/en-us/library/system.windows.media.scaletransform(v=vs.110).aspx" rel="nofollow">ScaleTransform</a> object and applying it to the imageBrush, and setting the Stretch property on your brush to whatever it is you desire.</p> <p>For example:</p> <pre><code> Button btn = new Button(); ImageBrush brush1 = new ImageBrush(); brush1.ImageSource = new BitmapImage(new Uri("ms-appx:///Assets/emptyseat.jpg")); ScaleTransform scaleTransform = new ScaleTransform(); scaleTransform.ScaleX = 0.5; brush1.Transform = scaleTransform; brush1.Stretch = Stretch.Uniform; btn.Background = brush1; </code></pre> <p>It's not entirely clear what you are trying to achieve but the above will resize the image for you.</p> |
6,792,818 | 0 | <p>If you are seeking to find out whether a type is a Foo(Of T) because you're interested in using some property which does not depend upon T, I would suggest that you should make that property available in either a non-generic base class or a non-generic interface. For example, if defining an ISuperCollection(Of T) which provides array-like access, one could offer a non-generic ISuperCollection collection which implements methods Count, RemoveAt, CompareAt, SwapAt, and RotateAt (calling RotateAt(4,3,1) would rotate three items, starting at item 4, up one spot, thus replacing item 5 with 4, 6 with 5, and 4 with the old value of 6), and have ISuperCollection(Of T) inherit from that.</p> <p>BTW, if you segregate reader interfaces from writer interfaces, the reader interfaces can be covariant and the writer interfaces contravariant. If any property or indexer implements both read- and write- functions, you'll need to define a read-write interface which includes read-write implementations of any such property or indexer; a slight nuisance, but IMHO worth the small additional effort.</p> |
21,222,769 | 0 | Texture Filtering <p>Why texture filtering is called <code>filtering</code>? As far as I understand, texture filtering means calculating the color components for the vertex from the texture texels. It can be considered as <code>mapping</code> . So where is the filtering here?</p> <p>I am asking to make sure that I am not missing the concept here.</p> |
4,849,454 | 0 | <p>I think you are missing a comma after <code>autoincrement</code> and then you don't need the trailing semicolon</p> |
27,244,700 | 0 | <p>Humm. Is your sort truly async or does it just take a function as a parameter? Also, I think we will need a bit more information regarding the workunit.sort method.</p> <p>Anyhow, as a high level, you can use something like <code>async</code> module to wait for the completion of async tasks perhaps?</p> |
17,654,733 | 0 | <p>edit the visibility line under <code>TextView</code> as follows:</p> <pre><code>android:visibility="visible" </code></pre> <p>Instead of</p> <pre><code>android:visibility="gone" </code></pre> |
24,378,730 | 0 | <p>The below coding is also useful to perform only string value.By using variable to access the property list of abject after that by using it check the value is a NotANumber by using isNaN.The code given below is useful to you</p> <pre><code>var languages = { english: "Hello!", french: "Bonjour!", notALanguage: 4, spanish: "Hola!" }; // print hello in the 3 different languages for(a in languages) { if(isNaN(languages[a])) console.log(languages[a]); } </code></pre> |
38,903,629 | 0 | Xcode 8 - directory not found for option '-F' <p>Started a new project in Xcode 8 beta 5, and I'm getting a warning for each cocoa pod in each of my targets:</p> <pre><code>ld: warning: directory not found for option '-F/Users/NinjaCoder/Library/Developer/Xcode/DerivedData/NinjaProduct-bfwyaspiuhsjzkhepkjmeoiayjnk/Build/Products/Debug-iphonesimulator/PureLayout' </code></pre> <p>I can still run, but I'd like to get rid of these warnings. Tried the solutions at this link, but they did not work: <a href="http://stackoverflow.com/questions/32676490/how-do-i-fix-the-directory-not-found-for-option-f-error">How do I fix the directory not found for option -F error</a></p> |
7,890,554 | 0 | Sending long XML over TCP <p>I'm sending an object (class name <code>House</code>) over TCP using the <code>TcpListener</code> on the server side in response to any message received from the <code>TcpClient</code>.</p> <p>When the message is received, it is currently populating a text box named <code>textBox1</code>.</p> <p>If I send a line of text, it works fine. You'll notice that I have a redundant line "Hello, I'm a server" for testing this purpose. But when I send the XML, it is cutting it off prematurely.</p> <p>When I send serialised XML in to the stream, I'm also receiving this error from the server side:</p> <blockquote> <p>Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.</p> </blockquote> <p><strong>Here's my server code</strong></p> <pre><code>// Set the variables for the TCP listener Int32 port = 14000; IPAddress ipaddress = IPAddress.Parse("132.147.160.198"); TcpListener houseServer = null; // Create IPEndpoint for connection IPEndPoint ipend = new IPEndPoint(ipaddress, port); // Set the server parameters houseServer = new TcpListener(port); // Start listening for clients connecting houseServer.Start(); // Buffer for reading the data received from the client Byte[] bytes = new Byte[256]; String data = "hello, this is a house"; // Show that the TCP Listener has been initialised Console.WriteLine("We have a TCP Listener, waiting for a connection..."); // Continuing loop looking for while (true) { // Create a house to send House houseToSendToClient = new House { house_id = 1, house_number = 13, street = "Barton Grange", house_town = "Lancaster", postcode = "LA1 2BP" }; // Get the object serialised var xmlSerializer = new XmlSerializer(typeof(House)); using (var memoryStream = new MemoryStream()) { xmlSerializer.Serialize(memoryStream, houseToSendToClient); } // Accept an incoming request from the client TcpClient client = houseServer.AcceptTcpClient(); // Show that there is a client connected //Console.WriteLine("Client connected!"); // Get the message that was sent by the server NetworkStream stream = client.GetStream(); // Blank int int i; // Loop for receiving the connection from the client // >>> ERROR IS ON THIS LINE <<< while ((i = stream.Read(bytes, 0, bytes.Length)) != 0) { Console.WriteLine("here"); // Take bytes and convert to ASCII string data = System.Text.Encoding.ASCII.GetString(bytes, 0, i); Console.WriteLine("Received s, return house"); // Convert the string to a byte array, ready for sending Byte[] dataToSend = System.Text.Encoding.ASCII.GetBytes("Hello, I'm a server"); // Send the data back to the client //stream.Write(dataToSend, 0, dataToSend.Length); // Send serialised XML in to the stream xmlSerializer.Serialize(stream, houseToSendToClient); } // Close the connection client.Close(); } </code></pre> <p><strong>Client code</strong></p> <pre><code>// Get the object serialised var xmlSerializer = new XmlSerializer(typeof(House)); // Set the variables for the TCP client Int32 port = 14000; IPAddress ipaddress = IPAddress.Parse("127.0.0.1"); IPEndPoint ipend = new IPEndPoint(ipaddress, port); string message = "s"; try { // Create TCPCLient //TcpClient client = new TcpClient("localhost", port); TcpClient client = new TcpClient(); // Convert the string to a byte array, ready for sending Byte[] dataToSend = System.Text.Encoding.ASCII.GetBytes(message); // Connect using TcpClient client.Connect(ipaddress, port); // Client stream for reading and writing to server NetworkStream stream = client.GetStream(); // Send the data to the TCP Server stream.Write(dataToSend, 0, dataToSend.Length); //xmlSerializer.Serialize(stream, houseToSend); // Buffer to store response Byte[] responseBytes = new Byte[256]; string responseData = String.Empty; // Read the response back from the server Int32 bytes = stream.Read(responseBytes, 0, responseBytes.Length); responseData = System.Text.Encoding.ASCII.GetString(responseBytes, 0, bytes); textBox1.Text = responseData; // Close the stream and the client connection stream.Close(); client.Close(); } catch (SocketException e) { MessageBox.Show(e.ToString()); } catch (Exception e) { MessageBox.Show(e.ToString()); } </code></pre> <p>I've marked on the code where the error is appearing.</p> <p>Is it because the message is too long?</p> |
972,645 | 0 | <p>I'm not sure I get you right, but if I do, something like that seems to do the trick:</p> <pre><code>select RESULT.* from classmembercall as RESULT inner join classmembercall as INPUT ON RESULT.startedontick BETWEEN INPUT.startedontick and INPUT.finishedontick AND RESULT.finishedontick BETWEEN INPUT.startedontick and INPUT.finishedontick where INPUT.CallGUID = 'CAE8210C-617A-49F4-A739-E442F39B55B0' </code></pre> <p>it should give you all calls between start and end tick of given log entry</p> <p>if you need to filter it additionally by the same InstanceGUID, then:</p> <pre><code>select RESULT.* from classmembercall as RESULT inner join classmembercall as INPUT ON RESULT.startedontick BETWEEN INPUT.startedontick and INPUT.finishedontick AND RESULT.finishedontick BETWEEN INPUT.startedontick and INPUT.finishedontick AND RESULT.InstanceGUID = INPUT.InstanceGUID where INPUT.CallGUID = 'CAE8210C-617A-49F4-A739-E442F39B55B0' </code></pre> <p>note that given your sample data, you'll always get only the item with provided CallGuild - because all of the rows have different InstanceGUIDs...</p> <p>Good luck :)</p> |
39,744,272 | 0 | <p>I think your problem is, though we destroy session we can still access the page that should be loaded only if the user in logged in.</p> <p>For example, when user log in with correct credentials the url should look like this: localhost/app/controller/function (just for instance). And later when the user log out you will redirect back to login page. But if we type localhost/app/controller/function in url or if we click back button in browser, the browser will load the page !!! I consider your stated problem is same like this.</p> <p>For this problem I always use a solution in every function of controller. Like;</p> <pre><code>class MainController extends CI_Controller { function test { $user_name = $this->session->userdata('user_name'); if(isset($user_name)) { //the actual function code goes here } else { //redirect to the login function } } } </code></pre> <p>I hope this helped some one.. cheers..</p> |
21,132,767 | 0 | <p>For buttons, i prefer to use:</p> <pre><code>$('<%=updAccountObject.ClientID %>').click(); </code></pre> |
8,998,950 | 0 | <p>Since twig 1.12.2 you can use <a href="http://twig.sensiolabs.org/doc/filters/first.html"><code>first</code></a>:</p> <pre><code>{% if user.name|first|lower == i %} </code></pre> <p>For older version you can use <a href="http://twig.sensiolabs.org/doc/filters/slice.html"><code>slice</code></a>:</p> <pre><code>{% if user.name|slice(0, 1)|lower == i %} </code></pre> |
14,695,303 | 0 | Accessing an imported element after the original DOMDocument is destroyed <p>I've been messing around with DOMDocument lately, and I've noticed that in order to transfer elements from one document to the next, I have to call <a href="http://php.net/manual/en/domdocument.importnode.php" rel="nofollow"><code>$DOMDocument->importNode()</code></a> on the target <code>DOMDocument</code>.</p> <p>However, I'm running into weird issues, where once the originating document is destroyed, the cloned element misbehaves.</p> <hr> <p>For example, here's some lovely working code:</p> <pre class="lang-php prettyprint-override"><code>$dom1 = new DOMDocument; $dom2 = new DOMDocument; $dom2->loadHTML('<div id="div"><span class="inner"></span></div>'); $div = $dom2->getElementById('div'); $children = $dom1->importNode( $div, true )->childNodes; echo $children->item(0)->tagName; // Output: "span" </code></pre> <p>Here's a demo: <a href="http://codepad.viper-7.com/pjd9Ty" rel="nofollow">http://codepad.viper-7.com/pjd9Ty</a></p> <hr> <p>The problem arises when I try using the elements after their original document is out of scope:</p> <pre class="lang-php prettyprint-override"><code>global $dom; $dom = new DOMDocument; function get_div_children () { global $dom; $local_dom = new DOMDocument; $local_dom->loadHTML('<div id="div"><span class="inner"></span></div>'); $div = $local_dom->getElementById('div'); return $dom->importNode( $div, true )->childNodes; } echo get_div_children()->item(0)->tagName; </code></pre> <p>The above results in the following errors:</p> <blockquote> <p><strong>PHP Warning</strong>: Couldn't fetch <code>DOMElement</code>. Node no longer exists in ...<br> <strong>PHP Notice</strong>: Undefined property: <code>DOMElement::$tagName</code> in ...</p> </blockquote> <p>Here's a demo: <a href="http://codepad.viper-7.com/c0kqOA" rel="nofollow">http://codepad.viper-7.com/c0kqOA</a></p> <hr> <p>My question is twofold:</p> <ol> <li><p>Shouldn't the returned elements exist even after the original document was destroyed, since they were cloned into the current document?</p></li> <li><p>A workaround. For various reasons, I have to manipulate the elements after the original document is destroyed, but before I actually insert them into the DOM of the other <code>DOMDocument</code>. Is there any way to accomplish this?</p></li> </ol> <hr> <p><strong>Clarification:</strong> I understand that if the elements are inserted into the DOM, it behaves as expected. But, as outlined above, my setup calls for the elements to be manipulated before being inserted into the DOM (long story). Given that the first example here works - and that manipulating elements outside of the DOM is standard procedure in JavaScript - shouldn't this be possible here as well?</p> |
20,104,230 | 0 | <p>From what I could dig, there seems to be two ways to open the compose window of the email app with the fields filled: </p> <h3>1. regular email link</h3> <p>You can pass subject, body, cc, bcc strings as query URL parameters on a mailto link, for example:</p> <pre><code><a href="mailto:[email protected]?subject=foo&body=bar>email link</a> </code></pre> <p>Using this method you won't be able to fill the attachment.</p> <p>To fill a file attachment, you would need to use the second way which is…</p> <h3>2. web activity "share"</h3> <p>The share web activity will ask for the user which of the apps that accepts the share activity she would like to chose for sharing the file, this activity is what the Gallery App uses to share pictures, if the email app is chosen, it will fill the compose message window according to the parameters you pass.</p> <p>If you look at the source code of the email app, you'll see that <a href="https://github.com/mozilla-b2g/gaia/blob/b585b32441fafa67f2b4582db23be5f3a2afab21/apps/email/js/mail-app.js#L287" rel="nofollow">on Firefox OS 1.1</a> (v1-train branch) the activity handler for the share activity accepts 2 parameters: data.blobs and data.filenames. Later versions (like <a href="https://github.com/mozilla-b2g/gaia/blob/v1.2/apps/email/js/app_messages.js#L53" rel="nofollow">Firefox OS 1.2</a>) also support an url parameter that can have the other fields subject, body, cc, bcc as part of the query string.</p> |
9,804,114 | 0 | <p><em>You haven't specified Joomla version so I'm assuming 1.6/7/2.5 in my answer.</em></p> <p><strong>Short Answer:</strong> If you're using Joomla!'s default .htaccess then all you have to do is create a Joomla! menu to each of your components views with the right alias eg. <code>portal</code> for your default component access ie. <code>?option=com_tmportal</code>.</p> <p>This is what the default <code>.htaccess</code> does it passes all of the elements after the base URL to <code>index.php</code> to help select the component and view.</p> <p><strong>Longer Answer</strong> When you create a component for Joomla! you specify <a href="http://docs.joomla.org/Developing_a_Model-View-Controller_%28MVC%29_Component_for_Joomla!2.5_-_Part_03" rel="nofollow">the menu settings for each view</a> using an XML file usual the same name as the view file in it's <code>view/tmpl/</code> directory.</p> <p>Typically the url to a specific view & task in a component would look like these:</p> <pre><code>?option=com_mycomponent ?option=com_mycomponent&view=userdetails ?option=com_mycomponent&view=userdetails&task=main </code></pre> <p>Joomla!'s framework will automatically use the <code>view</code> & <code>task</code> params to get your components correct controller and view (or sub-view). I'm not sure that it does anything with the <code>module</code> param that you have in your URL's so I'd guess you're trapping and processing that yourself.</p> |
16,909,638 | 0 | How can I use HttpClient in my .NET Framework 4.5 app/site? <p>Based on the answer here: <a href="http://stackoverflow.com/questions/16470458/how-can-i-retrieve-and-parse-just-the-html-returned-from-an-url">How can I retrieve and parse just the html returned from an URL?</a></p> <p>...I'm trying to begin by adding code based on that found here: <a href="http://msdn.microsoft.com/en-us/library/system.net.http.httpclient.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.net.http.httpclient.aspx</a></p> <p>...namely by adding this to \App_Code\Functions.cshtml:</p> <pre><code>@functions { public static string GetUrlHtml(string dynamicUrl) { HttpClient client = new HttpClient(); string body = await client.GetStringAsync(dynamicUrl); // parse it using HTML Agility Pack? (http://htmlagilitypack.codeplex.com/) } } </code></pre> <p>HttpClient is not recognized, and does not afford a "resolve" context menu item. Intellisense does not offer me a "Http" after entering:</p> <pre><code>@using System.Net. </code></pre> <p>Is HttpClient really unavailable to me? If so, what can I have as a consolation prize? Is my best option to use WebClient like so:</p> <pre><code>WebClient wc = new WebClient(); string body = wc.DownloadString(dynamicUrl); // parse it with html agility pack </code></pre> <p>...or, as shown at <a href="http://www.4guysfromrolla.com/articles/011211-1.aspx#postadlink" rel="nofollow">http://www.4guysfromrolla.com/articles/011211-1.aspx#postadlink</a>, I can use the webGet class from the HTML Agility Pack:</p> <pre><code>var webGet = new HtmlWeb(); var document = webGet.Load(dynamicUrl); </code></pre> <p>Does anybody have any supportable opinions on which option is the best?</p> |
29,185,829 | 0 | <p>You can get the checkbox control value as</p> <pre><code>SPFieldMultiChoiceValue choices = new SPFieldMultiChoiceValue(item["MultiChoice"].ToString()); </code></pre> <p>And iterate through the values as</p> <pre><code>for (int i = 0; i < choices.Count; i++) { Console.WriteLine(choices[i]); } </code></pre> |
4,265,472 | 0 | <p>My solution is fastest and easiest.</p> <pre><code>public class MyBase64 { private final static char[] ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); private static int[] toInt = new int[128]; static { for(int i=0; i< ALPHABET.length; i++){ toInt[ALPHABET[i]]= i; } } /** * Translates the specified byte array into Base64 string. * * @param buf the byte array (not null) * @return the translated Base64 string (not null) */ public static String encode(byte[] buf){ int size = buf.length; char[] ar = new char[((size + 2) / 3) * 4]; int a = 0; int i=0; while(i < size){ byte b0 = buf[i++]; byte b1 = (i < size) ? buf[i++] : 0; byte b2 = (i < size) ? buf[i++] : 0; int mask = 0x3F; ar[a++] = ALPHABET[(b0 >> 2) & mask]; ar[a++] = ALPHABET[((b0 << 4) | ((b1 & 0xFF) >> 4)) & mask]; ar[a++] = ALPHABET[((b1 << 2) | ((b2 & 0xFF) >> 6)) & mask]; ar[a++] = ALPHABET[b2 & mask]; } switch(size % 3){ case 1: ar[--a] = '='; case 2: ar[--a] = '='; } return new String(ar); } /** * Translates the specified Base64 string into a byte array. * * @param s the Base64 string (not null) * @return the byte array (not null) */ public static byte[] decode(String s){ int delta = s.endsWith( "==" ) ? 2 : s.endsWith( "=" ) ? 1 : 0; byte[] buffer = new byte[s.length()*3/4 - delta]; int mask = 0xFF; int index = 0; for(int i=0; i< s.length(); i+=4){ int c0 = toInt[s.charAt( i )]; int c1 = toInt[s.charAt( i + 1)]; buffer[index++]= (byte)(((c0 << 2) | (c1 >> 4)) & mask); if(index >= buffer.length){ return buffer; } int c2 = toInt[s.charAt( i + 2)]; buffer[index++]= (byte)(((c1 << 4) | (c2 >> 2)) & mask); if(index >= buffer.length){ return buffer; } int c3 = toInt[s.charAt( i + 3 )]; buffer[index++]= (byte)(((c2 << 6) | c3) & mask); } return buffer; } } </code></pre> |
17,704,225 | 0 | <p>Apparently, emptying the ReSharper cache:</p> <blockquote> <p>In menu, ReSharper > Options > Environment > General > Clear Caches</p> </blockquote> <p>and disabling and re-enabling ReSharper:</p> <blockquote> <p>In menu, Tools > Options > ReSharper > General > Suspend / Restore</p> </blockquote> <p>did the trick for me. I am not sure if both operations are necessary, but they solved my problem.</p> |
13,597,664 | 0 | <p>I solved it with <a href="http://msdn.microsoft.com/en-us/library/bb126445.aspx" rel="nofollow">T4</a>. Now I have <code>Queries</code> directory in my project and <code>SQLGenerator.tt</code> in it. Here is my template source code:</p> <pre><code><#@ template debug="true" hostSpecific="true" #> <#@ output extension=".cs" #> <#@ Assembly Name="System.Core" #> <#@ Assembly Name="System.Windows.Forms" #> <#@ import namespace="System" #> <#@ import namespace="System.IO" #> <#@ import namespace="System.Diagnostics" #> <#@ import namespace="System.Linq" #> <#@ import namespace="System.Collections" #> <#@ import namespace="System.Collections.Generic" #> <#var sqlScriptsContent = ReadSql(); #> namespace MathApplication.SQL { public class Queries { <# foreach(var file in sqlScriptsContent) { #> public string <#= file.Key #> = @"<#= file.Value #>"; <# } #> } } <#+ public Dictionary<string, string> ReadSql() { var filePaths = Directory.GetFiles(Host.ResolvePath(".")); var result = new Dictionary<string, string>(); foreach (var filename in filePaths) { if (filename.EndsWith(".sql")) { result[Path.GetFileNameWithoutExtension(filename)] = System.Text.RegularExpressions.Regex.Replace(File.ReadAllText(filename), @"\s+", " ").Replace("\"", "'"); } } return result; } #> </code></pre> <p>This code assembles all <code>*.sql</code> files in <code>Queries</code> directory to one class.</p> |
6,917,688 | 0 | <p>The on_register is a basic module function of ?MODULE. If the gen_server is a singleton server, you can send the name to it using gen_server:call(?MODULE, {name, Name}) or gen_server:cast(?MODULE, {name, Name}).</p> <p>So the result would look like:</p> <pre><code>on_register(SID, JID, INFO) -> {_, _, _, _, Name, _, _} = JID, gen_server:call(?MODULE, {name, Name}), ok. </code></pre> |
29,080,900 | 0 | dispatch_after is persisting view controller in memory <p>I have this code, which runs a block of code after a delay.</p> <pre><code>public func delay(delay:Double, closure:()->()) { dispatch_after( dispatch_time( DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC)) ), dispatch_get_main_queue(), closure) } </code></pre> <p>The problem is that the view controller using the delay function persists even after dismissal. With the code removed, it becomes nil, as it should.</p> <p>I need to know how to have a delay function, like this, but which wouldn't persist the object it was called from, and instead would just not call the block, in the event that it's otherwise no longer existent.</p> <p>This is in Swift, but replies in Objective-C are entirely appreciated.</p> |
37,186,302 | 0 | Putting CreateElementNS in a function (SVG Groups, shapes etc) <p>I am trying to turn this code right here:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var group = function(n){ n = document.createElementNS(svg, "g" ); }</code></pre> </div> </div> </p> <p>Am I doing it right? I have also tried with 'Return n = doc...' but that doesn't seem to work either.</p> <p>At the moment I just have allot of lines like this; </p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>e.g1 = document.createElementNS(svg, "g" ); t2 = "translate("+e.x+" "+e.y+"), rotate("+e.z+" "+0+" "+0+")"; e.g1.setAttributeNS(null, "transform", t2); e.g1.setAttributeNS(null,"fill", "url(#gradient)"); e.g1.setAttributeNS(null,"stroke", "none"); e.g1.setAttributeNS(null,"stroke-width", e.a*0.03); document.getElementById("mySVG").appendChild(e.g1);</code></pre> </div> </div> </p> <p>Would prefer it to look more like this..</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code> group(e.g1); t2 = "translate("+e.x+" "+e.y+"), rotate("+e.z+" "+0+" "+0+")"; transform(e.g1, t2); fill(e.g1, url(#gradient)); stroke(e.g1, #000); strokewidth(e.g1, (e.a*0.03)); append(e.g1);</code></pre> </div> </div> </p> <p>Thanks, shorter code is what I need!</p> |
26,833,850 | 0 | <p>As you can see in <a href="https://github.com/playframework/playframework/blob/2.3.x/framework/src/sbt-plugin/src/sbt-test/play-sbt-plugin/secret/project/Build.scala" rel="nofollow">this test</a> of the Play framework itself, you need to use <code>play.PlayScala</code>.</p> <pre><code>Project(id = dir, base = file(dir)).enablePlugins(play.PlayScala) </code></pre> |
37,426,620 | 0 | Error: Not implemented Trying to create a stream with ExcelJS <p>Using Node v 5.4.1</p> <p>I'm trying to create a stream like so:</p> <pre><code>const program = require('commander'), Excel = require('exceljs'), colors = require('colors/safe'), inquirer = require('inquirer'), async = require('async'), stream = require('stream'); program .version('0.0.1') .usage('[options] <file>') .parse(process.argv); if (program.args.length > 0 && program.args[0]) { var workbook = new Excel.Workbook(); var rs = new stream.Readable(); rs.pipe(workbook.xlsx.createInputStream()); < -- Error } else { console.log("You did not enter a valid file path"); } </code></pre> <p>But I get the error <code>Error: Not Implemented</code> </p> <p>which I believe is because I have not implemented the <code>._read</code> but I thought maybe <code>workbook.xlsx.createInputStream()</code> would do this.</p> <p>Am I using the stream package wrong? Any information would be great thanks</p> |
31,310,149 | 0 | Activemq not start in linux mint17 <p>Please see the following console output after executing activemq console command: </p> <p>/opt/apache-activemq-5.5.1/bin $ sudo activemq console sudo: /var/lib/sudo/vivek writable by non-owner (040777), should be mode 0700 [sudo] password for vivek: INFO: Loading '/usr/share/activemq/activemq-options' INFO: Using java '/usr/bin/java' INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C) INFO: changing to user 'activemq' to invoke java mkdir: missing operand Try 'mkdir --help' for more information. Java Runtime: Oracle Corporation 1.8.0_45 /usr/lib/jvm/java-8-oracle/jre Heap sizes: current=502784k free=492256k max=502784k JVM args: -Xms512M -Xmx512M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Dcom.sun.management.jmxremote -Djava.io.tmpdir=/var/lib/activemq/tmp -Dactivemq.classpath=/var/lib/activemq/conf; -Dactivemq.home=/usr/share/activemq -Dactivemq.base=/var/lib/activemq/ -Dactivemq.conf=/var/lib/activemq/conf -Dactivemq.data=/var/lib/activemq/data ACTIVEMQ_HOME: /usr/share/activemq ACTIVEMQ_BASE: /var/lib/activemq ACTIVEMQ_CONF: /var/lib/activemq/conf ACTIVEMQ_DATA: /var/lib/activemq/data Loading message broker from: xbean:activemq.xml log4j:WARN No appenders could be found for logger (org.apache.activemq.xbean.XBeanBrokerFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See <a href="http://logging.apache.org/log4j/1.2/faq.html#noconfig" rel="nofollow">http://logging.apache.org/log4j/1.2/faq.html#noconfig</a> for more info. ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [activemq.xml]; nested exception is java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [activemq.xml]; nested exception is java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98) at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148) at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.activemq.console.Main.runTaskClass(Main.java:257) at org.apache.activemq.console.Main.main(Main.java:111) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [activemq.xml]; nested exception is java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52) at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBrokerFactory.java:108) at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:108) at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:72) at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115) at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74) ... 10 more Caused by: java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328) ... 25 more ERROR: java.lang.Exception: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [activemq.xml]; nested exception is java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist java.lang.Exception: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [activemq.xml]; nested exception is java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:99) at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:148) at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.activemq.console.Main.runTaskClass(Main.java:257) at org.apache.activemq.console.Main.main(Main.java:111) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [activemq.xml]; nested exception is java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:64) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.(ResourceXmlApplicationContext.java:52) at org.apache.activemq.xbean.XBeanBrokerFactory$1.(XBeanBrokerFactory.java:108) at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:108) at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:72) at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:115) at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74) ... 10 more Caused by: java.io.FileNotFoundException: class path resource [activemq.xml] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328) ... 25 more</p> |
33,047,711 | 0 | <p>Yes, Browser-Sync has <a href="http://www.browsersync.io/docs/api/#api-init" rel="nofollow">snippet-mode</a> for the case in which a proxy won't work. The general usage is to just cut and paste a snippet into the body of your pages and you'll get the injecting/reloading support. However this is a lot of perpetual manual work.</p> <p>I came up with a convention to eliminate the manual work.</p> <p><strong>First</strong> add to your <code>Web.config</code>:</p> <pre><code> <configuration> <appSettings> <add key="IncludeBrowserSync" value="true" /> <!--...--> </appSettings> <!--...--> </configuration> </code></pre> <p><strong>Then</strong> add to your Web.Release.config:</p> <pre><code><appSettings> <add key="IncludeBrowserSync" value="false" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" /> </appSettings> </code></pre> <p><em>This allows us to not worry about accidentally deploying the snippet.</em></p> <p><strong>Create</strong> in the <code>Shared</code> Views folder a <code>BrowserSync.cshtml</code>:</p> <pre><code>@using System.Configuration @if (ConfigurationManager.AppSettings["IncludeBrowserSync"]?.ToLower().Contains("t") ?? false) { <!-- BrowserSync:SNIPPET--> <script type='text/javascript' id="__bs_script__"> //<![CDATA[ document.write("<script async src='http://HOST:PORT/browser-sync/browser-sync-client.js'><\/script>".replace("HOST", location.hostname).replace("PORT", parseInt(location.port) + 1)); //]]> </script> <!-- BS:BrowserSyncs:END--> } </code></pre> <p><em>As you can see for the snippet, its going to be a little different from what browser sync tells you to cut and paste. The main difference is that it's not going to include the version number (so <code>npm</code> can update browser-sync without breaking your snippet) and it's using a convention for the port number to be one above what IISExpress is serving.</em></p> <p><strong>Now</strong> add <code>@Html.Partial("BrowserSync")</code> right above the <code></body</code> in any <code>_layout.html</code> you have.</p> <p><strong>Finally</strong> to make this all work in your <code>gulpfile.js</code> with a <code>serve</code> task for browse-sync.</p> <pre><code>var gulp = require('gulp'); var browserSync = require('browser-sync').create(); ... var dllName = "<YourProjectName>.dll"; var iisPort = <YourPortNumber>; gulp.task('serve', ['default'], function () { browserSync.init({ port: iisPort + 1; }); gulp.watch("<your wildchar to find your editable css files>", ['compile-minimize-css']); /*...*/ gulp.watch("Views/**/*.cshtml").on('change', browserSync.reload); gulp.watch("bin/"+dllName).on('change', browserSync.reload); }); </code></pre> <p><em>Enjoy automatic refreshes after you start <code>serve</code> in the task runner!</em></p> |
33,861,636 | 0 | <p>Try using <code>li:before</code> with a content of <code>></code> to make these bullet points, like so:</p> <pre><code>li:before { align-items: center; background-color: #fcbe35; border-radius: 50%; color: white; content: '>'; display: inline-flex; font-weight: bold; height: 24px; justify-content: center; margin-right: 10px; width: 24px; } </code></pre> <p>Here's a <a href="https://jsfiddle.net/9mj638qy/" rel="nofollow">JsFiddle</a>.</p> |
1,610,790 | 0 | External HTML page, inside AJAX Iframe? <p>Hi Masters Of Web Development. I have a not that simple question this time. I have got a simple external HTML page, that I want to include in my site. The HTML page contains a submit form or something like that, and I wish to send this data from the form, without to reload the whole page. So I decided to put HTML page inside iframe. But, some people said that this is older technology, google doesn't like iframes, etc. So I want to use something like AJAX or JQuery to load that external HTML page, and to send submit form without reloading the whole page with it. :)</p> <p>Any suggestions on how to make this? Thanks in advance :)</p> |
2,104,678 | 0 | <p>You can apply to have your IP address and account whitelisted which will increase your rate limit to 20,000/hour if you are approved. (<a href="http://apiwiki.twitter.com/Rate-limiting" rel="nofollow noreferrer">http://apiwiki.twitter.com/Rate-limiting</a>)</p> |
39,105,586 | 0 | <p>If it will always be a div, and you know the element's ID:</p> <pre><code>$("#myElement div[data-custom-property]:first") </code></pre> <p>Otherwise, this will work, too, though it's best to be as specific as possible:</p> <pre><code>$("[data-custom-property]:first") </code></pre> |
9,607,180 | 0 | PHP Conditional -- Only Display if a String Has Any Value? <p>I need to display the results of either one or two strings. Each string contains a comma-separated list of items. I need to concatenate them into a single list.</p> <p>I know how to do the concatenation.</p> <p>The issue I have is that sometimes the second string contains entries, sometimes it does not.</p> <p>If the second string contains data, I want to display the concatenated result (first string and second string). If the second string is empty, I only want to display the first string.</p> <p>Can someone help me figure out how to accomplish this?</p> |
21,426,905 | 0 | <p>Do this:</p> <pre><code>params[:list].each do |hash| hash['id'] # => 3 hash['status'] # => true end </code></pre> |
9,684,565 | 0 | <p>Your best bet appears to be 'CEESITST', as it appears to exist in z/OS COBOL. I found an example using that as well as the other bit manipulation programs.</p> <p><a href="http://esj.com/articles/2000/09/01/callable-service-manipulating-binary-data-at-the-bit-level.aspx" rel="nofollow">http://esj.com/articles/2000/09/01/callable-service-manipulating-binary-data-at-the-bit-level.aspx</a></p> |
11,330,347 | 1 | Python XML comparison <p>I have 2 files each with a list of items which all have 3 properties. What is the quickest way to compare these files and list the differences, i.e. the items that are not in both files.</p> <p>For the items to be the same, all 3 properties have to agree. Also the files were in XML.</p> |
14,885,885 | 0 | <p>Actually it was straight-forward selenium code:</p> <pre><code>click link="Change..." pause 200 click //ul[contains(@id,'fruit-switcher')]//ul[contains(@class,'dropdown-menu')]/li[3]/a click link="Change..." pause 600 click //ul[contains(@id,'fruit-switcher')]//a[contains(text(),'Bananas')] </code></pre> |
24,646,200 | 0 | <p><code>order by</code> should after <code>where</code> clause</p> <pre><code>"SELECT Products.ProductID, Products.Name, Categories.CatName, " + "Products.Description, Products.Price FROM Products INNER JOIN Categories ON " + "Products.CatID = Categories.CatID " + "WHERE " + column + " LIKE '%" + keyword + "%'"; "ORDER BY Products.Price DESC" </code></pre> <p>And as other comment said, you should consider use <code>SQLParameters</code> to avoid <strong>SQL Injection</strong></p> |
37,818,832 | 0 | <p>This may be a pretty simple answer but it really depends on how you structure your data.</p> <p>If there are exactly 100 users at all times and you want everyone from position 65 to position 1, thats easy.</p> <p>Likewise if you want what position user XYZ is, that's also easy.</p> <p>There's also ways to load the top 2 users by position (or 35)</p> <pre><code>users: user_id_0 position: 15 user_id_1 position: 32 user_id_2 position: 7 </code></pre> <p>then to a query on the /users/position sort by position and then queryLimitedToFirst(2) will return user_id_2 and user_id_0.</p> <p>Edit:</p> <p>Based on more data, here are a couple more options. Given we have 5 users, each with a score (I noted their 'position' in the list)</p> <pre><code>uid_0: 50 //pos 2 uid_1: 25 //pos 1 uid_2: 73 //pos 4 uid_3: 10 //pos 0 uid_4: 58 //pos 3 </code></pre> <p>If you want to know the position, based on score of uid_2 - I don't know your platform so I will give a generic flow:</p> <p>step 1) query uid_2 to get his score, 73, then</p> <p>step 2) queryOrderedByChild(score).startingAtValue(73), get nodes with scores from 73 to whatever the highest score is</p> <p>step 3) then the result will be in a snapshot, so check snapshot.childrenCount, which will be the position if uid_2, which is 4. This will reduce the number of nodes loaded.</p> <p>The downside is that the farther down the list, the more data would be loaded. If you only have 1000 nodes with just scores in them, that's not a lot of data.</p> <p>The following solution avoids lots of data but requires more work by the app.</p> <p>Of course, if your platform support array's this is a super simple task. Using the same structure above, load the children into and array and get the index number of the uid you want to know the position of.</p> <p>Swift code</p> <pre><code>let ref = self.myRootRef.childByAppendingPath("scores") ref.queryOrderedByValue().observeEventType(.Value, withBlock: { snapshot in var myArray = [String]() for child in snapshot.children { let key = child.key as String myArray.append(key) } let pos = myArray.indexOf("uid_0") print("postion = \(pos!)") }) </code></pre> |
31,551,380 | 0 | <p>You can change the <em>room speed</em> in the room settings, this is the number of steps per second. This property can also be accessed and changed mid-game with the <code>room_speed</code> global.</p> <p>You can also access the actual screen update speed with the <code>fps</code> read-only global. <strong>Note:</strong> screen fps is totally independent from the <em>draw event</em>, which happens at the end of each step.</p> |
35,244,370 | 0 | <p>If <code>bitarray</code> can't be installed, the 1d solution in <a href="http://stackoverflow.com/questions/35208160/dot-product-in-python-without-numpy">Dot Product in Python without NumPy</a> can be used with the same nested comprehension (<a href="http://stackoverflow.com/a/35241087/901925">http://stackoverflow.com/a/35241087/901925</a>). This does not take advantage of the 0/1 nature of the data. So basically it's an exercise in nested iterations.</p> <pre><code>def dot1d(a,b): return sum(x*y for x,y in zip(a,b)) def dot_2cmp(a): return [[dot1d(r,c) for c in a] for r in a] </code></pre> <p><code>itertools.product</code> can be used to iterate over the row and column combinations, but the result is a 1d list, which then needs to be grouped (but this step is fast):</p> <pre><code>def dot2d(a): aa=[dot1d(x,y) for x,y in itertools.product(a,a)] return [aa[i::len(a)] for i in range(len(a))] </code></pre> <p>testing:</p> <pre><code>a=[[1,0,1,0],[0,1,0,1],[0,0,1,1],[1,1,0,0]] In [246]: dot2d(a) Out[246]: [[2, 0, 1, 1], [0, 2, 1, 1], [1, 1, 2, 0], [1, 1, 0, 2]] In [247]: dot_2cmp(a) Out[247]: [[2, 0, 1, 1], [0, 2, 1, 1], [1, 1, 2, 0], [1, 1, 0, 2]] In [248]: np.dot(np.array(a),np.array(a).T).tolist() Out[248]: [[2, 0, 1, 1], [0, 2, 1, 1], [1, 1, 2, 0], [1, 1, 0, 2]] </code></pre> <p>In timings on a larger list, the 2 list operations take the same time. The array version, even with the in/out array conversion is considerably faster.</p> <pre><code>In [254]: b=np.random.randint(0,2,(100,100)).tolist() In [255]: timeit np.dot(np.array(b),np.array(b).T).tolist() 100 loops, best of 3: 5.46 ms per loop In [256]: timeit dot2d(b) 10 loops, best of 3: 177 ms per loop In [257]: timeit dot_2cmp(b) 10 loops, best of 3: 177 ms per loop </code></pre> <p>The result is symmetric, so it might be worth the effort to skip the duplicate calculations. Mapping them back on to the nested list will be more work than in <code>numpy</code>.</p> <pre><code>In [265]: timeit [[dot1d(r,c) for c in b[i:]] for i,r in enumerate(b)] 10 loops, best of 3: 90.1 ms per loop </code></pre> <p>For what it's worth I don't consider any of these solutions 'more Pythonic' than the others. As long as it is written in clear, running, Python it is Pythonic. </p> |
3,966,342 | 0 | <p>No, I don't believe there is. In a standard Subversion workflow, it's quite rare to need to type the full URL -- most operations are on an already-checked-out working copy -- and in any case, if you're working with branches and tags, the URL would change between invocations.</p> <p>That's not to say that the idea isn't any use, just that it's not useful enough for the developers to have added it.</p> <p>If, like me, you have difficulty remembering what the URL was for a working copy you want to work with, <code>svn info</code> will give it to you.</p> |
35,004,146 | 0 | Referencing a variable in the main function - Java <p>I have written a simple summation function where I add up values of an array. I need to reference the values of the array (which is within the main class) in my function. My code looks like this:</p> <pre><code>public class myClass { public static void main(String[] args) throws Exception { int[] myArray = {0,1,2,3,4}; //Some random operations } public static int sum(int low,int up) { int sum; for (int k=low; k<=up; k++) { sum +=myArray[k]; } return sum; } } </code></pre> <p>However I get the error "myArray cannot be resolved to a type". Why is this error occurring? How may I fix it? Thanks in advance.</p> |
4,027,476 | 0 | Do disabled Drupal modules affect performance? <p>Does having Drupal modules installed but not enabled have any effect on the performance of a Drupal site?</p> <p>To put it another way.. Would removing disabled modules from a Drupal site have a positive affect on performance?</p> |
3,486,957 | 0 | <p>Can I just add a lesson I learned about 27 years ago: don't try to make your version control numbers align with your product release numbers. That way madness lies.</p> |
17,110,830 | 0 | <p>Not sure it should work actually: Just do some minute checks:</p> <p>1.exclude should be part of class Meta</p> <p>2.make that exclude from tuple to list , (not sure if it helps)</p> <p>3.or instead of exclude try giving fields = (#some fields names, )</p> <p>Hope this works .. </p> |
7,005,135 | 0 | <p>Try to put it with explode into an array and count the values with array_count_values. </p> <pre><code><?php $text = "whatever"; $text_array = explode( ' ', $text); $double_words = array(); for($c = 1; $c < count($text_array); $c++) { $double_words[] = $text_array[$c -1] . ' ' . $text_array[$c]; } $result = array_count_values($double_words); ?> </code></pre> <p>I updated it now to two word version. Does this work for you?</p> <pre><code>array(9) { ["I am"]=> int(1) ["am purchasing"]=> int(1) ["purchasing a"]=> int(2) ["a wallet"]=> int(2) ["wallet a"]=> int(1) ["wallet for"]=> int(1) ["for 20$"]=> int(1) ["20$ purchasing"]=> int(1) ["a bag"]=> int(1) } </code></pre> |
2,708,608 | 0 | <p>You might be able to use <a href="http://msdn.microsoft.com/en-us/library/ms749011.aspx" rel="nofollow noreferrer">Attached Dependency Properties</a> of type AugmentedThickness and then, when they change, update the underlying properties they are intended to update. This requires all access to be performed using your Attached Properties, as simply setting the Thickness property will not use your AugmentedThickness. If necessary, you could also (though it might be a bit evil) listen for explicit changes to Thickness properties (that you didn't initiate) and force it back to the value specified by your AugmentedThickness.</p> |
1,048,888 | 0 | How to update a BindingSource based on a modified DataContext <p>In my application, I extract the Data of a Linq To SQL DataContext into a dictionary for easy use like so:</p> <pre><code>Jobs = dbc.Jobs.ToDictionary(j => j.Id, j => j); </code></pre> <p>Then I bind this dictionary to a BindingSource:</p> <pre><code>bsJob.DataSource = jobManager.Jobs.Values.ToList(); </code></pre> <p>I refresh the DataContext and the Dictionary regularly for when new Jobs are added to the database (whether directly through the local application or the application running on a different machine):</p> <pre><code>dbc.Refresh(RefreshMode.OverwriteCurrentValues, dbc.Job); Jobs = dbc.Job.ToDictionary(j => j.Id, j => j); </code></pre> <p>How can I update the BindingSource to accommodate the changes as well?</p> |
31,528,441 | 0 | How to to filter by media subtype using NSPredicate with PHFetchOptions <p>How do I filter by media subtype using <code>NSPredicate</code> with <code>PHFetchOptions</code>? I'm trying to exclude slow mo (high frame rate) and time lapse videos. I keep getting strange results when I try to use the <code>predicate</code> field of <code>PHFetchOptions</code>. </p> <p>My phone has a bunch (120+) regular videos, and one slow mo video. When I run the example from <a href="https://developer.apple.com/library/prerelease/ios/documentation/Photos/Reference/PHFetchOptions_Class/index.html#//apple_ref/occ/instp/PHFetchOptions/predicate">Apple's docs</a>, I get the correct result back: 1 slow mo video. </p> <pre><code>PHFetchOptions *options = [PHFetchOptions new]; options.predicate = [NSPredicate predicateWithFormat:@"(mediaSubtype & %d) != 0 || (mediaSubtype & %d) != 0", PHAssetMediaSubtypeVideoTimelapse, PHAssetMediaSubtypeVideoHighFrameRate]; </code></pre> <p>But I'm trying to <em>exclude</em> slow mo, rather than select it. However if I negate the filter condition, I get zero results back: </p> <pre><code>options.predicate = [NSPredicate predicateWithFormat:@"(mediaSubtype & %d) == 0", PHAssetMediaSubtypeVideoHighFrameRate]; <PHFetchResult: 0x1702a6660> count=0 </code></pre> <p>Confusingly, the Apple docs list the name of the field as <a href="https://developer.apple.com/library/prerelease/ios/documentation/Photos/Reference/PHAsset_Class/index.html#//apple_ref/occ/instp/PHAsset/mediaSubtypes"><code>mediaSubtypes</code></a> (with an "s"), while their sample predicate is filtering on <code>mediaSubtype</code> (without an "s"). </p> <p>Trying to filter on <code>mediaSubtypes</code> produces an error:</p> <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't do bit operators on non-numbers' </code></pre> <p>Has anyone been able to make heads or tails of this predicate? </p> |
24,566,261 | 0 | jstree: how to get the id of undetermined state of node <p>I use the jstree('get_selected',false) to get the selected node of my jstree with checkbox plugins, but the result doesn't include the node with undetermined state . How can I get all of the selected node include undetermined ones.</p> <p>the newest version of jstree does not include the method 'get_checked', why?</p> <p>thanks.</p> |
34,670,951 | 0 | php bootstrap error with modal <p>I have the below scripts running but once I add a remote file link for the modal, it will not update. </p> <ol> <li>I want to edit from a modal</li> <li>within that modal window, confirm the data was submitted successfully</li> <li>on close, refresh the crud. </li> </ol> <p>Any help will be appreciated.</p> <p>I'm modifying the class.crud.php file to include this line</p> <p>removing</p> <pre><code><a href="edit-data.php?edit_id=<?php print($row['id']); ?>"><i class="glyphicon glyphicon-edit"></i></a> </code></pre> <p>replacing with</p> <pre><code><a data-toggle="modal" class="btn btn-info" href="edit-data.php?edit_id=<?php print($row['id']); ?>" data-target="#myModal"><i class="glyphicon glyphicon-edit"></i></a> </code></pre> <p>INDEX.PHP</p> <pre><code><?php include_once 'dbconfig.php'; ?> <?php include_once 'header.php'; ?> <div class="clearfix"></div> <div class="container"> <table class='table table-bordered table-responsive'> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>E - mail ID</th> <th>Contact No</th> <th colspan="2" align="center">Actions</th> </tr> <?php $query = "SELECT * FROM tblUsers"; $records_per_page=10; $newquery = $crud->paging($query,$records_per_page); $crud->dataview($newquery); ?> <tr> <td colspan="7" align="center"> <div class="pagination-wrap"> <?php $crud->paginglink($query,$records_per_page); ?> </div> </td> </tr> </table> </div> <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </div> <!-- /.modal --> <?php include_once 'footer.php'; ?> </code></pre> <p>CLASS.CRUD.PHP</p> <pre><code> public function update($id,$fname,$lname,$email,$level_id) { try { $stmt=$this->db->prepare("UPDATE tblUsers SET firstname=:fname, lastname=:lname, email=:email, level_id=:contact WHERE id=:id "); $stmt->bindparam(":fname",$fname); $stmt->bindparam(":lname",$lname); $stmt->bindparam(":email",$email); $stmt->bindparam(":contact",$level_id); $stmt->bindparam(":id",$id); $stmt->execute(); return true; } catch(PDOException $e) { echo $e->getMessage(); return false; } } public function delete($id) { $stmt = $this->db->prepare("DELETE FROM tblUsers WHERE id=:id"); $stmt->bindparam(":id",$id); $stmt->execute(); return true; } /* paging */ public function dataview($query) { $stmt = $this->db->prepare($query); $stmt->execute(); if($stmt->rowCount()>0) { while($row=$stmt->fetch(PDO::FETCH_ASSOC)) { ?> <tr> <td><?php print($row['id']); ?></td> <td><?php print($row['firstname']); ?></td> <td><?php print($row['lastname']); ?></td> <td><?php print($row['email']); ?></td> <td><?php print($row['level_id']); ?></td> <td align="center"> <a href="edit-data.php?edit_id=<?php print($row['id']); ?>"><i class="glyphicon glyphicon-edit"></i></a> </td> <td align="center"> <a href="delete.php?delete_id=<?php print($row['id']); ?>"><i class="glyphicon glyphicon-remove-circle"></i></a> </td> </tr> <?php } } else { ?> <tr> <td>Nothing here...</td> </tr> <?php } } </code></pre> <p>EDIT-DATA.PHP</p> <pre><code><?php include_once 'dbconfig.php'; if(isset($_POST['btn-update'])) { $id = $_GET['edit_id']; $fname = $_POST['firstname']; $lname = $_POST['lastname']; $email = $_POST['email']; $level_id = $_POST['level_id']; if($crud->update($id,$fname,$lname,$email,$level_id)) { $msg = "<div class='alert alert-info'> <strong>WOW!</strong> Record was updated successfully <a href='index.php'>HOME</a>! </div>"; } else { $msg = "<div class='alert alert-warning'> <strong>SORRY!</strong> ERROR while updating record ! </div>"; } } if(isset($_GET['edit_id'])) { $id = $_GET['edit_id']; extract($crud->getID($id)); } ?> <?php include_once 'header.php'; ?> <div class="clearfix"></div> <div class="container"> <?php if(isset($msg)) { echo $msg; } ?> </div> <div class="clearfix"></div> <br /> <div class="modal-header" id="myModal"> <form method='post'> <div class="form-group"> <label for="email">First Name:</label> <input type='text' name='firstname' class='form-control' value="<?php echo $firstname; ?>" required> </div> <div class="form-group"> <label for="email">Last Name:</label> <input type='text' name='lastname' class='form-control' value="<?php echo $lastname; ?>" required> </div> <div class="form-group"> <label for="email">Email:</label> <input type='text' name='email' class='form-control' value="<?php echo $email; ?>" required> </div> <div class="form-group"> <label for="email">Level ID:</label> <input type='text' name='level_id' class='form-control' value="<?php echo $level_id; ?>" required> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary" name="btn-update">Save changes</button> </div> </form> </div> </code></pre> |
39,664,746 | 0 | Docker: save - produces no output <p>Fairly new to using Docker..</p> <p>I pulled an image for Oracle 11g Full. Created a DB and installed an application into the container.</p> <p>Once configured correctly, I committed the container which resulted in a 15GB image.</p> <p>Tested a new container of that image, everything works fine, Oracle services etc. startup automatically and then I just attach and run the application...all good.</p> <p>I need to upload this onto a server, so my intended approach was:</p> <p>1) Save container<br> 2) Upload tarball to server<br> 3) Load container</p> <p>However, when I run the following command:</p> <p><code>sudo docker save --output ~/etlf_961_meta.tar etlf/informatica9.6.1:latest</code> </p> <p>it just hangs and produces no output.</p> <p>The process is active, but no file appears and there is no activity:</p> <p><code>T20 chris # ps aux | grep "docker save" root 26179 0.0 0.0 91928 5000 pts/14 S+ 16:36 0:00 sudo docker save --output /home/chris/etlf_961_meta.tar etlf/informatica9.6.1:latest root 26201 0.0 0.0 127404 14664 pts/14 Sl+ 16:36 0:00 docker save --output /home/chris/etlf_961_meta.tar etlf/informatica9.6.1:latest root 26277 0.0 0.0 14232 980 pts/0 S+ 16:36 0:00 grep --color=auto docker save</code></p> <p>If I use <code>export</code> and <code>import</code> the process runs fine, a 15GB image is produced and can be imported, however I lose all the ENV and CMD metadata.</p> <p>Can anyone advise: </p> <p>1) How to resolve the <code>save</code> command, to actually export the container<br> or<br> 2) How to restore or attach the ENV/CMD metadata (..the dockerfile?) to a exported/imported image? </p> <p>Much appreciated</p> |
5,420,072 | 0 | <p>Lasso is an interpreted programming language with PHP-like syntax, and a commercial server geared towards database-driven web applications. Its current stable release is 9.2, with 9.3 in development, while the legacy version is also maintained as 8.6. Information about Lasso releases is available at <a href="http://www.lassosoft.com/" rel="nofollow">http://www.lassosoft.com/</a>. </p> <p><strong>Documentation and Community</strong></p> <p>The <a href="http://lassoguide.com/" rel="nofollow">LassoGuide</a> site is the official location for Lasso 9's documentation, while a language reference for all versions is at <a href="http://www.lassosoft.com/LassoDocs/LanguageReferenceCategories" rel="nofollow">LassoDocs</a>, and an active archive of the <a href="http://lassotalk.com/" rel="nofollow">LassoTalk mailing list</a> is also available.</p> |
21,153,543 | 0 | <p>Assuming your puppet master is Puppet Enterprise also, otherwise a PE agent will not work with it.</p> <p>The client needs to know where the puppet master is. Can specify it on the command line with "--server fqdn.of.master" or put it in the agent's puppet.conf file in the main section.</p> <p>I believe you'll find the puppet.conf file on Windows 2008 at c:\ProgramData\PuppetLabs\puppet\etc\puppet.conf</p> <p>On Linux it's at /etc/puppet/puppet.conf</p> |
18,541,225 | 0 | <p>You forgot several <code>]</code> in your jQuery selectors at the end</p> <p>Edit: from 'pedu' and down, just add those final braces and that should be all of them.</p> |
35,120,583 | 0 | <p>You are going to require an array formula¹ or <a href="https://support.office.com/en-us/article/sumproduct-function-4e0bffa7-4291-4635-a61f-6aaa9399e7ff" rel="nofollow">SUMPRODUCT</a>, neither of which handles 'thousands of rows' well due to the logrythmic taxation of cyclic processing. Full column references should be avoided at all costs.</p> <p>In a cell as a standard formula,</p> <pre><code>=SUMPRODUCT(--(Y$2:INDEX(Y:Y, MATCH(1E+99,Y:Y ))<500-2.48*X$2:INDEX(X:X, MATCH(1E+99,Y:Y )))) </code></pre> <p>The <a href="https://support.office.com/en-us/article/match-function-0600e189-9f3c-4e4f-98c1-943a0eb427ca" rel="nofollow">MATCH function</a> uses an approximate match for an impossibly high number. This returns the row number of the last number in column Y. It is used to limit both X and Y columns to the extent of the data. The last number in column Y is used in both cases as SUMPRODUCT requires that the ranges be the same size (although not necessarily the same rows).</p> <p>In a cell as an array formula¹,</p> <pre><code>=SUM(IF(X$2:INDEX(X:X, MATCH(1E+99,Y:Y )), --(Y$2:INDEX(Y:Y, MATCH(1E+99,Y:Y ))<497.52), --(Y$2:INDEX(Y:Y, MATCH(1E+99,Y:Y ))<500))) </code></pre> <hr> <p>¹ <sub>Array formulas need to be finalized with <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Enter↵</kbd>. Once entered into the first cell correctly, they can be filled or copied down or right just like any other formula. Try and reduce your full-column references to ranges more closely representing the extents of your actual data. Array formulas chew up calculation cycles logarithmically so it is good practise to narrow the referenced ranges to a minimum. See <a href="https://support.office.com/en-ca/article/guidelines-and-examples-of-array-formulas-7d94a64e-3ff3-4686-9372-ecfd5caa57c7" rel="nofollow">Guidelines and examples of array formulas</a> for more information.</sub></p> |
22,997,038 | 0 | <p>You have a space on the end of your variable, and you've set IFS so that it's not being removed as part of word splitting. Here's a simplified test case that exibits your problem:</p> <pre><code>IFS=$'\r\n' value=$(echo "hello - world" | cut -d - -f 1) [ $value = hello ] && echo "works" || echo "fails" </code></pre> <p>The simplest solution is to cut your variables before the first space, rather than after the space but before the dash:</p> <pre><code>boolser=($(getsebool -a | grep $serv | cut -d ' ' -f1)) </code></pre> |
40,099,477 | 0 | has no member error with Alamofire 4.0 with Swift 3 <p>I have used Alamofire 4.0 in with Swift 3.0 but getting issue with the following code</p> <blockquote> <p>Type 'Method' (aka 'OpaquePointer') has no member 'GET'</p> <p>Type 'Method' (aka 'OpaquePointer') has no member 'PUT'</p> <p>Type 'Method' (aka 'OpaquePointer') has no member 'POST'</p> <p>Type 'Method' (aka 'OpaquePointer') has no member 'PATCH'</p> <p>Type 'Method' (aka 'OpaquePointer') has no member 'DELETE'</p> </blockquote> <p>Enum definition:</p> <pre><code>enum Method { case get case put case post case patch case delete func toAFMethod() -> Alamofire.Method { switch self { case .get: return Alamofire.Method.GET case .put: return Alamofire.Method.PUT case .post: return Alamofire.Method.POST case .patch: return Alamofire.Method.PATCH case .delete: return Alamofire.Method.DELETE } } } </code></pre> |
23,147,907 | 0 | <pre><code>select * from (select id,subject_id FROM table group by subject_id)tempalias where subject_id=1 select * from (select id,subject_id FROM table group by subject_id)tempalias where subject_id=2 </code></pre> |
16,110,595 | 0 | <p>There times that you will use more memory than the 8 MB php has allotted. If your unable to use less memory by making your code more efficient, you might have to increase your available memory. This can be done in two ways.</p> <p>The limit can be set to a global default in php.ini:</p> <pre><code>memory_limit = 32M </code></pre> <p>Or you can override it in your script like this:</p> <pre><code><?php ini_set('memory_limit', '64M'); ... </code></pre> <p>For more on PHP memory limit you can see <a href="http://stackoverflow.com/questions/620602/php-memory-limit">This SO question</a> or <a href="http://www.php.net/manual/en/ini.core.php#ini.memory-limit" rel="nofollow">ini.memory-limit</a>.</p> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.