How to remove MenuCool Trial version for localhost for the lastest version v2015.10.26. - slider

I am trying to make the slider work in my local machine either using http://localhost/thumbnail-slider or using http://127.0.0.1/thumbnail-slider. In both the cases I am getting the message occasionally "Thumbnail Slider trial version".
I tried all the steps in the below url with no success in any of the solution for the version v2015.10.26
jquery menucool slider not working

Try this
Find the
vb=function(d,c){for(var b=[],a=0;a<d[e];a++)b[b[e]]=String[kb](d[Z](a)-(c?c:3));return b.join("")},
From slider js file and Replace with
vb=function(d,c){return " "},

Try this, It worked for ThumbnailSlider Slider v2015.10.26.
vb = function (d, c) {
for (var b = [], a = 0; a < d[e]; a++)
b[b[e]] = String[kb](d[Z](a) - (c ? c : 3));
if (b.join("") == "Thumbnail Slider trial version")
return "";
return b.join("")
},

For Ninja Slider v2016.12.29
It's both of the answers above:
find the a.replace(/(?:..)?(\w)([\w-])?[^.](\w).[^.]*$/,"$1$3$2") in jquery-slider.js file
change to a.replace("","$1$3$2")
AND
yb = function (d, c) {
for (var b = [], a = 0; a < d[e]; a++)
b[b[e]] = String[nb](d[Z](a) - (c ? c : 3));
if (b.join("") == "Ninja Slider trial version")
return "";
return b.join("")
},
Although I had to make it
yb = function (d, c) {
for (var b = [], a = 0; a < d[e]; a++)
b[b[e]] = String[nb](d[ab](a) - (c ? c : 3));
if (b.join("") == "Ninja Slider trial version")
return "";
return b.join("")
},
Notice d[Z] was changed to d[ab].
P.S. I tried buying the $29 license, but the website won't let the order go through.

its very simple
find the
return a.replace(/(?:.*\.)?(\w)([\w\-])?[^.]*(\w)\.[^.]*$/, "$1$3$2")
in js file
change to return null;
and enjoy

You need to take four steps
Find this code for Ninja slider Js file
return a.replace(/(?:.*\.)?(\w)([\w\-])?[^.]*(\w)\.[^.]*$/,"$1$3$2")
replace to:
return null
find code with string "www."
Sb=function(a){var b=Yb(document.domain.replace("www.",""));
change to:
Sb=function(a){var b=Yb(document.domain.replace("",""));
delete the word "www."
find code
Ab=["$1$2$3","$1$2$3","$1$24","$1$23","$1$22"]
delete string value inside bracket:
Ab=[]
find code
apply(this,[a,Y,b,Qb,wb,o,vb,xb,document,m]
(or apply(this,[a,ab,g,Tb,zb,i,yb,Ab,document,y]) )
replace with
apply(this, [a, Y, b, Qb, wb, o, vb, xb, o, m]
(or apply(this,[a,ab,g,Tb,zb,i,yb,Ab,i,y]) )
change the "document" with 6th var

find the a.replace(/(?:..)?(\w)([\w-])?[^.](\w).[^.]*$/,"$1$3$2") in jquery-slider.js file
change to a.replace("","$1$3$2")

Find and replace in ninja-slider.js
Worked for Ninja Slider v2016.12.29
yb = function (d, c) {
for (var b = [], a = 0; a < d[e]; a++)
b[b[e]] = String[nb](d[Z](a) - (c ? c : 3));
if (b.join("") == "Ninja Slider trial version")
return "";
return b.join("")
},
Hope it helps someone. :)

I have found a solution using CSS.
Give a unique class to the parent div and then use color:transparent;

just do text-indent -9999px on text div.

Related

React-Native number formatting

I'm currently using the react-native-globalize library to format numbers but when using:
<FormattedNumber value={10000000} useGrouping={true} />
Which is supposed to present a result like this:
> 10,000,000
But for some but reason it doesn't seem to be working at all and the output is the number with no separators.
Anyone knows how to solve this or another library I could use? (yes I have done my google research first).
Thank you guys!
You can use the method toLocaleString() provided by Javascript.
Use it as:
getFormattedNumber = number => {
let formattedNumber = Number.parseInt(number).toLocaleString('en-IN');
return formattedNumber;
}
You may use en-US based on your region.
If the above code fails in Android, try below steps:
Goto your android/app/build.gradle file
Change line def jscFlavor = 'org.webkit:android-jsc:+' to def jscFlavor = 'org.webkit:android-jsc-intl:+'
Above solution is here: https://blog.bam.tech/developer-news/formating-numbers-in-react-native
You can use this function simply.
const numberWithComma = x => {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
};
When you call this function:
numberWithComma(10000000)
the result should be as follows:
10,000,000
For example:
let val = 14234523;
... ...
<Text> {numberWithComma(val)} </Text>
Result:
14,234,523
numberFormat = (value) => {
var re = '\\d(?=(\\d{' + 3 + '})+' + '\\D' + ')';
var num = value.toFixed(Math.max(0, ~~2));
var str = num.replace(new RegExp(re, 'g'), '$&' + ',');
return str;
}
Use:
numberFormat(4000)
Result:
4,000.00

How to delete a paragraph using XWPF - Apache POI

I am trying to delete a paragraph from the .docx document i have generated using the Apache poi XWPF. I can do it easily with the .doc word document using HWPF as below :
for (String paraCount : plcHoldrPargrafDletdLst) {
Paragraph ph = doc.getRange().getParagraph(Integer.parseInt(paraCount));
System.out.println("Deleted Paragraph Start & End: " + ph.getStartOffset() +" & " + ph.getEndOffset());
System.out.println("Deleted Paragraph Test: " + ph.text());
ph.delete();
}
I tried to do the same with
doc.removeBodyElement(Integer.parseInt(paraCount));
But unfortunatley not successful enough to get the result as i want. The result document, i cannot see the paragraph deleted.
Any suggestions on how to accompolish the similar functionality in XWPF.
Ok, this question is a bit old and might not be required anymore, but I just found a different solution than the suggested one.
Hope the following code will help somebody with the same issue
...
FileInputStream fis = new FileInputStream(fileName);
XWPFDocument doc = new XWPFDocument(fis);
fis.close();
// Find a paragraph with todelete text inside
XWPFParagraph toDelete = doc.getParagraphs().stream()
.filter(p -> StringUtils.equalsIgnoreCase("todelete", p.getParagraphText()))
.findFirst().orElse(null);
if (toDelete != null) {
doc.removeBodyElement(doc.getPosOfParagraph(toDelete));
OutputStream fos = new FileOutputStream(fileName);
doc.write(fos);
fos.close();
}
Seems like you're really unable to remove paragraphs from a .docx file.
What you should be able to do is removing the content of paragraphs... So called Runs.You could try with this one:
List<XWPFParagraph> paragraphs = doc.getParagraphs();
for (XWPFParagraph paragraph : paragraphs)
{
for (int i = 0; i < paragraph.getRuns().size(); i++)
{
paragraph.removeRun(i);
}
}
You can also specify which Run of which Paragraph should be removed e.g.
paragraphs.get(23).getRuns().remove(17);
all rights reserved
// Remove all existing runs
removeRun(para, 0);
public static void removeRun(XWPFParagraph para, int depth)
{
if(depth > 10)
{
return;
}
int numberOfRuns = para.getRuns().size();
// Remove all existing runs
for(int i = 0; i < numberOfRuns; i++)
{
try
{
para.removeRun(numberOfRuns - i - 1);
}
catch(Exception e)
{
//e.printStackTrace();
}
}
if(para.getRuns().size() > 0)
{
removeRun(para, ++depth);
}
}
I like Apache POI, and for the most part its great, however I have found the documentation a little scatty to say the least.
The elusive way of deleting a paragraph I found to be quite a nightmare, giving me the following exception error when try to remove a paragraph:
java.util.ConcurrentModificationException
As mention in Ugo Delle Donne example, I solved this by first recording the paragraph that I wanted to delete, and then using the removeBodyElement method the document.
e.g.
List<XWPFParagraph> record = new ArrayList<XWPFParagraph>();
String text = "";
for (XWPFParagraph p : doc.getParagraphs()){
for (XWPFRun r : p.getRuns()){
text += r.text();
// I saw so many examples as r.getText(pos), don't use that
// Find some unique text in the paragraph
//
if (!(text==null) && (text.contains("SOME-UNIQUE-TEXT")) {
// Save the Paragraph to delete for later
record.add( p );
}
}
}
// Now delete the paragraph and anything within it.
for(int i=0; i< record.size(); i++)
{
// Remove the Paragraph and everything within it
doc.removeBodyElement(doc.getPosOfParagraph( record.get(i) ));
}
// Shaaazam, I hope this helps !
I believe your question was answered in this question.
When you are inside of a table you need to use the functions of the XWPFTableCell instead of the XWPFDocument:
cell.removeParagraph(cell.getParagraphs().indexOf(para));

TFS SDK : Get Child Branches

What I want to do is to get the available branches that I can merge to. Pretty much the same as the dropdown when you say merge in TFS2008 and you select the destination branch.
However, it's been very hard to find how.
Below code is a merge between some of the resources I've found in the web, but none seem to work. My guess is that if VS2008 can do it, I can do it thru the SDK, right?.
The below code always give me the same result all the time.
My repository is something like this:
Development
Version1
Code
Version2
Code
Version3
Code
Main
Code
And normally I branch Main > Version X. So the merging can be done Main > Version X and Version X to Main.
The below code always gives me the children of the Main, even if I'm querying (tfsParentBranchPath) with Version3 folder.
Is this because perhaps I used TFS2010 web service but pointing to TFS2008 (that's why I marked some methods that do not work in the code)?
Well please let me know, if someone knows the answer.
Thanks!
public string[] GetChildBranchesToMerge(string tfsParentBranchPath)
{
var versionControl = teamFoundationServer.GetService<VersionControlServer>();
//not supported by tfs2008
//ItemIdentifier[] identifiers = versionControl.QueryMergeRelationships(tfsParentBranchPath);
//var allBranches = versionControl.QueryBranchObjects(new ItemIdentifier(tfsParentBranchPath), RecursionType.OneLevel);
List<string> childs = new List<string>();
ItemSpec[] specs = new ItemSpec[] { new ItemSpec(tfsParentBranchPath, RecursionType.OneLevel) };
BranchHistoryTreeItem[][] branchHistoryTree = versionControl.GetBranchHistory(specs, VersionSpec.Latest);
if (branchHistoryTree.Length > 0 && branchHistoryTree[0].Length > 0)
{
var treeItem = branchHistoryTree[0][0];
if (treeItem.Children.Count > 0)
{
foreach (BranchHistoryTreeItem tia in treeItem.Children)
{
childs.Add(tia.Relative.BranchToItem.ServerItem);
}
}
}
return childs.OrderBy((s) =>
{
return s;
}).ToArray();
}
Finally, this is the last version that works!.
First, I stopped using VS2010 assemblies and it's much faster now.
Second, the big difference is this line:
var treeItem = branchHistoryTree[0][0].GetRequestedItem();
I really dont know why the difference, but it seems without that method, the item returned is a generic one.
public string[] GetChildBranchesToMerge(string tfsParentBranchPath)
{
DoLog("Getting child branches for {0} ...", tfsParentBranchPath);
VersionControlServer vcs = (VersionControlServer)teamFoundationServer.GetService(typeof(VersionControlServer));
List<string> childs = new List<string>();
ItemSpec[] specs = new ItemSpec[] { new ItemSpec(tfsParentBranchPath, RecursionType.OneLevel) };
BranchHistoryTreeItem[][] branchHistoryTree = vcs.GetBranchHistory(specs, VersionSpec.Latest);
if (branchHistoryTree.Length > 0 && branchHistoryTree[0].Length > 0)
{
var treeItem = branchHistoryTree[0][0].GetRequestedItem();
AddChildBranch(childs, treeItem, tfsParentBranchPath);
if (treeItem.Children != null && treeItem.Children.Count > 0)
{
foreach (BranchHistoryTreeItem tia in treeItem.Children)
{
AddChildBranch(childs, tia, tfsParentBranchPath);
}
}
}
DoLog("{0} child branches found", childs.Count);
return childs.OrderBy((s) =>
{
return s;
}).ToArray();
}
private void AddChildBranch(List<string> list, BranchHistoryTreeItem itemToCheck, string tfsParentBranchPath)
{
if (itemToCheck.Relative.BranchFromItem != null && itemToCheck.Relative.BranchFromItem.DeletionId == 0 && itemToCheck.Relative.BranchFromItem.ServerItem != tfsParentBranchPath)
list.Add(itemToCheck.Relative.BranchFromItem.ServerItem);
if (itemToCheck.Relative.BranchToItem != null && itemToCheck.Relative.BranchToItem.DeletionId == 0 && itemToCheck.Relative.BranchToItem.ServerItem != tfsParentBranchPath)
list.Add(itemToCheck.Relative.BranchToItem.ServerItem);
}

Refresh a dijit.form.Select

First, you have to know that I am developing my project with Struts (J2EE
Here is my problem :
I have 2 dijit.form.Select widgets in my page, and those Select are filled with the same list (returned by a Java class).
When I select an option in my 1st "Select widget", I would like to update my 2nd Select widget, and disable the selected options from my 1st widget (to prevent users to select the same item twice).
I succeed doing this (I'll show you my code later), but my problem is that when I open my 2nd list, even once, it will never be refreshed again. So I can play a long time with my 1st Select, and choose many other options, the only option disabled in my 2nd list is the first I've selected.
Here is my JS Code :
function removeSelectedOption(){
var list1 = dijit.byId("codeModif1");
var list2 = dijit.byId("codeModif2");
var list1SelectedOptionValue = list1.get("value");
if(list1SelectedOptionValue!= null){
list2.reset();
for(var i = 0; i < myListSize; i++){
// If the value of the current option = my selected option from list1
if(liste2.getOptions(i).value == list1SelectedOptionValue){
list2.getOptions(i).disabled = true;
} else {
list2.getOptions(i).disabled = false;
}
}
}
Thanks for your help
Regards
I think you have to reset() the Select after you've updated its options' properties. Something like:
function removeSelectedOption(value)
{
var list2 = dijit.byId("codeModif2"),
prev = list2.get('value');
for(var i = 0; i < myListSize; i++)
{
var opt = myList[i];
opt.disabled = opt.value === value;
list2.updateOption(opt);
}
list2.reset();
// Set selection again, unless it was the newly disabled one.
if(prev !== value) list2.set('value', prev);
};
(I'm assuming you have a myList containing the possible options here, and the accompanying myListSize.)

websql use select in to get rows from an array

in websql we can request a certain row like this:
tx.executeSql('SELECT * FROM tblSettings where id = ?', [id], function(tx, rs){
// do stuff with the resultset.
},
function errorHandler(tx, e){
// do something upon error.
console.warn('SQL Error: ', e);
});
however, I know regular SQL and figured i should be able to request
var arr = [1, 2, 3];
tx.executeSql('SELECT * FROM tblSettings where id in (?)', [arr], function(tx, rs){
// do stuff with the resultset.
},
function errorHandler(tx, e){
// do something upon error.
console.warn('SQL Error: ', e);
});
but that gives us no results, the result is always empty. if i would remove the [arr] into arr, then the sql would get a variable amount of parameters, so i figured it should be [arr]. otherwise it would require us to add a dynamic amount of question marks (as many as there are id's in the array).
so can anyone see what i'm doing wrong?
aparently, there is no other solution, than to manually add a question mark for every item in your array.
this is actually in the specs on w3.org
var q = "";
for each (var i in labels)
q += (q == "" ? "" : ", ") + "?";
// later to be used as such:
t.executeSql('SELECT id FROM docs WHERE label IN (' + q + ')', labels, function (t, d) {
// do stuff with result...
});
more info here: http://www.w3.org/TR/webdatabase/#introduction (at the end of the introduction)
however, at the moment i created a helper function that creates such a string for me
might be better than the above, might not, i haven't done any performance testing.
this is what i use now
var createParamString = function(arr){
return _(arr).map(function(){ return "?"; }).join(',');
}
// when called like this:
createparamString([1,2,3,4,5]); // >> returns ?,?,?,?,?
this however makes use of the underscore.js library we have in our project.
Good answer. It was interesting to read an explanation in the official documentation.
I see this question was answered in 2012. I tried it in Google 37 exactly as it is recommened and this is what I got.
Data on input: (I outlined them with the black pencil)
Chrome complains:
So it accepts as many question signs as many input parameters are given. (Let us pay attention that although array is passed it's treated as one parameter)
Eventually I came up to this solution:
var activeItemIds = [1,2,3];
var q = "";
for (var i=0; i< activeItemIds.length; i++) {
q += '"' + activeItemIds[i] + '", ';
}
q= q.substring(0, q.length - 2);
var query = 'SELECT "id" FROM "products" WHERE "id" IN (' + q + ')';
_db.transaction(function (tx) {
tx.executeSql(query, [], function (tx, results1) {
console.log(results1);
debugger;
}, function (a, b) {
console.warn(a);
console.warn(b);
})
})