w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
protecting javascript code by placing in php code
it doesn't work that way - javascript code MUST be visible to client browser because browser parse and runs it + there is no way to "hide" it under .php file. With php file you can send/generate javascript code to the browser - just as you do with regular html

Categories : Javascript

parallax refreshing the page not taking the page to the landing page
Did you try: document.getElementById("body").scrollTop = 0; If this doesn't work, you may want to replace the "body" element id with the id of the container of your parallax section. If you need parallax-specific scrolling help, my company and I have a list of parallax tutorials at http://potentpages.com/parallax-tutorials/. You will likely want the jQuery section. A tutorial there may be able to help you if the "scrollTop" solution doesn't work.

Categories : Misc

page load with child grids taking too much of time in loading the page
You need to provide all of your code before we can provide an accurate answer. For example: Where SubItemBL is defined? Also try to see what line is the exact bottleneck. Is it bl.FetchForCategory(aDataSet, Category, RowId); or grdSubItems.DataBind(); If above line is the bottleneck, note that Gridview binding to a datasource with large number of data is indeedslow. how large is your data?

Categories : C#

jQuery : Placing object in center of page
in css it would be something like #wrapper{ top: 50%; margin-top: -200px; //half of height height: 400px; } in jq it would work with: (maybe some little logical mistake, because of bit tired) var objHeight = $("#wrapper").height() /2; var winHeight = $(window).height() /2; $('#wrapper').css("top", (winHeight - objHeight) + 'px');

Categories : Jquery

placing multiple HTML5 canvas elements on a page
How to turn your mock-up into a working pad You already have the functions for drawing the body, screen and a button. So the task becomes: Make the button drawing code reusable so all 12 buttons can be drawn easily. Listen for user mouseclicks and report which button was pressed. Here's how to accomplish those tasks. Draw Multiple Buttons using the same button drawing function First you need to calculate some basic information about the button drawing: // calculate button properties var buttonOffsetX=44.9; var buttonOffsetY=210.6; var buttonWidth=139.4-44.9; var buttonHeight=305.1-210.3; var buttonPadding=15; Make the button drawing reusable by putting it in a function. function drawOneButton(left,top) { …draw one button at left/to

Categories : HTML

problems placing submit button in a responsive web page
I assume your markup would look something like this <div class="row-fluid"> <div class="span3" id="L1Locations"> <h4>Branch:</h4> <select name='L1Locations'> <option selected value=''></option> </select> </div> <div class="span3" id="L2Locations"> <h4>Branch:</h4> <select name='L2Locations'> <option selected value=''></option> </select> </div> <div class="span3" id="L2Locations"> <h4>Branch:</h4> <select name='L2Locations'> <option selected value=''></option> </select> </div> <button class="btn search">

Categories : CSS

Taking the average of bottom n percent in Excel
I'm not entirely sure what you're looking for when you say 'where all I have to do is give it what percent I want and it gives me the answer', but you could perhaps try AVERAGEIF: =AVERAGEIF(A1:A10,"<="&COUNTA(A1:A10)*0.3) Assuming that the data is in the range A1:A10. You can have a reference for the 0.3 for the percentage. =AVERAGEIF(A1:A10,"<="&COUNTA(A1:A10)*B1) If you put the percentage in B1, then the formula will change accordingly.

Categories : Excel

PHP script generating an Excel file taking too much memory
I had also worked on a project to export data from MySQL to excel. In my generated XL sheet I have around 30 tabs and their are some complex formulas for different cell. I am using PHPExcel for that. But in my case I was generating the excel as a cron job because it was taking much time. Here if you have some complex excel template then you can also save a designed template on server and then by the help of reader and writer class of PHPExcel you can read that template and write you data on it and save it in a new file. I think this information will help you. Please let me know if you want any further clarification.

Categories : PHP

blank page opening after uploading codeigniter code to server
I'm not familiar with codeignighter. But I think if your class name is My_Controller and it's filename is MY_Controller.php autoloader probably won't find the file on a case sensitive file system.

Categories : PHP

IBM Worklight - Placing tab bar below the header in integrating server generated pages application
I believe the tabbar mimics the android tabbar functionality, sadly that means for android the tabbar will appear at the top, on ios it will on the bottom. Though the document does say that it is an HTML element for android, so if you can find the css that controls this you might be able to override it. http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/index.jsp?topic=%2Fcom.ibm.worklight.help.doc%2Fapiref%2Fr_wl_tabbar_additem.html

Categories : Android

What is taking up space in web page?
It's the white space in between the tags. Check out this article for things you can do to combat it. My suggestion is to simply put the HTML all on one line. It's harder to read, but renders what you want. The best way, though, is to have a build step that will minify your HTML and get rid of all of it automatically.

Categories : HTML

Using Spring MVC, accepting POST requests with bad JSON leads to a default 400 error code server page being returned
This was raised as an issue with Spring SPR-7439 - JSON (jackson) @RequestBody marshalling throws awkward exception - which was fixed in Spring 3.1M2 by having Spring throw a org.springframework.http.converter.HttpMessageNotReadableException in the case of a missing or invalid message body. In your code you cannot create a ResponseStatus since it is abstract but I tested catching this exception with a simpler method locally with Spring 3.2.0.RELEASE running on Jetty 9.0.3.v20130506. @ExceptionHandler({org.springframework.http.converter.HttpMessageNotReadableException.class}) @ResponseStatus(HttpStatus.BAD_REQUEST) @ResponseBody public String resolveException() { return "error"; } and I received a 400 status "error" String response. The defect was discussed on this Spring forum pos

Categories : Java

SSRS must Excel be installed on Reporting server to use Excel as a Data SOURCE?
No, you don't have to install Excel. The MS Business Intelligence Development Studio (ie. Visual Studio) is 32-bit and you need 32-bit ODBC drivers for report development. I'll assume your Report Server is 64-bit, so you'll need 64-bit drivers for that. You can download both of the drivers here: Microsoft Access Database Engine 2010 Redistributable Took me a long time to figure out how to cope with 32-bit editor and 64-bit server, but here's the deal: Install the 64-bit drivers first Go to Administrative Tools -> Data Sources (ODBC) Add a new data source (you can mention in the description that this is the 64-bit data source) Install the 32-bit drivers second Run C:WindowsSysWoW64Odbcad32.exe as administrator Add a new data source (you can mention in the description that this is the 32

Categories : Excel

PHP page not loading; Wordpress taking over with 404
I figured out the problem. It was in the .htaccess file. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] RewriteRule ^/([^-]*)$ /$1.php Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / ## hide .php extension # To externally redirect /dir/foo.php to /dir/foo RewriteCond %{THE_REQUEST} ^[A-Z]{3,}s([^.]+).php [NC] RewriteRule ^ %1 [R,L,NC] ## To internally forward /dir/foo to /dir/foo.php RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^ %{REQUEST_FILENAME}.php [L] </IfModule> # END WordPress The top rules from Wordpress were mucking everything up. By removing or com

Categories : PHP

Want to import a map of US to excel VBA program and color-code it using excel data
older versions of excel actually made this very easy (below version 2002) for newer versions i would just recommend using google charting apis instead, its much easier https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Example if you do have a copy of an old excel just insert and then map and you excel will recognise the states etc. Im not sure why this feature was taken out

Categories : Excel

Excel-VBA code that moves Excel sheets to Microsoft access?
The code that you have found transfers data to an already existing database named FDData.mdb that is probably already set up to look exactly like your excel worksheet. Can I ask why you don't just use Access? It is easier to use VBA to create excel sheets from Access than it is to do the opposite. There is also the import database from excel worksheet feature in Access, are you trying to automate this process for a vast number of excel worksheets? Otherwise you are better off just using the wizard. We might be able to help more if you can tell us exactly what you are trying to do, linking up Excel and Access via VBA might be more counterproductive than just picking one and dealing with the downsides unless you are prepared to write a whole lot of code.

Categories : Excel

Is there a way to run excel code in sql or run small datasets in excel and export to SQL automatically?
If you're familiar with Excel and its formulas, it won't be too arduous for you to pick up on SQL. In addition to that, I can copy and paste outputs from SQL Sever into Excel sheets that have a graph auto-built (since I use Express) and it's a simple copy-and-paste into an Excel sheet. While I don't know all your calculations, I haven't seen Excel be able to do something that SQL couldn't do and when you consider the benefit of indexing among the freedom to organize your data how you want (and have saved stored procedures), a switch might only be temporarily inconvenient while you pick up on SQL, and after that, you'll easily produce what you need. Ultimately, I want to know if I can run the excel code in SQL Not always exactly identical, but you can run similar structured code. F

Categories : SQL

Why this taking screenshot code fails?
As per the documenation The current graphics context is nil by default. Prior to calling its drawRect: method, view objects push a valid context onto the stack, making it current. So you need to put this code in the drawRect method

Categories : IOS

Taking a photo upon QR code scan
The data from preview callback is NV21 format. So if you wanna save it, you could use such code: YuvImage im = new YuvImage(byteArray, ImageFormat.NV21, width, height, null); Rect r = new Rect(0, 0, width, height); ByteArrayOutputStream baos = new ByteArrayOutputStream(); im.compressToJpeg(r, 50, baos); try { FileOutputStream output = new FileOutputStream("/sdcard/test_jpg.jpg"); output.write(baos.toByteArray()); output.flush(); output.close(); } catch (FileNotFoundException e) { } catch (IOException e) { } The save point is when the ZXing could decode the byte[] and return content String successfully.

Categories : Java

action code for taking pictures
Intents are designed to allow your application to interact with others. In this case, your application will bring up the camera app, and the result will be sent back into your app. A great place to get started with understanding this is, is the Android training "Interacting with Other Apps".

Categories : Android

Taking lot of time to read from SQL Server using c#
Something like this might work. I'm not sure on the efficiency yet - it may depend on the amount of hits that you're looking for: create type HitBlocks as table ( HitIndex int not null ) go create procedure FindMaxCover @Hits HitBlocks readonly as ;With DecomposedBlocks as ( select (HitIndex/8)+1 as ByteIndex,POWER(2,(HitIndex%8)) as BitMask from @Hits ), Coverage as ( select t.TraceName,SUM(CASE WHEN SUBSTRING(t.BlockVector,db.ByteIndex,1) & BitMask != 0 THEN 1 ELSE 0 END) as Coverage from Trace t cross join DecomposedBlocks db group by t.TraceName ), Ranked as ( select *,RANK() OVER (ORDER BY Coverage desc) as rk from Coverage ) select

Categories : C#

Taking text from a response web page using Java
So while scrutinizing my code above, I decided to change connection.setRequestMethod("POST"); to connection.setRequestMethod("GET"); This solved my problem. In hindsight, I think the server was not recognizing the HTTP because it is not set up to handle the various trappings that come along with post.

Categories : Java

Excel 2007 VBA code doesn't run under Excel 2010
As your error raised in: bperiod = InStr(bdash, Mid(Dfiles(ii, 1), ".")) Your problem is right there in Mid(Dfiles(ii, 1), ".") part: Mid Function (Visual Basic) Public Shared Function Mid( _ ByVal str As String, _ ByVal Start As Integer, _ Optional ByVal Length As Integer _ ) As String I think your code should be something like this: bperiod = InStr(bdash, Mid(Dfiles(ii, 1), bdash), "."))

Categories : Excel

My code is taking too long at time of execution
first of all i didn't understand if the query to the DB is taking too long or the rest of the function or both. if you don't know, you should start by testing it. you can use a simple DateTime.Now and see how many ticks did each part took. if you want to test it with an even better way, you can use StopWatch as as V4Vendetta said. you can find an example here and basically the syntext will be like: // Create new stopwatch Stopwatch stopwatch = new Stopwatch(); // Begin timing stopwatch.Start(); // YOUR CODE HERE // Stop timing stopwatch.Stop(); // Write result Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed); for the DB access is the one that take too long i can advise you not to call too many sql queries. i see that in a for loop you are calling: "select slno from

Categories : C#

Taking ownership for SQL Server Management Studio
Try logging in with the sa account and grant permissions to your Windows account. If you do not know the sa password use sqlcmd and execute the following commands: Use Master Go ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword' Go Login with the sa account and GRANT permission to the account. USE Master; GRANT CREATE DATABASE TO Jommel;

Categories : SQL

Changes to PHP files on LAMP server not taking effect
You can see cached version (try to to force refresh - CTLR-F5) Or you changing the files in the different location than they are being served from. Check your httpd config and see if both location matches.

Categories : PHP

The server at www.localhost.com is taking too long to respond. asp.net
Change the url from your browser from www.localhost.com to localhost only. Usually, after 'localhost' is the name of your application. Sometimes, the browsers are trying to connect you to another domain if they detect that you might misspelled the url address. Might be the case.

Categories : C#

SQL Server 2008 DELETE taking too long
Here is what I came up with: SELECT ROLEID INTO #RIDS FROM APPROLES WHERE NAME IN ( 'GM', 'MINOR', 'USER') DELETE T1 FROM [ROLEFUNCS] T1 INNER JOIN [#RIDS] T2 ON T2.ROLEID = T1.ROLEID DELETE T3 FROM [USERROLES] T3 INNER JOIN [#RIDS] T2 ON T2.ROLEID = T3.ROLEID DELETE T4 FROM [ROLES] T4 INNER JOIN [#RIDS] T2 ON T2.ROLEID = T4.ROLEID DROP TABLE #RIDS

Categories : SQL

Difficulty taking info from JSON page and putting into MySQL
Since you are using mysql you should be able to use and replace into query. First off you want to add a primary key on id and whichSeason ALTER TABLE myTable add primary key (id, whichSeason); Then you can issue the replace into query. REPLACE INTO myTable (id, whichSeason, SeasonMins, SeasonGoalsScored, SeasonAssists) VALUES ('$id', '$whichSeason', '$SeasonMins', '$SeasonGoalsScored', '$SeasonAssists');

Categories : PHP

http errors 404 page taking a long while to load - EpiServer 7
I had the same kind of issue, do you have a custom route mapping? Like: protected override void RegisterRoutes(RouteCollection routes) { routes.MapRoute("404", "404", new { controller = "ContentPage", action = "NotFound" }); base.RegisterRoutes(routes); } Remove that route and add the following catch all route: protected override void RegisterRoutes(RouteCollection routes) { base.RegisterRoutes(routes); routes.MapRoute("Error", "{*url}", new { controller = "ContentPage", action = "NotFound" }); }

Categories : Asp Net Mvc

Web page linking to SQL2000 - taking too long to fully load
The user defined function function in the where and order by clause is probably causing the slow-down for SQL. You should be able to pull the query data once, and then build up in memory hashes of the Teams and Dates. Another hash should contain lists of the entries for a cross hash between the team and dates, then you can just iterate over the data set once instead of (team-names.count * dates.count) times.

Categories : HTML

Convert html page to a image using webbrowser in asp.net taking Too much time to generate image of heavy html page
I changed your class a little bit and it now uses async/await instead of busy-waiting. You can use it as var th = new WebsiteThumbnailImage("http://www.google.com", 1024, 768, 256, 192); this.BackgroundImage = await th.GenerateWebSiteThumbnailImage(); . class WebsiteThumbnailImage { public WebsiteThumbnailImage(string Url, int BrowserWidth, int BrowserHeight, int ThumbnailWidth, int ThumbnailHeight) { this.Url = Url; this.BrowserWidth = BrowserWidth; this.BrowserHeight = BrowserHeight; this.ThumbnailHeight = ThumbnailHeight; this.ThumbnailWidth = ThumbnailWidth; } public string Url { set; get; } public int ThumbnailWidth { set; get; } public int ThumbnailHeight { set; get; } public int BrowserWidth { set; get; }

Categories : C#

Select query taking too long to execute (SQL Server 2008)
As far as I can tell, you need only one join to the EntryAttribute and AttributeString tables. The aggregation takes care of the rest. Select a.entryID,g.GroupName, MAX(CASE WHEN e.attributedefinitionid = 15 THEN e.AttributeValue END) AS EnglishWording, MAX(CASE WHEN e.attributedefinitionid = 41 THEN e.AttributeValue END) AS GermanWording, MAX(CASE WHEN e.attributedefinitionid = 64 THEN e.AttributeValue END) AS RussianWording, MAX(CASE WHEN e.attributedefinitionid = 91 THEN e.AttributeValue END) AS FrenchWording, MAX(CASE WHEN e.attributedefinitionid = 143 THEN e.AttributeValue END) AS ItalianWording, MAX(CASE WHEN e.attributedefinitionid = 160 THEN e.AttributeValue END) AS SpanishWording, MAX(CASE WHEN e.attributedefinitionid = 165 THEN e.AttributeValue END) AS ChineseWording, MAX(

Categories : SQL

Drawable.createFromStream taking longer with image from remote server?
I think it was the over the wire time that was killing me. Nothing I could do about this, so instead of getting each image serially, I instead use a thread per image (5 images max), and get them in parallel. Something like... m_threadLatch = new CountDownLatch(m_story.photos_thumb.length); for(int i=0; i<m_story.photos_thumb.length; i++) { new HTTPGetImages(((MyApplication)getApplication()).getBaseURL() + m_story.photos_thumb[i]).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } new AddImagesToUI().execute(); AddImagesToUI waits on the m_threadLatch, and adds the images to the UI. Result? Less than a second! Thank god for parallelism!

Categories : Java

Placing a button at the bottom of the page and bottom of a list
Then use following, it will surely help you, i have tested it ! <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="bottom" android:layout_alignParentBottom="true" android:layout_below="@id/table_wrapper" > <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:padding="20dp" android:text="load more" /> </LinearLayout>

Categories : Android

How can my ASP.NET page go back and forth from client to server code and back several times?
This sounds more like an architectural issue than anything else. What you should be doing here is: 1) User clicks a button. This is NOT a regular submit button. Just a plain old button that executes some local javascript. 2) Local javascript makes an AJAX request to determine how many records are available. 3) That javascript then does a loop based on the number of available records divided by the amount you want to pull per chunk. 3.a) Execute AJAX request for a chunk 3.b) Throw the data into your ActiveX control - which, btw, I really would suggest you guys think about getting rid of. There are so many issues with ActiveX that it's not even funny. 4) Repeat 3.a and 3.b until completion. You'll notice that at no point was a full post back performed. You'll also notic

Categories : Javascript

For an Excel Formula's variable taking a Range, input row number by the result of a formula
Try using the INDIRECT function:) say you have three cell that can dynamically calculate the address of your input range. something like what you suggested and it is in the cell A1 ="$BB$2:$BB$" & COUNTA(BB2:BB1000) ---> in cell A1 You can use the Indirect function like this: =SERIES(INDIRECT(A1),[RANGE],[RANGE]) Hope this helps!

Categories : Excel

SQL Server Stored Procedure taking too long to retrive data from database
In the stored procedure at the beginning set: SET ARITHABORT ON If it doesn't make any difference then cause my parameter sniffing. The sql server has complied the query on the basis of first parameter you have passed and generated the execution plan. This plan may be bad for other parameters. You can use optimize for clause.

Categories : Sql Server

What program/s or application can compile my Java Server Code, Android Client Code and Asynctask code?
I'm not sure what you mean by your ASyncTask code as this would be part of the android code. Anyway, your android code can be run from Eclipse but you would need the Android SDK and ADT plugin for eclipse. Details of which can be found here. There are other IDEs but this is probably the most used and if you are beginner at android Google has all the documentation about eclipse which will make things easier. As for your java server, this can be run in Eclipse, but there are lots of other browsers that can be used, Netbeans is another example.

Categories : Java

Linked Server Error: Unable to read excel 2010 data through sql server 2008
Try using ACE OleDB and excel version 12.0 Example: SELECT * FROM OPENROWSET ( 'Microsoft.ACE.OLEDB.12.0', 'Data Source=C:Hierarchy.xlsx;Extended Properties="Excel 12.0;HDR=YES"', 'SELECT * FROM [Group$]' )

Categories : Sql Server



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