w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Git: Custom editor opens blank file
This gist mentions: The -w doesn't seem to be needed anymore; Actually adding it now inverses the way it worked. Adding it, makes the terminal command exit before editing the file in sublime Removing it, will properly make the sublime command to not exit until the file is closed. Can just use this now (with no Sublime version): ln -s /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime Check to see if /usr/local/bin is in your PATH: open ~/.zshrc Make sure it says: export PATH=/usr/local/bin:/example/other/dirs/ Back in the terminal enter this to refresh the file: source ~/.zshrc Now you can type sublime to open up Sublime Text: sublime . to open the current directory or sublime some-file.txt to open the directory/file in

Categories : GIT

How can i read a json file in chromium source code using chromium in-built json parser
You're probably looking for https://code.google.com/p/chromium/codesearch#chromium/src/base/json/json_reader.h&sq=package:chromium&type=cs.

Categories : Json

PHP str_replace replace space with dash, but too many dash
You can use the more powerful preg_replace, instructing it to replace runs of dashes and/or spaces with a single dash: $name = preg_replace('/[s-]+/', '-', $name); [s-]+ is a regular expression that matches "one or more of: whitespace and dashes".

Categories : PHP

Chromium for android eclipse debugging / DDD for chromium C++ debugging
See https://code.google.com/p/chromium/wiki/LinuxEclipseDev in particular the "Optional: Building inside Eclipse" section. It's still a bit flaky but works most of the time.

Categories : Android

Apk file opens with another program on windows. How do I change it so that it opens with the default program?
Maybe this will help file.downlaodatoz.com By right-clicking on the .apk file while the shift button is pressed, you'll get an "Open with..." option. On the dialog that will be opened, you'll find a link to search the internet for a appropriate program to use.

Categories : Misc

TableView Cell Custom type Text Overlaps itself or is Blank
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } FailedBankInfo *info = [_fetchedResultsController objectAtIndex:indexPath.row]; CGRect infoFrame = CGRectMake(10, 10, 200, 16); UILabel *infoLabel = [[UILabel alloc] initWithFrame:infoFrame]; infoLabel.textColor = [UIColor blackColor]; infoLabel.backgroundColor = [UIColor yellowColor]; infoLabel.font = [UIFont systemFontOfSize:12]; infoLabel.textAlignment = NSTextAlignmentCenter; infoLabel.ta

Categories : IOS

Project Template with Blank Activity and Navigation type Scrollable Tabs + Swipe results in R cannot be resolved to a variable
Ok it turns out there are MORE updates, even after the reboot AND I double checked to make sure. I should have checked that other default projects weren't giving the same error, which they were.

Categories : Android

If no blank lines preceding an outline heading `**`, then insert one blank line
The problem with using delete-blank-lines is that its behavior depends on the number of blank lines around point. Here is an very inelegant way to solve the problem: (save-excursion (beginning-of-buffer) (while (re-search-forward "^[*][*]" nil t) (forward-line 0) (newline) (forward-line -1) (delete-blank-lines) (delete-blank-lines) (newline) (forward-line 1)))) It hurts my eyes a little and it does look more like a macro than a function, but I think that it does the job.

Categories : Emacs

In Excel, how to fill blank cells with the last preceding non-blank cell?
In a "manual" fashion, you could do the following: Select the column, go to Edit > Go To > Special > Blanks, type = in the formula bars, hit the up arrow then Ctrl+Enter. you should now have the cells fill with the values above In a more "automated" fashion using VBA, you could do the following: Select the range where you want to fill the blank cells, Then click on Developer Tab -> Visual Basic -> Insert -> Module Then paste the code in the Module, and click on run: Code: Sub Fill_Blank_Cells() Selection.SpecialCells(xlCellTypeBlanks).Select Selection.FormulaR1C1 = "=R[-1]C" End Sub As @Jerry rightfully pointed out, make sure to copy-paste special the values in order to remove the formulas behind your filled column. This will prevent any undesirable results later!

Categories : Excel

Why is a empty variable declaration of type String "null" and not "" (blank or empty)
It's not "null", it's null. But println displays it like that because it's defined to do so (see the Javadocs). As for why it's not initialized to an empty string, that's because String is a class type, and the default value for references to class instances is always null. There is a big difference between no object at all (i.e. null) and an object in an "empty" state.

Categories : Java

Javascript causes Chromium to run out of memory
Here is a vastly simplified script for you - your loop made no sense at all and there is no Ajax in your code var graph = "https://zabbix.tulsahpc.org/signage/sign.png",tId; window.onload=function() { tId=setInterval(function() { document.getElementById('graph').src = graph+new Date().getTime();// avoid cache },10000);// reload every 10 secs }

Categories : Javascript

CSS Gradient very rough in Chromium
why dont you just use a gradient generator ? http://gradients.glrzad.com/ http://www.colorzilla.com/gradient-editor/ even from microsoft http://ie.microsoft.com/testdrive/graphics/cssgradientbackgroundmaker/

Categories : CSS

Chromium Browser Branding
Got it: On Chromium dev by James Atkinson How to change Chromium app name and logo? "What is the right place to change Chromium application name, program title, .exe file name, and logo image. I guess there is place in source code for windows, where it could be changed centralized for whole project?"

Categories : Google Chrome

Selecting blank and non-blank cells using google script
If I'm understanding correctly, this might me one way: var counter = 1; for (var i = 1, length = data.length; i <= length; i++) { if (i == length || data[i][0]) { sheet.getRange(i + row - counter, 1, counter, 3).setBorder(true,true,true,true,true,false); counter = 1; } else { counter++; } }

Categories : Javascript

Chromium: missing sass support
This one got me too, after reading a NetTuts article on Developing With Sass and Chrome DevTools. Seems like most articles on the subject are outdated. Turns out Chrome v30 and later ship with souce maps and SASS support enabled by defualt. In v29 and earlier you have to check the "Support for SASS" box. Furthermore, according to Google: "Currently Sass is the only preprocessor that supports CSS source maps..." So as long as you don't uncheck "Enable CSS Source Maps" in Dev Tools > Settings > General, you can hack away at your scss/sass directly from chrome. I followed the Google Dev Tools docs and got it working on OSX.8 with Canary 32.0.1664.3. Here are the key points: Make sure you're using sass 3.3.0alpha gem install sass -v '>=3.3.0alpha' --pre Add the --sourcemap flag when y

Categories : Google Chrome

CORS XMLHTTPRequest not working in Chromium 28
I'm sure the response headers are available. Most likely you are just not looking in the correct place. I suspect you are looking at the "response" tab, instead of in the "headers" tab. Either way, I looked at a request/response to/from enable-cors.org myself, and it is clear that this site does not permit cross-origin requests due to the lack of "Access-Control-*" headers in the response. So, you are out of luck. By the way, why are you trying to make cross-origin requests to enable-cors.org anyway? It's a static site. It's primary purpose is to teach others about CORS. I think it might be nice to provide some sort of a "sandbox" that lets learners test out CORS themselves though. Maybe that is something you can suggest in the forum related to the site. Click on the "suggest"

Categories : Ajax

Use Chromium Browser with webdriverjs and Selenium
Following the instructions in this wiki page, I can run chromium browser with selenium using WebDriverJS. You need to download a ChromeDriver and export Path to your system's environment.

Categories : Google Chrome

CSS box-shadow renders different on Firefox and Chromium
Try to use the -moz-box-shadow property for firefox, it will render better. div{ margin:100px; padding:100px; border:1px solid red; -moz-box-shadow: 0 80px 15px -85px #000; box-shadow:0 80px 15px -85px #000; }

Categories : CSS

How do I detect Chromium specifically vs. Chrome?
I think the link you sent is just a mix of examples, mostly from chrome but occasionally from chromium. For example: http://www.useragentstring.com/Chrome18.0.1025.142_id_19156.php matches the format I see on my chromium v25 while my chrome v29 lacks the chromium version string before the chrome version string. If that is not sufficient you could look for a capability like codec support but that is likely to require a complicated grid, or a plugin unique to chrome. Perhaps the existence of chrome's PDF viewer in window.navigator.plugins. The usual response for this kind of thing is why do you care? Normally the answer gives a way to detect the situation (i.e. chromium lacks a proprietary feature you need which can hopefully be found by a sideeffect.)

Categories : Google Chrome

How can I automatically restart chromium if it crashes?
Put the following code in a file, name it whatever you like (foo): #!/bin/sh while : # run forever do chromium-browser done Then execute: chmod +x foo to make the file named foo executable. When your kiosk starts, invoke the program foo (the file you just created). The script runs the chrome browser in a "do this forever" loop. If the browser ever dies (for whatever reason), the script will restart it.

Categories : Google Chrome

If blank text is in textbox then blank action
This line of code will set the value of the input $("#textinput").val("evil"); You said you wanted to test the current text if ($("#textinput").val() === "evil") { alert("Watch your language!"); }

Categories : Jquery

Delphi, chromium, tabs and flash trouble
If the tab is not being shown (it's not the front one), it doesn't get drawn (this is an operating system thing). If it's not being drawn, there's nothing there for a screenshot to capture. If your requirement is to capture a Flash page without it being displayed, you're going to have to find another way to do it.

Categories : Delphi

How to define a javascript function from Chromium Console
function is reserved word in javascript. Try this var f = function() { console.log("Hello world"); }; instead of var function = f(){ console.log("Hello world"); };

Categories : Javascript

Using Chromium Remote Debugging from External Device
I've successfully used RInetD for easy port-forwarding in Windows 7, tried this and it worked like a charm, externally debugging a Chrome browser in Windows from a Chrome in Mac/Ubuntu. You can download rinetd from: http://www.boutell.com/rinetd/ Unzip the file, create an empty file with any name (I used rinetd.conf), with this content: 9223 9222 The in Windows console run it with: rinetd.exe -c rinetd.conf And voila!

Categories : Debugging

Chromium's XSS auditor refused to execute a script
If you'd like to tell Chrome to disable its XSS protection, you can send an X-XSS-Protection header with a value of 0. Since you appear to be using PHP, you'd add this somewhere where it'll always be executed before any content has been output: header("X-XSS-Protection: 0");

Categories : Google Chrome

Options for embedding Chromium instead of IE WebBrowser control with WPF/C#
I have used Awesomium.NET. Although I don't like the fact that it's not open-source, and also the fact that it uses a pretty old Webkit rendering engine, it is really easy to use. That's about the only endorsement I can give it.

Categories : C#

android_gyp missing/not found when building Chromium for Android
./build/android/envsetup.sh Should be: . build/android/envsetup.sh The dot + space sources the script so that any bash definitions will be kept around after the script runs. See: http://ss64.com/bash/source.html. android_gyp is a bash function defined in envsetup.sh, so sourcing it provides the definition in your shell.

Categories : Android

Chromium Embedded (CEF3). How to resize new browser window?
Quick solution is to use SetWindowPos function instead of DeferWindowPos function. //hdwp = DeferWindowPos(hdwp, hWndTab, NULL, // rect.left, rect.top, rect.right - rect.left, // rect.bottom - rect.top, SWP_NOZORDER); SetWindowPos(hWndTab, NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);

Categories : Visual C++

Non-zero exit status while regenerating during component build in chromium
From the error it looks like there is something wrong with your GYP_DEFINES environment variable. what does echo $GYP_DEFINES output? It should be a set of space separated key=value pairs.

Categories : Misc

Why does the sort() JavaScript function works in Firefox but not in Chromium?
Your sort comparer is broken. The sort callback is expected to return a negative number, 0, or a positive number, depending on whether the first argument is smaller than, equal to, or larger than the second. You're always returning a boolean, which is not what it's supposed to do.

Categories : Javascript

How do I get the result from executing JavaScript in an embedded Chromium control?
From python implementation wiki: This function executes asynchronously so there is no way to get the returned value. Calling javascript from native code synchronously is not possible in CEF 3. It is also not possible doing it synchronously the other way around ie. js->native.

Categories : Javascript

Changing the user agent in Chromium Embedded 3 (DCEF3) (CefVCL)
There is no built in way to do this. In my experience, the user-agent setting does nothing.. so you have to edit ceflib.pas directly (line ~8532) to achieve this effect. settings.user_agent := cefstring(UserAgent); becomes: settings.user_agent := cefstring('My USERAGENT v1.0'); With the above, you may want to include your own OS and Browser Info as this blocks off CEF's implementation of those variables. Or append it, like this: settings.user_agent := cefstring(UserAgent+'; My UserAgent v1.0'); This is how I do it.. I've been working with DCEF1 and DCEF3 for about a year.. and still learning!

Categories : Misc

fail to install chromium embedded on C++ Builder from Delphi files
You're installing the selected component into the IDE's default custom-component package. That package evidently makes reference to the TOutline component, but that component isn't defined in the package. Normally, TOutline is in the vclsmp package, so add vclsmp to your component package's requires list. Preferably, use a different and more typical technique for installing the Chromium control. Instead of adding just one unit to the default custom-component package, install the ready-made package that comes with the Chromium component: Open the .dpk file corresponding to your Delphi version, compile it, and install it. If there isn't a package file for your product version, then simply add the four source files to a new package; use the existing .dpk files as examples. Some of your trou

Categories : C++

PhoneGap / Android WebView throws "Unknown chromium error: 0"
Try disabling cache $.ajax({ cache: false, //your code }); This error message is really vacuous. It mostly means that your app cannot find the resource on the file system. So try disabling the cache, so it will always load the resource from the server.

Categories : Javascript

Get string between last dash and last dot
Demo here: var test = "http://foo.com/bar/image/abc.jpg"; var i = test.lastIndexOf("/"); var j = test.lastIndexOf("."); var str = test.substring(i + 1, j); document.body.innerHTML += "<p>" + str + "</p>";

Categories : Javascript

keep blank cell blank instead of None by python
Instead of using A[i][x] which dictates the value for you, why not simply add an OR logic to eliminate the possibility of None. For any cell you wish to keep as "blank" (assume you mean empty string), let's say A[i][1], just do A[i][1] or "" Which will yield empty string "" if the cell gives you None.

Categories : Python

Redirect with a dash / hyphen
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^[^-]+-for-([^/]+)/?$ /article/$1 [R=301,NC,L]

Categories : Apache

variable variables in sh or dash
I don't think that you have any option but to use eval. The following: sms="SMSFile" email="EmailSubj" for x in sms email; do eval val=$$x; echo variable $$x=$val; done; should result in: variable $sms=SMSFile variable $email=EmailSubj in both sh and dash.

Categories : Unix

Extract Text after first "-" Dash
So you want everything from the beginning of the string through the 6th character after the first hyphen? This should work. If it's possible to have a string with no hyphen, you'd need to make it more complex, but your examples imply there will always be at least one. SUBSTR( string, 1, INSTR( string, '-') + 6 )

Categories : Oracle

RewriteRule: problems with dash
Well you're getting 404 because w in your regex matches only alphanumerics and underscore so it won't match hyphen. Replace your RewriteRule with this: RewriteRule ^colection/([^/]+)/?$ collection.php?title=$1 [L,QSA,NC]

Categories : Htaccess

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