-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
class HelloRooster implements EditorPlugin {
getName() {
return 'HelloRooster';
}
initialize(editor: Editor) {}
dispose() {}
onPluginEvent(e: PluginEvent) {
if (e.eventType == PluginEventType.KeyPress && e.rawEvent.which == 65) {
alert('Hello Rooster');
}
}
}
https://github.com/microsoft/roosterjs
3_dar,
24 Сентября 2020
-
0
- 1
- 2
- 3
- 4
- 5
- 6
#include <stdlib.h>
void main()
{
a: ; malloc(1); goto a;
}
GDMaster,
23 Сентября 2020
-
+2
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
REM I'm trying to do some simple webscraping in OpenOffice (I usually work in Excel but I'm trying to port
REM something over for a coworker that doesn't have Excel).
REM However, when I try to run something very similar to this, it keeps giving me this BASIC runtime error 1.
Sub Macro1
Dim explorer As Object
Set explorer = CreateObject("InternetExplorer.Application")
explorer.Visible = True
explorer.navigate("www.yahoo.com")
Const READYSTATE_COMPLETE As Long = 4
Do While explorer.Busy Or explorer.readyState <> READYSTATE_COMPLETE
Loop
dim page as object
set page = explorer.Document
dim mailButton as object
set mailButton = page.GetElementByID("ybar-navigation-item-mail") 'this is the line the error occurs on
mailButton.Click
End Sub
а чего бы нам не краулить сайты, запуская IE через BASIC в экселе
https://stackoverflow.com/questions/64010764/is-webscraping-with-openoffice-basic-even-possible
Fike,
22 Сентября 2020
-
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
public void startLoginService(User paramUser) {
if (paramUser != null) {
Intent intent = new Intent((Context)this, LoginService.class);
intent.putExtra("LOGIN_KEY", paramUser.getLogin());
intent.putExtra("PASSWORD_KEY", String.valueOf(paramUser.getId()));
startService(intent);
}
}
GDMaster,
22 Сентября 2020
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
public static UUID fromString(String name) {
String[] components = name.split("-");
if (components.length != 5)
throw new IllegalArgumentException("Invalid UUID string: "+name);
for (int i=0; i<5; i++)
components[i] = "0x"+components[i];
long mostSigBits = Long.decode(components[0]).longValue();
mostSigBits <<= 16;
mostSigBits |= Long.decode(components[1]).longValue();
mostSigBits <<= 16;
mostSigBits |= Long.decode(components[2]).longValue();
long leastSigBits = Long.decode(components[3]).longValue();
leastSigBits <<= 48;
leastSigBits |= Long.decode(components[4]).longValue();
return new UUID(mostSigBits, leastSigBits);
}
без префикса "0x" написать рабочий код было невозможно, очевидно
это хоть починили
https://github.com/openjdk/jdk/blob/jdk8-b120/jdk/src/share/classes/java/util/UUID.java#L191-L209
Fike,
22 Сентября 2020
-
0
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
/**
* Compares {@link Comparable} objects in natural order.
*
* @see Comparable
*/
enum NaturalOrderComparator implements Comparator<Comparable<Object>> {
INSTANCE;
@Override
public int compare(Comparable<Object> c1, Comparable<Object> c2) {
return c1.compareTo(c2);
}
@Override
public Comparator<Comparable<Object>> reversed() {
return Comparator.reverseOrder();
}
}
У нас будет компаратор, который сравнивает дженерики, но не совсем дженерики, потому что Object, а еще мы сделаем его enum, потому что можем
https://github.com/openjdk/jdk/blob/jdk-14-ga/src/java.base/share/classes/java/util/Comparators.java#L47-L59
Fike,
22 Сентября 2020
-
0
- 1
<img alt="[object Object]" title="[object Object]" loading="lazy">
https://beru.ru/catalog/avtotovary/76688?hid=90402 , когда смог в жс на бэкэнде
phpBidlokoder2,
21 Сентября 2020
-
0
#1: https://govnokod.ru/26692 https://govnokod.xyz/_26692
#2: https://govnokod.ru/26891 https://govnokod.xyz/_26891
#3: https://govnokod.ru/26893 https://govnokod.xyz/_26893
#4: https://govnokod.ru/26935 https://govnokod.xyz/_26935
#5: (vanished) https://govnokod.xyz/_26954
#6: (vanished) https://govnokod.xyz/_26956
#7: https://govnokod.ru/26964 https://govnokod.xyz/_26964
nepeKamHblu_nemyx,
21 Сентября 2020
-
+1
- 1
Чем пакеты "npm" лучше старых добрых плагинов "jQuery"?
Плагины зависели только от самого "jQuery", а пакеты волокут за собою десятки и сотни левых говен.
rotoeb,
20 Сентября 2020
-
+1
#1: https://govnokod.ru/26692 https://govnokod.xyz/_26692
#2: https://govnokod.ru/26891 https://govnokod.xyz/_26891
#3: https://govnokod.ru/26893 https://govnokod.xyz/_26893
#4: https://govnokod.ru/26935 https://govnokod.xyz/_26935
#5: (vanished) https://govnokod.xyz/_26954
#6: (vanished) https://govnokod.xyz/_26956
nepeKamHblu_nemyx,
20 Сентября 2020